mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-04-21 21:52:04 +02:00
Set Ruby's ARGV based on the command line
This commit is contained in:
parent
0770751e20
commit
7a9d60cdbc
4 changed files with 131 additions and 105 deletions
|
@ -1077,6 +1077,13 @@ static void mriBindingExecute() {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
VALUE rbArgv = rb_get_argv();
|
||||
for (const auto &str : conf.launchArgs)
|
||||
rb_ary_push(rbArgv, rb_utf8_str_new_cstr(str.c_str()));
|
||||
|
||||
// Duplicates get pushed for some reason
|
||||
rb_funcall(rbArgv, rb_intern("uniq!"), 0);
|
||||
|
||||
VALUE lpaths = rb_gv_get(":");
|
||||
if (!conf.rubyLoadpaths.empty()) {
|
||||
/* Setup custom load paths */
|
||||
|
|
12
mkxp.json
12
mkxp.json
|
@ -324,4 +324,16 @@
|
|||
//
|
||||
// "execName": "Game"
|
||||
|
||||
// You can define alternate terminology for the different
|
||||
// inputs recognized by RPG Maker. A, B, C, X, Y, Z, L, and R
|
||||
// can all be set using this dictionary, and will be displayed
|
||||
// on the F1 menu. This is only a cosmetic effect, so it will
|
||||
// have no effect on the game's scripts.
|
||||
//
|
||||
// "bindingNames": {
|
||||
// "c": "Confirm",
|
||||
// "b": "Cancel",
|
||||
// "x": ...
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -236,6 +236,11 @@ try { exp } catch (...) {}
|
|||
editor.debug = true;
|
||||
else if (!strcmp(argv[1], "btest"))
|
||||
editor.battleTest = true;
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
const char *arg = argv[i];
|
||||
launchArgs.push_back(argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (mkxp_fs::fileExists(CONF_FILE)) {
|
||||
|
|
|
@ -78,6 +78,8 @@ struct Config {
|
|||
bool useScriptNames;
|
||||
|
||||
std::string customScript;
|
||||
|
||||
std::vector<std::string> launchArgs;
|
||||
std::vector<std::string> preloadScripts;
|
||||
std::vector<std::string> rtps;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue