| 284 | |
| 285 | |
| 286 | void 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 | |
| 317 | void ServerMenu::resize(int _width, int _height) { |
nothing calls this directly
no test coverage detected