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

Method updateDescription

source/modes/MenuModeMultiplayerServer.cpp:256–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256bool MenuModeMultiplayerServer::updateDescription(const CEGUI::EventArgs&)
257{
258 // Get the level corresponding id
259 CEGUI::Window* mainWin = getModeManager().getGui().getGuiSheet(Gui::multiplayerServerMenu);
260 CEGUI::Listbox* levelSelectList = static_cast<CEGUI::Listbox*>(mainWin->getChild(Gui::SKM_LIST_LEVELS));
261
262 CEGUI::Window* descTxt = mainWin->getChild("LevelWindowFrame/MapDescriptionText");
263
264 if(levelSelectList->getSelectedCount() == 0)
265 {
266 descTxt->setText("");
267 return true;
268 }
269
270 getModeManager().getGui().playButtonClickSound();
271
272 CEGUI::ListboxItem* selItem = levelSelectList->getFirstSelectedItem();
273 int id = selItem->getID();
274
275 std::string description = mDescriptionList[id];
276 descTxt->setText(reinterpret_cast<const CEGUI::utf8*>(description.c_str()));
277 return true;
278}

Callers

nothing calls this directly

Calls 3

getGuiSheetMethod · 0.80
setTextMethod · 0.80
playButtonClickSoundMethod · 0.80

Tested by

no test coverage detected