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

Method OnQueryTextFinished

src/network/network_gui.cpp:1920–1941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1918 }
1919
1920 void OnQueryTextFinished(std::optional<std::string> str) override
1921 {
1922 if (!str.has_value()) return;
1923
1924 switch (this->query_widget) {
1925 default: NOT_REACHED();
1926
1927 case WID_CL_SERVER_NAME_EDIT: {
1928 if (!_network_server) break;
1929
1930 SetSettingValue(GetSettingFromName("network.server_name")->AsStringSetting(), *str);
1931 this->InvalidateData();
1932 break;
1933 }
1934
1935 case WID_CL_CLIENT_NAME_EDIT: {
1936 SetSettingValue(GetSettingFromName("network.client_name")->AsStringSetting(), *str);
1937 this->InvalidateData();
1938 break;
1939 }
1940 }
1941 }
1942
1943 void DrawWidget(const Rect &r, WidgetID widget) const override
1944 {

Callers

nothing calls this directly

Calls 5

NOT_REACHEDFunction · 0.85
SetSettingValueFunction · 0.85
GetSettingFromNameFunction · 0.85
AsStringSettingMethod · 0.80
InvalidateDataMethod · 0.45

Tested by

no test coverage detected