mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-04 14:05:32 +02:00
Merge pull request #107 from WaywardHeart/patches
Add a "patches" option to the config.
This commit is contained in:
commit
5ed8fd7986
4 changed files with 14 additions and 0 deletions
|
@ -331,6 +331,14 @@
|
||||||
// "/path/to/rtp2.zip",
|
// "/path/to/rtp2.zip",
|
||||||
// "/path/to/game.rgssad"],
|
// "/path/to/game.rgssad"],
|
||||||
|
|
||||||
|
// Similar to the RTP option, except items are loaded before
|
||||||
|
// the game archive and folder, for incremental game updates
|
||||||
|
// or modding.
|
||||||
|
// (default: none)
|
||||||
|
//
|
||||||
|
// "patches": ["/path/to/patch1.zip",
|
||||||
|
// "/path/to/patch2"],
|
||||||
|
|
||||||
|
|
||||||
// Use the script's name as filename in warnings and error messages
|
// Use the script's name as filename in warnings and error messages
|
||||||
// (default: enabled)
|
// (default: enabled)
|
||||||
|
|
|
@ -180,6 +180,7 @@ void Config::read(int argc, char *argv[]) {
|
||||||
{"useScriptNames", true},
|
{"useScriptNames", true},
|
||||||
{"preloadScript", json::array({})},
|
{"preloadScript", json::array({})},
|
||||||
{"RTP", json::array({})},
|
{"RTP", json::array({})},
|
||||||
|
{"patches", json::array({})},
|
||||||
{"fontSub", json::array({})},
|
{"fontSub", json::array({})},
|
||||||
{"rubyLoadpath", json::array({})},
|
{"rubyLoadpath", json::array({})},
|
||||||
{"JITEnable", false},
|
{"JITEnable", false},
|
||||||
|
@ -298,6 +299,7 @@ try { exp } catch (...) {}
|
||||||
|
|
||||||
fillStringVec(opts["preloadScript"], preloadScripts);
|
fillStringVec(opts["preloadScript"], preloadScripts);
|
||||||
fillStringVec(opts["RTP"], rtps);
|
fillStringVec(opts["RTP"], rtps);
|
||||||
|
fillStringVec(opts["patches"], patches);
|
||||||
fillStringVec(opts["fontSub"], fontSubs);
|
fillStringVec(opts["fontSub"], fontSubs);
|
||||||
for (std::string & fontSub : fontSubs)
|
for (std::string & fontSub : fontSubs)
|
||||||
std::transform(fontSub.begin(), fontSub.end(), fontSub.begin(),
|
std::transform(fontSub.begin(), fontSub.end(), fontSub.begin(),
|
||||||
|
|
|
@ -106,6 +106,7 @@ struct Config {
|
||||||
std::vector<std::string> launchArgs;
|
std::vector<std::string> launchArgs;
|
||||||
std::vector<std::string> preloadScripts;
|
std::vector<std::string> preloadScripts;
|
||||||
std::vector<std::string> rtps;
|
std::vector<std::string> rtps;
|
||||||
|
std::vector<std::string> patches;
|
||||||
|
|
||||||
std::vector<std::string> fontSubs;
|
std::vector<std::string> fontSubs;
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,9 @@ struct SharedStatePrivate
|
||||||
|
|
||||||
std::string archPath = config.execName + gameArchExt();
|
std::string archPath = config.execName + gameArchExt();
|
||||||
|
|
||||||
|
for (size_t i = 0; i < config.patches.size(); ++i)
|
||||||
|
fileSystem.addPath(config.patches[i].c_str());
|
||||||
|
|
||||||
/* Check if a game archive exists */
|
/* Check if a game archive exists */
|
||||||
FILE *tmp = fopen(archPath.c_str(), "rb");
|
FILE *tmp = fopen(archPath.c_str(), "rb");
|
||||||
if (tmp)
|
if (tmp)
|
||||||
|
|
Loading…
Add table
Reference in a new issue