diff --git a/mkxp.json b/mkxp.json index 78f37212..0ddc9d60 100644 --- a/mkxp.json +++ b/mkxp.json @@ -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) diff --git a/src/config.cpp b/src/config.cpp index 7e400834..298da5db 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -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(), diff --git a/src/config.h b/src/config.h index bd253f7a..a3d7de3f 100644 --- a/src/config.h +++ b/src/config.h @@ -106,6 +106,7 @@ struct Config { std::vector launchArgs; std::vector preloadScripts; std::vector rtps; + std::vector patches; std::vector fontSubs; diff --git a/src/sharedstate.cpp b/src/sharedstate.cpp index c1ee14ab..f11153ec 100644 --- a/src/sharedstate.cpp +++ b/src/sharedstate.cpp @@ -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)