mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-25 16:23:46 +02:00
Use path select based on env rather than Debug
Building a Release seems to just break newer versions of ANGLE, so now let's just use Debug always. the environment variable `MKXPZ_SELECT_PATH` can be set to any value to bring up the option to select a path
This commit is contained in:
parent
822b3ae550
commit
8aa7fc7cc3
8 changed files with 48 additions and 19 deletions
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -56,6 +56,13 @@
|
||||||
isEnabled = "YES">
|
isEnabled = "YES">
|
||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
</CommandLineArguments>
|
</CommandLineArguments>
|
||||||
|
<EnvironmentVariables>
|
||||||
|
<EnvironmentVariable
|
||||||
|
key = "MKXPZ_SELECT_PATH"
|
||||||
|
value = "1"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</EnvironmentVariable>
|
||||||
|
</EnvironmentVariables>
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
|
|
|
@ -56,6 +56,13 @@
|
||||||
isEnabled = "YES">
|
isEnabled = "YES">
|
||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
</CommandLineArguments>
|
</CommandLineArguments>
|
||||||
|
<EnvironmentVariables>
|
||||||
|
<EnvironmentVariable
|
||||||
|
key = "MKXPZ_SELECT_PATH"
|
||||||
|
value = "1"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</EnvironmentVariable>
|
||||||
|
</EnvironmentVariables>
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
|
|
|
@ -50,6 +50,13 @@
|
||||||
ReferencedContainer = "container:mkxp-z.xcodeproj">
|
ReferencedContainer = "container:mkxp-z.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildableProductRunnable>
|
</BuildableProductRunnable>
|
||||||
|
<EnvironmentVariables>
|
||||||
|
<EnvironmentVariable
|
||||||
|
key = "MKXPZ_SELECT_PATH"
|
||||||
|
value = "1"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</EnvironmentVariable>
|
||||||
|
</EnvironmentVariables>
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Release"
|
||||||
|
|
|
@ -56,6 +56,13 @@
|
||||||
isEnabled = "YES">
|
isEnabled = "YES">
|
||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
</CommandLineArguments>
|
</CommandLineArguments>
|
||||||
|
<EnvironmentVariables>
|
||||||
|
<EnvironmentVariable
|
||||||
|
key = "MKXPZ_SELECT_PATH"
|
||||||
|
value = "1"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</EnvironmentVariable>
|
||||||
|
</EnvironmentVariables>
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Debug"
|
||||||
|
@ -78,7 +85,7 @@
|
||||||
buildConfiguration = "Debug">
|
buildConfiguration = "Debug">
|
||||||
</AnalyzeAction>
|
</AnalyzeAction>
|
||||||
<ArchiveAction
|
<ArchiveAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Debug"
|
||||||
revealArchiveInOrganizer = "YES">
|
revealArchiveInOrganizer = "YES">
|
||||||
</ArchiveAction>
|
</ArchiveAction>
|
||||||
</Scheme>
|
</Scheme>
|
||||||
|
|
|
@ -30,10 +30,8 @@ std::string contentsOfAssetAsString(const char *baseName, const char *ext);
|
||||||
|
|
||||||
std::string getResourcePath();
|
std::string getResourcePath();
|
||||||
|
|
||||||
#ifdef MKXPZ_DEBUG
|
|
||||||
std::string selectPath(SDL_Window *win, const char *msg, const char *prompt);
|
std::string selectPath(SDL_Window *win, const char *msg, const char *prompt);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif /* filesystemImpl_h */
|
#endif /* filesystemImpl_h */
|
||||||
|
|
|
@ -5,12 +5,8 @@
|
||||||
// Created by ゾロアーク on 11/21/20.
|
// Created by ゾロアーク on 11/21/20.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifdef MKXPZ_DEBUG
|
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
#import <SDL_syswm.h>
|
#import <SDL_syswm.h>
|
||||||
#else
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import <SDL_filesystem.h>
|
#import <SDL_filesystem.h>
|
||||||
|
|
||||||
|
@ -100,7 +96,6 @@ std::string filesystemImpl::getResourcePath() {
|
||||||
return std::string(NSTOPATH(NSBundle.mainBundle.resourcePath));
|
return std::string(NSTOPATH(NSBundle.mainBundle.resourcePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MKXPZ_DEBUG
|
|
||||||
std::string filesystemImpl::selectPath(SDL_Window *win, const char *msg, const char *prompt) {
|
std::string filesystemImpl::selectPath(SDL_Window *win, const char *msg, const char *prompt) {
|
||||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||||
panel.canChooseDirectories = true;
|
panel.canChooseDirectories = true;
|
||||||
|
@ -126,4 +121,3 @@ std::string filesystemImpl::selectPath(SDL_Window *win, const char *msg, const c
|
||||||
|
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -344,9 +344,10 @@ int main(int argc, char *argv[]) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(MKXPZ_BUILD_XCODE) && defined(MKXPZ_DEBUG)
|
#if defined(MKXPZ_BUILD_XCODE)
|
||||||
#define DEBUG_FSELECT_MSG "Select the folder to load game files from. This is the folder containing the INI and/or configuration JSON.\nThis prompt does not appear in release builds."
|
#define DEBUG_FSELECT_MSG "Select the folder to load game files from. This is the folder containing the INI and/or configuration JSON."
|
||||||
#define DEBUG_FSELECT_PROMPT "Load Game"
|
#define DEBUG_FSELECT_PROMPT "Load Game"
|
||||||
|
if (SDL_getenv("MKXPZ_SELECT_PATH")) {
|
||||||
std::string dataDirStr = mkxp_fs::selectPath(win, DEBUG_FSELECT_MSG, DEBUG_FSELECT_PROMPT);
|
std::string dataDirStr = mkxp_fs::selectPath(win, DEBUG_FSELECT_MSG, DEBUG_FSELECT_PROMPT);
|
||||||
if (!dataDirStr.empty()) {
|
if (!dataDirStr.empty()) {
|
||||||
conf.gameFolder = dataDirStr;
|
conf.gameFolder = dataDirStr;
|
||||||
|
@ -355,7 +356,7 @@ int main(int argc, char *argv[]) {
|
||||||
conf.read(argc, argv);
|
conf.read(argc, argv);
|
||||||
conf.readGameINI();
|
conf.readGameINI();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* OSX and Windows have their own native ways of
|
/* OSX and Windows have their own native ways of
|
||||||
|
|
Loading…
Add table
Reference in a new issue