| 254 | } |
| 255 | |
| 256 | bool 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 | } |
nothing calls this directly
no test coverage detected