Debian Codegraph @

netgames/dmfc/dmfcui.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/Dmfc/dmfcui.cpp $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003/08/26 03:57:21 $
23 * $Author: kevinb $
24 *
25 * UI Code for DMFC dialogs
26 *
27 * $Log: dmfcui.cpp,v $
28 * Revision 1.1.1.1 2003/08/26 03:57:21 kevinb
29 * initial 1.5 import
30 *
31 *
32 * 26 7/09/99 2:54p Jeff
33 * handle gametime better (pause it when needed) if the server is 'waiting
34 * for players'
35 *
36 * 25 5/19/99 2:40a Jeff
37 * use correct calls of NewUIGameWindow
38 *
39 * 24 5/18/99 7:14p Jeff
40 * error checking
41 *
42 * 23 4/27/99 12:36p Jeff
43 * fixed dialog due to new art
44 *
45 * 22 4/24/99 11:13p Jeff
46 * added flags for creating a newui window for a title bar
47 *
48 * 21 4/09/99 3:28p Jeff
49 * fixed some bugs in wait for players dlg
50 *
51 * 20 4/03/99 9:26p Jeff
52 * changed dialogs that weren't using UID_OK and UID_CANCEL to use and
53 * handle them properly
54 *
55 * 19 3/17/99 12:25p Jeff
56 * converted DMFC to be COM interface
57 *
58 * 18 2/11/99 12:51a Jeff
59 * changed names of exported variables
60 *
61 * 17 2/09/99 3:32p Jeff
62 * table file parser takes quotes strings for force keywords
63 *
64 * 16 2/07/99 1:18a Jeff
65 * peppered UI dialogs that were missing NEWUIRES_FORCEQUIT to handle it
66 *
67 * 15 2/05/99 8:24p Jeff
68 * added table file parser macros
69 *
70 * 14 1/19/99 3:55a Jeff
71 * all strings localized out
72 *
73 * 13 1/14/99 7:55p Jeff
74 * changed icons for team selection dialog, added real powerball
75 *
76 * 12 1/12/99 2:55p Jeff
77 * added/finished the waiting for player's to join dialog
78 *
79 * 11 1/11/99 6:54p Jeff
80 * fixed bug with wait4player dialog
81 *
82 * 10 1/10/99 7:41p Jeff
83 * added initial version of waitforplayers dialog
84 *
85 * 9 12/08/98 3:29p Jeff
86 * updated the team control dialog so the server can determine if they
87 * want to make the clients wait
88 *
89 * 8 12/08/98 12:17p Jeff
90 * various changes that include an improved Team Control dialog (doesn't
91 * switch teams until exit..) and spew/respawn players that change teams
92 *
93 * 7 11/19/98 5:56p Jeff
94 * added slider exported and improved Hoard
95 *
96 * 6 11/17/98 6:29p Jeff
97 * mod can specify whether or not to display the team setup dialog on team
98 * game start. Added a menu item to display team setup dialog in mid-game
99 *
100 * 5 11/17/98 12:35p Jeff
101 * fixed bug where team placement window didn't update second time
102 * displayed
103 *
104 * 4 11/16/98 5:35p Jeff
105 * removed log functions, added support for changing team names, fixed ctf
106 * to work better with different team names
107 *
108 * 3 11/11/98 7:19p Jeff
109 * changes made so that a dedicated server's team is always -1 (team game
110 * or not)
111 *
112 * 2 10/29/98 7:01p Jeff
113 * creation of team placement dialog. Moved TranslateEvent into DMFC
114 *
115 * $NoKeywords: $
116 */
117
118 #include "gamedll_header.h"cxx . . $ `<file>/netgames/includes/gamedll_header.h`/
119 #include "DMFC.h"cxx . . $ `<file>/netgames/includes/DMFC.h`/
120 #include "dmfcinternal.h"cxx . . $ `<file>/netgames/dmfc/dmfcinternal.h`/
121
122 extern DMFCBasecxx . . $ DMFCBase# *basethiscxx . . $ basethis.;
123
124 struct tTeamPlacementDialogInfocxx . . $ tTeamPlacementDialogInfo# {
125 void *lbcxx . . $ tTeamPlacementDialogInfo#lb.[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!];
126 void *textcxx . . $ tTeamPlacementDialogInfo#text.[DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!];
127 int transcxx . . $ tTeamPlacementDialogInfo#trans.[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!][DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!];
128 void (*old_callbackcxx . . $ tTeamPlacementDialogInfo#old_callback.)();
129 };
130 tTeamPlacementDialogInfocxx . . $ tTeamPlacementDialogInfo# tpdicxx . . $ tpdi.;
131
132 #define TS_NOTINGAMEcxx . . $ `netgames/dmfc/dmfcui.cpp:132:9`! -2
133 int8_t TeamDlgInitialTeamSettingscxx . . $ TeamDlgInitialTeamSettings.[DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!];
134 int8_t TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!];
135
136 // UpdateTeamPlacementDialog
137 //
138 // Call to update the listboxes, etc in the team placement
139 void UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).(void) {
140 int selected_num[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!];
141 int i;
142
143 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
144 selected_num[i] = -1;
145
146 // remove everything from the listboxes
147 // save the selected names, and reselect them if they are on the same listbox
148 if (tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[i]) {
149 int sel = DLLListGetSelectedIndex(tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[i]);
150
151 if (sel >= 0 && sel < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!)
152 selected_num[i] = tpdicxx . . $ tpdi..transcxx . . $ tTeamPlacementDialogInfo#trans.[i][sel];
153
154 DLLListRemoveAll(tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[i]);
155 }
156 }
157
158 int curr_lb_count[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!];
159 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
160 curr_lb_count[i] = 0;
161 for (int p = 0; p < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; p++) {
162 tpdicxx . . $ tpdi..transcxx . . $ tTeamPlacementDialogInfo#trans.[i][p] = -1;
163 }
164 }
165
166 // now rebuild the listboxes with correct placement
167 for (i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
168
169 if (tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i]) {
170 DLLRemoveUITextItem(tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i]);
171 tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
172 }
173
174 // as we go through all the players, we need to update the trans[][]
175 if (basethiscxx . . $ basethis.->CheckPlayerNumcxx . . $ DMFCBase#CheckPlayerNum(83c267b20bac841a).(i)) {
176 // the player is in the game, get their team
177 int team;
178
179 if (TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i] != TS_NOTINGAMEcxx . . $ `netgames/dmfc/dmfcui.cpp:132:9`!) {
180 // ok this guy was in the game when the dialog first got displayed, so
181 // use his current status, and not his real team
182 team = TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i];
183 } else {
184 // he wasn't in the game to start and his team hasn't changed yet
185 team = basethiscxx . . $ basethis.->GetPlayerTeamcxx . . $ DMFCBase#GetPlayerTeam(7864480464b09eea).(i);
186 }
187
188 // add them to a team
189 if (tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[team]) {
190 tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i] = DLLCreateNewUITextItem(basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[i].callsigncxx . . $ player#callsign., basethiscxx . . $ basethis.->GetTeamColorcxx . . $ DMFCBase#GetTeamColor(46cc46841198e427).(team), -1);
191 if (tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i]) {
192 DLLListAddItem(tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[team], tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i]);
193 tpdicxx . . $ tpdi..transcxx . . $ tTeamPlacementDialogInfo#trans.[team][curr_lb_count[team]] = i; // update the translator
194 curr_lb_count[team]++;
195 } else
196 mprintfcxx . . $ `netgames/dmfc/dmfcinternal.h:275:9`!(0, "Couldn't create text item\n");
197 } else {
198 mprintfcxx . . $ `netgames/dmfc/dmfcinternal.h:275:9`!(0, "Listbox not valid!\n");
199 }
200 } else {
201 TeamDlgInitialTeamSettingscxx . . $ TeamDlgInitialTeamSettings.[i] = TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i] = TS_NOTINGAMEcxx . . $ `netgames/dmfc/dmfcui.cpp:132:9`!;
202 }
203 }
204
205 // go through all the listboxes, and reselect previously selected
206 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
207 if (selected_num[i] != -1 && basethiscxx . . $ basethis.->CheckPlayerNumcxx . . $ DMFCBase#CheckPlayerNum(83c267b20bac841a).(selected_num[i])) {
208
209 if (((TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[selected_num[i]] == TS_NOTINGAMEcxx . . $ `netgames/dmfc/dmfcui.cpp:132:9`!) &&
210 (basethiscxx . . $ basethis.->GetPlayerTeamcxx . . $ DMFCBase#GetPlayerTeam(7864480464b09eea).(selected_num[i]) == i)) ||
211 (TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[selected_num[i]] == i)) {
212 // this player was on this team last update, is still on the team, is a valid player in the game and was
213 // selected so select them again
214 for (int j = 0; j < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; j++) {
215 if (tpdicxx . . $ tpdi..transcxx . . $ tTeamPlacementDialogInfo#trans.[i][j] == selected_num[i]) {
216 // we found em, reselect
217 if (tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[i]) {
218 DLLListSetSelectedIndex(tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[i], j);
219 }
220 break;
221 }
222 }
223 }
224 }
225 }
226 }
227
228 static float Team_placement_lastcallcxx . . $ Team_placement_lastcall. = 0;
229 void TeamPlacementCallbackcxx . . $ TeamPlacementCallback(49f6e7a06ebc5aa8).(void) {
230 float time = *basethiscxx . . $ basethis.->Gametimecxx . . $ DMFCBase#Gametime.;
231
232 if (time > Team_placement_lastcallcxx . . $ Team_placement_lastcall. + 0.5f) {
233 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
234 Team_placement_lastcallcxx . . $ Team_placement_lastcall. = time;
235 }
236
237 if (tpdicxx . . $ tpdi..old_callbackcxx . . $ tTeamPlacementDialogInfo#old_callback.)
238 (*tpdicxx . . $ tpdi..old_callbackcxx . . $ tTeamPlacementDialogInfo#old_callback.)();
239 }
240
241 void TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(int old_team, int new_team) {
242 int sel = DLLListGetSelectedIndex(tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[old_team]);
243 if (sel < 0)
244 return;
245
246 int pnum = tpdicxx . . $ tpdi..transcxx . . $ tTeamPlacementDialogInfo#trans.[old_team][sel];
247 if (!basethiscxx . . $ basethis.->CheckPlayerNumcxx . . $ DMFCBase#CheckPlayerNum(83c267b20bac841a).(pnum)) {
248 TeamDlgInitialTeamSettingscxx . . $ TeamDlgInitialTeamSettings.[pnum] = TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[pnum] = TS_NOTINGAMEcxx . . $ `netgames/dmfc/dmfcui.cpp:132:9`!;
249 return;
250 }
251
252 TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[pnum] = new_team;
253 }
254
255 #define REDTOBLUEcxx . . $ `netgames/dmfc/dmfcui.cpp:255:9`! 0xC0
256 #define REDTOGREENcxx . . $ `netgames/dmfc/dmfcui.cpp:256:9`! 0xC1
257 #define REDTOYELLOWcxx . . $ `netgames/dmfc/dmfcui.cpp:257:9`! 0xC2
258 #define BLUETOREDcxx . . $ `netgames/dmfc/dmfcui.cpp:258:9`! 0xC3
259 #define BLUETOGREENcxx . . $ `netgames/dmfc/dmfcui.cpp:259:9`! 0xC4
260 #define BLUETOYELLOWcxx . . $ `netgames/dmfc/dmfcui.cpp:260:9`! 0xC5
261 #define GREENTOREDcxx . . $ `netgames/dmfc/dmfcui.cpp:261:9`! 0xC6
262 #define GREENTOBLUEcxx . . $ `netgames/dmfc/dmfcui.cpp:262:9`! 0xC7
263 #define GREENTOYELLOWcxx . . $ `netgames/dmfc/dmfcui.cpp:263:9`! 0xC8
264 #define YELLOWTOREDcxx . . $ `netgames/dmfc/dmfcui.cpp:264:9`! 0xC9
265 #define YELLOWTOBLUEcxx . . $ `netgames/dmfc/dmfcui.cpp:265:9`! 0xCA
266 #define YELLOWTOGREENcxx . . $ `netgames/dmfc/dmfcui.cpp:266:9`! 0xCB
267
268 // DMFCBase::DoDMFCUITeamPlacement
269 //
270 // Displays the dialog for doing team placement in DMFC
271 void DMFCBasecxx . . $ DMFCBase#::DoDMFCUITeamPlacementcxx . . $ DMFCBase#DoDMFCUITeamPlacement(b0b38cda41d4ede4).(bool clients_wait, bool called_by_level_start) {
272 if (GetLocalRolecxx . . $ DMFCBase#GetLocalRole(b126dc7c1de90089).() != LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!)
273 return;
274
275 if (IAmDedicatedServercxx . . $ DMFCBase#IAmDedicatedServer(c9857a73d68e59ba).())
276 return;
277
278 Team_placement_lastcallcxx . . $ Team_placement_lastcall. = 0;
279
280 // turn on client waiting
281 if (clients_wait) {
282 // Pause realgametime,
283 ENABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2371:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
284 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:286:9`!);
285 MakeClientsWaitcxx . . $ DMFCBase#MakeClientsWait(b45ddcbc8423892c).(true);
286 }
287
288 int i;
289
290 // build the initial team list, so we know what players changed teams in the process
291 for (i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
292 if (CheckPlayerNumcxx . . $ DMFCBase#CheckPlayerNum(83c267b20bac841a).(i)) {
293 TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i] = TeamDlgInitialTeamSettingscxx . . $ TeamDlgInitialTeamSettings.[i] = Playerscxx . . $ DMFCBase#Players.[i].teamcxx . . $ player#team.;
294 } else {
295 TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i] = TeamDlgInitialTeamSettingscxx . . $ TeamDlgInitialTeamSettings.[i] = TS_NOTINGAMEcxx . . $ `netgames/dmfc/dmfcui.cpp:132:9`!;
296 }
297 }
298
299 bool exit_menu = false;
300 void *list_red = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, *list_blue = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, *list_green = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, *list_yellow = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
301 void *icon_b_hs[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!][DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1];
302 void *icon_hs[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!][DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1];
303 void *team_text[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!];
304
305 int count;
306 int id_list[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! * (DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1)];
307
308 int team_icons[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!];
309 const char *team_icon_names[DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!] = {"toredteamicon.ogf", "toblueteamicon.ogf", "togreenteamicon.ogf", "toyellowteamicon.ogf"};
310 /*
311 $$TABLE_GAMEFILE "toredteamicon.ogf"
312 $$TABLE_GAMEFILE "toblueteamicon.ogf"
313 $$TABLE_GAMEFILE "togreenteamicon.ogf"
314 $$TABLE_GAMEFILE "toyellowteamicon.ogf"
315 */
316 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
317 team_icons[i] = DLLbm_AllocLoadFileBitmap(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(team_icon_names[i]), 0, BITMAP_FORMAT_1555cxx . . $ `lib/bitmap.h:56:9`!);
318 if (team_icons[i] <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!)
319 team_icons[i] = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!;
320 }
321
322 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
323 count = 0;
324 for (int j = 0; j < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; j++) {
325 if (i != j) {
326 icon_b_hs[i][count] = DLLCreateNewUIBmpItem(team_icons[j], 255);
327 icon_hs[i][count] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
328 count++;
329 }
330 }
331 }
332
333 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! * (DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1); i++) {
334 id_list[i] = 0xC0 + i;
335 }
336
337 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
338 team_text[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
339 }
340
341 //////////////////////////////////////////////////
342 // Text Items
343 void *start_game_text_off =
344 DLLCreateNewUITextItem((called_by_level_start) ? DTXT_UI_STARTGAMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2700:9`! : DTXT_UI_RETURNTOGAMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2701:9`!, UICOL_HOTSPOT_LOcxx . . $ `netgames/includes/DMFC.h:470:9`!, -1);
345 void *start_game_text_on =
346 DLLCreateNewUITextItem((called_by_level_start) ? DTXT_UI_STARTGAMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2700:9`! : DTXT_UI_RETURNTOGAMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2701:9`!, UICOL_HOTSPOT_HIcxx . . $ `netgames/includes/DMFC.h:473:9`!, -1);
347 void *client_wait_txt = DLLCreateNewUITextItem(DTXT_UI_CLIENTSWAITcxx . . $ `netgames/dmfc/dmfcinternal.h:2702:9`!, UICOL_HOTSPOT_LOcxx . . $ `netgames/includes/DMFC.h:470:9`!, -1);
348 void *window_title = DLLCreateNewUITextItem(DTXT_UI_TEAMSETUPcxx . . $ `netgames/dmfc/dmfcinternal.h:2703:9`!, UICOL_WINDOW_TITLEcxx . . $ `netgames/includes/DMFC.h:475:9`!, -1);
349
350 ///////////////////////////////////////////////////
351 // Main Window
352 void *main_wnd = DLLNewUIGameWindowCreate(0, 0, 512, 384, UIF_PROCESS_ALLcxx . . $ `netgames/includes/gamedll_header.h:74:9`! | UIF_CENTERcxx . . $ `netgames/includes/gamedll_header.h:63:9`! | NUWF_TITLEMEDcxx . . $ `netgames/includes/DMFC.h:488:9`!);
353
354 ///////////////////////////////////////////////////
355 // Item placement
356 int cury;
357 count = GetNumTeamscxx . . $ DMFCBase#GetNumTeams(b126dc7c1de90089).();
358
359 void *start_game_hs = DLLHotSpotCreate(main_wnd, UID_OKcxx . . $ `netgames/includes/DMFC.h:494:9`!, K_ENTERcxx . . $ `netgames/includes/DMFCKeyCodes.h:98:9`!, start_game_text_off, start_game_text_on, 40,
360 384 - OKCANCEL_YOFFSETcxx . . $ `netgames/includes/DMFC.h:483:9`!, 130, 15, UIF_CENTERcxx . . $ `netgames/includes/gamedll_header.h:63:9`!);
361 void *window_title_text = DLLTextCreate(main_wnd, window_title, 0, 7, UIF_CENTERcxx . . $ `netgames/includes/gamedll_header.h:63:9`! | UIF_FITcxx . . $ `netgames/includes/gamedll_header.h:64:9`!);
362 void *client_wait_cb;
363
364 if (count > 2) {
365 client_wait_cb = DLLCheckBoxCreate(main_wnd, 128, client_wait_txt, 256 - (DLLGetUIItemWidth(client_wait_txt) / 2),
366 192 - (DLLGetUIItemHeight(client_wait_txt) / 2), 130, 15, UIF_FITcxx . . $ `netgames/includes/gamedll_header.h:64:9`!);
367 cury = 60;
368 } else {
369 client_wait_cb = DLLCheckBoxCreate(main_wnd, 128, client_wait_txt, 30, 384 - OKCANCEL_YOFFSETcxx . . $ `netgames/includes/DMFC.h:483:9`!, 130, 15, UIF_FITcxx . . $ `netgames/includes/gamedll_header.h:64:9`!);
370 cury = 80;
371 }
372
373 DLLCheckBoxSetCheck(client_wait_cb, clients_wait);
374
375 int left_x, right_x;
376 int top_y, bottom_y;
377 int icon_width = DLLbm_w(team_icons[0], 0);
378 int icon_height = DLLbm_h(team_icons[0], 0);
379 int curr_y;
380 int *id_list_ptr;
381
382 left_x = 168 + 10;
383 right_x = 512 - 178 - icon_width;
384
385 int total_height = (count - 1) * (icon_height + 3);
386 top_y = cury + (64 - (total_height / 2));
387 bottom_y = cury + 163 + (64 - (total_height / 2));
388
389 switch (count) {
390 case 4:
391 list_yellow = DLLListCreate(main_wnd, 1, 512 - 168, cury + 163, 128, 128, 0);
392 team_text[YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!] = DLLEditCreate(main_wnd, -1, 512 - 168, cury + 131, 128, 32, 0);
393
394 // put in the hotspots for yellow
395 curr_y = bottom_y;
396 id_list_ptr = &id_list[YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`! * (DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1)];
397 for (i = 0; i < count - 1; i++) {
398 icon_hs[YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!][i] =
399 DLLHotSpotCreate(main_wnd, id_list_ptr[i], -1, icon_b_hs[YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!][i], icon_b_hs[YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!][i], right_x,
400 curr_y, icon_width, icon_height, 0);
401 curr_y += icon_height + 3;
402 }
403 case 3:
404 list_green = DLLListCreate(main_wnd, 1, 40, cury + 163, 128, 128, 0);
405 team_text[GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!] = DLLEditCreate(main_wnd, -1, 40, cury + 131, 128, 32, 0);
406
407 list_red = DLLListCreate(main_wnd, 0, 40, cury, 128, 128, 0);
408 team_text[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!] = DLLEditCreate(main_wnd, -1, 40, cury - 32, 128, 32, 0);
409
410 list_blue = DLLListCreate(main_wnd, 1, 512 - 168, cury, 128, 128, 0);
411 team_text[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!] = DLLEditCreate(main_wnd, -1, 512 - 168, cury - 32, 128, 32, 0);
412
413 // put in the hotspots for green
414 curr_y = bottom_y;
415 id_list_ptr = &id_list[GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`! * (DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1)];
416 for (i = 0; i < count - 1; i++) {
417 icon_hs[GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!][i] = DLLHotSpotCreate(main_wnd, id_list_ptr[i], -1, icon_b_hs[GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!][i],
418 icon_b_hs[GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!][i], left_x, curr_y, icon_width, icon_height, 0);
419 curr_y += icon_height + 3;
420 }
421
422 // put in the hotspots for blue
423 curr_y = top_y;
424 id_list_ptr = &id_list[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`! * (DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1)];
425 for (i = 0; i < count - 1; i++) {
426 icon_hs[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][i] = DLLHotSpotCreate(main_wnd, id_list_ptr[i], -1, icon_b_hs[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][i],
427 icon_b_hs[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][i], right_x, curr_y, icon_width, icon_height, 0);
428 curr_y += icon_height + 3;
429 }
430
431 // put in the hotspots for red
432 curr_y = top_y;
433 id_list_ptr = &id_list[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`! * (DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1)];
434 for (i = 0; i < count - 1; i++) {
435 icon_hs[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][i] = DLLHotSpotCreate(main_wnd, id_list_ptr[i], -1, icon_b_hs[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][i],
436 icon_b_hs[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][i], left_x, curr_y, icon_width, icon_height, 0);
437 curr_y += icon_height + 3;
438 }
439
440 break;
441 case 2:
442 list_red = DLLListCreate(main_wnd, 0, 40, cury, 128, 224, 0);
443 team_text[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!] = DLLEditCreate(main_wnd, -1, 40, cury - 32, 128, 32, 0);
444
445 list_blue = DLLListCreate(main_wnd, 1, 512 - 168, cury, 128, 224, 0);
446 team_text[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!] = DLLEditCreate(main_wnd, -1, 512 - 168, cury - 32, 128, 32, 0);
447
448 // recalc the top y value
449 top_y = cury + (118 - (total_height / 2));
450
451 // put in the hotspots for blue
452 curr_y = top_y;
453 id_list_ptr = &id_list[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`! * (DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1)];
454 for (i = 0; i < count - 1; i++) {
455 icon_hs[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][i] = DLLHotSpotCreate(main_wnd, id_list_ptr[i], -1, icon_b_hs[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][i],
456 icon_b_hs[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][i], right_x, curr_y, icon_width, icon_height, 0);
457 curr_y += icon_height + 3;
458 }
459
460 // put in the hotspots for red
461 curr_y = top_y;
462 id_list_ptr = &id_list[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`! * (DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1)];
463 for (i = 0; i < count - 1; i++) {
464 icon_hs[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][i] = DLLHotSpotCreate(main_wnd, id_list_ptr[i], -1, icon_b_hs[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][i],
465 icon_b_hs[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][i], left_x, curr_y, icon_width, icon_height, 0);
466 curr_y += icon_height + 3;
467 }
468
469 break;
470 case 0:
471 case 1:
472 // the wait is over, let them in
473 if (clients_wait) {
474 // UnPause realgametime,
475 DISABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2372:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
476 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_UNPAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:287:9`!);
477 MakeClientsWaitcxx . . $ DMFCBase#MakeClientsWait(b45ddcbc8423892c).(false);
478 }
479
480 // Unpause realgametime,
481 DISABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2372:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
482 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_UNPAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:287:9`!);
483 return;
484 break;
485 }
486
487 // Set information for the team name edit boxes
488 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
489 if (team_text[i]) {
490 DLLSetOldEditBufferLen(team_text[i], MAX_TEAMNAME_LENcxx . . $ `netgames/includes/DMFC.h:443:9`! - 1);
491 DLLEditSetText(team_text[i], DMFC_team_namescxx . . $ DMFCBase#DMFC_team_names.[i]);
492 }
493 }
494
495 tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!] = list_red;
496 tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!] = list_blue;
497 tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!] = list_green;
498 tpdicxx . . $ tpdi..lbcxx . . $ tTeamPlacementDialogInfo#lb.[YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!] = list_yellow;
499 for (i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
500 tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
501 for (int t = 0; t < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; t++) {
502 tpdicxx . . $ tpdi..transcxx . . $ tTeamPlacementDialogInfo#trans.[t][i] = -1;
503 }
504 }
505 DLLGetUICallback((void **)&tpdicxx . . $ tpdi..old_callbackcxx . . $ tTeamPlacementDialogInfo#old_callback.);
506 DLLSetUICallback(TeamPlacementCallbackcxx . . $ TeamPlacementCallback(49f6e7a06ebc5aa8).);
507
508 //////////////////////////////////////////////////
509 // Process all
510 DLLNewUIGameWindowOpen(main_wnd);
511
512 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
513
514 bool canceled = false;
515
516 while (!exit_menu) {
517 int res;
518 res = DLLPollUI();
519
520 if (res == -1)
521 continue;
522
523 // handle all UI results.
524 switch (res) {
525 case REDTOBLUEcxx . . $ `netgames/dmfc/dmfcui.cpp:255:9`!:
526 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!, BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!);
527 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
528 break;
529 case REDTOGREENcxx . . $ `netgames/dmfc/dmfcui.cpp:256:9`!:
530 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!, GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!);
531 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
532 break;
533 case REDTOYELLOWcxx . . $ `netgames/dmfc/dmfcui.cpp:257:9`!:
534 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!, YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!);
535 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
536 break;
537 case BLUETOREDcxx . . $ `netgames/dmfc/dmfcui.cpp:258:9`!:
538 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!, RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!);
539 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
540 break;
541 case BLUETOGREENcxx . . $ `netgames/dmfc/dmfcui.cpp:259:9`!:
542 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!, GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!);
543 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
544 break;
545 case BLUETOYELLOWcxx . . $ `netgames/dmfc/dmfcui.cpp:260:9`!:
546 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!, YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!);
547 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
548 break;
549 case GREENTOREDcxx . . $ `netgames/dmfc/dmfcui.cpp:261:9`!:
550 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!, RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!);
551 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
552 break;
553 case GREENTOBLUEcxx . . $ `netgames/dmfc/dmfcui.cpp:262:9`!:
554 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!, BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!);
555 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
556 break;
557 case GREENTOYELLOWcxx . . $ `netgames/dmfc/dmfcui.cpp:263:9`!:
558 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!, YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!);
559 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
560 break;
561 case YELLOWTOREDcxx . . $ `netgames/dmfc/dmfcui.cpp:264:9`!:
562 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!, RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!);
563 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
564 break;
565 case YELLOWTOBLUEcxx . . $ `netgames/dmfc/dmfcui.cpp:265:9`!:
566 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!, BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!);
567 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
568 break;
569 case YELLOWTOGREENcxx . . $ `netgames/dmfc/dmfcui.cpp:266:9`!:
570 TeamPlacementChangeTeamcxx . . $ TeamPlacementChangeTeam(3e454b8ccf442868).(YELLOW_TEAMcxx . . $ `netgames/includes/DMFC.h:430:9`!, GREEN_TEAMcxx . . $ `netgames/includes/DMFC.h:429:9`!);
571 UpdateTeamPlacementDialogcxx . . $ UpdateTeamPlacementDialog(49f6e7a06ebc5aa8).();
572 break;
573 case UID_OKcxx . . $ `netgames/includes/DMFC.h:494:9`!: // start game
574 // get the team names and save them
575 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
576 if (team_text[i]) {
577 char buff[MAX_TEAMNAME_LENcxx . . $ `netgames/includes/DMFC.h:443:9`! + 1];
578 DLLEditGetText(team_text[i], buff, MAX_TEAMNAME_LENcxx . . $ `netgames/includes/DMFC.h:443:9`!);
579 SetTeamNamecxx . . $ DMFCBase#SetTeamName(dc3004c27659fe3).(i, buff, true);
580 }
581 }
582
583 exit_menu = true;
584 break;
585 case NEWUIRES_FORCEQUITcxx . . $ `netgames/includes/DMFC.h:493:9`!:
586 exit_menu = true;
587 canceled = true;
588 break;
589 case 128: // make clients wait on/off
590 {
591 if (DLLCheckBoxIsChecked(client_wait_cb)) {
592 // make the clients wait
593 clients_wait = true;
594
595 // Pause realgametime,
596 ENABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2371:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
597 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:286:9`!);
598 } else {
599 // they no longer have to wait
600 clients_wait = false;
601
602 // UnPause realgametime,
603 DISABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2372:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
604 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_UNPAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:287:9`!);
605 }
606
607 MakeClientsWaitcxx . . $ DMFCBase#MakeClientsWait(b45ddcbc8423892c).(clients_wait);
608 } break;
609 };
610 }
611
612 // Place all changed players!!!
613 if (!canceled) {
614 for (i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
615 if (CheckPlayerNumcxx . . $ DMFCBase#CheckPlayerNum(83c267b20bac841a).(i)) {
616 // the player is in the game, update his team if needed
617 if (TeamDlgInitialTeamSettingscxx . . $ TeamDlgInitialTeamSettings.[i] == TS_NOTINGAMEcxx . . $ `netgames/dmfc/dmfcui.cpp:132:9`!) {
618 // this player was NOT in the game when we brought up the dialog
619
620 if (TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i] != TS_NOTINGAMEcxx . . $ `netgames/dmfc/dmfcui.cpp:132:9`!) {
621 // we've changed his team though
622 int new_team;
623 new_team = TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i];
624 RequestTeamChangecxx . . $ DMFCBase#RequestTeamChange(6908015b96d379c0).(new_team, i, false); // no need to spew his stuff
625 } else {
626 // we haven't changed his team, so he's ok on the team he's on
627 }
628 } else {
629 // this player was in the game when we brought up the dialog
630 if (TeamDlgInitialTeamSettingscxx . . $ TeamDlgInitialTeamSettings.[i] != TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i]) {
631 // he has changed teams!!
632 int new_team;
633 if (TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i] != TS_NOTINGAMEcxx . . $ `netgames/dmfc/dmfcui.cpp:132:9`!) {
634 new_team = TeamDlgFinalTeamSettingscxx . . $ TeamDlgFinalTeamSettings.[i];
635 } else {
636 // weird...they are out of sync?
637 FatalError("Team Dialog Out Of Sync"); // remove later
638 }
639 RequestTeamChangecxx . . $ DMFCBase#RequestTeamChange(6908015b96d379c0).(new_team, i, true); // spew his stuff also
640 }
641 }
642 }
643 }
644 }
645
646 // the wait is over, let them in
647 if (clients_wait) {
648 // UnPause realgametime,
649 DISABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2372:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
650 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_UNPAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:287:9`!);
651 MakeClientsWaitcxx . . $ DMFCBase#MakeClientsWait(b45ddcbc8423892c).(false);
652 }
653
654 DLLNewUIGameWindowClose(main_wnd);
655 DLLNewUIGameWindowDestroy(main_wnd);
656
657 ////////////////////////////////////////////
658 // Remove text items
659 DLLRemoveUITextItem(start_game_text_on);
660 DLLRemoveUITextItem(start_game_text_off);
661 DLLRemoveUITextItem(window_title);
662 DLLRemoveUITextItem(client_wait_txt);
663 for (i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
664 if (tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i]) {
665 DLLRemoveUITextItem(tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i]);
666 tpdicxx . . $ tpdi..textcxx . . $ tTeamPlacementDialogInfo#text.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
667 }
668 }
669 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
670 for (int j = 0; j < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`! - 1; j++) {
671 if (icon_b_hs[i][j])
672 DLLRemoveUIBmpItem(icon_b_hs[i][j]);
673 if (icon_hs[i][j])
674 DLLDeleteUIItem(icon_hs[i][j]);
675 }
676 }
677
678 ////////////////////////////////////////////
679 // Remove all items
680 if (list_red)
681 DLLDeleteUIItem(list_red);
682 if (list_blue)
683 DLLDeleteUIItem(list_blue);
684 if (list_green)
685 DLLDeleteUIItem(list_green);
686 if (list_yellow)
687 DLLDeleteUIItem(list_yellow);
688 DLLDeleteUIItem(main_wnd);
689 DLLDeleteUIItem(start_game_hs);
690 DLLDeleteUIItem(window_title_text);
691 DLLDeleteUIItem(client_wait_cb);
692
693 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
694 if (team_icons[i] > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!)
695 DLLbm_FreeBitmap(team_icons[i]);
696 }
697
698 for (i = 0; i < DLLMAX_TEAMScxx . . $ `netgames/includes/DMFC.h:426:9`!; i++) {
699 if (team_text[i])
700 DLLDeleteUIItem(team_text[i]);
701 }
702
703 DLLSetUICallback(tpdicxx . . $ tpdi..old_callbackcxx . . $ tTeamPlacementDialogInfo#old_callback.);
704 }
705
706 //============================================================================
707 // Wait for Players Dialog
708 //============================================================================
709 struct tWaitForPlayerscxx . . $ tWaitForPlayers# {
710 float last_updatecxx . . $ tWaitForPlayers#last_update.;
711 void (*old_callbackcxx . . $ tWaitForPlayers#old_callback.)(void);
712 void *listboxcxx . . $ tWaitForPlayers#listbox.;
713 void *textcxx . . $ tWaitForPlayers#text.[DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!];
714 int indexmapcxx . . $ tWaitForPlayers#indexmap.[DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!];
715 };
716 tWaitForPlayerscxx . . $ tWaitForPlayers# wfpicxx . . $ wfpi.;
717
718 void UpdateWaitForPlayersDialogcxx . . $ UpdateWaitForPlayersDialog(49f6e7a06ebc5aa8).(void) {
719 int pnum = -1;
720
721 int sel = DLLListGetSelectedIndex(wfpicxx . . $ wfpi..listboxcxx . . $ tWaitForPlayers#listbox.);
722 if (sel >= 0) {
723 pnum = wfpicxx . . $ wfpi..indexmapcxx . . $ tWaitForPlayers#indexmap.[sel];
724 }
725
726 int index = 0;
727 DLLListRemoveAll(wfpicxx . . $ wfpi..listboxcxx . . $ tWaitForPlayers#listbox.);
728 for (int i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
729 if (wfpicxx . . $ wfpi..textcxx . . $ tWaitForPlayers#text.[i]) {
730 DLLRemoveUITextItem(wfpicxx . . $ wfpi..textcxx . . $ tWaitForPlayers#text.[i]);
731 wfpicxx . . $ wfpi..textcxx . . $ tWaitForPlayers#text.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
732 }
733
734 if (basethiscxx . . $ basethis.->CheckPlayerNumcxx . . $ DMFCBase#CheckPlayerNum(83c267b20bac841a).(i)) {
735 wfpicxx . . $ wfpi..indexmapcxx . . $ tWaitForPlayers#indexmap.[index] = i;
736 index++;
737 wfpicxx . . $ wfpi..textcxx . . $ tWaitForPlayers#text.[i] = DLLCreateNewUITextItem(basethiscxx . . $ basethis.->Playerscxx . . $ DMFCBase#Players.[i].callsigncxx . . $ player#callsign., basethiscxx . . $ basethis.->Player_colorscxx . . $ DMFCBase#Player_colors.[i], -1);
738 DLLListAddItem(wfpicxx . . $ wfpi..listboxcxx . . $ tWaitForPlayers#listbox., wfpicxx . . $ wfpi..textcxx . . $ tWaitForPlayers#text.[i]);
739 if (pnum == i) {
740 DLLListSetSelectedIndex(wfpicxx . . $ wfpi..listboxcxx . . $ tWaitForPlayers#listbox., i);
741 }
742 }
743 }
744 }
745 void WaitForPlayersCallbackcxx . . $ WaitForPlayersCallback(49f6e7a06ebc5aa8).(void) {
746 float time = *basethiscxx . . $ basethis.->Gametimecxx . . $ DMFCBase#Gametime.;
747
748 if (time > wfpicxx . . $ wfpi..last_updatecxx . . $ tWaitForPlayers#last_update. + 0.5f) {
749 UpdateWaitForPlayersDialogcxx . . $ UpdateWaitForPlayersDialog(49f6e7a06ebc5aa8).();
750 wfpicxx . . $ wfpi..last_updatecxx . . $ tWaitForPlayers#last_update. = time;
751 }
752
753 if (wfpicxx . . $ wfpi..old_callbackcxx . . $ tWaitForPlayers#old_callback.)
754 (*wfpicxx . . $ wfpi..old_callbackcxx . . $ tWaitForPlayers#old_callback.)();
755 }
756
757 // DMFCBase::DoDMFCUIWaitForPlayers
758 //
759 // Displays the dialog for in the beginning of the level, waiting for all the players
760 void DMFCBasecxx . . $ DMFCBase#::DoDMFCUIWaitForPlayerscxx . . $ DMFCBase#DoDMFCUIWaitForPlayers(b45ddcbc8423892c).(bool clients_wait) {
761 if (GetLocalRolecxx . . $ DMFCBase#GetLocalRole(b126dc7c1de90089).() != LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!)
762 return;
763
764 if (IAmDedicatedServercxx . . $ DMFCBase#IAmDedicatedServer(c9857a73d68e59ba).())
765 return;
766
767 wfpicxx . . $ wfpi..last_updatecxx . . $ tWaitForPlayers#last_update. = 0;
768 int i;
769 for (i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++)
770 wfpicxx . . $ wfpi..textcxx . . $ tWaitForPlayers#text.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
771
772 // turn on client waiting
773 if (clients_wait) {
774 // Pause realgametime,
775 ENABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2371:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
776 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:286:9`!);
777 MakeClientsWaitcxx . . $ DMFCBase#MakeClientsWait(b45ddcbc8423892c).(true);
778 }
779
780 for (i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++)
781 wfpicxx . . $ wfpi..indexmapcxx . . $ tWaitForPlayers#indexmap.[i] = 0;
782
783 ///////////////////////////////////////////////////
784 // Text Items
785 void *start_game_text_off = DLLCreateNewUITextItem(DTXT_UI_STARTGAMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2700:9`!, UICOL_HOTSPOT_LOcxx . . $ `netgames/includes/DMFC.h:470:9`!, -1);
786 void *start_game_text_on = DLLCreateNewUITextItem(DTXT_UI_STARTGAMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2700:9`!, UICOL_HOTSPOT_HIcxx . . $ `netgames/includes/DMFC.h:473:9`!, -1);
787 void *client_wait_txt = DLLCreateNewUITextItem(DTXT_UI_CLIENTSWAITcxx . . $ `netgames/dmfc/dmfcinternal.h:2702:9`!, UICOL_HOTSPOT_LOcxx . . $ `netgames/includes/DMFC.h:470:9`!, -1);
788 void *window_title = DLLCreateNewUITextItem(DTXT_UI_WAITFORPLAYERScxx . . $ `netgames/dmfc/dmfcinternal.h:2704:9`!, UICOL_WINDOW_TITLEcxx . . $ `netgames/includes/DMFC.h:475:9`!, -1);
789 void *kick_text_off = DLLCreateNewUITextItem(DTXT_UI_KICKPLAYERcxx . . $ `netgames/dmfc/dmfcinternal.h:2705:9`!, UICOL_HOTSPOT_LOcxx . . $ `netgames/includes/DMFC.h:470:9`!, -1);
790 void *kick_text_on = DLLCreateNewUITextItem(DTXT_UI_KICKPLAYERcxx . . $ `netgames/dmfc/dmfcinternal.h:2705:9`!, UICOL_HOTSPOT_HIcxx . . $ `netgames/includes/DMFC.h:473:9`!, -1);
791 void *ban_text_off = DLLCreateNewUITextItem(DTXT_UI_BANPLAYERcxx . . $ `netgames/dmfc/dmfcinternal.h:2706:9`!, UICOL_HOTSPOT_LOcxx . . $ `netgames/includes/DMFC.h:470:9`!, -1);
792 void *ban_text_on = DLLCreateNewUITextItem(DTXT_UI_BANPLAYERcxx . . $ `netgames/dmfc/dmfcinternal.h:2706:9`!, UICOL_HOTSPOT_HIcxx . . $ `netgames/includes/DMFC.h:473:9`!, -1);
793
794 ///////////////////////////////////////////////////
795 // Main Window
796 void *main_wnd = DLLNewUIGameWindowCreate(0, 0, 512, 384, UIF_PROCESS_ALLcxx . . $ `netgames/includes/gamedll_header.h:74:9`! | UIF_CENTERcxx . . $ `netgames/includes/gamedll_header.h:63:9`! | NUWF_TITLEMEDcxx . . $ `netgames/includes/DMFC.h:488:9`!);
797
798 ///////////////////////////////////////////////////
799 // Item placement
800 int cury = 30;
801 bool exit_menu = false;
802
803 void *start_game_hs = DLLHotSpotCreate(main_wnd, UID_OKcxx . . $ `netgames/includes/DMFC.h:494:9`!, K_ENTERcxx . . $ `netgames/includes/DMFCKeyCodes.h:98:9`!, start_game_text_off, start_game_text_on, 40,
804 384 - OKCANCEL_YOFFSETcxx . . $ `netgames/includes/DMFC.h:483:9`!, 130, 15, UIF_CENTERcxx . . $ `netgames/includes/gamedll_header.h:63:9`!);
805 void *window_title_text = DLLTextCreate(main_wnd, window_title, 0, 7, UIF_CENTERcxx . . $ `netgames/includes/gamedll_header.h:63:9`! | UIF_FITcxx . . $ `netgames/includes/gamedll_header.h:64:9`!);
806 void *client_wait_cb =
807 DLLCheckBoxCreate(main_wnd, 128, client_wait_txt, 30, 369 - OKCANCEL_YOFFSETcxx . . $ `netgames/includes/DMFC.h:483:9`!, 130, 15, UIF_FITcxx . . $ `netgames/includes/gamedll_header.h:64:9`! | UIF_CENTERcxx . . $ `netgames/includes/gamedll_header.h:63:9`!);
808 wfpicxx . . $ wfpi..listboxcxx . . $ tWaitForPlayers#listbox. = DLLListCreate(main_wnd, -1, 40, cury, 256, 288, UIF_CENTERcxx . . $ `netgames/includes/gamedll_header.h:63:9`!);
809 DLLCheckBoxSetCheck(client_wait_cb, clients_wait);
810
811 int l_x, l_y, l_w, l_h;
812 DLLGetUIItemPosition(wfpicxx . . $ wfpi..listboxcxx . . $ tWaitForPlayers#listbox., &l_x, &l_y, &l_w, &l_h);
813 l_x = l_x + l_w + 10;
814 l_y = (l_y + (l_h / 2)) - 15;
815 void *kick_hs = DLLHotSpotCreate(main_wnd, 10, -1, kick_text_off, kick_text_on, l_x, l_y, 130, 15, UIF_FITcxx . . $ `netgames/includes/gamedll_header.h:64:9`!);
816 l_y += 15;
817 void *ban_hs = DLLHotSpotCreate(main_wnd, 20, -1, ban_text_off, ban_text_on, l_x, l_y, 130, 15, UIF_FITcxx . . $ `netgames/includes/gamedll_header.h:64:9`!);
818
819 //////////////////////////////////////////////////
820 // Process all
821 DLLGetUICallback((void **)&wfpicxx . . $ wfpi..old_callbackcxx . . $ tWaitForPlayers#old_callback.);
822 DLLSetUICallback(WaitForPlayersCallbackcxx . . $ WaitForPlayersCallback(49f6e7a06ebc5aa8).);
823
824 DLLNewUIGameWindowOpen(main_wnd);
825
826 UpdateWaitForPlayersDialogcxx . . $ UpdateWaitForPlayersDialog(49f6e7a06ebc5aa8).();
827
828 mprintfcxx . . $ `netgames/dmfc/dmfcinternal.h:275:9`!(0, "1:Entering UI Loop\n");
829
830 while (!exit_menu) {
831 int res;
832 res = DLLPollUI();
833
834 if (res == -1) {
835 continue;
836 }
837 switch (res) {
838 case NEWUIRES_FORCEQUITcxx . . $ `netgames/includes/DMFC.h:493:9`!:
839 mprintfcxx . . $ `netgames/dmfc/dmfcinternal.h:275:9`!(0, "1:Got a force quit\n");
840 exit_menu = true;
841 break;
842 case UID_OKcxx . . $ `netgames/includes/DMFC.h:494:9`!: // exit menu
843 mprintfcxx . . $ `netgames/dmfc/dmfcinternal.h:275:9`!(0, "1:Got a regular quit\n");
844 exit_menu = true;
845 break;
846 case 10: // kick player
847 {
848 int cursel = DLLListGetSelectedIndex(wfpicxx . . $ wfpi..listboxcxx . . $ tWaitForPlayers#listbox.);
849 int pnum = wfpicxx . . $ wfpi..indexmapcxx . . $ tWaitForPlayers#indexmap.[cursel];
850 KickPlayercxx . . $ KickPlayer(d4f767463ce0a6b3).(pnum);
851 } break;
852 case 20: // ban player
853 {
854 int cursel = DLLListGetSelectedIndex(wfpicxx . . $ wfpi..listboxcxx . . $ tWaitForPlayers#listbox.);
855 int pnum = wfpicxx . . $ wfpi..indexmapcxx . . $ tWaitForPlayers#indexmap.[cursel];
856 BanPlayercxx . . $ BanPlayer(d4f767463ce0a6b3).(pnum);
857 } break;
858 case 128: // make clients wait on/off
859 {
860 if (DLLCheckBoxIsChecked(client_wait_cb)) {
861 // make the clients wait
862 clients_wait = true;
863 // Pause realgametime,
864 ENABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2371:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
865 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:286:9`!);
866 } else {
867 // they no longer have to wait
868 clients_wait = false;
869 // UnPause realgametime,
870 DISABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2372:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
871 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_UNPAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:287:9`!);
872 }
873 MakeClientsWaitcxx . . $ DMFCBase#MakeClientsWait(b45ddcbc8423892c).(clients_wait);
874 } break;
875 };
876 }
877
878 mprintfcxx . . $ `netgames/dmfc/dmfcinternal.h:275:9`!(0, "1:Out of UI Loop\n");
879
880 // the wait is over, let them in
881 if (clients_wait) {
882 // Unpause realgametime,
883 DISABLE_FLAGScxx . . $ `netgames/dmfc/dmfcinternal.h:2372:9`!(m_iProtectedFlags, DMFC_PRF_PAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:2391:9`!);
884 SendControlMessageToPlayercxx . . $ DMFCBase#SendControlMessageToPlayer(9633529ce3c4ff50).(SP_ALLcxx . . $ `netgames/includes/DMFC.h:435:9`!, CM_UNPAUSETIMEcxx . . $ `netgames/dmfc/dmfcinternal.h:287:9`!);
885 MakeClientsWaitcxx . . $ DMFCBase#MakeClientsWait(b45ddcbc8423892c).(false);
886 }
887
888 DLLNewUIGameWindowClose(main_wnd);
889 DLLNewUIGameWindowDestroy(main_wnd);
890
891 DLLRemoveUITextItem(start_game_text_on);
892 DLLRemoveUITextItem(start_game_text_off);
893 DLLRemoveUITextItem(kick_text_off);
894 DLLRemoveUITextItem(kick_text_on);
895 DLLRemoveUITextItem(ban_text_off);
896 DLLRemoveUITextItem(ban_text_on);
897 DLLRemoveUITextItem(window_title);
898 DLLRemoveUITextItem(client_wait_txt);
899 for (i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
900 if (wfpicxx . . $ wfpi..textcxx . . $ tWaitForPlayers#text.[i]) {
901 DLLRemoveUITextItem(wfpicxx . . $ wfpi..textcxx . . $ tWaitForPlayers#text.[i]);
902 wfpicxx . . $ wfpi..textcxx . . $ tWaitForPlayers#text.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
903 }
904 }
905
906 DLLDeleteUIItem(main_wnd);
907 DLLDeleteUIItem(start_game_hs);
908 DLLDeleteUIItem(window_title_text);
909 DLLDeleteUIItem(client_wait_cb);
910 DLLDeleteUIItem(wfpicxx . . $ wfpi..listboxcxx . . $ tWaitForPlayers#listbox.);
911 DLLDeleteUIItem(kick_hs);
912 DLLDeleteUIItem(ban_hs);
913
914 DLLSetUICallback(wfpicxx . . $ wfpi..old_callbackcxx . . $ tWaitForPlayers#old_callback.);
915 }