MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / execute

Method execute

src/bzflag/ServerMenu.cpp:286–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284
285
286void ServerMenu::execute() {
287 if ((tabbedControl->getActiveTab() == customTabControl) &&
288 (dynamic_cast<HUDuiServerListCustomTab*>(tabbedControl->getActiveTab())->createNew->hasFocus())) {
289 HUDuiServerList* newServerList = customTabControl->createServerList();
290 listsCache.addNewList(newServerList, customTabControl->tabName->getString());
291 tabbedControl->addTab(newServerList, customTabControl->tabName->getString(), tabbedControl->getTabCount() - 1);
292 for (size_t i = 0; i < serverList.size(); i++) {
293 newServerList->addItem(serverList.getServerAt(i));
294 }
295 //newServerList->searchServers(customTabControl->serverName->getString());
296 dynamic_cast<HUDuiNestedContainer*>(tabbedControl->getTab(tabbedControl->getTabCount() - 2))->getNav().set(1);
297 return;
298 }
299
300 if ((tabbedControl->hasFocus()) ||
301 (tabbedControl->getActiveTab()->hasFocus()) ||
302 (tabbedControl->getActiveTabName() == "Create New Tab")) {
303 return;
304 }
305
306 // update startup info
307 StartupInfo* info = getStartupInfo();
308 ServerItem* selectedServer = dynamic_cast<HUDuiServerList*>(tabbedControl->getActiveTab())->getSelectedServer();
309 strncpy(info->serverName, selectedServer->name.c_str(), ServerNameLen - 1);
310 info->serverPort = ntohs((unsigned short) selectedServer->ping.serverId.port);
311
312 // all done
313 HUDDialogStack::get()->pop();
314}
315
316
317void ServerMenu::resize(int _width, int _height) {

Callers

nothing calls this directly

Calls 15

getStartupInfoFunction · 0.85
hasFocusMethod · 0.80
createServerListMethod · 0.80
addNewListMethod · 0.80
getServerAtMethod · 0.80
getTabMethod · 0.80
getActiveTabNameMethod · 0.80
getSelectedServerMethod · 0.80
c_strMethod · 0.80
popMethod · 0.80
getActiveTabMethod · 0.45
getStringMethod · 0.45

Tested by

no test coverage detected