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

Method OnEditboxChanged

src/network/network_gui.cpp:797–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795 }
796
797 void OnEditboxChanged(WidgetID wid) override
798 {
799 switch (wid) {
800 case WID_NG_FILTER: {
801 this->servers.ForceRebuild();
802 this->BuildGUINetworkGameList();
803 this->ScrollToSelectedServer();
804 this->SetDirty();
805 break;
806 }
807
808 case WID_NG_CLIENT:
809 /* Validation of the name will happen once the user tries to join or start a game, as getting
810 * error messages while typing (e.g. when you clear the name) defeats the purpose of the check. */
811 _settings_client.network.client_name = this->name_editbox.text.GetText();
812 break;
813 }
814 }
815
816 void OnQueryTextFinished(std::optional<std::string> str) override
817 {

Callers

nothing calls this directly

Calls 5

ForceRebuildMethod · 0.80
SetDirtyMethod · 0.45
GetTextMethod · 0.45

Tested by

no test coverage detected