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

Method OnClick

src/network/network_gui.cpp:2179–2198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2177 }
2178
2179 void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
2180 {
2181 switch (widget) {
2182 case WID_NAR_NO:
2183 _network_coordinator_client.ConnectFailure(this->token, 0);
2184 this->Close(NRWCD_HANDLED);
2185 break;
2186
2187 case WID_NAR_YES_ONCE:
2188 _network_coordinator_client.StartTurnConnection(this->token);
2189 this->Close(NRWCD_HANDLED);
2190 break;
2191
2192 case WID_NAR_YES_ALWAYS:
2193 _settings_client.network.use_relay_service = URS_ALLOW;
2194 _network_coordinator_client.StartTurnConnection(this->token);
2195 this->Close(NRWCD_HANDLED);
2196 break;
2197 }
2198 }
2199};
2200
2201static constexpr std::initializer_list<NWidgetPart> _nested_network_ask_relay_widgets = {

Callers

nothing calls this directly

Calls 3

CloseMethod · 0.95
StartTurnConnectionMethod · 0.80
ConnectFailureMethod · 0.45

Tested by

no test coverage detected