Skip to content

Commit

Permalink
Call System Functions: Move EasyRPG Extensions to a higher ID to prev…
Browse files Browse the repository at this point in the history
…ent conflicts

Minor enhancements
  • Loading branch information
Ghabry committed Sep 2, 2024
1 parent 10fe6bb commit 99188a1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ bool Game_Interpreter::ExecuteCommand(lcf::rpg::EventCommand const& com) {
return CommandManiacControlStrings(com);
case Cmd::Maniac_CallCommand:
return CommandManiacCallCommand(com);
case Cmd::EasyRpg_SetInterpreterFlag: //Cmd::EasyRpg_SetInterpreterFlag
case Cmd::EasyRpg_SetInterpreterFlag:
return CommandEasyRpgSetInterpreterFlag(com);
default:
return true;
Expand Down
45 changes: 20 additions & 25 deletions src/game_interpreter_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,48 +736,43 @@ bool Game_Interpreter_Map::CommandOpenSaveMenu(lcf::rpg::EventCommand const& com
return false;
}

// Parse common parameters
const int fullscreen_mode = com.parameters[1]; // Broken in Maniac.
const int pause_while_debugging = com.parameters[1]; // unused in our ingame debug screen.

const int actor_index = ValueOrVariable(com.parameters[1], com.parameters[2]);
const bool is_db_actor = ValueOrVariable(com.parameters[3], com.parameters[4]);

// Command "Call System Functions"
switch (current_system_function) {
case 1: // Load menu
return CommandOpenLoadMenu(com);
case 2: // Game menu
Scene::instance->SetRequestedScene(std::make_shared<Scene_Menu>());
break;
return CommandOpenMainMenu(com);
case 3: // Toggle fullscreen
// TODO? Implement fullscreen mode once maniacs supports it
// TODO Implement fullscreen mode once maniacs supports it
// const int fullscreen_mode = com.parameters[1]; // Broken in Maniac.
return CommandToggleFullscreen(com);
case 4: // Settings menu
return CommandOpenVideoOptions(com);
case 5: // Debug menu
// const int pause_while_debugging = com.parameters[1]; // unused in our ingame debug screen.
Scene::instance->SetRequestedScene(std::make_shared<Scene_Debug>());
break;
++index;
return false;
case 6: // License information menu
// TODO? Implement license information menu
// TODO Implement license information menu
return true;
case 7: // Reset game
return CommandReturnToTitleScreen(com);
case 8: // EASYRPG Inventory menu
return RequestMainMenuScene(1);
case 9: // EASYRPG Skills menu
return RequestMainMenuScene(2, actor_index, is_db_actor);
case 10: // EASYRPG Equip menu
return RequestMainMenuScene(3, actor_index, is_db_actor);
case 11: // EASYRPG Status menu
return RequestMainMenuScene(4, actor_index, is_db_actor);
case 12: // EASYRPG Reorder Party menu
return RequestMainMenuScene(5);
default:
return true;
if (Player::HasEasyRpgExtensions() && current_system_function >= 200 && current_system_function < 210) {
const int actor_index = ValueOrVariable(com.parameters[1], com.parameters[2]);
const bool is_db_actor = ValueOrVariable(com.parameters[3], com.parameters[4]);

if (RequestMainMenuScene(current_system_function - 200, actor_index, is_db_actor)) {
++index;
return false;
}
} else {
Output::Warning("CommandOpenSaveMenu: Unsupported scene {}", current_system_function);
}
}

++index;
return false;
return true;
}

bool Game_Interpreter_Map::CommandOpenMainMenu(lcf::rpg::EventCommand const&) { // code 11950
Expand Down

0 comments on commit 99188a1

Please sign in to comment.