Skip to content

Commit 05ad681

Browse files
committed
BetterAEP: Emulate patch "CustomSaveLoad" which depends on BetterAEP
1 parent 6911bda commit 05ad681

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/game_config_game.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ struct Game_ConfigGame {
5050
ConfigParam<int> patch_anti_lag_switch{ "Anti-Lag Switch", "Disable event page refreshes when switch is set", "Patch", "AntiLagSwitch", 0 };
5151
ConfigParam<int> patch_direct_menu{ "Direct Menu", " Allows direct access to subscreens of the default menu", "Patch", "DirectMenu", 0 };
5252
ConfigParam<int> patch_better_aep{ "BetterAEP", "Emulates the \"BetterAEP\" patch, commonly used for custom title screens.", "Patch", "BetterAEP", 0 };
53+
ConfigParam<int> patch_custom_save_load{ "BetterAEP", "Emulates the \"BetterAEP\" addon which allows for saving/loading by save slot.", "Patch", "BetterAEP.CustomSaveLoad", 0 };
5354

5455
// Command line only
5556
BoolConfigParam patch_support{ "Support patches", "When OFF all patch support is disabled", "", "", true };

src/game_interpreter.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,11 +2044,19 @@ bool Game_Interpreter::CommandEndEventProcessing(lcf::rpg::EventCommand const& /
20442044
if (auto var_id = Player::game_config.patch_better_aep.Get()) {
20452045
switch (Main_Data::game_variables->Get(var_id)) {
20462046
case 1:
2047+
if (var_id = Player::game_config.patch_custom_save_load.Get()) {
2048+
if (auto save_slot = Main_Data::game_variables->Get(var_id) > 0) {
2049+
_async_op = MakeLoadOp("CustomSaveLoad", save_slot);
2050+
return true;
2051+
}
2052+
}
20472053
Scene::instance->SetRequestedScene(std::make_shared<Scene_Load>());
20482054
return true;
20492055
case 2:
20502056
Player::exit_flag = true;
20512057
return true;
2058+
default:
2059+
break;
20522060
}
20532061
}
20542062

src/game_interpreter_map.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,13 @@ bool Game_Interpreter_Map::CommandOpenSaveMenu(lcf::rpg::EventCommand const& com
776776
auto& frame = GetFrame();
777777
auto& index = frame.current_command;
778778

779+
if (auto var_id = Player::game_config.patch_custom_save_load.Get()) {
780+
if (auto save_slot = Main_Data::game_variables->Get(var_id) > 0) {
781+
_async_op = AsyncOp::MakeSave(save_slot, -1);
782+
return true;
783+
}
784+
}
785+
779786
Scene::instance->SetRequestedScene(std::make_shared<Scene_Save>());
780787

781788
int current_system_function = 0;

0 commit comments

Comments
 (0)