MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / OnButtonClicked

Method OnButtonClicked

engine/Poseidon/UI/DisplayUISetup.cpp:87–121  ·  view source on GitHub ↗

Client display

Source from the content-addressed store, hash-verified

85 return -1; // slot doesn't exist
86}
87
88// Client display
89void DisplayClient::OnButtonClicked(int idc)
90{
91 switch (idc)
92 {
93 case IDC_OK:
94 {
95 // init game info
96 SetBaseDirectory("");
97 CurrentCampaign = "";
98 CurrentBattle = "";
99 CurrentMission = "";
100 USER_CONFIG.easyMode = false;
101
102 CurrentTemplate.Clear();
103 if (GWorld->UI())
104 {
105 GWorld->UI()->Init();
106 }
107
108 // In auto-assign mode, default exit code is 2 (server offline before play).
109 // It gets overridden to 0 when a mission completes.
110 if (!AppConfig::Instance().GetMPAssign().empty())
111 GApp->m_exitCode = 2;
112
113 CreateChild(new DisplayMultiplayerSetup(this));
114 }
115 break;
116 case IDC_AUTOCANCEL:
117 Exit(idc);
118 break;
119 default:
120 Display::OnButtonClicked(idc);
121 break;
122 }
123}
124

Callers

nothing calls this directly

Calls 15

SetBaseDirectoryFunction · 0.85
LocalizeStringFunction · 0.85
UIMethod · 0.80
FindIdentityMethod · 0.80
ClearMethod · 0.45
InitMethod · 0.45
emptyMethod · 0.45
IsServerMethod · 0.45
GetIdentitiesMethod · 0.45
GetPlayerMethod · 0.45
NPlayerRolesMethod · 0.45
GetPlayerRoleMethod · 0.45

Tested by

no test coverage detected