mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-04 05:55:31 +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/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
|
||||
// (default: enabled)
|
||||
|
|
|
@ -180,6 +180,7 @@ void Config::read(int argc, char *argv[]) {
|
|||
{"useScriptNames", true},
|
||||
{"preloadScript", json::array({})},
|
||||
{"RTP", json::array({})},
|
||||
{"patches", json::array({})},
|
||||
{"fontSub", json::array({})},
|
||||
{"rubyLoadpath", json::array({})},
|
||||
{"JITEnable", false},
|
||||
|
@ -298,6 +299,7 @@ try { exp } catch (...) {}
|
|||
|
||||
fillStringVec(opts["preloadScript"], preloadScripts);
|
||||
fillStringVec(opts["RTP"], rtps);
|
||||
fillStringVec(opts["patches"], patches);
|
||||
fillStringVec(opts["fontSub"], fontSubs);
|
||||
for (std::string & fontSub : fontSubs)
|
||||
std::transform(fontSub.begin(), fontSub.end(), fontSub.begin(),
|
||||
|
|
|
@ -106,6 +106,7 @@ struct Config {
|
|||
std::vector<std::string> launchArgs;
|
||||
std::vector<std::string> preloadScripts;
|
||||
std::vector<std::string> rtps;
|
||||
std::vector<std::string> patches;
|
||||
|
||||
std::vector<std::string> fontSubs;
|
||||
|
||||
|
|
|
@ -125,6 +125,9 @@ struct SharedStatePrivate
|
|||
|
||||
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 */
|
||||
FILE *tmp = fopen(archPath.c_str(), "rb");
|
||||
if (tmp)
|
||||
|
|
Loading…
Add table
Reference in a new issue