MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / activate

Method activate

source/modes/MenuModeSkirmish.cpp:104–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void MenuModeSkirmish::activate()
105{
106 // Loads the corresponding Gui sheet.
107 getModeManager().getGui().loadGuiSheet(Gui::guiSheet::skirmishMenu);
108
109 giveFocus();
110
111 // Play the main menu music
112 MusicPlayer::getSingleton().play(ConfigManager::getSingleton().getMainMenuMusic());
113
114 GameMap* gameMap = ODFrameListener::getSingleton().getClientGameMap();
115 gameMap->clearAll();
116 gameMap->setGamePaused(true);
117
118 // Select skirmish
119 CEGUI::Combobox* levelTypeCb = static_cast<CEGUI::Combobox*>(getModeManager().getGui().
120 getGuiSheet(Gui::skirmishMenu)->getChild(Gui::SKM_LIST_LEVEL_TYPES));
121 levelTypeCb->setItemSelectState(static_cast<size_t>(0), true);
122 updateFilesList();
123
124 // Set the player name if valid. (Will use the defaut one if not.)
125 ConfigManager& config = ConfigManager::getSingleton();
126 std::string nickname = config.getGameValue(Config::NICKNAME, std::string(), false);
127 if (!nickname.empty())
128 ODFrameListener::getSingleton().getClientGameMap()->setLocalPlayerNick(nickname);
129}
130
131bool MenuModeSkirmish::updateFilesList(const CEGUI::EventArgs&)
132{

Callers

nothing calls this directly

Calls 8

loadGuiSheetMethod · 0.80
getClientGameMapMethod · 0.80
clearAllMethod · 0.80
setGamePausedMethod · 0.80
getGuiSheetMethod · 0.80
getGameValueMethod · 0.80
setLocalPlayerNickMethod · 0.80
playMethod · 0.45

Tested by

no test coverage detected