Debian Codegraph @

Descent3/ctlconfig.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/ctlconfig.cpp $
21 * $Revision: 78 $
22 * $Date: 4/19/00 5:25p $
23 * $Author: Matt $
24 *
25 * <insert description of file here>
26 *
27 * $Log: /DescentIII/main/ctlconfig.cpp $
28 *
29 * 78 4/19/00 5:25p Matt
30 * From Duane for 1.4
31 * Several Mac config changes
32 * Fixed a bug that caused the deadzone value to be decreased each time
33 * you the config dialog was used.
34 *
35 * 77 3/20/00 12:03p Matt
36 * Merge of Duane's post-1.3 changes.
37 * Mac deadzone stuff (Mac only)
38 *
39 * 76 10/22/99 3:40p Kevin
40 * Mac merge fixes
41 *
42 * 75 10/22/99 10:50a Matt
43 * Mac merge
44 *
45 * 74 7/28/99 4:18p Kevin
46 * Macintosh!
47 *
48 * 73 7/16/99 11:16a Samir
49 * multiple hat support.
50 *
51 * 72 6/10/99 9:07p Samir
52 * fixed weapon string name localization issues.
53 *
54 * 71 5/12/99 1:18p Samir
55 * play music during game too when in menus.
56 *
57 * 70 5/06/99 1:40a Samir
58 * adjusted some text.
59 *
60 * 69 5/02/99 2:19a Samir
61 * new weapon autoselect interface (a little more like D2)
62 *
63 * 68 4/30/99 12:12p Samir
64 * added strings for key ramping, other buttons in general config menu.
65 *
66 * 67 4/29/99 2:59p Samir
67 * added help and made CTRL-C clear for controller screens.
68 *
69 * 66 4/29/99 2:18a Samir
70 * updated art for options style menu.
71 *
72 * 65 4/22/99 3:43p Kevin
73 * Training missions show controls on screen
74 *
75 * 64 4/19/99 5:09p Samir
76 * ugh, forgot to destroy revert gadget when unrealizing ui page.
77 *
78 * 63 4/18/99 4:21p Samir
79 * added restore settings for either joystick or keyboard settings.
80 *
81 * 62 4/15/99 2:55p Samir
82 * added UI for mouselook.
83 *
84 * 61 3/22/99 6:20p Jeff
85 * added 2 more audio taunts. a mulitplayer event when someone plays an
86 * audio taunt. option to disable audio taunts.
87 *
88 * 60 3/17/99 4:18p Samir
89 * added button to calibrate joystick.
90 *
91 * 59 3/05/99 2:44p Samir
92 * needs to be cleaned up later, but mouse and joystick sensitivities are
93 * read in always, and set by the controller system. A cancel method
94 * needs to be implemented for these functions.
95 *
96 * 58 3/05/99 12:24p Samir
97 * weapon select screen has more help to determine what's high and what's
98 * low.
99 *
100 * 57 3/03/99 3:41a Samir
101 * moved ok and cancel buttons in weapon_select_dialog.
102 *
103 * 56 3/02/99 1:14p Samir
104 * added joystick/mouse enable and gamma help.
105 *
106 * 55 3/01/99 8:51p Samir
107 * fixed potential crash with no forcefeedback.
108 *
109 * 54 3/01/99 8:12p Samir
110 * don;t display force feedback menu if no stick.
111 *
112 * 53 3/01/99 5:01a Samir
113 * made sure NEWUIRES_FORCEQUIT was added to all new interfaces.
114 *
115 * 52 2/28/99 3:22a Samir
116 * added rearview text.
117 *
118 * 51 2/26/99 2:13a Samir
119 * massive reorg of weapon select prec
120 *
121 * 50 2/24/99 6:21p Samir
122 * moved sensitivity sliders to config key/controller and cleaned up
123 * weapon select menu.
124 *
125 * 49 2/24/99 12:41p Samir
126 * put in weapon selection.
127 *
128 * 48 2/23/99 2:00p Samir
129 * added keyboard ramping slider.
130 *
131 * 47 2/19/99 11:07p Samir
132 * don't verify control changes if new element has a NULL controller
133 * instead of a null binding (hats can have a 'null binding' and be valid.
134 *
135 * 46 2/16/99 12:07p Samir
136 * redid controller config with new ui.
137 *
138 * 45 2/10/99 3:39p Samir
139 * table file parsing stuff
140 *
141 * 44 1/28/99 3:58p Jeff
142 * localization update
143 *
144 * 43 1/06/99 6:33p Samir
145 * more hacks for demo.
146 *
147 * 42 1/06/99 6:28p Samir
148 * demo hack for controller checkbox code not in sync with UI checkbox
149 * code.
150 *
151 * 41 12/17/98 5:59p Samir
152 * moved mouse enabled and joy enabled to config menu.
153 *
154 * 40 11/30/98 4:54p Samir
155 * added rear view config item.
156 *
157 * 39 10/22/98 10:54p Samir
158 * put mouse or joystick disabled messages if pilot disabled them, to help
159 * those configuring.
160 *
161 * 38 10/21/98 11:14a Samir
162 * added generic code to skip rendering while in game controller config or
163 * telcom.
164 *
165 * 37 10/18/98 7:24p Samir
166 * added a reset to defaults options for key and joystick config.
167 *
168 * 36 10/18/98 1:07p Samir
169 * tweaked user interface for controller config.
170 *
171 * 35 10/17/98 7:33p Samir
172 * fixed bug when initializing elements list per panel.
173 *
174 * 34 10/13/98 6:33p Samir
175 * poll mulitplayer every frame if needed in controller config screen.
176 *
177 * 33 10/07/98 6:29p Samir
178 * bail if multiplayer game ended in ui.
179 *
180 * 32 10/02/98 4:15p Samir
181 * added fancy artwork for config screens.
182 *
183 * 31 10/01/98 12:57p Samir
184 * basic weapon autoselect config working.
185 *
186 * 30 9/30/98 4:35p Samir
187 * revamped control configuration ui,
188 *
189 * 29 9/23/98 6:19p Jeff
190 * finished up (hopefully) updating the config/ui dialogs to meet our
191 * standard. Keyboard/joystick config still needs some work
192 *
193 * 28 9/17/98 3:24p Samir
194 * added headlight configuration.
195 *
196 * 27 9/10/98 12:39p Samir
197 * added senstivity issures for controller.
198 *
199 * 26 8/31/98 6:49p Jeff
200 * made inventory and countermeasure keys customizable
201 *
202 * 25 6/29/98 6:42p Samir
203 * Properly handle controller pausing and resumption.
204 *
205 * 24 6/18/98 5:49p Samir
206 * finished controller string localization minus the binding stuff.
207 *
208 * 23 6/18/98 4:48p Samir
209 * added changes for multiple configs for joystick controls.
210 *
211 * 22 6/17/98 3:27p Jeff
212 * Changes made for localization
213 *
214 * 21 6/16/98 10:38a Jeff
215 * localization, strings pulled out to stringtable.h and d3.str
216 *
217 * 20 6/05/98 5:34p Samir
218 * new config system.
219 *
220 * 19 5/19/98 3:36p Samir
221 * added automap key.
222 *
223 * 18 5/15/98 3:13p Samir
224 * added 2 key support for controller functions.
225 *
226 * 17 5/12/98 3:04p Samir
227 * added button control for pbh.
228 *
229 * 16 5/11/98 4:53p Samir
230 * added axis sliding, config.
231 *
232 * 15 5/05/98 5:15p Samir
233 * adjusted menus to work in 512x384 as well as 640x480.
234 *
235 * 14 4/24/98 2:43a Samir
236 * added ability to turn off controller.
237 *
238 * 13 4/13/98 7:01p Samir
239 * added snazzy listbox and edit box art.
240 *
241 * 12 4/08/98 3:44p Samir
242 * added toggle bank and configuration for afterburner
243 *
244 * 11 3/20/98 1:19p Jeff
245 * Changes made to use Default_pilot string for pilot filename to use.
246 *
247 * 10 3/17/98 2:36p Samir
248 * Added Macros.h
249 *
250 * 9 3/05/98 6:38p Samir
251 * Use UI_FONT now.
252 *
253 * 8 2/16/98 9:27p Samir
254 * Simple joystick configuration working.
255 *
256 * 7 2/16/98 3:02p Samir
257 * Joystick config sort of working.
258 *
259 * 6 2/15/98 7:06p Samir
260 * Keyboard configuration system done. Not joystick.
261 *
262 * 5 2/13/98 7:10p Samir
263 * Fixed prob when pressing ALT (since it set a bit in the return key
264 * value that's greater that 256)
265 *
266 * 4 2/13/98 6:37p Samir
267 * Simple keyboard configuration.
268 *
269 * 3 2/10/98 4:55p Samir
270 * Added rudimentary items for controller config.
271 *
272 * 2 2/10/98 3:45p Samir
273 * Added list of configuration items.
274 *
275 * 1 2/10/98 11:49a Samir
276 * Initial revision.
277 *
278 * $NoKeywords: $
279 */
280 #include "ctlconfig.h"cxx . . $ `<file>/Descent3/ctlconfig.h`/
281 #include "CtlCfgElem.h"cxx . . $ `<file>/Descent3/CtlCfgElem.h`/
282 #include "ctlconfigtxt.h"cxx . . $ `<file>/Descent3/ctlconfigtxt.h`/
283 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
284 #include "weapon.h"cxx . . $ `<file>/Descent3/weapon.h`/
285 #include "pilot.h"cxx . . $ `<file>/Descent3/pilot.h`/
286 #include "bitmap.h"cxx . . $ `<file>/lib/bitmap.h`/
287 #include "multi.h"cxx . . $ `<file>/Descent3/multi.h`/
288 #include "gameloop.h"cxx . . $ `<file>/Descent3/gameloop.h`/
289 #include "gamefont.h"cxx . . $ `<file>/Descent3/gamefont.h`/
290 #include "D3ForceFeedback.h"cxx . . $ `<file>/Descent3/D3ForceFeedback.h`/
291 #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/
292 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
293 #include <string.h>
294 //////////////////////////////////////////////////////////////////////////////
295 #define IDV_KCONFIGcxx . . $ `Descent3/ctlconfig.cpp:295:9`! 10
296 #define IDV_CCONFIGcxx . . $ `Descent3/ctlconfig.cpp:296:9`! 11
297 #define IDV_WPNSELcxx . . $ `Descent3/ctlconfig.cpp:297:9`! 17
298 #define IDV_OPTIONScxx . . $ `Descent3/ctlconfig.cpp:298:9`! 18
299
300 // used for adjusting settings.
301 #define CFG_AXIS_SENS_RANGEcxx . . $ `Descent3/ctlconfig.cpp:301:9`! 20
302 const int16_tcxx . . $ int16_t# UID_JOYCFGcxx . . $ UID_JOYCFG. = 0x1000;
303
304
305 // Setup of config screens.
306 #define CCITEM_WPN_Xcxx . . $ `Descent3/ctlconfig.cpp:306:9`! 0
307 #define CCITEM_WPN_Ycxx . . $ `Descent3/ctlconfig.cpp:307:9`! 20
308 #define CCITEM_AUX_Xcxx . . $ `Descent3/ctlconfig.cpp:308:9`! 0
309 #define CCITEM_AUX_Ycxx . . $ `Descent3/ctlconfig.cpp:309:9`! 160
310 #define CCITEM_THRUST_Xcxx . . $ `Descent3/ctlconfig.cpp:310:9`! 295
311 #define CCITEM_THRUST_Ycxx . . $ `Descent3/ctlconfig.cpp:311:9`! 20
312 #define CCITEM_ROT_Xcxx . . $ `Descent3/ctlconfig.cpp:312:9`! 295
313 #define CCITEM_ROT_Ycxx . . $ `Descent3/ctlconfig.cpp:313:9`! 160
314 t_cfg_elementcxx . . $ t_cfg_element# Cfg_key_elementscxx . . $ Cfg_key_elements.[] = {
315 // column1 -indices 0-15
316 {-1, CtlText_WeaponGroupcxx . . $ `Descent3/ctlconfigtxt.h:152:9`!, CCITEM_WPN_Xcxx . . $ `Descent3/ctlconfig.cpp:306:9`!, CCITEM_WPN_Ycxx . . $ `Descent3/ctlconfig.cpp:307:9`!},
317 {ctfFIREPRIMARY_KEYcxx . . $ ctfFIREPRIMARY_KEY., CtlText_FirePrimarycxx . . $ `Descent3/ctlconfigtxt.h:111:9`!, 0, 0},
318 {ctfFIRESECONDARY_KEYcxx . . $ ctfFIRESECONDARY_KEY., CtlText_FireSecondarycxx . . $ `Descent3/ctlconfigtxt.h:112:9`!, 0, 0},
319 {ctfFIREFLARE_KEYcxx . . $ ctfFIREFLARE_KEY., CtlText_FireFlarecxx . . $ `Descent3/ctlconfigtxt.h:127:9`!, 0, 0},
320 {ctfWPNSEL_PCYCLEKEYcxx . . $ ctfWPNSEL_PCYCLEKEY., CtlText_WpnCycPcxx . . $ `Descent3/ctlconfigtxt.h:144:9`!, 0, 0},
321 {ctfWPNSEL_SCYCLEKEYcxx . . $ ctfWPNSEL_SCYCLEKEY., CtlText_WpnCycScxx . . $ `Descent3/ctlconfigtxt.h:145:9`!, 0, 0},
322 {-1, CtlText_MiscGroupcxx . . $ `Descent3/ctlconfigtxt.h:153:9`!, CCITEM_AUX_Xcxx . . $ `Descent3/ctlconfig.cpp:308:9`!, CCITEM_AUX_Ycxx . . $ `Descent3/ctlconfig.cpp:309:9`!},
323 {ctfHEADLIGHT_KEYcxx . . $ ctfHEADLIGHT_KEY., CtlText_Headlightcxx . . $ `Descent3/ctlconfigtxt.h:143:9`!, 0, 0},
324 {ctfREARVIEW_KEYcxx . . $ ctfREARVIEW_KEY., CtlText_Rearviewcxx . . $ `Descent3/ctlconfigtxt.h:148:9`!, 0, 0},
325 {ctfAUTOMAP_KEYcxx . . $ ctfAUTOMAP_KEY., CtlText_Automapcxx . . $ `Descent3/ctlconfigtxt.h:136:9`!, 0, 0},
326 {ctfPREV_INVKEYcxx . . $ ctfPREV_INVKEY., CtlText_PrevInvcxx . . $ `Descent3/ctlconfigtxt.h:137:9`!, 0, 0},
327 {ctfNEXT_INVKEYcxx . . $ ctfNEXT_INVKEY., CtlText_NextInvcxx . . $ `Descent3/ctlconfigtxt.h:138:9`!, 0, 0},
328 {ctfINV_USEKEYcxx . . $ ctfINV_USEKEY., CtlText_InvUsecxx . . $ `Descent3/ctlconfigtxt.h:139:9`!, 0, 0},
329 {ctfPREV_CNTMSKEYcxx . . $ ctfPREV_CNTMSKEY., CtlText_PrevCntMscxx . . $ `Descent3/ctlconfigtxt.h:140:9`!, 0, 0},
330 {ctfNEXT_CNTMSKEYcxx . . $ ctfNEXT_CNTMSKEY., CtlText_NextCntMscxx . . $ `Descent3/ctlconfigtxt.h:141:9`!, 0, 0},
331 {ctfCNTMS_USEKEYcxx . . $ ctfCNTMS_USEKEY., CtlText_CntMsUsecxx . . $ `Descent3/ctlconfigtxt.h:142:9`!, 0, 0},
332 {ctfAUDIOTAUNT1_KEYcxx . . $ ctfAUDIOTAUNT1_KEY., CtlText_AudioTaunt1cxx . . $ `Descent3/ctlconfigtxt.h:146:9`!, 0, 0},
333 {ctfAUDIOTAUNT2_KEYcxx . . $ ctfAUDIOTAUNT2_KEY., CtlText_AudioTaunt2cxx . . $ `Descent3/ctlconfigtxt.h:147:9`!, 0, 0},
334 {ctfAUDIOTAUNT3_KEYcxx . . $ ctfAUDIOTAUNT3_KEY., CtlText_AudioTaunt3cxx . . $ `Descent3/ctlconfigtxt.h:149:9`!, 0, 0},
335 {ctfAUDIOTAUNT4_KEYcxx . . $ ctfAUDIOTAUNT4_KEY., CtlText_AudioTaunt4cxx . . $ `Descent3/ctlconfigtxt.h:150:9`!, 0, 0},
336 {-1, CtlText_ThrustGroupcxx . . $ `Descent3/ctlconfigtxt.h:154:9`!, CCITEM_THRUST_Xcxx . . $ `Descent3/ctlconfig.cpp:310:9`!, CCITEM_THRUST_Ycxx . . $ `Descent3/ctlconfig.cpp:311:9`!},
337 {ctfFORWARD_THRUSTKEYcxx . . $ ctfFORWARD_THRUSTKEY., CtlText_Acceleratecxx . . $ `Descent3/ctlconfigtxt.h:113:9`!, 0, 0},
338 {ctfREVERSE_THRUSTKEYcxx . . $ ctfREVERSE_THRUSTKEY., CtlText_Reversecxx . . $ `Descent3/ctlconfigtxt.h:114:9`!, 0, 0},
339 {ctfAFTERBURN_KEYcxx . . $ ctfAFTERBURN_KEY., CtlText_Afterburncxx . . $ `Descent3/ctlconfigtxt.h:135:9`!, 0, 0},
340 {ctfTOGGLE_SLIDEKEYcxx . . $ ctfTOGGLE_SLIDEKEY., CtlText_ToggleSlidecxx . . $ `Descent3/ctlconfigtxt.h:128:9`!, 0, 0},
341 {ctfLEFT_THRUSTKEYcxx . . $ ctfLEFT_THRUSTKEY., CtlText_SlideLeftcxx . . $ `Descent3/ctlconfigtxt.h:116:9`!, 0, 0},
342 {ctfRIGHT_THRUSTKEYcxx . . $ ctfRIGHT_THRUSTKEY., CtlText_SlideRightcxx . . $ `Descent3/ctlconfigtxt.h:117:9`!, 0, 0},
343 {ctfUP_THRUSTKEYcxx . . $ ctfUP_THRUSTKEY., CtlText_SlideUpcxx . . $ `Descent3/ctlconfigtxt.h:119:9`!, 0, 0},
344 {ctfDOWN_THRUSTKEYcxx . . $ ctfDOWN_THRUSTKEY., CtlText_SlideDowncxx . . $ `Descent3/ctlconfigtxt.h:120:9`!, 0, 0},
345 {-1, CtlText_TurningGroupcxx . . $ `Descent3/ctlconfigtxt.h:155:9`!, CCITEM_ROT_Xcxx . . $ `Descent3/ctlconfig.cpp:312:9`!, CCITEM_ROT_Ycxx . . $ `Descent3/ctlconfig.cpp:313:9`!},
346 {ctfPITCH_UPKEYcxx . . $ ctfPITCH_UPKEY., CtlText_PitchUpcxx . . $ `Descent3/ctlconfigtxt.h:123:9`!, 0, 0},
347 {ctfPITCH_DOWNKEYcxx . . $ ctfPITCH_DOWNKEY., CtlText_PitchDowncxx . . $ `Descent3/ctlconfigtxt.h:124:9`!, 0, 0},
348 {ctfHEADING_LEFTKEYcxx . . $ ctfHEADING_LEFTKEY., CtlText_TurnLeftcxx . . $ `Descent3/ctlconfigtxt.h:125:9`!, 0, 0},
349 {ctfHEADING_RIGHTKEYcxx . . $ ctfHEADING_RIGHTKEY., CtlText_TurnRightcxx . . $ `Descent3/ctlconfigtxt.h:126:9`!, 0, 0},
350 {ctfTOGGLE_BANKKEYcxx . . $ ctfTOGGLE_BANKKEY., CtlText_ToggleBankcxx . . $ `Descent3/ctlconfigtxt.h:129:9`!, 0, 0},
351 {ctfBANK_LEFTKEYcxx . . $ ctfBANK_LEFTKEY., CtlText_BankLeftcxx . . $ `Descent3/ctlconfigtxt.h:121:9`!, 0, 0},
352 {ctfBANK_RIGHTKEYcxx . . $ ctfBANK_RIGHTKEY., CtlText_BankRightcxx . . $ `Descent3/ctlconfigtxt.h:122:9`!, 0, 0}};
353 #define CCITEM_WPN_X2cxx . . $ `Descent3/ctlconfig.cpp:353:9`! 0
354 #define CCITEM_WPN_Y2cxx . . $ `Descent3/ctlconfig.cpp:354:9`! 20
355 #define CCITEM_AUX_X2cxx . . $ `Descent3/ctlconfig.cpp:355:9`! 0
356 #define CCITEM_AUX_Y2cxx . . $ `Descent3/ctlconfig.cpp:356:9`! 160
357 #define CCITEM_THRUST_X2cxx . . $ `Descent3/ctlconfig.cpp:357:9`! 295
358 #define CCITEM_THRUST_Y2cxx . . $ `Descent3/ctlconfig.cpp:358:9`! 20
359 #define CCITEM_ROT_X2cxx . . $ `Descent3/ctlconfig.cpp:359:9`! 295
360 #define CCITEM_ROT_Y2cxx . . $ `Descent3/ctlconfig.cpp:360:9`! 200
361 t_cfg_elementcxx . . $ t_cfg_element# Cfg_joy_elementscxx . . $ Cfg_joy_elements.[] = {{-1, CtlText_WeaponGroupcxx . . $ `Descent3/ctlconfigtxt.h:152:9`!, CCITEM_WPN_X2cxx . . $ `Descent3/ctlconfig.cpp:353:9`!, CCITEM_WPN_Y2cxx . . $ `Descent3/ctlconfig.cpp:354:9`!},
362 {ctfFIREPRIMARY_BUTTONcxx . . $ ctfFIREPRIMARY_BUTTON., CtlText_FirePrimarycxx . . $ `Descent3/ctlconfigtxt.h:111:9`!, 0, 0},
363 {ctfFIRESECONDARY_BUTTONcxx . . $ ctfFIRESECONDARY_BUTTON., CtlText_FireSecondarycxx . . $ `Descent3/ctlconfigtxt.h:112:9`!, 0, 0},
364 {ctfFIREFLARE_BUTTONcxx . . $ ctfFIREFLARE_BUTTON., CtlText_FireFlarecxx . . $ `Descent3/ctlconfigtxt.h:127:9`!, 0, 0},
365 {ctfWPNSEL_PCYCLEBTNcxx . . $ ctfWPNSEL_PCYCLEBTN., CtlText_WpnCycPcxx . . $ `Descent3/ctlconfigtxt.h:144:9`!, 0, 0},
366 {ctfWPNSEL_SCYCLEBTNcxx . . $ ctfWPNSEL_SCYCLEBTN., CtlText_WpnCycScxx . . $ `Descent3/ctlconfigtxt.h:145:9`!, 0, 0},
367 {-1, CtlText_MiscGroupcxx . . $ `Descent3/ctlconfigtxt.h:153:9`!, CCITEM_AUX_X2cxx . . $ `Descent3/ctlconfig.cpp:355:9`!, CCITEM_AUX_Y2cxx . . $ `Descent3/ctlconfig.cpp:356:9`!},
368 {ctfHEADLIGHT_BUTTONcxx . . $ ctfHEADLIGHT_BUTTON., CtlText_Headlightcxx . . $ `Descent3/ctlconfigtxt.h:143:9`!, 0, 0},
369 {ctfREARVIEW_BTNcxx . . $ ctfREARVIEW_BTN., CtlText_Rearviewcxx . . $ `Descent3/ctlconfigtxt.h:148:9`!, 0, 0},
370 {ctfAUTOMAP_BUTTONcxx . . $ ctfAUTOMAP_BUTTON., CtlText_Automapcxx . . $ `Descent3/ctlconfigtxt.h:136:9`!, 0, 0},
371 {ctfPREV_INVBTNcxx . . $ ctfPREV_INVBTN., CtlText_PrevInvcxx . . $ `Descent3/ctlconfigtxt.h:137:9`!, 0, 0},
372 {ctfNEXT_INVBTNcxx . . $ ctfNEXT_INVBTN., CtlText_NextInvcxx . . $ `Descent3/ctlconfigtxt.h:138:9`!, 0, 0},
373 {ctfINV_USEBTNcxx . . $ ctfINV_USEBTN., CtlText_InvUsecxx . . $ `Descent3/ctlconfigtxt.h:139:9`!, 0, 0},
374 {ctfPREV_CNTMSBTNcxx . . $ ctfPREV_CNTMSBTN., CtlText_PrevCntMscxx . . $ `Descent3/ctlconfigtxt.h:140:9`!, 0, 0},
375 {ctfNEXT_CNTMSBTNcxx . . $ ctfNEXT_CNTMSBTN., CtlText_NextCntMscxx . . $ `Descent3/ctlconfigtxt.h:141:9`!, 0, 0},
376 {ctfCNTMS_USEBTNcxx . . $ ctfCNTMS_USEBTN., CtlText_CntMsUsecxx . . $ `Descent3/ctlconfigtxt.h:142:9`!, 0, 0},
377 {ctfAUDIOTAUNT1_BTNcxx . . $ ctfAUDIOTAUNT1_BTN., CtlText_AudioTaunt1cxx . . $ `Descent3/ctlconfigtxt.h:146:9`!, 0, 0},
378 {ctfAUDIOTAUNT2_BTNcxx . . $ ctfAUDIOTAUNT2_BTN., CtlText_AudioTaunt2cxx . . $ `Descent3/ctlconfigtxt.h:147:9`!, 0, 0},
379 {ctfAUDIOTAUNT3_BTNcxx . . $ ctfAUDIOTAUNT3_BTN., CtlText_AudioTaunt3cxx . . $ `Descent3/ctlconfigtxt.h:149:9`!, 0, 0},
380 {ctfAUDIOTAUNT4_BTNcxx . . $ ctfAUDIOTAUNT4_BTN., CtlText_AudioTaunt4cxx . . $ `Descent3/ctlconfigtxt.h:150:9`!, 0, 0},
381 {-1, CtlText_ThrustGroupcxx . . $ `Descent3/ctlconfigtxt.h:154:9`!, CCITEM_THRUST_X2cxx . . $ `Descent3/ctlconfig.cpp:357:9`!, CCITEM_THRUST_Y2cxx . . $ `Descent3/ctlconfig.cpp:358:9`!},
382 {ctfFORWARD_THRUSTAXIScxx . . $ ctfFORWARD_THRUSTAXIS., CtlText_Forwardcxx . . $ `Descent3/ctlconfigtxt.h:133:9`!, 0, 0},
383 {ctfFORWARD_BUTTONcxx . . $ ctfFORWARD_BUTTON., CtlText_Acceleratecxx . . $ `Descent3/ctlconfigtxt.h:113:9`!, 0, 0},
384 {ctfREVERSE_BUTTONcxx . . $ ctfREVERSE_BUTTON., CtlText_Reversecxx . . $ `Descent3/ctlconfigtxt.h:114:9`!, 0, 0},
385 {ctfAFTERBURN_BUTTONcxx . . $ ctfAFTERBURN_BUTTON., CtlText_Afterburncxx . . $ `Descent3/ctlconfigtxt.h:135:9`!, 0, 0},
386 {ctfUP_THRUSTAXIScxx . . $ ctfUP_THRUSTAXIS., CtlText_SlideVertcxx . . $ `Descent3/ctlconfigtxt.h:118:9`!, 0, 0},
387 {ctfRIGHT_THRUSTAXIScxx . . $ ctfRIGHT_THRUSTAXIS., CtlText_SlideHorizcxx . . $ `Descent3/ctlconfigtxt.h:115:9`!, 0, 0},
388 {ctfTOGGLE_SLIDEBUTTONcxx . . $ ctfTOGGLE_SLIDEBUTTON., CtlText_ToggleSlidecxx . . $ `Descent3/ctlconfigtxt.h:128:9`!, 0, 0},
389 {ctfUP_BUTTONcxx . . $ ctfUP_BUTTON., CtlText_SlideUpcxx . . $ `Descent3/ctlconfigtxt.h:119:9`!, 0, 0},
390 {ctfDOWN_BUTTONcxx . . $ ctfDOWN_BUTTON., CtlText_SlideDowncxx . . $ `Descent3/ctlconfigtxt.h:120:9`!, 0, 0},
391 {ctfLEFT_BUTTONcxx . . $ ctfLEFT_BUTTON., CtlText_SlideLeftcxx . . $ `Descent3/ctlconfigtxt.h:116:9`!, 0, 0},
392 {ctfRIGHT_BUTTONcxx . . $ ctfRIGHT_BUTTON., CtlText_SlideRightcxx . . $ `Descent3/ctlconfigtxt.h:117:9`!, 0, 0},
393 {-1, CtlText_TurningGroupcxx . . $ `Descent3/ctlconfigtxt.h:155:9`!, CCITEM_ROT_X2cxx . . $ `Descent3/ctlconfig.cpp:359:9`!, CCITEM_ROT_Y2cxx . . $ `Descent3/ctlconfig.cpp:360:9`!},
394 {ctfPITCH_DOWNAXIScxx . . $ ctfPITCH_DOWNAXIS., CtlText_Pitchcxx . . $ `Descent3/ctlconfigtxt.h:131:9`!, 0, 0},
395 {ctfPITCH_UPBUTTONcxx . . $ ctfPITCH_UPBUTTON., CtlText_PitchUpcxx . . $ `Descent3/ctlconfigtxt.h:123:9`!, 0, 0},
396 {ctfPITCH_DOWNBUTTONcxx . . $ ctfPITCH_DOWNBUTTON., CtlText_PitchDowncxx . . $ `Descent3/ctlconfigtxt.h:124:9`!, 0, 0},
397 {ctfHEADING_RIGHTAXIScxx . . $ ctfHEADING_RIGHTAXIS., CtlText_Headingcxx . . $ `Descent3/ctlconfigtxt.h:130:9`!, 0, 0},
398 {ctfHEADING_LEFTBUTTONcxx . . $ ctfHEADING_LEFTBUTTON., CtlText_TurnLeftcxx . . $ `Descent3/ctlconfigtxt.h:125:9`!, 0, 0},
399 {ctfHEADING_RIGHTBUTTONcxx . . $ ctfHEADING_RIGHTBUTTON., CtlText_TurnRightcxx . . $ `Descent3/ctlconfigtxt.h:126:9`!, 0, 0},
400 {ctfBANK_RIGHTAXIScxx . . $ ctfBANK_RIGHTAXIS., CtlText_Bankcxx . . $ `Descent3/ctlconfigtxt.h:134:9`!, 0, 0},
401 {ctfTOGGLE_BANKBUTTONcxx . . $ ctfTOGGLE_BANKBUTTON., CtlText_ToggleBankcxx . . $ `Descent3/ctlconfigtxt.h:129:9`!, 0, 0},
402 {ctfBANK_LEFTBUTTONcxx . . $ ctfBANK_LEFTBUTTON., CtlText_BankLeftcxx . . $ `Descent3/ctlconfigtxt.h:121:9`!, 0, 0},
403 {ctfBANK_RIGHTBUTTONcxx . . $ ctfBANK_RIGHTBUTTON., CtlText_BankRightcxx . . $ `Descent3/ctlconfigtxt.h:122:9`!, 0, 0}};
404 #define N_JOY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:404:9`! (sizeof(Cfg_joy_elements) / sizeof(t_cfg_element))
405 #define N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`! (sizeof(Cfg_key_elements) / sizeof(t_cfg_element))
406 static void ctl_cfg_set_and_verify_changescxx . . $ ctl_cfg_set_and_verify_changes(d3584dfdf09776).(int16_tcxx . . $ int16_t# fnid, ct_typecxx . . $ ct_type# elem_type, uint8_tcxx . . $ uint8_t# controller, uint8_tcxx . . $ uint8_t# elem, int8_tcxx . . $ int8_t# slot);
407 static void ctl_cfg_element_options_dialogcxx . . $ ctl_cfg_element_options_dialog(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# fnid);
408 // used for adjusting settings.
409 static int weapon_select_dialogcxx . . $ weapon_select_dialog(d455ce14f374a3ab).(int wpn, bool is_secondary);
410 #define UID_KEYCFG_IDcxx . . $ `Descent3/ctlconfig.cpp:410:9`! 0x1000
411 #define UID_JOYCFG_IDcxx . . $ `Descent3/ctlconfig.cpp:411:9`! 0x1100
412 #define UID_PRIMARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:412:9`! 0x1200
413 #define UID_PRIMARY_DIScxx . . $ `Descent3/ctlconfig.cpp:413:9`! 0x1220
414 #define UID_SECONDARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:414:9`! 0x1300
415 #define UID_SECONDARY_DIScxx . . $ `Descent3/ctlconfig.cpp:415:9`! 0x1320
416 #define UID_WPNLISTcxx . . $ `Descent3/ctlconfig.cpp:416:9`! 0x1400
417 #define UID_RESETDEFAULTScxx . . $ `Descent3/ctlconfig.cpp:417:9`! 0x2000
418 #define UID_CFGSETTINGScxx . . $ `Descent3/ctlconfig.cpp:418:9`! 0x2001
419 #define UID_CLEAR_SLOTcxx . . $ `Descent3/ctlconfig.cpp:419:9`! 0x2002
420 #define UID_REVERTcxx . . $ `Descent3/ctlconfig.cpp:420:9`! 0x2003
421 //////////////////////////////////////////////////////////////////////////////
422 //
423 class cfg_screencxx . . $ cfg_screen# {
424 protected:
425 newuiSheetcxx . . $ newuiSheet# *m_sheetcxx . . $ cfg_screen#m_sheet.;
426 newuiLargeMenucxx . . $ newuiLargeMenu# *m_menucxx . . $ cfg_screen#m_menu.;
427
428 public:
429 virtual void setupcxx . . $ cfg_screen#setup(69eaa751469a2e53).(newuiLargeMenucxx . . $ newuiLargeMenu# *menu) = 0;
430 virtual void finishcxx . . $ cfg_screen#finish(49f6e7a06ebc5aa8).() = 0;
431 virtual void realizecxx . . $ cfg_screen#realize(49f6e7a06ebc5aa8).() = 0;
432 virtual void unrealizecxx . . $ cfg_screen#unrealize(49f6e7a06ebc5aa8).() = 0;
433 virtual void processcxx . . $ cfg_screen#process(d4f767463ce0a6b3).(int res){};
434 };
435 //////////////////////////////////////////////////////////////////////////////
436 // KEY CONFIG
437 #define KEYCFG_EXTRAS_Xcxx . . $ `Descent3/ctlconfig.cpp:437:9`! 0
438 #define KEYCFG_EXTRAS_Ycxx . . $ `Descent3/ctlconfig.cpp:438:9`! 4
439 #define KEYCFG_EXTRAS_Wcxx . . $ `Descent3/ctlconfig.cpp:439:9`! 160
440 class key_cfg_screencxx . . $ key_cfg_screen# : public cfg_screencxx . . $ cfg_screen# {
441 cfg_elementcxx . . $ cfg_element# m_elemcxx . . $ key_cfg_screen#m_elem.[N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!];
442 newuiButtoncxx . . $ newuiButton# m_reset_btncxx . . $ key_cfg_screen#m_reset_btn.;
443 newuiButtoncxx . . $ newuiButton# m_key_settingscxx . . $ key_cfg_screen#m_key_settings.;
444 newuiButtoncxx . . $ newuiButton# m_revert_btncxx . . $ key_cfg_screen#m_revert_btn.;
445 UITextcxx . . $ UIText# m_help1_txtcxx . . $ key_cfg_screen#m_help1_txt.;
446 UITextcxx . . $ UIText# m_help2_txtcxx . . $ key_cfg_screen#m_help2_txt.;
447 cntrldatacxx . . $ cntrldata# m_old_controlscxx . . $ key_cfg_screen#m_old_controls.[N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!];
448
449 public:
450 virtual void setupcxx . . $ key_cfg_screen#setup(69eaa751469a2e53).(newuiLargeMenucxx . . $ newuiLargeMenu# *menu);
451 virtual void finishcxx . . $ key_cfg_screen#finish(49f6e7a06ebc5aa8).();
452 virtual void processcxx . . $ key_cfg_screen#process(d4f767463ce0a6b3).(int res);
453 virtual void realizecxx . . $ key_cfg_screen#realize(49f6e7a06ebc5aa8).();
454 virtual void unrealizecxx . . $ key_cfg_screen#unrealize(49f6e7a06ebc5aa8).();
455 };
456 void key_cfg_screencxx . . $ key_cfg_screen#::setupcxx . . $ key_cfg_screen#setup(69eaa751469a2e53).(newuiLargeMenucxx . . $ newuiLargeMenu# *menu) {
457 int i;
458 m_menucxx . . $ cfg_screen#m_menu. = menu;
459 m_sheetcxx . . $ cfg_screen#m_sheet. = menu->AddOptioncxx . . $ newuiLargeMenu#AddOption(2e05a335277a5351).(IDV_KCONFIGcxx . . $ `Descent3/ctlconfig.cpp:295:9`!, TXT_OPTCUSTKEYBcxx . . $ `Descent3/stringtable.h:167:9`!);
460 // save original settings.
461 for (i = 0; i < N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!; i++) {
462 Controllercxx . . $ Controller.->get_controller_functioncxx . . $ gameController#get_controller_function(c004c324aa6068e0).(Cfg_key_elementscxx . . $ Cfg_key_elements.[i].fn_idcxx . . $ t_cfg_element#fn_id., m_old_controlscxx . . $ key_cfg_screen#m_old_controls.[i].typecxx . . $ cntrldata#type., &m_old_controlscxx . . $ key_cfg_screen#m_old_controls.[i].valuecxx . . $ cntrldata#value.,
463 m_old_controlscxx . . $ key_cfg_screen#m_old_controls.[i].flagscxx . . $ cntrldata#flags.);
464 }
465 }
466 void key_cfg_screencxx . . $ key_cfg_screen#::finishcxx . . $ key_cfg_screen#finish(49f6e7a06ebc5aa8).() {}
467 void key_cfg_screencxx . . $ key_cfg_screen#::processcxx . . $ key_cfg_screen#process(d4f767463ce0a6b3).(int res) {
468 int i;
469 for (i = 0; i < N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!; i++) {
470 if (m_elemcxx . . $ key_cfg_screen#m_elem.[i].GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).() != -1 && m_elemcxx . . $ key_cfg_screen#m_elem.[i].GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).() == res) {
471 // we chose a slot to configure.
472 uint8_tcxx . . $ uint8_t# elem, controller;
473 int8_tcxx . . $ int8_t# slot;
474 ct_typecxx . . $ ct_type# elem_type;
475 if (m_elemcxx . . $ key_cfg_screen#m_elem.[i].GetActiveSlotcxx . . $ cfg_element#GetActiveSlot(4f2304c4a29b870b).() == CFGELEM_SLOT_CLEARcxx . . $ `Descent3/CtlCfgElem.h:88:9`!) {
476 ctl_cfg_element_options_dialogcxx . . $ ctl_cfg_element_options_dialog(68e3ae50fe6578a9).((int16_tcxx . . $ int16_t#)(res - UID_KEYCFG_IDcxx . . $ `Descent3/ctlconfig.cpp:410:9`!));
477 } else if (m_elemcxx . . $ key_cfg_screen#m_elem.[i].Configurecxx . . $ cfg_element#Configure(ccaa17bdaf66462f).(&elem_type, &controller, &elem, &slot)) {
478 ctl_cfg_set_and_verify_changescxx . . $ ctl_cfg_set_and_verify_changes(d3584dfdf09776).((int16_tcxx . . $ int16_t#)(res - UID_KEYCFG_IDcxx . . $ `Descent3/ctlconfig.cpp:410:9`!), elem_type, controller, elem, slot);
479 }
480 break;
481 }
482 }
483 switch (res) {
484 case UID_RESETDEFAULTScxx . . $ `Descent3/ctlconfig.cpp:417:9`!:
485 for (i = 0; i < NUM_CONTROLLER_FUNCTIONScxx . . $ NUM_CONTROLLER_FUNCTIONS.; i++) {
486 if (Controller_needscxx . . $ Controller_needs.[i].ctypecxx . . $ ct_function#ctype.[0] == ctKeycxx . . $ ctKey.) {
487 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Controller_needs[i].ctype[1] == ctKey);
488 Controllercxx . . $ Controller.->assign_functioncxx . . $ gameController#assign_function(2608e8495e192ac3).(&Controller_needscxx . . $ Controller_needs.[i]);
489 }
490 }
491 break;
492 case UID_CFGSETTINGScxx . . $ `Descent3/ctlconfig.cpp:418:9`!:
493 key_settings_dialogcxx . . $ key_settings_dialog(49f6e7a06ebc5aa8).();
494 break;
495 case UID_REVERTcxx . . $ `Descent3/ctlconfig.cpp:420:9`!:
496 // restore original settings.
497 for (i = 0; i < N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!; i++) {
498 Controllercxx . . $ Controller.->set_controller_functioncxx . . $ gameController#set_controller_function(a87bf4975f40b925).(Cfg_key_elementscxx . . $ Cfg_key_elements.[i].fn_idcxx . . $ t_cfg_element#fn_id., m_old_controlscxx . . $ key_cfg_screen#m_old_controls.[i].typecxx . . $ cntrldata#type., m_old_controlscxx . . $ key_cfg_screen#m_old_controls.[i].valuecxx . . $ cntrldata#value.,
499 m_old_controlscxx . . $ key_cfg_screen#m_old_controls.[i].flagscxx . . $ cntrldata#flags.);
500 }
501 break;
502 }
503 }
504 void key_cfg_screencxx . . $ key_cfg_screen#::realizecxx . . $ key_cfg_screen#realize(49f6e7a06ebc5aa8).() {
505 // create controls
506 int i, x = 0, y;
507 t_cfg_elementcxx . . $ t_cfg_element# *cfg_elem = &Cfg_key_elementscxx . . $ Cfg_key_elements.[0];
508 m_reset_btncxx . . $ key_cfg_screen#m_reset_btn..Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_menucxx . . $ cfg_screen#m_menu., UID_RESETDEFAULTScxx . . $ `Descent3/ctlconfig.cpp:417:9`!, TXT_RESETTODEFAULTcxx . . $ `Descent3/stringtable.h:427:9`!, KEYCFG_EXTRAS_Xcxx . . $ `Descent3/ctlconfig.cpp:437:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Xcxx . . $ newuiSheet#X(455f465bc33b4cdf).(),
509 KEYCFG_EXTRAS_Ycxx . . $ `Descent3/ctlconfig.cpp:438:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Ycxx . . $ newuiSheet#Y(455f465bc33b4cdf).(), NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
510 m_key_settingscxx . . $ key_cfg_screen#m_key_settings..Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_menucxx . . $ cfg_screen#m_menu., UID_CFGSETTINGScxx . . $ `Descent3/ctlconfig.cpp:418:9`!, TXT_ADJUSTSETTINGScxx . . $ `Descent3/stringtable.h:120:9`!, KEYCFG_EXTRAS_Xcxx . . $ `Descent3/ctlconfig.cpp:437:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Xcxx . . $ newuiSheet#X(455f465bc33b4cdf).() + KEYCFG_EXTRAS_Wcxx . . $ `Descent3/ctlconfig.cpp:439:9`!,
511 KEYCFG_EXTRAS_Ycxx . . $ `Descent3/ctlconfig.cpp:438:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Ycxx . . $ newuiSheet#Y(455f465bc33b4cdf).(), NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
512 m_revert_btncxx . . $ key_cfg_screen#m_revert_btn..Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_menucxx . . $ cfg_screen#m_menu., UID_REVERTcxx . . $ `Descent3/ctlconfig.cpp:420:9`!, TXT_REVERTCONTROLScxx . . $ `Descent3/stringtable.h:832:9`!, KEYCFG_EXTRAS_Xcxx . . $ `Descent3/ctlconfig.cpp:437:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Xcxx . . $ newuiSheet#X(455f465bc33b4cdf).() + KEYCFG_EXTRAS_Wcxx . . $ `Descent3/ctlconfig.cpp:439:9`! * 2,
513 KEYCFG_EXTRAS_Ycxx . . $ `Descent3/ctlconfig.cpp:438:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Ycxx . . $ newuiSheet#Y(455f465bc33b4cdf).(), NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
514 UITextItemcxx . . $ UITextItem# itemHelpF1cxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, TXT_KEYCFGSCREENHELP1cxx . . $ `Descent3/stringtable.h:873:9`!, NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!};
515 m_help1_txtcxx . . $ key_cfg_screen#m_help1_txt..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemHelpF1, 280, 30);
516 UITextItemcxx . . $ UITextItem# itemHelpcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, TXT_CFGSCREENHELPcxx . . $ `Descent3/stringtable.h:872:9`!, NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!};
517 m_help2_txtcxx . . $ key_cfg_screen#m_help2_txt..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemHelp, 280, 40);
518 for (i = 0; i < N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!; i++) {
519 if (cfg_elem->fn_idcxx . . $ t_cfg_element#fn_id. == -1) {
520 x = cfg_elem->xcxx . . $ t_cfg_element#x. + m_sheetcxx . . $ cfg_screen#m_sheet.->Xcxx . . $ newuiSheet#X(455f465bc33b4cdf).();
521 y = cfg_elem->ycxx . . $ t_cfg_element#y. + m_sheetcxx . . $ cfg_screen#m_sheet.->Ycxx . . $ newuiSheet#Y(455f465bc33b4cdf).();
522 }
523 m_elemcxx . . $ key_cfg_screen#m_elem.[i].Createcxx . . $ cfg_element#Create(d616eeffcc609617).(m_menucxx . . $ cfg_screen#m_menu., cfg_elem->textcxx . . $ t_cfg_element#text., x, y, cfg_elem->fn_idcxx . . $ t_cfg_element#fn_id.,
524 (cfg_elem->fn_idcxx . . $ t_cfg_element#fn_id. == -1) ? -1 : UID_KEYCFG_IDcxx . . $ `Descent3/ctlconfig.cpp:410:9`! + cfg_elem->fn_idcxx . . $ t_cfg_element#fn_id.);
525 y += m_elemcxx . . $ key_cfg_screen#m_elem.[i].Hcxx . . $ UIObject#H(455f465bc33b4cdf).() + 2;
526 cfg_elem++;
527 }
528 }
529 void key_cfg_screencxx . . $ key_cfg_screen#::unrealizecxx . . $ key_cfg_screen#unrealize(49f6e7a06ebc5aa8).() {
530 // create controls
531 int i;
532 t_cfg_elementcxx . . $ t_cfg_element# *cfg_elem = &Cfg_key_elementscxx . . $ Cfg_key_elements.[0];
533 m_help2_txtcxx . . $ key_cfg_screen#m_help2_txt..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
534 m_help1_txtcxx . . $ key_cfg_screen#m_help1_txt..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
535 m_key_settingscxx . . $ key_cfg_screen#m_key_settings..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
536 m_reset_btncxx . . $ key_cfg_screen#m_reset_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
537 m_revert_btncxx . . $ key_cfg_screen#m_revert_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
538 for (i = 0; i < N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!; i++) {
539 m_elemcxx . . $ key_cfg_screen#m_elem.[i].Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
540 cfg_elem++;
541 }
542 }
543 //////////////////////////////////////////////////////////////////////////////
544 // JOY CONFIG
545 class joy_cfg_screencxx . . $ joy_cfg_screen# : public cfg_screencxx . . $ cfg_screen# {
546 cfg_elementcxx . . $ cfg_element# m_elemcxx . . $ joy_cfg_screen#m_elem.[N_JOY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:404:9`!];
547 newuiButtoncxx . . $ newuiButton# m_reset_btncxx . . $ joy_cfg_screen#m_reset_btn.;
548 newuiButtoncxx . . $ newuiButton# m_controller_settingscxx . . $ joy_cfg_screen#m_controller_settings.;
549 newuiButtoncxx . . $ newuiButton# m_revert_btncxx . . $ joy_cfg_screen#m_revert_btn.;
550 cntrldatacxx . . $ cntrldata# m_old_controlscxx . . $ joy_cfg_screen#m_old_controls.[N_JOY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:404:9`!];
551 UITextcxx . . $ UIText# m_help1_txtcxx . . $ joy_cfg_screen#m_help1_txt.;
552 UITextcxx . . $ UIText# m_help2_txtcxx . . $ joy_cfg_screen#m_help2_txt.;
553
554 public:
555 virtual void setupcxx . . $ joy_cfg_screen#setup(69eaa751469a2e53).(newuiLargeMenucxx . . $ newuiLargeMenu# *menu);
556 virtual void finishcxx . . $ joy_cfg_screen#finish(49f6e7a06ebc5aa8).();
557 virtual void processcxx . . $ joy_cfg_screen#process(d4f767463ce0a6b3).(int res);
558 virtual void realizecxx . . $ joy_cfg_screen#realize(49f6e7a06ebc5aa8).();
559 virtual void unrealizecxx . . $ joy_cfg_screen#unrealize(49f6e7a06ebc5aa8).();
560 };
561 // setup user interfaces for each screen.
562 void joy_cfg_screencxx . . $ joy_cfg_screen#::setupcxx . . $ joy_cfg_screen#setup(69eaa751469a2e53).(newuiLargeMenucxx . . $ newuiLargeMenu# *menu) {
563 int i;
564 m_menucxx . . $ cfg_screen#m_menu. = menu;
565 m_sheetcxx . . $ cfg_screen#m_sheet. = menu->AddOptioncxx . . $ newuiLargeMenu#AddOption(2e05a335277a5351).(IDV_CCONFIGcxx . . $ `Descent3/ctlconfig.cpp:296:9`!, TXT_OPTCUSTCONTcxx . . $ `Descent3/stringtable.h:168:9`!);
566
567 // save original settings.
568 for (i = 0; i < N_JOY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:404:9`!; i++) {
569 Controllercxx . . $ Controller.->get_controller_functioncxx . . $ gameController#get_controller_function(c004c324aa6068e0).(Cfg_joy_elementscxx . . $ Cfg_joy_elements.[i].fn_idcxx . . $ t_cfg_element#fn_id., m_old_controlscxx . . $ joy_cfg_screen#m_old_controls.[i].typecxx . . $ cntrldata#type., &m_old_controlscxx . . $ joy_cfg_screen#m_old_controls.[i].valuecxx . . $ cntrldata#value.,
570 m_old_controlscxx . . $ joy_cfg_screen#m_old_controls.[i].flagscxx . . $ cntrldata#flags.);
571 }
572 }
573 void joy_cfg_screencxx . . $ joy_cfg_screen#::finishcxx . . $ joy_cfg_screen#finish(49f6e7a06ebc5aa8).() {}
574 void joy_cfg_screencxx . . $ joy_cfg_screen#::processcxx . . $ joy_cfg_screen#process(d4f767463ce0a6b3).(int res) {
575 int i;
576
577 for (i = 0; i < N_JOY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:404:9`!; i++) {
578 if (m_elemcxx . . $ joy_cfg_screen#m_elem.[i].GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).() != -1 && m_elemcxx . . $ joy_cfg_screen#m_elem.[i].GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).() == res) {
579 // we chose a slot to configure.
580 uint8_tcxx . . $ uint8_t# elem, controller;
581 int8_tcxx . . $ int8_t# slot;
582 ct_typecxx . . $ ct_type# elem_type;
583 if (m_elemcxx . . $ joy_cfg_screen#m_elem.[i].GetActiveSlotcxx . . $ cfg_element#GetActiveSlot(4f2304c4a29b870b).() == CFGELEM_SLOT_CLEARcxx . . $ `Descent3/CtlCfgElem.h:88:9`!) {
584 ctl_cfg_element_options_dialogcxx . . $ ctl_cfg_element_options_dialog(68e3ae50fe6578a9).((int16_tcxx . . $ int16_t#)(res - UID_JOYCFG_IDcxx . . $ `Descent3/ctlconfig.cpp:411:9`!));
585 } else if (m_elemcxx . . $ joy_cfg_screen#m_elem.[i].Configurecxx . . $ cfg_element#Configure(ccaa17bdaf66462f).(&elem_type, &controller, &elem, &slot)) {
586 ctl_cfg_set_and_verify_changescxx . . $ ctl_cfg_set_and_verify_changes(d3584dfdf09776).((int16_tcxx . . $ int16_t#)(res - UID_JOYCFG_IDcxx . . $ `Descent3/ctlconfig.cpp:411:9`!), elem_type, controller, elem, slot);
587 }
588 break;
589 }
590 }
591 switch (res) {
592 case UID_RESETDEFAULTScxx . . $ `Descent3/ctlconfig.cpp:417:9`!:
593 for (i = 0; i < NUM_CONTROLLER_FUNCTIONScxx . . $ NUM_CONTROLLER_FUNCTIONS.; i++) {
594 if (Controller_needscxx . . $ Controller_needs.[i].ctypecxx . . $ ct_function#ctype.[0] != ctKeycxx . . $ ctKey.) {
595 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Controller_needs[i].ctype[1] != ctKey);
596 Controllercxx . . $ Controller.->assign_functioncxx . . $ gameController#assign_function(2608e8495e192ac3).(&Controller_needscxx . . $ Controller_needs.[i]);
597 }
598 }
599 break;
600 case UID_CFGSETTINGScxx . . $ `Descent3/ctlconfig.cpp:418:9`!:
601 joystick_settings_dialogcxx . . $ joystick_settings_dialog(49f6e7a06ebc5aa8).();
602 break;
603 case UID_REVERTcxx . . $ `Descent3/ctlconfig.cpp:420:9`!:
604 // restore original settings.
605 for (i = 0; i < N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!; i++) {
606 Controllercxx . . $ Controller.->set_controller_functioncxx . . $ gameController#set_controller_function(a87bf4975f40b925).(Cfg_joy_elementscxx . . $ Cfg_joy_elements.[i].fn_idcxx . . $ t_cfg_element#fn_id., m_old_controlscxx . . $ joy_cfg_screen#m_old_controls.[i].typecxx . . $ cntrldata#type., m_old_controlscxx . . $ joy_cfg_screen#m_old_controls.[i].valuecxx . . $ cntrldata#value.,
607 m_old_controlscxx . . $ joy_cfg_screen#m_old_controls.[i].flagscxx . . $ cntrldata#flags.);
608 }
609 break;
610 }
611 }
612
613 void joy_cfg_screencxx . . $ joy_cfg_screen#::realizecxx . . $ joy_cfg_screen#realize(49f6e7a06ebc5aa8).() {
614 int i, x = 0, y;
615 t_cfg_elementcxx . . $ t_cfg_element# *cfg_elem = &Cfg_joy_elementscxx . . $ Cfg_joy_elements.[0];
616 m_reset_btncxx . . $ joy_cfg_screen#m_reset_btn..Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_menucxx . . $ cfg_screen#m_menu., UID_RESETDEFAULTScxx . . $ `Descent3/ctlconfig.cpp:417:9`!, TXT_RESETTODEFAULTcxx . . $ `Descent3/stringtable.h:427:9`!, KEYCFG_EXTRAS_Xcxx . . $ `Descent3/ctlconfig.cpp:437:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Xcxx . . $ newuiSheet#X(455f465bc33b4cdf).(),
617 KEYCFG_EXTRAS_Ycxx . . $ `Descent3/ctlconfig.cpp:438:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Ycxx . . $ newuiSheet#Y(455f465bc33b4cdf).(), NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
618 m_controller_settingscxx . . $ joy_cfg_screen#m_controller_settings..Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_menucxx . . $ cfg_screen#m_menu., UID_CFGSETTINGScxx . . $ `Descent3/ctlconfig.cpp:418:9`!, TXT_ADJUSTSETTINGScxx . . $ `Descent3/stringtable.h:120:9`!,
619 KEYCFG_EXTRAS_Xcxx . . $ `Descent3/ctlconfig.cpp:437:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Xcxx . . $ newuiSheet#X(455f465bc33b4cdf).() + KEYCFG_EXTRAS_Wcxx . . $ `Descent3/ctlconfig.cpp:439:9`!, KEYCFG_EXTRAS_Ycxx . . $ `Descent3/ctlconfig.cpp:438:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Ycxx . . $ newuiSheet#Y(455f465bc33b4cdf).(),
620 NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
621 m_revert_btncxx . . $ joy_cfg_screen#m_revert_btn..Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_menucxx . . $ cfg_screen#m_menu., UID_REVERTcxx . . $ `Descent3/ctlconfig.cpp:420:9`!, TXT_REVERTCONTROLScxx . . $ `Descent3/stringtable.h:832:9`!, KEYCFG_EXTRAS_Xcxx . . $ `Descent3/ctlconfig.cpp:437:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Xcxx . . $ newuiSheet#X(455f465bc33b4cdf).() + KEYCFG_EXTRAS_Wcxx . . $ `Descent3/ctlconfig.cpp:439:9`! * 2,
622 KEYCFG_EXTRAS_Ycxx . . $ `Descent3/ctlconfig.cpp:438:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Ycxx . . $ newuiSheet#Y(455f465bc33b4cdf).(), NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
623 UITextItemcxx . . $ UITextItem# itemHelpF1cxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, TXT_JOYCFGSCREENHELP1cxx . . $ `Descent3/stringtable.h:874:9`!, NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!};
624 m_help1_txtcxx . . $ joy_cfg_screen#m_help1_txt..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemHelpF1, 280, 30);
625 UITextItemcxx . . $ UITextItem# itemHelpcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, TXT_CFGSCREENHELPcxx . . $ `Descent3/stringtable.h:872:9`!, NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!};
626 m_help2_txtcxx . . $ joy_cfg_screen#m_help2_txt..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemHelp, 280, 40);
627 for (i = 0; i < N_JOY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:404:9`!; i++) {
628 if (cfg_elem->fn_idcxx . . $ t_cfg_element#fn_id. == -1) {
629 x = cfg_elem->xcxx . . $ t_cfg_element#x. + m_sheetcxx . . $ cfg_screen#m_sheet.->Xcxx . . $ newuiSheet#X(455f465bc33b4cdf).();
630 y = cfg_elem->ycxx . . $ t_cfg_element#y. + m_sheetcxx . . $ cfg_screen#m_sheet.->Ycxx . . $ newuiSheet#Y(455f465bc33b4cdf).();
631 }
632 m_elemcxx . . $ joy_cfg_screen#m_elem.[i].Createcxx . . $ cfg_element#Create(d616eeffcc609617).(m_menucxx . . $ cfg_screen#m_menu., cfg_elem->textcxx . . $ t_cfg_element#text., x, y, cfg_elem->fn_idcxx . . $ t_cfg_element#fn_id.,
633 (cfg_elem->fn_idcxx . . $ t_cfg_element#fn_id. == -1) ? -1 : UID_JOYCFG_IDcxx . . $ `Descent3/ctlconfig.cpp:411:9`! + cfg_elem->fn_idcxx . . $ t_cfg_element#fn_id.);
634 y += m_elemcxx . . $ joy_cfg_screen#m_elem.[i].Hcxx . . $ UIObject#H(455f465bc33b4cdf).() + 2;
635 cfg_elem++;
636 }
637 }
638 void joy_cfg_screencxx . . $ joy_cfg_screen#::unrealizecxx . . $ joy_cfg_screen#unrealize(49f6e7a06ebc5aa8).() {
639 // create controls
640 int i;
641
642 m_controller_settingscxx . . $ joy_cfg_screen#m_controller_settings..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
643 t_cfg_elementcxx . . $ t_cfg_element# *cfg_elem = &Cfg_joy_elementscxx . . $ Cfg_joy_elements.[0];
644 for (i = 0; i < N_JOY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:404:9`!; i++) {
645 m_elemcxx . . $ joy_cfg_screen#m_elem.[i].Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
646 cfg_elem++;
647 }
648 m_help2_txtcxx . . $ joy_cfg_screen#m_help2_txt..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
649 m_help1_txtcxx . . $ joy_cfg_screen#m_help1_txt..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
650 m_reset_btncxx . . $ joy_cfg_screen#m_reset_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
651 m_revert_btncxx . . $ joy_cfg_screen#m_revert_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
652 }
653 //////////////////////////////////////////////////////////////////////////////
654 // WEAPON SEL CONFIG
655 #define WPNSEL_PRIMARY_Xcxx . . $ `Descent3/ctlconfig.cpp:655:9`! 70
656 #define WPNSEL_PRIMARY_Ycxx . . $ `Descent3/ctlconfig.cpp:656:9`! 170
657 #define WPNSEL_SECONDARY_Xcxx . . $ `Descent3/ctlconfig.cpp:657:9`! 340
658 #define WPNSEL_SECONDARY_Ycxx . . $ `Descent3/ctlconfig.cpp:658:9`! 170
659 extern float Key_ramp_speedcxx . . $ Key_ramp_speed.;
660 class wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen# : public cfg_screencxx . . $ cfg_screen# {
661 UITextcxx . . $ UIText# m_primary_titlecxx . . $ wpnsel_cfg_screen#m_primary_title.;
662 UITextcxx . . $ UIText# m_primary_lowcxx . . $ wpnsel_cfg_screen#m_primary_low.;
663 UITextcxx . . $ UIText# m_primary_highcxx . . $ wpnsel_cfg_screen#m_primary_high.;
664 newuiTinyButtoncxx . . $ newuiTinyButton# m_primary_disablescxx . . $ wpnsel_cfg_screen#m_primary_disables.[MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!];
665 newuiButtoncxx . . $ newuiButton# m_primary_buttonscxx . . $ wpnsel_cfg_screen#m_primary_buttons.[MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!];
666 UITextcxx . . $ UIText# m_secondary_titlecxx . . $ wpnsel_cfg_screen#m_secondary_title.;
667 UITextcxx . . $ UIText# m_secondary_lowcxx . . $ wpnsel_cfg_screen#m_secondary_low.;
668 UITextcxx . . $ UIText# m_secondary_highcxx . . $ wpnsel_cfg_screen#m_secondary_high.;
669 newuiTinyButtoncxx . . $ newuiTinyButton# m_secondary_disablescxx . . $ wpnsel_cfg_screen#m_secondary_disables.[MAX_SECONDARY_WEAPONScxx . . $ `Descent3/weapon.h:203:9`!];
670 newuiButtoncxx . . $ newuiButton# m_secondary_buttonscxx . . $ wpnsel_cfg_screen#m_secondary_buttons.[MAX_SECONDARY_WEAPONScxx . . $ `Descent3/weapon.h:203:9`!];
671 UITextcxx . . $ UIText# m_weapon_choosecxx . . $ wpnsel_cfg_screen#m_weapon_choose.;
672 newuiButtoncxx . . $ newuiButton# m_reset_btncxx . . $ wpnsel_cfg_screen#m_reset_btn.;
673 int m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status.; // -1 = no selection, 0 = primary, 1 = secondary
674 int m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot.;
675
676 public:
677 virtual void setupcxx . . $ wpnsel_cfg_screen#setup(69eaa751469a2e53).(newuiLargeMenucxx . . $ newuiLargeMenu# *menu);
678 virtual void finishcxx . . $ wpnsel_cfg_screen#finish(49f6e7a06ebc5aa8).();
679 virtual void processcxx . . $ wpnsel_cfg_screen#process(d4f767463ce0a6b3).(int res);
680 virtual void realizecxx . . $ wpnsel_cfg_screen#realize(49f6e7a06ebc5aa8).();
681 virtual void unrealizecxx . . $ wpnsel_cfg_screen#unrealize(49f6e7a06ebc5aa8).();
682 };
683 void wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen#::setupcxx . . $ wpnsel_cfg_screen#setup(69eaa751469a2e53).(newuiLargeMenucxx . . $ newuiLargeMenu# *menu) {
684 m_menucxx . . $ cfg_screen#m_menu. = menu;
685 m_sheetcxx . . $ cfg_screen#m_sheet. = menu->AddOptioncxx . . $ newuiLargeMenu#AddOption(2e05a335277a5351).(IDV_WPNSELcxx . . $ `Descent3/ctlconfig.cpp:297:9`!, TXT_WPNSELPRECcxx . . $ `Descent3/stringtable.h:195:9`!);
686 m_sheetcxx . . $ cfg_screen#m_sheet.->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 20);
687 m_sheetcxx . . $ cfg_screen#m_sheet.->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXT_WPNCFGHELP0cxx . . $ `Descent3/stringtable.h:412:9`!);
688 m_sheetcxx . . $ cfg_screen#m_sheet.->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXT_WPNCFGHELP1cxx . . $ `Descent3/stringtable.h:413:9`!);
689 m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. = -1;
690 m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot. = -1;
691 }
692 void wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen#::finishcxx . . $ wpnsel_cfg_screen#finish(49f6e7a06ebc5aa8).() {}
693 void wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen#::processcxx . . $ wpnsel_cfg_screen#process(d4f767463ce0a6b3).(int res) {
694 int slot, i;
695 bool is_secondary = false, do_swap_ui = false, do_disable_ui = false, update_buttons = false;
696 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "res=%d\n", res);
697 if (m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. == -1) {
698 if (res == UID_RESETDEFAULTScxx . . $ `Descent3/ctlconfig.cpp:417:9`!) {
699 for (i = 0; i < MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!; i++)
700 SetAutoSelectPrimaryWpnIdxcxx . . $ SetAutoSelectPrimaryWpnIdx(a7050f1a4cb56049).(i, DefaultPrimarySelectListcxx . . $ DefaultPrimarySelectList.[i]);
701 for (i = 0; i < MAX_SECONDARY_WEAPONScxx . . $ `Descent3/weapon.h:203:9`!; i++)
702 SetAutoSelectSecondaryWpnIdxcxx . . $ SetAutoSelectSecondaryWpnIdx(a7050f1a4cb56049).(i, DefaultSecondarySelectListcxx . . $ DefaultSecondarySelectList.[i]);
703 update_buttons = true;
704 } else if (res == UID_CLEAR_SLOTcxx . . $ `Descent3/ctlconfig.cpp:419:9`!) {
705 // figure out id of current gadget highlighted.
706 UIGadgetcxx . . $ UIGadget# *gadget = m_menucxx . . $ cfg_screen#m_menu.->GetFocuscxx . . $ UIWindow#GetFocus(42baa2535cd0f5f7).();
707 if (gadget) {
708 // below code will then determine the correct information.
709 res = gadget->GetIDcxx . . $ UIGadget#GetID(455f465bc33b4cdf).();
710 do_disable_ui = true;
711 }
712 }
713 }
714 slot = -1;
715 if (res >= UID_PRIMARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:412:9`! && res < (UID_PRIMARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:412:9`! + MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!) && m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. != 1) {
716 slot = res - UID_PRIMARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:412:9`!;
717 is_secondary = false;
718 if (!do_disable_ui)
719 do_swap_ui = true;
720 } else if (res >= UID_SECONDARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:414:9`! && res < (UID_SECONDARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:414:9`! + MAX_SECONDARY_WEAPONScxx . . $ `Descent3/weapon.h:203:9`!) && m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. != 0) {
721 slot = res - UID_SECONDARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:414:9`!;
722 is_secondary = true;
723 if (!do_disable_ui)
724 do_swap_ui = true;
725 } else if (res >= UID_PRIMARY_DIScxx . . $ `Descent3/ctlconfig.cpp:413:9`! && res < (UID_PRIMARY_DIScxx . . $ `Descent3/ctlconfig.cpp:413:9`! + MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!) && m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. == -1) {
726 slot = res - UID_PRIMARY_DIScxx . . $ `Descent3/ctlconfig.cpp:413:9`!;
727 is_secondary = false;
728 do_disable_ui = true;
729 } else if (res >= UID_SECONDARY_DIScxx . . $ `Descent3/ctlconfig.cpp:415:9`! && res < (UID_SECONDARY_DIScxx . . $ `Descent3/ctlconfig.cpp:415:9`! + MAX_SECONDARY_WEAPONScxx . . $ `Descent3/weapon.h:203:9`!) &&
730 m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. == -1) {
731 slot = res - UID_SECONDARY_DIScxx . . $ `Descent3/ctlconfig.cpp:415:9`!;
732 is_secondary = true;
733 do_disable_ui = true;
734 }
735 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "slot=%d\n", slot);
736
737 // do different uis
738 if (do_disable_ui) {
739 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_selection_status == -1 && slot != -1);
740 uint16_tcxx . . $ uint16_t# wpnidx = is_secondary ? GetAutoSelectSecondaryWpnIdxcxx . . $ GetAutoSelectSecondaryWpnIdx(1ab5934a54f935a6).(slot) : GetAutoSelectPrimaryWpnIdxcxx . . $ GetAutoSelectPrimaryWpnIdx(1ab5934a54f935a6).(slot);
741 wpnidx = wpnidx ^ WPNSEL_SKIPcxx . . $ WPNSEL_SKIP.;
742 if (is_secondary) {
743 SetAutoSelectSecondaryWpnIdxcxx . . $ SetAutoSelectSecondaryWpnIdx(a7050f1a4cb56049).(slot, wpnidx);
744 } else {
745 SetAutoSelectPrimaryWpnIdxcxx . . $ SetAutoSelectPrimaryWpnIdx(a7050f1a4cb56049).(slot, wpnidx);
746 }
747 update_buttons = true;
748 }
749 // here we see if we are selecting a weapon to switch with another, if one is already selected, we
750 // see if the user has selected another (in the same category)
751 //
752 else if (do_swap_ui) {
753 uint16_tcxx . . $ uint16_t# wpnidx;
754 if (slot != -1) {
755 if (m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. == -1) {
756 m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot. = slot;
757 m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. = is_secondary ? 1 : 0;
758 // disable proper controls here.
759 for (i = 0; i < MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!; i++) {
760 if (m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. == 1) {
761 m_primary_disablescxx . . $ wpnsel_cfg_screen#m_primary_disables.[i].Disablecxx . . $ UIButton#Disable(49f6e7a06ebc5aa8).();
762 m_primary_buttonscxx . . $ wpnsel_cfg_screen#m_primary_buttons.[i].Disablecxx . . $ UIButton#Disable(49f6e7a06ebc5aa8).();
763 } else {
764 m_secondary_disablescxx . . $ wpnsel_cfg_screen#m_secondary_disables.[i].Disablecxx . . $ UIButton#Disable(49f6e7a06ebc5aa8).();
765 m_secondary_buttonscxx . . $ wpnsel_cfg_screen#m_secondary_buttons.[i].Disablecxx . . $ UIButton#Disable(49f6e7a06ebc5aa8).();
766 }
767 }
768 if (!m_weapon_choosecxx . . $ wpnsel_cfg_screen#m_weapon_choose..IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).()) {
769 UIGadgetcxx . . $ UIGadget# *focused_gadget = m_menucxx . . $ cfg_screen#m_menu.->GetFocuscxx . . $ UIWindow#GetFocus(42baa2535cd0f5f7).();
770 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, TXT_WPNCFGHELP2cxx . . $ `Descent3/stringtable.h:879:9`!, GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(240, 240, 0)};
771 m_weapon_choosecxx . . $ wpnsel_cfg_screen#m_weapon_choose..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &item, WPNSEL_PRIMARY_Xcxx . . $ `Descent3/ctlconfig.cpp:655:9`!, WPNSEL_PRIMARY_Ycxx . . $ `Descent3/ctlconfig.cpp:656:9`! - 48);
772 if (focused_gadget)
773 m_menucxx . . $ cfg_screen#m_menu.->SetFocusOnGadgetcxx . . $ UIWindow#SetFocusOnGadget(75ffd377f9406104).(focused_gadget);
774 }
775 } else {
776 int slot_idx = m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot.;
777 uint16_tcxx . . $ uint16_t# new_wpnidx =
778 is_secondary ? GetAutoSelectSecondaryWpnIdxcxx . . $ GetAutoSelectSecondaryWpnIdx(1ab5934a54f935a6).(m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot.) : GetAutoSelectPrimaryWpnIdxcxx . . $ GetAutoSelectPrimaryWpnIdx(1ab5934a54f935a6).(m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot.);
779
780 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_switch_slot != -1);
781 if (slot > m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot.) {
782 new_wpnidx =
783 is_secondary ? GetAutoSelectSecondaryWpnIdxcxx . . $ GetAutoSelectSecondaryWpnIdx(1ab5934a54f935a6).(m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot.) : GetAutoSelectPrimaryWpnIdxcxx . . $ GetAutoSelectPrimaryWpnIdx(1ab5934a54f935a6).(m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot.);
784 while (slot_idx < slot) {
785 if (is_secondary) {
786 wpnidx = GetAutoSelectSecondaryWpnIdxcxx . . $ GetAutoSelectSecondaryWpnIdx(1ab5934a54f935a6).(slot_idx + 1);
787 SetAutoSelectSecondaryWpnIdxcxx . . $ SetAutoSelectSecondaryWpnIdx(a7050f1a4cb56049).(slot_idx, wpnidx);
788 } else {
789 wpnidx = GetAutoSelectPrimaryWpnIdxcxx . . $ GetAutoSelectPrimaryWpnIdx(1ab5934a54f935a6).(slot_idx + 1);
790 SetAutoSelectPrimaryWpnIdxcxx . . $ SetAutoSelectPrimaryWpnIdx(a7050f1a4cb56049).(slot_idx, wpnidx);
791 }
792 slot_idx++;
793 }
794 update_buttons = true;
795 } else if (slot < m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot.) {
796 while (slot_idx > slot) {
797 if (is_secondary) {
798 wpnidx = GetAutoSelectSecondaryWpnIdxcxx . . $ GetAutoSelectSecondaryWpnIdx(1ab5934a54f935a6).(slot_idx - 1);
799 SetAutoSelectSecondaryWpnIdxcxx . . $ SetAutoSelectSecondaryWpnIdx(a7050f1a4cb56049).(slot_idx, wpnidx);
800 } else {
801 wpnidx = GetAutoSelectPrimaryWpnIdxcxx . . $ GetAutoSelectPrimaryWpnIdx(1ab5934a54f935a6).(slot_idx - 1);
802 SetAutoSelectPrimaryWpnIdxcxx . . $ SetAutoSelectPrimaryWpnIdx(a7050f1a4cb56049).(slot_idx, wpnidx);
803 }
804 slot_idx--;
805 }
806 update_buttons = true;
807 }
808 if (is_secondary) {
809 SetAutoSelectSecondaryWpnIdxcxx . . $ SetAutoSelectSecondaryWpnIdx(a7050f1a4cb56049).(slot, new_wpnidx);
810 } else {
811 SetAutoSelectPrimaryWpnIdxcxx . . $ SetAutoSelectPrimaryWpnIdx(a7050f1a4cb56049).(slot, new_wpnidx);
812 }
813 m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. = -1;
814 m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot. = -1;
815 if (m_weapon_choosecxx . . $ wpnsel_cfg_screen#m_weapon_choose..IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).()) {
816 m_weapon_choosecxx . . $ wpnsel_cfg_screen#m_weapon_choose..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
817 }
818 }
819 }
820 }
821 // if above actions modified buttons, refresh em.
822 if (update_buttons) {
823 wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen#::unrealizecxx . . $ wpnsel_cfg_screen#unrealize(49f6e7a06ebc5aa8).();
824 wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen#::realizecxx . . $ wpnsel_cfg_screen#realize(49f6e7a06ebc5aa8).();
825 }
826 }
827 void wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen#::realizecxx . . $ wpnsel_cfg_screen#realize(49f6e7a06ebc5aa8).() {
828 int i;
829 // make sure and reset these here.
830 m_selection_statuscxx . . $ wpnsel_cfg_screen#m_selection_status. = -1;
831 m_switch_slotcxx . . $ wpnsel_cfg_screen#m_switch_slot. = -1;
832
833 m_reset_btncxx . . $ wpnsel_cfg_screen#m_reset_btn..Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_menucxx . . $ cfg_screen#m_menu., UID_RESETDEFAULTScxx . . $ `Descent3/ctlconfig.cpp:417:9`!, TXT_RESETTODEFAULTcxx . . $ `Descent3/stringtable.h:427:9`!, KEYCFG_EXTRAS_Xcxx . . $ `Descent3/ctlconfig.cpp:437:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Xcxx . . $ newuiSheet#X(455f465bc33b4cdf).(),
834 KEYCFG_EXTRAS_Ycxx . . $ `Descent3/ctlconfig.cpp:438:9`! + m_sheetcxx . . $ cfg_screen#m_sheet.->Ycxx . . $ newuiSheet#Y(455f465bc33b4cdf).(), NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
835 UITextItemcxx . . $ UITextItem# itemPrimaryTitlecxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, TXT_PRIMARYcxx . . $ `Descent3/stringtable.h:417:9`!};
836 m_primary_titlecxx . . $ wpnsel_cfg_screen#m_primary_title..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemPrimaryTitle, WPNSEL_PRIMARY_Xcxx . . $ `Descent3/ctlconfig.cpp:655:9`!, WPNSEL_PRIMARY_Ycxx . . $ `Descent3/ctlconfig.cpp:656:9`! - 28);
837 UITextItemcxx . . $ UITextItem# itemSecondaryTitlecxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, TXT_SECONDARYcxx . . $ `Descent3/stringtable.h:418:9`!};
838 m_secondary_titlecxx . . $ wpnsel_cfg_screen#m_secondary_title..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemSecondaryTitle, WPNSEL_SECONDARY_Xcxx . . $ `Descent3/ctlconfig.cpp:657:9`!, WPNSEL_SECONDARY_Ycxx . . $ `Descent3/ctlconfig.cpp:658:9`! - 28);
839 UITextItemcxx . . $ UITextItem# itemLowPriorityTitlecxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, TXT_LOWPRIORITYcxx . . $ `Descent3/stringtable.h:419:9`!};
840 m_primary_lowcxx . . $ wpnsel_cfg_screen#m_primary_low..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemLowPriorityTitle, WPNSEL_PRIMARY_Xcxx . . $ `Descent3/ctlconfig.cpp:655:9`!, WPNSEL_SECONDARY_Ycxx . . $ `Descent3/ctlconfig.cpp:658:9`! - 11);
841 m_secondary_lowcxx . . $ wpnsel_cfg_screen#m_secondary_low..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemLowPriorityTitle, WPNSEL_SECONDARY_Xcxx . . $ `Descent3/ctlconfig.cpp:657:9`!, WPNSEL_SECONDARY_Ycxx . . $ `Descent3/ctlconfig.cpp:658:9`! - 11);
842 for (i = 0; i < MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!; i++) {
843 int wpnidx;
844 char str[64];
845 wpnidx = GetAutoSelectPrimaryWpnIdxcxx . . $ GetAutoSelectPrimaryWpnIdx(1ab5934a54f935a6).(i);
846 if (wpnidx != WPNSEL_INVALIDcxx . . $ WPNSEL_INVALID.) {
847 if (wpnidx & WPNSEL_SKIPcxx . . $ WPNSEL_SKIP.) {
848 wpnidx &= (~WPNSEL_SKIPcxx . . $ WPNSEL_SKIP.);
849 snprintf(str, sizeof(str), TXT_WPNSELBTNcxx . . $ `Descent3/stringtable.h:153:9`!, TXTcxx . . $ `Descent3/stringtable.h:24:9`!(Static_weapon_names_msg[wpnidx]));
850 } else {
851 snprintf(str, sizeof(str), "%s", TXTcxx . . $ `Descent3/stringtable.h:24:9`!(Static_weapon_names_msg[wpnidx]));
852 }
853 m_primary_disablescxx . . $ wpnsel_cfg_screen#m_primary_disables.[i].Createcxx . . $ newuiTinyButton#Create(752e5b2327f90754).(m_menucxx . . $ cfg_screen#m_menu., UID_PRIMARY_DIScxx . . $ `Descent3/ctlconfig.cpp:413:9`! + i, "X", WPNSEL_PRIMARY_Xcxx . . $ `Descent3/ctlconfig.cpp:655:9`!, WPNSEL_PRIMARY_Ycxx . . $ `Descent3/ctlconfig.cpp:656:9`! + i * 12);
854 m_primary_buttonscxx . . $ wpnsel_cfg_screen#m_primary_buttons.[i].Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_menucxx . . $ cfg_screen#m_menu., UID_PRIMARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:412:9`! + i, str, WPNSEL_PRIMARY_Xcxx . . $ `Descent3/ctlconfig.cpp:655:9`! + 28, WPNSEL_PRIMARY_Ycxx . . $ `Descent3/ctlconfig.cpp:656:9`! + i * 12,
855 NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
856 }
857 wpnidx = GetAutoSelectSecondaryWpnIdxcxx . . $ GetAutoSelectSecondaryWpnIdx(1ab5934a54f935a6).(i);
858 if (wpnidx != WPNSEL_INVALIDcxx . . $ WPNSEL_INVALID.) {
859 if (wpnidx & WPNSEL_SKIPcxx . . $ WPNSEL_SKIP.) {
860 wpnidx &= (~WPNSEL_SKIPcxx . . $ WPNSEL_SKIP.);
861 snprintf(str, sizeof(str), TXT_WPNSELBTNcxx . . $ `Descent3/stringtable.h:153:9`!, TXTcxx . . $ `Descent3/stringtable.h:24:9`!(Static_weapon_names_msg[wpnidx]));
862 } else {
863 snprintf(str, sizeof(str), "%s", TXTcxx . . $ `Descent3/stringtable.h:24:9`!(Static_weapon_names_msg[wpnidx]));
864 }
865 m_secondary_disablescxx . . $ wpnsel_cfg_screen#m_secondary_disables.[i].Createcxx . . $ newuiTinyButton#Create(752e5b2327f90754).(m_menucxx . . $ cfg_screen#m_menu., UID_SECONDARY_DIScxx . . $ `Descent3/ctlconfig.cpp:415:9`! + i, "X", WPNSEL_SECONDARY_Xcxx . . $ `Descent3/ctlconfig.cpp:657:9`!,
866 WPNSEL_SECONDARY_Ycxx . . $ `Descent3/ctlconfig.cpp:658:9`! + i * 12);
867 m_secondary_buttonscxx . . $ wpnsel_cfg_screen#m_secondary_buttons.[i].Createcxx . . $ newuiButton#Create(6c82988af4899650).(m_menucxx . . $ cfg_screen#m_menu., UID_SECONDARY_WPNcxx . . $ `Descent3/ctlconfig.cpp:414:9`! + i, str, WPNSEL_SECONDARY_Xcxx . . $ `Descent3/ctlconfig.cpp:657:9`! + 28,
868 WPNSEL_SECONDARY_Ycxx . . $ `Descent3/ctlconfig.cpp:658:9`! + i * 12, NEWUI_BTNF_LONGcxx . . $ `Descent3/newui_core.h:185:9`!);
869 }
870 }
871 UITextItemcxx . . $ UITextItem# itemHighPrioritycxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, TXT_HIGHPRIORITYcxx . . $ `Descent3/stringtable.h:420:9`!};
872 m_primary_highcxx . . $ wpnsel_cfg_screen#m_primary_high..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemHighPriority, WPNSEL_PRIMARY_Xcxx . . $ `Descent3/ctlconfig.cpp:655:9`!, WPNSEL_PRIMARY_Ycxx . . $ `Descent3/ctlconfig.cpp:656:9`! + i * 12 + 2);
873 m_secondary_highcxx . . $ wpnsel_cfg_screen#m_secondary_high..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_menucxx . . $ cfg_screen#m_menu., &itemHighPriority, WPNSEL_SECONDARY_Xcxx . . $ `Descent3/ctlconfig.cpp:657:9`!, WPNSEL_SECONDARY_Ycxx . . $ `Descent3/ctlconfig.cpp:658:9`! + i * 12 + 2);
874 // add accelerator keys
875 m_menucxx . . $ cfg_screen#m_menu.->AddAcceleratorKeycxx . . $ UIWindow#AddAcceleratorKey(3e454b8ccf442868).(KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_Ccxx . . $ `ddio/ddio_common.h:231:9`!, UID_CLEAR_SLOTcxx . . $ `Descent3/ctlconfig.cpp:419:9`!);
876 }
877 void wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen#::unrealizecxx . . $ wpnsel_cfg_screen#unrealize(49f6e7a06ebc5aa8).() {
878 int i;
879 m_menucxx . . $ cfg_screen#m_menu.->ResetAcceleratorKeycxx . . $ UIWindow#ResetAcceleratorKey(49f6e7a06ebc5aa8).();
880 if (m_weapon_choosecxx . . $ wpnsel_cfg_screen#m_weapon_choose..IsCreatedcxx . . $ UIObject#IsCreated(50ce9a9e25b4a850).()) {
881 m_weapon_choosecxx . . $ wpnsel_cfg_screen#m_weapon_choose..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
882 }
883 for (i = 0; i < MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!; i++) {
884 m_primary_buttonscxx . . $ wpnsel_cfg_screen#m_primary_buttons.[i].Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
885 m_primary_disablescxx . . $ wpnsel_cfg_screen#m_primary_disables.[i].Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
886 m_secondary_buttonscxx . . $ wpnsel_cfg_screen#m_secondary_buttons.[i].Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
887 m_secondary_disablescxx . . $ wpnsel_cfg_screen#m_secondary_disables.[i].Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
888 }
889 m_secondary_highcxx . . $ wpnsel_cfg_screen#m_secondary_high..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
890 m_primary_highcxx . . $ wpnsel_cfg_screen#m_primary_high..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
891
892 m_secondary_lowcxx . . $ wpnsel_cfg_screen#m_secondary_low..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
893 m_primary_lowcxx . . $ wpnsel_cfg_screen#m_primary_low..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
894 m_secondary_titlecxx . . $ wpnsel_cfg_screen#m_secondary_title..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
895 m_primary_titlecxx . . $ wpnsel_cfg_screen#m_primary_title..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
896
897 m_reset_btncxx . . $ wpnsel_cfg_screen#m_reset_btn..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
898 }
899 //////////////////////////////////////////////////////////////////////////////
900 // this will take out any repeats of element and slot in function id.
901 void ctl_cfg_set_and_verify_changescxx . . $ ctl_cfg_set_and_verify_changes(d3584dfdf09776).(int16_tcxx . . $ int16_t# fnid, ct_typecxx . . $ ct_type# elem_type, uint8_tcxx . . $ uint8_t# ctrl, uint8_tcxx . . $ uint8_t# elem, int8_tcxx . . $ int8_t# slot) {
902 ct_typecxx . . $ ct_type# ctype_fn[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
903 uint8_tcxx . . $ uint8_t# cfgflags_fn[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
904 ct_config_datacxx . . $ ct_config_data# ccfgdata_fn;
905 t_cfg_elementcxx . . $ t_cfg_element# *fn_list;
906 tCfgDataPartscxx . . $ tCfgDataParts# cfgparts;
907 int i, n_fn;
908 if (fnid == -1) {
909 Int3cxx . . $ `misc/pserror.h:247:9`!(); // get samir
910 return;
911 }
912 ASSERTcxx . . $ `misc/pserror.h:246:9`!(slot < N_CFGELEM_SLOTScxx . . $ `Descent3/CtlCfgElem.h:87:9`! && slot >= 0);
913 if (ctrl == NULL_CONTROLLERcxx . . $ `lib/Controller.h:181:9`!) {
914 return;
915 }
916 // if element is repeated anywhere in function list other than 'fnid'[slot] of elem_type, then remove that
917 // binding.
918 if (elem_type == ctNonecxx . . $ ctNone.) {
919 Int3cxx . . $ `misc/pserror.h:247:9`!();
920 return;
921 } else if (elem_type == ctKeycxx . . $ ctKey.) {
922 n_fn = N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!;
923 fn_list = Cfg_key_elementscxx . . $ Cfg_key_elements.;
924 } else {
925 n_fn = N_JOY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:404:9`!;
926 fn_list = Cfg_joy_elementscxx . . $ Cfg_joy_elements.;
927 }
928 for (i = 0; i < n_fn; i++) {
929 // get current function. if element in any slot matches elem_type, and elem, then remove it.
930 bool match_found = false;
931 Controllercxx . . $ Controller.->get_controller_functioncxx . . $ gameController#get_controller_function(c004c324aa6068e0).(fn_list[i].fn_idcxx . . $ t_cfg_element#fn_id., ctype_fn, &ccfgdata_fn, cfgflags_fn);
932
933 parse_config_datacxx . . $ parse_config_data(7e428e3458f6a03b).(&cfgparts, ctype_fn[0], ctype_fn[1], ccfgdata_fn);
934 if (elem_type == ctype_fn[0] && elem == cfgparts.bind_0cxx . . $ tCfgDataParts#bind_0. && cfgparts.ctrl_0cxx . . $ tCfgDataParts#ctrl_0. == ctrl) {
935 // match found! clear this part out.
936 cfgparts.bind_0cxx . . $ tCfgDataParts#bind_0. = NULL_BINDINGcxx . . $ `lib/Controller.h:180:9`!;
937 cfgparts.ctrl_0cxx . . $ tCfgDataParts#ctrl_0. = NULL_CONTROLLERcxx . . $ `lib/Controller.h:181:9`!;
938 match_found = true;
939 }
940 if (elem_type == ctype_fn[1] && elem == cfgparts.bind_1cxx . . $ tCfgDataParts#bind_1. && cfgparts.ctrl_1cxx . . $ tCfgDataParts#ctrl_1. == ctrl) {
941 // match found! clear this part out.
942 cfgparts.bind_1cxx . . $ tCfgDataParts#bind_1. = NULL_BINDINGcxx . . $ `lib/Controller.h:180:9`!;
943 cfgparts.ctrl_1cxx . . $ tCfgDataParts#ctrl_1. = NULL_CONTROLLERcxx . . $ `lib/Controller.h:181:9`!;
944 match_found = true;
945 }
946 if (match_found) {
947 // this will effectively clear any matches found.
948 ccfgdata_fn = unify_config_datacxx . . $ unify_config_data(93c052a99c9f35a1).(&cfgparts);
949 Controllercxx . . $ Controller.->set_controller_functioncxx . . $ gameController#set_controller_function(a87bf4975f40b925).(fn_list[i].fn_idcxx . . $ t_cfg_element#fn_id., ctype_fn, ccfgdata_fn, cfgflags_fn);
950 }
951 }
952 Controllercxx . . $ Controller.->get_controller_functioncxx . . $ gameController#get_controller_function(c004c324aa6068e0).(fnid, ctype_fn, &ccfgdata_fn, cfgflags_fn);
953
954 parse_config_datacxx . . $ parse_config_data(7e428e3458f6a03b).(&cfgparts, ctype_fn[0], ctype_fn[1], ccfgdata_fn);
955
956 ctype_fn[slot] = elem_type;
957 cfgflags_fn[slot] = 0;
958 if (slot == 1) {
959 cfgparts.bind_1cxx . . $ tCfgDataParts#bind_1. = elem;
960 cfgparts.ctrl_1cxx . . $ tCfgDataParts#ctrl_1. = ctrl;
961 } else {
962 cfgparts.bind_0cxx . . $ tCfgDataParts#bind_0. = elem;
963 cfgparts.ctrl_0cxx . . $ tCfgDataParts#ctrl_0. = ctrl;
964 }
965 ccfgdata_fn = unify_config_datacxx . . $ unify_config_data(93c052a99c9f35a1).(&cfgparts);
966 Controllercxx . . $ Controller.->set_controller_functioncxx . . $ gameController#set_controller_function(a87bf4975f40b925).(fnid, ctype_fn, ccfgdata_fn, cfgflags_fn);
967 }
968 // used as a help/options dialog for each controller config element
969 void ctl_cfg_element_options_dialogcxx . . $ ctl_cfg_element_options_dialog(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# fnid) {
970 newuiTiledWindowcxx . . $ newuiTiledWindow# wndcxx . . $ newuiTiledWindow#newuiTiledWindow(49f6e7a06ebc5aa8).;
971 newuiSheetcxx . . $ newuiSheet# *sheet;
972 int *inv_binding[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
973 bool *clear_binding[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
974 ct_typecxx . . $ ct_type# ctype_fn[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
975 uint8_tcxx . . $ uint8_t# cfgflags_fn[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
976 ct_config_datacxx . . $ ct_config_data# ccfgdata_fn;
977
978 tCfgDataPartscxx . . $ tCfgDataParts# cfgparts;
979 int res, y;
980 char str[64];
981
982 if (fnid == -1) {
983 Int3cxx . . $ `misc/pserror.h:247:9`!(); // get samir
984 return;
985 }
986 // determine which configuration pipe to go down
987 Controllercxx . . $ Controller.->get_controller_functioncxx . . $ gameController#get_controller_function(c004c324aa6068e0).(fnid, ctype_fn, &ccfgdata_fn, cfgflags_fn);
988 parse_config_datacxx . . $ parse_config_data(7e428e3458f6a03b).(&cfgparts, ctype_fn[0], ctype_fn[1], ccfgdata_fn);
989 switch (ctype_fn[0]) {
990 case ctKeycxx . . $ ctKey.:
991 strcpy(str, TXT_CFGHELP_KEYBcxx . . $ `Descent3/stringtable.h:176:9`!);
992 break;
993 case ctAxiscxx . . $ ctAxis.:
994 case ctMouseAxiscxx . . $ ctMouseAxis.:
995 strcpy(str, TXT_CFGHELP_JOYcxx . . $ `Descent3/stringtable.h:327:9`!);
996 break;
997 case ctButtoncxx . . $ ctButton.:
998 case ctMouseButtoncxx . . $ ctMouseButton.:
999 case ctPOVcxx . . $ ctPOV.:
1000 case ctPOV2cxx . . $ ctPOV2.:
1001 case ctPOV3cxx . . $ ctPOV3.:
1002 case ctPOV4cxx . . $ ctPOV4.:
1003 strcpy(str, TXT_CFGHELP_BTNScxx . . $ `Descent3/stringtable.h:337:9`!);
1004 break;
1005 default:
1006 str[0] = 0;
1007 }
1008 // open a small window
1009 wnd.Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 0, 320, 192);
1010 sheet = wnd.GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).();
1011 // the standard ok and cancel buttons
1012 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 116, 110, NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
1013 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, UID_OKcxx . . $ `ui/ui.h:368:9`!);
1014 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!, UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
1015 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 0);
1016 sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXT_CFGHELP_TEXTcxx . . $ `Descent3/stringtable.h:414:9`!);
1017 sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(str);
1018 y = 40;
1019 // check if there's a binding, if so, then check if we should put up invert axis option.
1020 clear_binding[0] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1021 inv_binding[0] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1022 if (cfgparts.ctrl_0cxx . . $ tCfgDataParts#ctrl_0. != NULL_CONTROLLERcxx . . $ `lib/Controller.h:181:9`!) {
1023 snprintf(str, sizeof(str), TXT_CFG_BIND_1cxx . . $ `Descent3/stringtable.h:339:9`!, cfg_binding_textcxx . . $ cfg_binding_text(c156078267dcf458).(ctype_fn[0], cfgparts.ctrl_0cxx . . $ tCfgDataParts#ctrl_0., cfgparts.bind_0cxx . . $ tCfgDataParts#bind_0.));
1024 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(str, 0, y, NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
1025 clear_binding[0] = sheet->AddCheckBoxcxx . . $ newuiSheet#AddCheckBox(b1b99af17a84c782).(TXT_CFG_CLEARcxx . . $ `Descent3/stringtable.h:345:9`!);
1026 if (ctype_fn[0] == ctAxiscxx . . $ ctAxis. || ctype_fn[0] == ctMouseAxiscxx . . $ ctMouseAxis.) {
1027 sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXT_CFG_INVERTcxx . . $ `Descent3/stringtable.h:426:9`!);
1028 inv_binding[0] = sheet->AddFirstRadioButtoncxx . . $ newuiSheet#AddFirstRadioButton(c0389c32fb6fc938).(TXT_NOcxx . . $ `Descent3/stringtable.h:112:9`!);
1029 sheet->AddRadioButtoncxx . . $ newuiSheet#AddRadioButton(9a5cb738bb1a644).(TXT_YEScxx . . $ `Descent3/stringtable.h:113:9`!);
1030 *inv_binding[0] = CHECK_FLAGcxx . . $ `lib/Macros.h:63:9`!(cfgflags_fn[0], CTFNF_INVERTcxx . . $ `lib/Controller.h:178:9`!) ? 1 : 0;
1031 }
1032 y += 30;
1033 }
1034 // check if there's a binding, if so, then check if we should put up invert axis option.
1035 clear_binding[1] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1036 inv_binding[1] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1037 if (cfgparts.ctrl_1cxx . . $ tCfgDataParts#ctrl_1. != NULL_CONTROLLERcxx . . $ `lib/Controller.h:181:9`!) {
1038 snprintf(str, sizeof(str), TXT_CFG_BIND_2cxx . . $ `Descent3/stringtable.h:340:9`!, cfg_binding_textcxx . . $ cfg_binding_text(c156078267dcf458).(ctype_fn[1], cfgparts.ctrl_1cxx . . $ tCfgDataParts#ctrl_1., cfgparts.bind_1cxx . . $ tCfgDataParts#bind_1.));
1039 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(str, 0, y, NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
1040 clear_binding[1] = sheet->AddCheckBoxcxx . . $ newuiSheet#AddCheckBox(b1b99af17a84c782).(TXT_CFG_CLEARcxx . . $ `Descent3/stringtable.h:345:9`!);
1041 if (ctype_fn[1] == ctAxiscxx . . $ ctAxis. || ctype_fn[1] == ctMouseAxiscxx . . $ ctMouseAxis.) {
1042 sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXT_CFG_INVERTcxx . . $ `Descent3/stringtable.h:426:9`!);
1043 inv_binding[1] = sheet->AddFirstRadioButtoncxx . . $ newuiSheet#AddFirstRadioButton(c0389c32fb6fc938).(TXT_NOcxx . . $ `Descent3/stringtable.h:112:9`!);
1044 sheet->AddRadioButtoncxx . . $ newuiSheet#AddRadioButton(9a5cb738bb1a644).(TXT_YEScxx . . $ `Descent3/stringtable.h:113:9`!);
1045 *inv_binding[1] = CHECK_FLAGcxx . . $ `lib/Macros.h:63:9`!(cfgflags_fn[1], CTFNF_INVERTcxx . . $ `lib/Controller.h:178:9`!) ? 1 : 0;
1046 }
1047 y += 30;
1048 }
1049 wnd.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
1050 do {
1051 res = wnd.DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).();
1052 if (res == NEWUIRES_FORCEQUITcxx . . $ `Descent3/newui_core.h:131:9`!) {
1053 break;
1054 }
1055 } while (res != UID_OKcxx . . $ `ui/ui.h:368:9`! && res != UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
1056 if (res == UID_OKcxx . . $ `ui/ui.h:368:9`!) {
1057 if (clear_binding[0] && (*clear_binding[0])) {
1058 cfgparts.bind_0cxx . . $ tCfgDataParts#bind_0. = NULL_BINDINGcxx . . $ `lib/Controller.h:180:9`!;
1059 cfgparts.ctrl_0cxx . . $ tCfgDataParts#ctrl_0. = NULL_CONTROLLERcxx . . $ `lib/Controller.h:181:9`!;
1060 }
1061 if (clear_binding[1] && (*clear_binding[1])) {
1062 cfgparts.bind_1cxx . . $ tCfgDataParts#bind_1. = NULL_BINDINGcxx . . $ `lib/Controller.h:180:9`!;
1063 cfgparts.ctrl_1cxx . . $ tCfgDataParts#ctrl_1. = NULL_CONTROLLERcxx . . $ `lib/Controller.h:181:9`!;
1064 }
1065 if (inv_binding[0]) {
1066 cfgflags_fn[0] = (*inv_binding[0]) ? (cfgflags_fn[0] | CTFNF_INVERTcxx . . $ `lib/Controller.h:178:9`!) : (cfgflags_fn[0] & (~CTFNF_INVERTcxx . . $ `lib/Controller.h:178:9`!));
1067 }
1068 if (inv_binding[1]) {
1069 cfgflags_fn[1] = (*inv_binding[1]) ? (cfgflags_fn[1] | CTFNF_INVERTcxx . . $ `lib/Controller.h:178:9`!) : (cfgflags_fn[1] & (~CTFNF_INVERTcxx . . $ `lib/Controller.h:178:9`!));
1070 }
1071
1072 ccfgdata_fn = unify_config_datacxx . . $ unify_config_data(93c052a99c9f35a1).(&cfgparts);
1073 Controllercxx . . $ Controller.->set_controller_functioncxx . . $ gameController#set_controller_function(a87bf4975f40b925).(fnid, ctype_fn, ccfgdata_fn, cfgflags_fn);
1074 }
1075 wnd.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
1076 wnd.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
1077 }
1078 // used in weapon selection: returns new slot.
1079 int weapon_select_dialogcxx . . $ weapon_select_dialog(d455ce14f374a3ab).(int wpn, bool is_secondary) {
1080 newuiTiledWindowcxx . . $ newuiTiledWindow# wndcxx . . $ newuiTiledWindow#newuiTiledWindow(49f6e7a06ebc5aa8).;
1081 newuiListBoxcxx . . $ newuiListBox# *lbox;
1082 newuiSheetcxx . . $ newuiSheet# *sheet;
1083 int res, i;
1084 uint16_tcxx . . $ uint16_t# retval;
1085 wpn &= (~WPNSEL_SKIPcxx . . $ WPNSEL_SKIP.);
1086 wnd.Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 0, 320, 288);
1087 sheet = wnd.GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).();
1088 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 116, 210, NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
1089 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, UID_OKcxx . . $ `ui/ui.h:368:9`!);
1090 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!, UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
1091 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 0);
1092 sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXT_WPNCFGHELP3cxx . . $ `Descent3/stringtable.h:415:9`!);
1093 sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXTcxx . . $ `Descent3/stringtable.h:24:9`!(Static_weapon_names_msg[wpn]));
1094 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 40);
1095 lbox = sheet->AddListBoxcxx . . $ newuiSheet#AddListBox(b890ce7adcd9a5ed).(192, 160, UID_WPNLISTcxx . . $ `Descent3/ctlconfig.cpp:416:9`!, UILB_NOSORTcxx . . $ `ui/ui.h:356:9`!);
1096 // add primaries or secondaries.
1097 for (i = 0; i < 10; i++) {
1098 int wpnidx;
1099 char str[64];
1100 wpnidx = is_secondary ? GetAutoSelectSecondaryWpnIdxcxx . . $ GetAutoSelectSecondaryWpnIdx(1ab5934a54f935a6).(i) : GetAutoSelectPrimaryWpnIdxcxx . . $ GetAutoSelectPrimaryWpnIdx(1ab5934a54f935a6).(i);
1101 if (wpnidx != WPNSEL_INVALIDcxx . . $ WPNSEL_INVALID.) {
1102 if (wpnidx & WPNSEL_SKIPcxx . . $ WPNSEL_SKIP.) {
1103 wpnidx &= (~WPNSEL_SKIPcxx . . $ WPNSEL_SKIP.);
1104 snprintf(str, sizeof(str), TXT_WPNSELBTNcxx . . $ `Descent3/stringtable.h:153:9`!, TXTcxx . . $ `Descent3/stringtable.h:24:9`!(Static_weapon_names_msg[wpnidx]));
1105 } else {
1106 snprintf(str, sizeof(str), "%s", TXTcxx . . $ `Descent3/stringtable.h:24:9`!(Static_weapon_names_msg[wpnidx]));
1107 }
1108 lbox->AddItemcxx . . $ newuiListBox#AddItem(85c52e162fed56f9).(str);
1109 } else {
1110 lbox->AddItemcxx . . $ newuiListBox#AddItem(85c52e162fed56f9).("ERR-WPN");
1111 }
1112 }
1113 wnd.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
1114 res = wnd.DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).();
1115 wnd.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
1116 switch (res) {
1117 case UID_WPNLISTcxx . . $ `Descent3/ctlconfig.cpp:416:9`!:
1118 case UID_OKcxx . . $ `ui/ui.h:368:9`!:
1119 retval = lbox->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
1120 break;
1121 default:
1122 retval = -1;
1123 }
1124 wnd.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
1125
1126 return retval;
1127 }
1128 void joystick_calibrationcxx . . $ joystick_calibration(49f6e7a06ebc5aa8).() {
1129 }
1130 void joystick_settings_dialogcxx . . $ joystick_settings_dialog(49f6e7a06ebc5aa8).() {
1131 newuiTiledWindowcxx . . $ newuiTiledWindow# wndcxx . . $ newuiTiledWindow#newuiTiledWindow(49f6e7a06ebc5aa8).;
1132 newuiSheetcxx . . $ newuiSheet# *sheet;
1133 int res, i, y;
1134 int16_tcxx . . $ int16_t# curpos;
1135 tSliderSettingscxx . . $ tSliderSettings# slider_set;
1136 char axis_str[N_JOY_AXIScxx . . $ `Descent3/pilot_class.h:129:9`!] = {'X', 'Y', 'Z', 'R', 'U', 'V'};
1137 int16_tcxx . . $ int16_t# *joy_sens[N_JOY_AXIScxx . . $ `Descent3/pilot_class.h:129:9`!];
1138 int16_tcxx . . $ int16_t# *mse_sens[N_MOUSE_AXIScxx . . $ `Descent3/pilot_class.h:128:9`!];
1139 int16_tcxx . . $ int16_t# *ff_gain = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1140 bool *ff_enabled = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1141 bool *ff_auto_center = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1142 bool ff_auto_center_support = false;
1143 bool ff_found = false;
1144 bool *joy_enabled;
1145 bool *mse_enabled;
1146 int *msectl;
1147
1148 wnd.Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(TXT_JOYMOUSESETTINGScxx . . $ `Descent3/stringtable.h:146:9`!, 0, 0, 480, 384);
1149 sheet = wnd.GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).();
1150 // standard ui
1151 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 270, 288, NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
1152 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, UID_OKcxx . . $ `ui/ui.h:368:9`!);
1153 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!, UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
1154 // sensitivity sliders for joystick
1155 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_SENSITIVITYcxx . . $ `Descent3/stringtable.h:382:9`!, 0, 0);
1156 for (i = 0; i < N_JOY_AXIScxx . . $ `Descent3/pilot_class.h:129:9`!; i++) {
1157 char str[16];
1158 float val = Controllercxx . . $ Controller.->get_axis_sensitivitycxx . . $ gameController#get_axis_sensitivity(13d73da2a9b3a1ee).(ctAxiscxx . . $ ctAxis., i + 1);
1159 slider_set.min_valcxx . . $ tSliderSettings#min_val..fcxx . . $ tSliderSettings#$anonymous_type_0#f. = 0.0f;
1160 slider_set.max_valcxx . . $ tSliderSettings#max_val..fcxx . . $ tSliderSettings#$anonymous_type_1#f. = JOY_AXIS_SENS_RANGEcxx . . $ `Descent3/controls.h:179:9`!;
1161 slider_set.typecxx . . $ tSliderSettings#type. = SLIDER_UNITS_FLOATcxx . . $ `Descent3/newui_core.h:165:9`!;
1162 curpos = CALC_SLIDER_POS_FLOATcxx . . $ CALC_SLIDER_POS_FLOAT(e0a034531ef5a7c4).(val, &slider_set, CFG_AXIS_SENS_RANGEcxx . . $ `Descent3/ctlconfig.cpp:301:9`!);
1163 snprintf(str, sizeof(str), TXT_CONTAXIScxx . . $ `Descent3/stringtable.h:752:9`!, axis_str[i]);
1164 joy_sens[i] = sheet->AddSlidercxx . . $ newuiSheet#AddSlider(8ed53311be8e1fab).(str, CFG_AXIS_SENS_RANGEcxx . . $ `Descent3/ctlconfig.cpp:301:9`!, curpos, &slider_set);
1165 }
1166 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_MSESENScxx . . $ `Descent3/stringtable.h:383:9`!, 0, 220);
1167
1168 for (i = 0; i < N_MOUSE_AXIScxx . . $ `Descent3/pilot_class.h:128:9`!; i++) {
1169 char str[16];
1170 float val = Controllercxx . . $ Controller.->get_axis_sensitivitycxx . . $ gameController#get_axis_sensitivity(13d73da2a9b3a1ee).(ctMouseAxiscxx . . $ ctMouseAxis., i + 1);
1171 slider_set.min_valcxx . . $ tSliderSettings#min_val..fcxx . . $ tSliderSettings#$anonymous_type_0#f. = 0.0f;
1172 slider_set.max_valcxx . . $ tSliderSettings#max_val..fcxx . . $ tSliderSettings#$anonymous_type_1#f. = MSE_AXIS_SENS_RANGEcxx . . $ `Descent3/controls.h:180:9`!;
1173 slider_set.typecxx . . $ tSliderSettings#type. = SLIDER_UNITS_FLOATcxx . . $ `Descent3/newui_core.h:165:9`!;
1174 curpos = CALC_SLIDER_POS_FLOATcxx . . $ CALC_SLIDER_POS_FLOAT(e0a034531ef5a7c4).(val, &slider_set, CFG_AXIS_SENS_RANGEcxx . . $ `Descent3/ctlconfig.cpp:301:9`!);
1175 snprintf(str, sizeof(str), TXT_CONTAXIScxx . . $ `Descent3/stringtable.h:752:9`!, axis_str[i]);
1176 mse_sens[i] = sheet->AddSlidercxx . . $ newuiSheet#AddSlider(8ed53311be8e1fab).(str, CFG_AXIS_SENS_RANGEcxx . . $ `Descent3/ctlconfig.cpp:301:9`!, curpos, &slider_set);
1177 }
1178 // joystick and mouse enabled
1179 y = 0;
1180 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_CONTROL_TOGGLEScxx . . $ `Descent3/stringtable.h:775:9`!, 210, y);
1181 joy_enabled = sheet->AddLongCheckBoxcxx . . $ newuiSheet#AddLongCheckBox(b1b99af17a84c782).(TXT_JOYENABLEDcxx . . $ `Descent3/stringtable.h:535:9`!);
1182 mse_enabled = sheet->AddLongCheckBoxcxx . . $ newuiSheet#AddLongCheckBox(b1b99af17a84c782).(TXT_CFG_MOUSEENABLEDcxx . . $ `Descent3/stringtable.h:510:9`!);
1183 *joy_enabled = CHECK_FLAGcxx . . $ `lib/Macros.h:63:9`!(Current_pilot.read_controller, READF_JOYcxx . . $ `Descent3/controls.h:178:9`!) ? true : false;
1184 *mse_enabled = CHECK_FLAGcxx . . $ `lib/Macros.h:63:9`!(Current_pilot.read_controller, READF_MOUSEcxx . . $ `Descent3/controls.h:177:9`!) ? true : false;
1185 y += 50;
1186 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_MOUSECONTROLcxx . . $ `Descent3/stringtable.h:822:9`!, 210, y);
1187 msectl = sheet->AddFirstLongRadioButtoncxx . . $ newuiSheet#AddFirstLongRadioButton(c0389c32fb6fc938).(TXT_MOUSEFLIGHTSIMcxx . . $ `Descent3/stringtable.h:823:9`!);
1188 sheet->AddLongRadioButtoncxx . . $ newuiSheet#AddLongRadioButton(9a5cb738bb1a644).(TXT_MOUSELOOKcxx . . $ `Descent3/stringtable.h:824:9`!);
1189 *msectl = Current_pilotcxx . . $ Current_pilot..mouselook_controlcxx . . $ pilot#mouselook_control. ? 1 : 0;
1190 y += 50;
1191 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 210, y);
1192 sheet->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_CALIBJOYSTICKcxx . . $ `Descent3/stringtable.h:821:9`!, UID_JOYCFGcxx . . $ UID_JOYCFG.);
1193 // force feedback stuff
1194 y += 30;
1195 ddio_ff_GetInfocxx . . $ ddio_ff_GetInfo(4bbb0be6c29741a8).(&ff_found, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1196 if (ff_found) {
1197 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_TITLE_FORCEFEEDBACKcxx . . $ `Descent3/stringtable.h:526:9`!, 210, y);
1198 ff_enabled = sheet->AddLongCheckBoxcxx . . $ newuiSheet#AddLongCheckBox(b1b99af17a84c782).(TXT_CFG_FFENABLEDcxx . . $ `Descent3/stringtable.h:527:9`!, ForceIsEnabledcxx . . $ ForceIsEnabled(c9857a73d68e59ba).());
1199 ff_auto_center_support = ddio_ffjoy_SupportAutoCentercxx . . $ ddio_ffjoy_SupportAutoCenter(19cec9addbf44e16).(kJoy1cxx . . $ kJoy1.);
1200 if (ff_auto_center_support) {
1201 // force feedback joystick supports autocentering
1202 // ----------------------------------------------
1203 ff_auto_center = sheet->AddLongCheckBoxcxx . . $ newuiSheet#AddLongCheckBox(b1b99af17a84c782).(TXT_CFG_FFAUTOCENTERcxx . . $ `Descent3/stringtable.h:528:9`!, ForceIsAutoCentercxx . . $ ForceIsAutoCenter(c9857a73d68e59ba).());
1204 }
1205 curpos = (int16_tcxx . . $ int16_t#)(ForceGetGaincxx . . $ ForceGetGain(9b8c9e39889c762c).() * 50.0f);
1206 slider_set.typecxx . . $ tSliderSettings#type. = SLIDER_UNITS_PERCENTcxx . . $ `Descent3/newui_core.h:164:9`!;
1207 ff_gain = sheet->AddSlidercxx . . $ newuiSheet#AddSlider(8ed53311be8e1fab).(TXT_CFG_FORCEGAINcxx . . $ `Descent3/stringtable.h:529:9`!, 50, curpos, &slider_set);
1208 }
1209 wnd.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
1210 do {
1211 res = wnd.DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).();
1212 if (res == NEWUIRES_FORCEQUITcxx . . $ `Descent3/newui_core.h:131:9`!) {
1213 break;
1214 }
1215 if (res == UID_JOYCFGcxx . . $ UID_JOYCFG.) {
1216 joystick_calibrationcxx . . $ joystick_calibration(49f6e7a06ebc5aa8).();
1217 }
1218 } while (res != UID_OKcxx . . $ `ui/ui.h:368:9`! && res != UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
1219 if (res == UID_OKcxx . . $ `ui/ui.h:368:9`!) {
1220 float f_temp;
1221
1222 Current_pilotcxx . . $ Current_pilot..read_controllercxx . . $ pilot#read_controller. = (*joy_enabled) ? READF_JOYcxx . . $ `Descent3/controls.h:178:9`! : 0;
1223 for (i = 0; i < N_JOY_AXIScxx . . $ `Descent3/pilot_class.h:129:9`!; i++) {
1224 float val = CALC_SLIDER_FLOAT_VALUEcxx . . $ CALC_SLIDER_FLOAT_VALUE(da32870243b99ecb).(*joy_sens[i], 0.0f, JOY_AXIS_SENS_RANGEcxx . . $ `Descent3/controls.h:179:9`!, CFG_AXIS_SENS_RANGEcxx . . $ `Descent3/ctlconfig.cpp:301:9`!);
1225 Controllercxx . . $ Controller.->set_axis_sensitivitycxx . . $ gameController#set_axis_sensitivity(b979151824fed4c4).(ctAxiscxx . . $ ctAxis., i + 1, val);
1226 }
1227 Current_pilotcxx . . $ Current_pilot..read_controllercxx . . $ pilot#read_controller. |= (*mse_enabled) ? READF_MOUSEcxx . . $ `Descent3/controls.h:177:9`! : 0;
1228 for (i = 0; i < N_MOUSE_AXIScxx . . $ `Descent3/pilot_class.h:128:9`!; i++) {
1229 float val = CALC_SLIDER_FLOAT_VALUEcxx . . $ CALC_SLIDER_FLOAT_VALUE(da32870243b99ecb).(*mse_sens[i], 0.0f, MSE_AXIS_SENS_RANGEcxx . . $ `Descent3/controls.h:180:9`!, CFG_AXIS_SENS_RANGEcxx . . $ `Descent3/ctlconfig.cpp:301:9`!);
1230 Controllercxx . . $ Controller.->set_axis_sensitivitycxx . . $ gameController#set_axis_sensitivity(b979151824fed4c4).(ctMouseAxiscxx . . $ ctMouseAxis., i + 1, val);
1231 }
1232 Current_pilotcxx . . $ Current_pilot..mouselook_controlcxx . . $ pilot#mouselook_control. = (*msectl) ? true : false;
1233 // force feedback stuff
1234 if (ff_enabled) {
1235 if (*ff_enabled) {
1236 ForceEnablecxx . . $ ForceEnable(49f6e7a06ebc5aa8).();
1237 } else {
1238 ForceDisablecxx . . $ ForceDisable(49f6e7a06ebc5aa8).();
1239 }
1240 }
1241 if (ff_auto_center_support) {
1242 if (*ff_auto_center) {
1243 ForceEnableAutoCentercxx . . $ ForceEnableAutoCenter(49f6e7a06ebc5aa8).();
1244 } else {
1245 ForceDisableAutoCentercxx . . $ ForceDisableAutoCenter(49f6e7a06ebc5aa8).();
1246 }
1247 }
1248 if (ff_gain) {
1249 f_temp = (*ff_gain) * 0.5f;
1250 ForceSetGaincxx . . $ ForceSetGain(9364e6e7bff7660).(f_temp);
1251 }
1252 }
1253 wnd.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
1254 wnd.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
1255 }
1256 #define CFG_KEY_RAMP_MAXcxx . . $ `Descent3/ctlconfig.cpp:1256:9`! 1.0f
1257 #define CFG_KEY_RAMP_RANGEcxx . . $ `Descent3/ctlconfig.cpp:1257:9`! 20
1258 void key_settings_dialogcxx . . $ key_settings_dialog(49f6e7a06ebc5aa8).() {
1259 newuiTiledWindowcxx . . $ newuiTiledWindow# wndcxx . . $ newuiTiledWindow#newuiTiledWindow(49f6e7a06ebc5aa8).;
1260 newuiSheetcxx . . $ newuiSheet# *sheet;
1261 int res;
1262 int16_tcxx . . $ int16_t# curpos;
1263 tSliderSettingscxx . . $ tSliderSettings# slider_set;
1264 int16_tcxx . . $ int16_t# *key_ramp_speed;
1265 wnd.Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(TXT_KEYSETTINGScxx . . $ `Descent3/stringtable.h:150:9`!, 0, 0, 384, 256);
1266 sheet = wnd.GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).();
1267 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 30);
1268 slider_set.min_valcxx . . $ tSliderSettings#min_val..fcxx . . $ tSliderSettings#$anonymous_type_0#f. = 0.0f;
1269 slider_set.max_valcxx . . $ tSliderSettings#max_val..fcxx . . $ tSliderSettings#$anonymous_type_1#f. = CFG_KEY_RAMP_MAXcxx . . $ `Descent3/ctlconfig.cpp:1256:9`!;
1270 slider_set.typecxx . . $ tSliderSettings#type. = SLIDER_UNITS_FLOATcxx . . $ `Descent3/newui_core.h:165:9`!;
1271 curpos = CALC_SLIDER_POS_FLOATcxx . . $ CALC_SLIDER_POS_FLOAT(e0a034531ef5a7c4).(Key_ramp_speedcxx . . $ Key_ramp_speed., &slider_set, CFG_KEY_RAMP_RANGEcxx . . $ `Descent3/ctlconfig.cpp:1257:9`!);
1272 key_ramp_speed = sheet->AddSlidercxx . . $ newuiSheet#AddSlider(8ed53311be8e1fab).(TXT_KEYRAMPINGTIMEcxx . . $ `Descent3/stringtable.h:875:9`!, CFG_KEY_RAMP_RANGEcxx . . $ `Descent3/ctlconfig.cpp:1257:9`!, curpos, &slider_set);
1273 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 180, 160, NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
1274 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, UID_OKcxx . . $ `ui/ui.h:368:9`!);
1275 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!, UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
1276 wnd.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
1277 do {
1278 res = wnd.DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).();
1279 if (res == NEWUIRES_FORCEQUITcxx . . $ `Descent3/newui_core.h:131:9`!) {
1280 break;
1281 }
1282 } while (res != UID_OKcxx . . $ `ui/ui.h:368:9`! && res != UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
1283 if (res == UID_OKcxx . . $ `ui/ui.h:368:9`!) {
1284 Key_ramp_speedcxx . . $ Key_ramp_speed. = CALC_SLIDER_FLOAT_VALUEcxx . . $ CALC_SLIDER_FLOAT_VALUE(da32870243b99ecb).(*key_ramp_speed, 0.0f, CFG_KEY_RAMP_MAXcxx . . $ `Descent3/ctlconfig.cpp:1256:9`!, CFG_KEY_RAMP_RANGEcxx . . $ `Descent3/ctlconfig.cpp:1257:9`!);
1285 }
1286 wnd.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
1287 wnd.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
1288 }
1289 //////////////////////////////////////////////////////////////////////////////
1290 // configure controller new way
1291 struct t_ctlcfgswitchcb_datacxx . . $ t_ctlcfgswitchcb_data# {
1292 joy_cfg_screencxx . . $ joy_cfg_screen# *joycfgcxx . . $ t_ctlcfgswitchcb_data#joycfg.;
1293 key_cfg_screencxx . . $ key_cfg_screen# *keycfgcxx . . $ t_ctlcfgswitchcb_data#keycfg.;
1294 wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen# *wpncfgcxx . . $ t_ctlcfgswitchcb_data#wpncfg.;
1295 cfg_screencxx . . $ cfg_screen# *curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg.;
1296 };
1297
1298 // called when we switch menus
1299 void CtlConfigSwitchCBcxx . . $ CtlConfigSwitchCB(e08fd7e36a7e14bc).(newuiMenucxx . . $ newuiMenu# *menu, int16_tcxx . . $ int16_t# old_option_id, int16_tcxx . . $ int16_t# new_option_id, void *data) {
1300 t_ctlcfgswitchcb_datacxx . . $ t_ctlcfgswitchcb_data# *cfgdata = (t_ctlcfgswitchcb_datacxx . . $ t_ctlcfgswitchcb_data# *)data;
1301 // performs custom gadget deinitialization and reinitilization
1302 if (cfgdata->curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg.) {
1303 cfgdata->curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg.->unrealizecxx . . $ cfg_screen#unrealize(49f6e7a06ebc5aa8).();
1304 }
1305
1306 switch (new_option_id) {
1307 case IDV_KCONFIGcxx . . $ `Descent3/ctlconfig.cpp:295:9`!:
1308 cfgdata->curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg. = cfgdata->keycfgcxx . . $ t_ctlcfgswitchcb_data#keycfg.;
1309 break;
1310 case IDV_CCONFIGcxx . . $ `Descent3/ctlconfig.cpp:296:9`!:
1311 cfgdata->curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg. = cfgdata->joycfgcxx . . $ t_ctlcfgswitchcb_data#joycfg.;
1312 break;
1313 case IDV_WPNSELcxx . . $ `Descent3/ctlconfig.cpp:297:9`!:
1314 cfgdata->curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg. = cfgdata->wpncfgcxx . . $ t_ctlcfgswitchcb_data#wpncfg.;
1315 break;
1316 default:
1317 cfgdata->curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1318 }
1319 if (cfgdata->curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg.) {
1320 cfgdata->curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg.->realizecxx . . $ cfg_screen#realize(49f6e7a06ebc5aa8).();
1321 }
1322 }
1323 // keep multiplayer going!
1324 void CtlConfigUICBcxx . . $ CtlConfigUICB(49f6e7a06ebc5aa8).() {
1325 if (Game_modecxx . . $ Game_mode. & (GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) {
1326 Skip_render_game_framecxx . . $ Skip_render_game_frame. = true;
1327 GameFramecxx . . $ GameFrame(49f6e7a06ebc5aa8).();
1328 Skip_render_game_framecxx . . $ Skip_render_game_frame. = false;
1329 } else if (GetFunctionModecxx . . $ GetFunctionMode(4270339a2fa9f0f5).() == GAME_MODEcxx . . $ GAME_MODE.) {
1330 extern void GameProcessMusiccxx . . $ GameProcessMusic(49f6e7a06ebc5aa8).();
1331 float saved_frame_time = Frametimecxx . . $ Frametime.;
1332 Frametimecxx . . $ Frametime. = UIFrameTimecxx . . $ UIFrameTime.;
1333 Sound_systemcxx . . $ Sound_system..BeginSoundFramecxx . . $ hlsSystem#BeginSoundFrame(b45ddcbc8423892c).(true);
1334 GameProcessMusiccxx . . $ GameProcessMusic(49f6e7a06ebc5aa8).();
1335 Sound_systemcxx . . $ Sound_system..EndSoundFramecxx . . $ hlsSystem#EndSoundFrame(49f6e7a06ebc5aa8).();
1336 Frametimecxx . . $ Frametime. = saved_frame_time;
1337 }
1338 }
1339 // the main controller config menu loop
1340 void CtlConfigcxx . . $ CtlConfig(d4f767463ce0a6b3).(int mode) {
1341 newuiLargeMenucxx . . $ newuiLargeMenu# menu;
1342 joy_cfg_screencxx . . $ joy_cfg_screen# joycfg;
1343 key_cfg_screencxx . . $ key_cfg_screen# keycfg;
1344 wpnsel_cfg_screencxx . . $ wpnsel_cfg_screen# wpncfg;
1345 t_ctlcfgswitchcb_datacxx . . $ t_ctlcfgswitchcb_data# cfg_cb_data;
1346 int res;
1347 void (*old_callback)() = GetUICallbackcxx . . $ GetUICallback(9f019fced98557ce).();
1348 int old_mode = GetScreenModecxx . . $ GetScreenMode(b126dc7c1de90089).();
1349 // must switch to standard resolution for large window
1350 SetScreenModecxx . . $ SetScreenMode(918ebd27a9ddbad3).(SM_MENUcxx . . $ SM_MENU.);
1351 LoadControlConfigcxx . . $ LoadControlConfig(1794bc617d3f3266).();
1352 // open menu
1353 menu.Createcxx . . $ newuiLargeMenu#Create(49f6e7a06ebc5aa8).();
1354 menu.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
1355 joycfg.setupcxx . . $ joy_cfg_screen#setup(69eaa751469a2e53).(&menu);
1356 keycfg.setupcxx . . $ key_cfg_screen#setup(69eaa751469a2e53).(&menu);
1357 wpncfg.setupcxx . . $ wpnsel_cfg_screen#setup(69eaa751469a2e53).(&menu);
1358 cfg_cb_data.joycfgcxx . . $ t_ctlcfgswitchcb_data#joycfg. = &joycfg;
1359 cfg_cb_data.keycfgcxx . . $ t_ctlcfgswitchcb_data#keycfg. = &keycfg;
1360 cfg_cb_data.wpncfgcxx . . $ t_ctlcfgswitchcb_data#wpncfg. = &wpncfg;
1361 cfg_cb_data.curcfgcxx . . $ t_ctlcfgswitchcb_data#curcfg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1362 menu.AddSimpleOptioncxx . . $ newuiMenu#AddSimpleOption(6ed0a7151bf51ed1).(UID_CANCELcxx . . $ `ui/ui.h:369:9`!, TXT_GEN_EXITcxx . . $ `Descent3/stringtable.h:458:9`!);
1363 menu.SetCurrentOptioncxx . . $ newuiMenu#SetCurrentOption(68e3ae50fe6578a9).((mode == CTLCONFIG_WPNSELcxx . . $ `Descent3/ctlconfig.h:60:9`!) ? IDV_WPNSELcxx . . $ `Descent3/ctlconfig.cpp:297:9`!
1364 : (mode == CTLCONFIG_CONTROLLERcxx . . $ `Descent3/ctlconfig.h:59:9`!) ? IDV_CCONFIGcxx . . $ `Descent3/ctlconfig.cpp:296:9`!
1365 : IDV_KCONFIGcxx . . $ `Descent3/ctlconfig.cpp:295:9`!);
1366 menu.SetOnOptionSwitchCBcxx . . $ newuiMenu#SetOnOptionSwitchCB(a57b737311599b0a).(CtlConfigSwitchCBcxx . . $ CtlConfigSwitchCB(e08fd7e36a7e14bc)., (void *)&cfg_cb_data);
1367
1368 // if(mode==CTLCONFIG_CONTROLLER) {
1369 // inSprocket_Configure();
1370 // }
1371 // make sure game is running!
1372 SetUICallbackcxx . . $ SetUICallback(964b12a25712bdc3).(CtlConfigUICBcxx . . $ CtlConfigUICB(49f6e7a06ebc5aa8).);
1373 // run menu
1374 do {
1375 res = menu.DoUIcxx . . $ newuiMenu#DoUI(b126dc7c1de90089).();
1376 // immediate checking of any option ids.
1377 if (res == UID_CANCELcxx . . $ `ui/ui.h:369:9`! || res == NEWUIRES_FORCEQUITcxx . . $ `Descent3/newui_core.h:131:9`!) {
1378 break; // next pass will quit
1379 }
1380 // if(res == IDV_CCONFIG) {
1381 // inSprocket_Configure();
1382 // }
1383 switch (menu.GetCurrentOptioncxx . . $ newuiMenu#GetCurrentOption(524863554b4a534e).()) {
1384 case IDV_KCONFIGcxx . . $ `Descent3/ctlconfig.cpp:295:9`!:
1385 keycfg.processcxx . . $ key_cfg_screen#process(d4f767463ce0a6b3).(res);
1386 break;
1387 case IDV_CCONFIGcxx . . $ `Descent3/ctlconfig.cpp:296:9`!:
1388 joycfg.processcxx . . $ joy_cfg_screen#process(d4f767463ce0a6b3).(res);
1389 break;
1390 case IDV_WPNSELcxx . . $ `Descent3/ctlconfig.cpp:297:9`!:
1391 wpncfg.processcxx . . $ wpnsel_cfg_screen#process(d4f767463ce0a6b3).(res);
1392 break;
1393 };
1394 } while (1);
1395 // write them out and close.
1396 wpncfg.finishcxx . . $ wpnsel_cfg_screen#finish(49f6e7a06ebc5aa8).();
1397 keycfg.finishcxx . . $ key_cfg_screen#finish(49f6e7a06ebc5aa8).();
1398 joycfg.finishcxx . . $ joy_cfg_screen#finish(49f6e7a06ebc5aa8).();
1399 SaveControlConfigcxx . . $ SaveControlConfig(1794bc617d3f3266).(); // write out config to pilot when destroying window
1400 PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(&Current_pilotcxx . . $ Current_pilot.);
1401 menu.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
1402 menu.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
1403 SetScreenModecxx . . $ SetScreenMode(918ebd27a9ddbad3).(old_mode);
1404 SetUICallbackcxx . . $ SetUICallback(964b12a25712bdc3).(old_callback);
1405 Skip_render_game_framecxx . . $ Skip_render_game_frame. = false;
1406 }
1407 int CtlFindBindingcxx . . $ CtlFindBinding(d455ce14f374a3ab).(int controlid, bool keyboard) {
1408 int i = 0;
1409
1410 if (keyboard) {
1411 for (i = 0; i < N_KEY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:405:9`!; i++) {
1412 if (Cfg_key_elementscxx . . $ Cfg_key_elements.[i].fn_idcxx . . $ t_cfg_element#fn_id. == controlid)
1413 return i;
1414 }
1415 } else {
1416 for (i = 0; i < N_JOY_CFG_FNcxx . . $ `Descent3/ctlconfig.cpp:404:9`!; i++) {
1417 if (Cfg_joy_elementscxx . . $ Cfg_joy_elements.[i].fn_idcxx . . $ t_cfg_element#fn_id. == controlid)
1418 return i;
1419 }
1420 }
1421 return -1;
1422 }