engine/source/ShadowOfTheWyrmEngine.cpp
// Process a load game command. Load the game and then reload the keybindings
// from disk, as the saved game will have settings based on when the savefile
// was originally created.
Process a load game command. Load the game and then reload the keybindings
from disk, as the saved game will have settings based on when the savefile
was originally created.
Process a load game command . Load the game and then reload the keybindings from disk as the saved game will have settings based on when the savefile was originally created .
bool ShadowOfTheWyrmEngine::process_load_game()
{
  bool result = false;
  Game& game = Game::instance();
  LoadGameScreen load_game(display);
  string option = load_game.display();
  string filename = load_game.get_file_name(option);
  if (!filename.empty())
  {
    SerializationReturnCode src = Serialization::load(filename);
    if (src == SerializationReturnCode::SERIALIZATION_OK)
    {
      game.set_current_loaded_savefile(filename);
      result = true;
    }
  }
  Settings kb_settings(true);
  map<string, string> keybinding_settings = kb_settings.get_keybindings();
  game.get_settings_ref().set_settings(keybinding_settings);
  return result;
}
bool ShadowOfTheWyrmEngine :: process_load_game ( ) { bool result = false ; Game & game = Game :: instance ( ) ; LoadGameScreen load_game ( display ) ; string option = load_game . display ( ) ; string filename = load_game . get_file_name ( option ) ; if ( ! filename . empty ( ) ) { SerializationReturnCode src = Serialization :: load ( filename ) ; if ( src == SerializationReturnCode :: SERIALIZATION_OK ) { game . set_current_loaded_savefile ( filename ) ; result = true ; } } Settings kb_settings ( true ) ; map < string , string > keybinding_settings = kb_settings . get_keybindings ( ) ; game . get_settings_ref ( ) . set_settings ( keybinding_settings ) ; return result ; }
Process a load game command.
Process a load game command .
// JCD TODO: Add support for additional reloadable settings here. // E.g., autopickup