mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-26 09:27:57 -05:00
remove geodeRoot
This commit is contained in:
parent
1807f19b51
commit
8126175eaa
7 changed files with 9 additions and 25 deletions
|
@ -81,7 +81,6 @@ namespace geode::utils::file {
|
||||||
*/
|
*/
|
||||||
GEODE_DLL Result<> unzipTo(ghc::filesystem::path const& from, ghc::filesystem::path const& to);
|
GEODE_DLL Result<> unzipTo(ghc::filesystem::path const& from, ghc::filesystem::path const& to);
|
||||||
|
|
||||||
GEODE_DLL ghc::filesystem::path geodeRoot();
|
|
||||||
GEODE_DLL bool openFolder(ghc::filesystem::path const& path);
|
GEODE_DLL bool openFolder(ghc::filesystem::path const& path);
|
||||||
|
|
||||||
enum class PickMode {
|
enum class PickMode {
|
||||||
|
|
|
@ -411,7 +411,7 @@ ghc::filesystem::path Loader::getSaveDirectory() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
ghc::filesystem::path Loader::getGeodeDirectory() const {
|
ghc::filesystem::path Loader::getGeodeDirectory() const {
|
||||||
return geode::utils::file::geodeRoot() / GEODE_DIRECTORY;
|
return this->getGameDirectory() / GEODE_DIRECTORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
ghc::filesystem::path Loader::getGeodeSaveDirectory() const {
|
ghc::filesystem::path Loader::getGeodeSaveDirectory() const {
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
#include <InternalLoader.hpp>
|
#include <InternalLoader.hpp>
|
||||||
#include <Geode/loader/Log.hpp>
|
|
||||||
#include <iostream>
|
|
||||||
#include <InternalMod.hpp>
|
|
||||||
|
|
||||||
#ifdef GEODE_IS_IOS
|
#ifdef GEODE_IS_IOS
|
||||||
|
|
||||||
|
#include <Geode/loader/Loader.hpp>
|
||||||
|
#include <Geode/loader/Log.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
#include <InternalMod.hpp>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -16,7 +17,7 @@ void InternalLoader::platformMessageBox(char const* title, std::string const& in
|
||||||
void InternalLoader::openPlatformConsole() {
|
void InternalLoader::openPlatformConsole() {
|
||||||
ghc::filesystem::path(getpwuid(getuid())->pw_dir);
|
ghc::filesystem::path(getpwuid(getuid())->pw_dir);
|
||||||
freopen(
|
freopen(
|
||||||
ghc::filesystem::path(utils::file::geodeRoot() / "geode_log.txt").string().c_str(), "w",
|
ghc::filesystem::path(Loader::get()->getGeodeDirectory() / "geode_log.txt").string().c_str(), "w",
|
||||||
stdout
|
stdout
|
||||||
);
|
);
|
||||||
InternalLoader::m_platformConsoleOpen = true;
|
InternalLoader::m_platformConsoleOpen = true;
|
||||||
|
|
|
@ -19,13 +19,6 @@ std::string utils::clipboard::read() {
|
||||||
return std::string([[UIPasteboard generalPasteboard].string UTF8String]);
|
return std::string([[UIPasteboard generalPasteboard].string UTF8String]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ghc::filesystem::path utils::file::geodeRoot() {
|
|
||||||
return ghc::filesystem::path([[[NSFileManager defaultManager]
|
|
||||||
URLsForDirectory:NSDocumentDirectory
|
|
||||||
inDomains:NSUserDomainMask] lastObject]
|
|
||||||
.path.UTF8String);
|
|
||||||
}
|
|
||||||
|
|
||||||
void utils::web::openLinkInBrowser(std::string const& url) {
|
void utils::web::openLinkInBrowser(std::string const& url) {
|
||||||
[[UIApplication sharedApplication]
|
[[UIApplication sharedApplication]
|
||||||
openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]]];
|
openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]]];
|
||||||
|
|
|
@ -27,13 +27,6 @@ std::string utils::clipboard::read() {
|
||||||
return std::string(clipboard);
|
return std::string(clipboard);
|
||||||
}
|
}
|
||||||
|
|
||||||
ghc::filesystem::path utils::file::geodeRoot() {
|
|
||||||
char cwd[PATH_MAX];
|
|
||||||
getcwd(cwd, sizeof(cwd));
|
|
||||||
// utils::clipboard::write(cwd);
|
|
||||||
return ghc::filesystem::path(cwd);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool utils::file::openFolder(ghc::filesystem::path const& path) {
|
bool utils::file::openFolder(ghc::filesystem::path const& path) {
|
||||||
NSURL* fileURL = [NSURL fileURLWithPath:[NSString stringWithUTF8String:path.string().c_str()]];
|
NSURL* fileURL = [NSURL fileURLWithPath:[NSString stringWithUTF8String:path.string().c_str()]];
|
||||||
NSURL* folderURL = [fileURL URLByDeletingLastPathComponent];
|
NSURL* folderURL = [fileURL URLByDeletingLastPathComponent];
|
||||||
|
|
|
@ -70,10 +70,6 @@ std::string utils::clipboard::read() {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
ghc::filesystem::path utils::file::geodeRoot() {
|
|
||||||
return ghc::filesystem::path(CCFileUtils::sharedFileUtils()->getWritablePath2().c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool utils::file::openFolder(ghc::filesystem::path const& path) {
|
bool utils::file::openFolder(ghc::filesystem::path const& path) {
|
||||||
ShellExecuteA(NULL, "open", path.string().c_str(), NULL, NULL, SW_SHOWDEFAULT);
|
ShellExecuteA(NULL, "open", path.string().c_str(), NULL, NULL, SW_SHOWDEFAULT);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include <Geode/binding/CCTextInputNode.hpp>
|
#include <Geode/binding/CCTextInputNode.hpp>
|
||||||
#include <Geode/binding/ColorChannelSprite.hpp>
|
#include <Geode/binding/ColorChannelSprite.hpp>
|
||||||
#include <Geode/binding/Slider.hpp>
|
#include <Geode/binding/Slider.hpp>
|
||||||
|
#include <Geode/binding/CCMenuItemToggler.hpp>
|
||||||
|
#include <Geode/loader/Loader.hpp>
|
||||||
|
|
||||||
// BoolSettingNode
|
// BoolSettingNode
|
||||||
|
|
||||||
|
@ -120,7 +122,7 @@ void FileSettingNode::onPickFile(CCObject*) {
|
||||||
if (auto path = file::pickFile(
|
if (auto path = file::pickFile(
|
||||||
file::PickMode::OpenFile,
|
file::PickMode::OpenFile,
|
||||||
{
|
{
|
||||||
file::geodeRoot(),
|
Loader::get()->getGameDirectory(),
|
||||||
setting->getFileFilters().value_or(std::vector<file::FilePickOptions::Filter>())
|
setting->getFileFilters().value_or(std::vector<file::FilePickOptions::Filter>())
|
||||||
}
|
}
|
||||||
)) {
|
)) {
|
||||||
|
|
Loading…
Reference in a new issue