MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / NetworkGameWindow

Method NetworkGameWindow

src/network/network_gui.cpp:434–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432
433public:
434 NetworkGameWindow(WindowDesc &desc) : Window(desc), name_editbox(NETWORK_CLIENT_NAME_LENGTH), filter_editbox(120)
435 {
436 this->CreateNestedTree();
437 this->vscroll = this->GetScrollbar(WID_NG_SCROLLBAR);
438 this->FinishInitNested(WN_NETWORK_WINDOW_GAME);
439
440 this->querystrings[WID_NG_CLIENT] = &this->name_editbox;
441 this->name_editbox.text.Assign(_settings_client.network.client_name);
442
443 this->querystrings[WID_NG_FILTER] = &this->filter_editbox;
444 this->filter_editbox.cancel_button = QueryString::ACTION_CLEAR;
445 this->SetFocusedWidget(WID_NG_FILTER);
446
447 /* As the Game Coordinator doesn't support "websocket" servers yet, we
448 * let "os/emscripten/pre.js" hardcode a list of servers people can
449 * join. This means the serverlist is curated for now, but it is the
450 * best we can offer. */
451#ifdef __EMSCRIPTEN__
452 EM_ASM(if (window["openttd_server_list"]) openttd_server_list());
453#endif
454
455 this->last_joined = NetworkAddServer(_settings_client.network.last_joined, false);
456 this->server = this->last_joined;
457
458 this->servers.SetListing(this->last_sorting);
459 this->servers.SetSortFuncs(NetworkGameWindow::sorter_funcs);
460 this->servers.SetFilterFuncs(NetworkGameWindow::filter_funcs);
461 this->servers.ForceRebuild();
462 }
463
464 ~NetworkGameWindow()
465 {

Callers

nothing calls this directly

Calls 11

ifFunction · 0.85
NetworkAddServerFunction · 0.85
CreateNestedTreeMethod · 0.80
GetScrollbarMethod · 0.80
FinishInitNestedMethod · 0.80
SetFocusedWidgetMethod · 0.80
SetListingMethod · 0.80
SetSortFuncsMethod · 0.80
SetFilterFuncsMethod · 0.80
ForceRebuildMethod · 0.80
AssignMethod · 0.45

Tested by

no test coverage detected