Debian Codegraph @

Descent3/ConfigItem.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/ConfigItem.cpp $
21 * $Revision: 19 $
22 * $Date: 4/26/99 9:11p $
23 * $Author: Matt $
24 *
25 * Contains the implementation for ConfigItem [config dialog UI objects]
26 *
27 * $Log: /DescentIII/main/ConfigItem.cpp $
28 *
29 * 19 4/26/99 9:11p Matt
30 * Use small font instead of old UI font.
31 *
32 * 18 4/14/99 2:50a Jeff
33 * fixed some case mismatched #includes
34 *
35 * 17 10/23/98 11:09a Jeff
36 * fixed percent sign
37 *
38 * 16 10/20/98 12:14p Jeff
39 * added color to the UIGroup
40 *
41 * 15 10/19/98 6:30p Jeff
42 * changes made for detail variables. Put in preset values. Preset
43 * options. Removed terrain_cast from detail. Put new callbacks in
44 * UIListBox and UISlider
45 *
46 * 14 10/16/98 1:42p Jeff
47 * added CIF_USEGROUP and general dialog look
48 *
49 * 13 10/07/98 2:54p Jeff
50 * General UI fixes and additions
51 *
52 * 12 10/06/98 5:34p Jeff
53 * various UI changes/improvements
54 *
55 * 11 9/23/98 3:07p Jeff
56 * updated the colors and various other items of config and UI
57 *
58 * 10 9/08/98 11:40a Jeff
59 * fixed radio button bug
60 *
61 * 9 9/04/98 3:52p Jeff
62 * changes made from UI meeting
63 *
64 * 8 9/02/98 2:54p Jeff
65 * added defines for text colors to be used throughout the game...fixed up
66 * buddy menu too
67 *
68 * 7 6/16/98 10:38a Jeff
69 * localization, strings pulled out to stringtable.h and d3.str
70 *
71 * 6 6/11/98 12:08p Jeff
72 * fixed memory leak in CIT_CHECKBOX
73 *
74 * 5 6/05/98 5:59p Jeff
75 * Added a CIT_CHECKBOX style
76 *
77 * 4 5/23/98 6:33p Jeff
78 * Added some flags for the slider, and fixed it up a bit
79 *
80 * 3 5/22/98 5:02p Jeff
81 * Increased functionality
82 *
83 * 2 5/21/98 10:35p Jeff
84 * Initial creation
85 *
86 * $NoKeywords: $
87 */
88
89 #include "ConfigItem.h"cxx . . $ `<file>/Descent3/ConfigItem.h`/
90 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
91 #include "newui.h"cxx . . $ `<file>/Descent3/newui.h`/
92 #include "application.h"cxx . . $ `<file>/lib/application.h`/
93 #include "descent.h"cxx . . $ `<file>/Descent3/descent.h`/
94 #include "mono.h"cxx . . $ `<file>/ddebug/mono.h`/
95 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
96 #include "gamefont.h"cxx . . $ `<file>/Descent3/gamefont.h`/
97 #include "multi_ui.h"cxx . . $ `<file>/Descent3/multi_ui.h`/
98 #include "cfile.h"cxx . . $ `<file>/cfile/cfile.h`/
99 #include "mem.h"cxx . . $ `<file>/mem/mem.h`/
100 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
101 #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/
102
103 #include <string.h>
104 #include <stdlib.h>
105 #include <stdarg.h>
106 #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/
107
108 #define UI_CHECKBOX_OFF_CHARcxx . . $ `Descent3/ConfigItem.cpp:108:9`! 28
109 #define UI_CHECKBOX_ON_CHARcxx . . $ `Descent3/ConfigItem.cpp:109:9`! 29
110
111 ConfigItemcxx . . $ ConfigItem#::ConfigItemcxx . . $ ConfigItem#ConfigItem(49f6e7a06ebc5aa8).() {
112 m_fInitialcxx . . $ ConfigItem#$anonymous_type_0#m_fInitial. = 0;
113 m_Xcxx . . $ ConfigItem#m_X. = m_Ycxx . . $ ConfigItem#m_Y. = m_Wcxx . . $ ConfigItem#m_W. = m_Hcxx . . $ ConfigItem#m_H. = 0;
114 curr_xcxx . . $ ConfigItem#curr_x. = curr_ycxx . . $ ConfigItem#curr_y. = 0;
115 m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue. = 0;
116 m_iFlagscxx . . $ ConfigItem#m_iFlags. = 0;
117 m_iTypecxx . . $ ConfigItem#m_iType. = 0;
118 m_iIDcxx . . $ ConfigItem#m_iID. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
119 m_iNumIDscxx . . $ ConfigItem#m_iNumIDs. = 0;
120 m_iItemscxx . . $ ConfigItem#m_iItems. = 0;
121 m_iValueTypecxx . . $ ConfigItem#m_iValueType. = 0;
122 m_hWndcxx . . $ ConfigItem#m_hWnd. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
123 m_tiListcxx . . $ ConfigItem#m_tiList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
124 m_tiCountcxx . . $ ConfigItem#m_tiCount. = 0;
125 m_hsListcxx . . $ ConfigItem#m_hsList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
126 m_hsCountcxx . . $ ConfigItem#m_hsCount. = 0;
127 m_sListcxx . . $ ConfigItem#m_sList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
128 m_sCountcxx . . $ ConfigItem#m_sCount. = 0;
129 m_rbListcxx . . $ ConfigItem#m_rbList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
130 m_rbCountcxx . . $ ConfigItem#m_rbCount. = 0;
131 m_bListcxx . . $ ConfigItem#m_bList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
132 m_bCountcxx . . $ ConfigItem#m_bCount. = 0;
133 m_lbListcxx . . $ ConfigItem#m_lbList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
134 m_lbCountcxx . . $ ConfigItem#m_lbCount. = 0;
135 m_fMincxx . . $ ConfigItem#m_fMin. = 0;
136 m_fMaxcxx . . $ ConfigItem#m_fMax. = 100;
137 m_iRangecxx . . $ ConfigItem#m_iRange. = 100;
138 m_fUnitcxx . . $ ConfigItem#m_fUnit. = 1;
139 m_auxXcxx . . $ ConfigItem#m_auxX. = 0;
140 m_bAlivecxx . . $ ConfigItem#m_bAlive. = false;
141 m_labeltextcxx . . $ ConfigItem#m_labeltext. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
142 m_fCallbackcxx . . $ ConfigItem#m_fCallback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
143 m_iCallbackcxx . . $ ConfigItem#m_iCallback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
144 m_bCallbackcxx . . $ ConfigItem#m_bCallback. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
145 }
146
147 ConfigItemcxx . . $ ConfigItem#::~cxx . . $ ConfigItem#`~ConfigItem`(ced63f7c635d850d).ConfigItemcxx . . $ ConfigItem#() {
148 if (m_bAlivecxx . . $ ConfigItem#m_bAlive.)
149 Destroycxx . . $ ConfigItem#Destroy(49f6e7a06ebc5aa8).();
150 }
151
152 bool ConfigItemcxx . . $ ConfigItem#::Createcxx . . $ ConfigItem#Create(7794d1f573484a60).(NewUIGameWindowcxx . . $ NewUIGameWindow# *parentwnd, int type, int flags, int x, int y, int w, int h, char *label,
153 int item_x) {
154 if (m_bAlivecxx . . $ ConfigItem#m_bAlive.)
155 return false;
156 if (!parentwnd)
157 return false;
158 switch (type) {
159 case CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`!:
160 case CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!:
161 case CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`!:
162 case CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!:
163 case CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`!:
164 case CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!:
165 case CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`!:
166 m_iTypecxx . . $ ConfigItem#m_iType. = type;
167 break;
168 default:
169 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Bad config item type in Create\n");
170 return false;
171 }
172 if (!label)
173 return false;
174
175 m_hWndcxx . . $ ConfigItem#m_hWnd. = parentwnd;
176 m_iFlagscxx . . $ ConfigItem#m_iFlags. = flags;
177
178 if ((m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_USEGROUPcxx . . $ `Descent3/ConfigItem.h:83:9`!) && (type != CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!)) {
179 // only radiobutton items support the CIF_USEGROUP
180 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "CONFIGITEM: Only CIT_RADIOBUTTON supports CIF_USEGROUP flag\n");
181 m_iFlagscxx . . $ ConfigItem#m_iFlags. &= ~CIF_USEGROUPcxx . . $ `Descent3/ConfigItem.h:83:9`!;
182 Int3cxx . . $ `misc/pserror.h:247:9`!();
183 }
184
185 if (type == CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!) { // slider's need to have the label centered vertically
186 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{label, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!};
187 m_tLabelcxx . . $ ConfigItem#m_tLabel..Createcxx . . $ UIText#Create(c90f152919fa414d).(parentwnd, &item, x, y + 7, UIF_FITcxx . . $ `ui/ui.h:343:9`!);
188 } else {
189 if (!(m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_USEGROUPcxx . . $ `Descent3/ConfigItem.h:83:9`!)) {
190 // create a regular label
191 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{label, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!};
192 m_tLabelcxx . . $ ConfigItem#m_tLabel..Createcxx . . $ UIText#Create(c90f152919fa414d).(parentwnd, &item, x, y, UIF_FITcxx . . $ `ui/ui.h:343:9`!);
193 } else {
194 // save the label text
195 m_labeltextcxx . . $ ConfigItem#m_labeltext. = mem_strdupcxx . . $ `mem/mem.h:81:9`!(label);
196 }
197 }
198
199 m_auxXcxx . . $ ConfigItem#m_auxX. = x;
200 m_auxYcxx . . $ ConfigItem#m_auxY. = y;
201 m_Xcxx . . $ ConfigItem#m_X. = item_x;
202 m_Ycxx . . $ ConfigItem#m_Y. = y;
203 m_Wcxx . . $ ConfigItem#m_W. = w;
204 m_Hcxx . . $ ConfigItem#m_H. = h;
205 return true;
206 }
207
208 bool ConfigItemcxx . . $ ConfigItem#::Createcxx . . $ ConfigItem#Create(427e420ce4e940e6).(NewUIGameWindowcxx . . $ NewUIGameWindow# *parentwnd, int type, char *label, int x, int y, int w, int h, int initialvalue,
209 int flags, int item_x) {
210 if (!Createcxx . . $ ConfigItem#Create(7794d1f573484a60).(parentwnd, type, flags, x, y, w, h, label, item_x))
211 return false;
212
213 m_iValueTypecxx . . $ ConfigItem#m_iValueType. = CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!;
214 m_iInitialcxx . . $ ConfigItem#$anonymous_type_0#m_iInitial. = m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue. = initialvalue;
215
216 m_bAlivecxx . . $ ConfigItem#m_bAlive. = true;
217 return true;
218 }
219
220 bool ConfigItemcxx . . $ ConfigItem#::Createcxx . . $ ConfigItem#Create(9ca3d41f557e3874).(NewUIGameWindowcxx . . $ NewUIGameWindow# *parentwnd, int type, char *label, int x, int y, int w, int h,
221 bool initialvalue, int flags, int item_x) {
222 if (!Createcxx . . $ ConfigItem#Create(7794d1f573484a60).(parentwnd, type, flags, x, y, w, h, label, item_x))
223 return false;
224
225 m_iValueTypecxx . . $ ConfigItem#m_iValueType. = CIV_BOOLcxx . . $ `Descent3/ConfigItem.h:76:9`!;
226 m_bInitialcxx . . $ ConfigItem#$anonymous_type_0#m_bInitial. = m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue. = initialvalue;
227
228 m_bAlivecxx . . $ ConfigItem#m_bAlive. = true;
229 return true;
230 }
231
232 bool ConfigItemcxx . . $ ConfigItem#::Createcxx . . $ ConfigItem#Create(a2e6a2b58c19220).(NewUIGameWindowcxx . . $ NewUIGameWindow# *parentwnd, int type, char *label, int x, int y, int w, int h,
233 float initialvalue, int flags, int item_x) {
234 if (!Createcxx . . $ ConfigItem#Create(7794d1f573484a60).(parentwnd, type, flags, x, y, w, h, label, item_x))
235 return false;
236
237 m_iValueTypecxx . . $ ConfigItem#m_iValueType. = CIV_FLOATcxx . . $ `Descent3/ConfigItem.h:78:9`!;
238 m_fInitialcxx . . $ ConfigItem#$anonymous_type_0#m_fInitial. = m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue. = initialvalue;
239
240 m_bAlivecxx . . $ ConfigItem#m_bAlive. = true;
241 return true;
242 }
243
244 void ConfigItemcxx . . $ ConfigItem#::Destroycxx . . $ ConfigItem#Destroy(49f6e7a06ebc5aa8).(void) {
245 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
246 return;
247
248 int i;
249
250 if (m_labeltextcxx . . $ ConfigItem#m_labeltext.) {
251 mem_freecxx . . $ `mem/mem.h:80:9`!(m_labeltext);
252 m_labeltextcxx . . $ ConfigItem#m_labeltext. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
253 }
254
255 if ((m_tiCountcxx . . $ ConfigItem#m_tiCount.) && (m_tiListcxx . . $ ConfigItem#m_tiList.)) {
256 for (i = 0; i < m_tiCountcxx . . $ ConfigItem#m_tiCount.; i++)
257 if (m_tiListcxx . . $ ConfigItem#m_tiList.[i])
258 delete m_tiListcxx . . $ ConfigItem#m_tiList.[i];
259 mem_freecxx . . $ `mem/mem.h:80:9`!(m_tiList);
260 }
261
262 if ((m_hsCountcxx . . $ ConfigItem#m_hsCount.) && (m_hsListcxx . . $ ConfigItem#m_hsList.)) {
263 for (i = 0; i < m_hsCountcxx . . $ ConfigItem#m_hsCount.; i++)
264 if (m_hsListcxx . . $ ConfigItem#m_hsList.[i])
265 delete m_hsListcxx . . $ ConfigItem#m_hsList.[i];
266 mem_freecxx . . $ `mem/mem.h:80:9`!(m_hsList);
267 }
268
269 if ((m_sCountcxx . . $ ConfigItem#m_sCount.) && (m_sListcxx . . $ ConfigItem#m_sList.)) {
270 for (i = 0; i < m_sCountcxx . . $ ConfigItem#m_sCount.; i++)
271 if (m_sListcxx . . $ ConfigItem#m_sList.[i])
272 delete m_sListcxx . . $ ConfigItem#m_sList.[i];
273 mem_freecxx . . $ `mem/mem.h:80:9`!(m_sList);
274 }
275
276 if ((m_rbCountcxx . . $ ConfigItem#m_rbCount.) && (m_rbListcxx . . $ ConfigItem#m_rbList.)) {
277 for (i = 0; i < m_rbCountcxx . . $ ConfigItem#m_rbCount.; i++)
278 if (m_rbListcxx . . $ ConfigItem#m_rbList.[i])
279 delete m_rbListcxx . . $ ConfigItem#m_rbList.[i];
280 mem_freecxx . . $ `mem/mem.h:80:9`!(m_rbList);
281 }
282
283 if ((m_bCountcxx . . $ ConfigItem#m_bCount.) && (m_bListcxx . . $ ConfigItem#m_bList.)) {
284 for (i = 0; i < m_bCountcxx . . $ ConfigItem#m_bCount.; i++)
285 if (m_bListcxx . . $ ConfigItem#m_bList.[i])
286 delete m_bListcxx . . $ ConfigItem#m_bList.[i];
287 mem_freecxx . . $ `mem/mem.h:80:9`!(m_bList);
288 }
289
290 if ((m_lbCountcxx . . $ ConfigItem#m_lbCount.) && (m_lbListcxx . . $ ConfigItem#m_lbList.)) {
291 for (i = 0; i < m_lbCountcxx . . $ ConfigItem#m_lbCount.; i++)
292 if (m_lbListcxx . . $ ConfigItem#m_lbList.[i])
293 delete m_lbListcxx . . $ ConfigItem#m_lbList.[i];
294 mem_freecxx . . $ `mem/mem.h:80:9`!(m_lbList);
295 }
296
297 if ((m_iNumIDscxx . . $ ConfigItem#m_iNumIDs.) && (m_iIDcxx . . $ ConfigItem#m_iID.))
298 mem_freecxx . . $ `mem/mem.h:80:9`!(m_iID);
299
300 m_bAlivecxx . . $ ConfigItem#m_bAlive. = false;
301 }
302
303 bool ConfigItemcxx . . $ ConfigItem#::GetCurrentValuecxx . . $ ConfigItem#GetCurrentValue(18a3c31ed0aa5760).(int *currvalue) {
304 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
305 return false;
306 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!)
307 return false;
308 if (m_iTypecxx . . $ ConfigItem#m_iType. == CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!) // we need to get the current index since it only gets updated on a double click
309 m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue. = m_lbListcxx . . $ ConfigItem#m_lbList.[0]->GetSelectedIndexcxx . . $ UIListBox#GetSelectedIndex(455f465bc33b4cdf).();
310 *currvalue = m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue.;
311 return true;
312 }
313
314 bool ConfigItemcxx . . $ ConfigItem#::GetCurrentValuecxx . . $ ConfigItem#GetCurrentValue(78ac5d2f3d401626).(bool *currvalue) {
315 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
316 return false;
317 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_BOOLcxx . . $ `Descent3/ConfigItem.h:76:9`!)
318 return false;
319 *currvalue = m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.;
320 return true;
321 }
322
323 bool ConfigItemcxx . . $ ConfigItem#::GetCurrentValuecxx . . $ ConfigItem#GetCurrentValue(7f1546a85f5329ec).(float *currvalue) {
324 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
325 return false;
326 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_FLOATcxx . . $ `Descent3/ConfigItem.h:78:9`!)
327 return false;
328 *currvalue = m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue.;
329 return true;
330 }
331
332 bool ConfigItemcxx . . $ ConfigItem#::SetCurrentValuecxx . . $ ConfigItem#SetCurrentValue(9609253e83e89946).(int currvalue, bool call_back) {
333 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
334 return false;
335 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!)
336 return false;
337
338 float f_cv = (float)currvalue;
339 int i_cv = currvalue;
340
341 // do some error checking
342 switch (m_iTypecxx . . $ ConfigItem#m_iType.) {
343 case CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`!:
344 case CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!:
345 if (i_cv < 0)
346 i_cv = 0;
347 if (i_cv >= m_iNumIDscxx . . $ ConfigItem#m_iNumIDs.)
348 i_cv = m_iNumIDscxx . . $ ConfigItem#m_iNumIDs. - 1;
349 break;
350 case CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!:
351 if (f_cv < m_fMincxx . . $ ConfigItem#m_fMin.)
352 f_cv = m_fMincxx . . $ ConfigItem#m_fMin.;
353 if (f_cv >= m_fMaxcxx . . $ ConfigItem#m_fMax.)
354 f_cv = m_fMaxcxx . . $ ConfigItem#m_fMax.;
355 i_cv = (int)(((float)(f_cv - m_fMincxx . . $ ConfigItem#m_fMin.)) / m_fUnitcxx . . $ ConfigItem#m_fUnit.);
356 break;
357 case CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!:
358 // handles error checking in itself
359 break;
360 case CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`!:
361 case CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`!:
362 case CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`!:
363 Int3cxx . . $ `misc/pserror.h:247:9`!();
364 break;
365 }
366
367 switch (m_iTypecxx . . $ ConfigItem#m_iType.) {
368 case CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`!:
369 case CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!:
370 m_rbListcxx . . $ ConfigItem#m_rbList.[i_cv]->Activatecxx . . $ UIRadioButton#Activate(49f6e7a06ebc5aa8).();
371 break;
372 case CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!:
373 m_sListcxx . . $ ConfigItem#m_sList.[0]->SetPoscxx . . $ UISlider#SetPos(d4f767463ce0a6b3).(i_cv);
374 UpdateSlidercxx . . $ ConfigItem#UpdateSlider(918ebd27a9ddbad3).(0, call_back);
375 break;
376 case CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!:
377 m_lbListcxx . . $ ConfigItem#m_lbList.[0]->SetSelectedIndexcxx . . $ UIListBox#SetSelectedIndex(d4f767463ce0a6b3).(i_cv);
378 break;
379 case CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`!:
380 case CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`!:
381 case CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`!:
382 Int3cxx . . $ `misc/pserror.h:247:9`!();
383 break;
384 }
385
386 // set the value than update
387 m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue. = currvalue;
388
389 // Update(int result);
390
391 return true;
392 }
393
394 bool ConfigItemcxx . . $ ConfigItem#::SetCurrentValuecxx . . $ ConfigItem#SetCurrentValue(f2cb034b043a1ce9).(bool currvalue, bool call_back) {
395 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
396 return false;
397 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_BOOLcxx . . $ `Descent3/ConfigItem.h:76:9`!)
398 return false;
399
400 // do some error checking
401 switch (m_iTypecxx . . $ ConfigItem#m_iType.) {
402 case CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`!:
403 case CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!:
404 case CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!:
405 case CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!:
406 Int3cxx . . $ `misc/pserror.h:247:9`!();
407 break;
408 case CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`!:
409 case CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`!:
410 case CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`!:
411 break;
412 }
413
414 switch (m_iTypecxx . . $ ConfigItem#m_iType.) {
415 case CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`!:
416 case CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!:
417 case CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!:
418 case CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!:
419 Int3cxx . . $ `misc/pserror.h:247:9`!();
420 break;
421 case CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`!:
422 if (currvalue)
423 m_hsListcxx . . $ ConfigItem#m_hsList.[0]->SetStatescxx . . $ UIHotspot#SetStates(ca92f25ca46ed94).(m_tiListcxx . . $ ConfigItem#m_tiList.[2], m_tiListcxx . . $ ConfigItem#m_tiList.[3]); // Checked
424 else
425 m_hsListcxx . . $ ConfigItem#m_hsList.[0]->SetStatescxx . . $ UIHotspot#SetStates(ca92f25ca46ed94).(m_tiListcxx . . $ ConfigItem#m_tiList.[0], m_tiListcxx . . $ ConfigItem#m_tiList.[1]); // Unchecked
426 break;
427 case CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`!:
428 case CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`!:
429 if (currvalue)
430 m_bListcxx . . $ ConfigItem#m_bList.[0]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[1]); // Yes
431 else
432 m_bListcxx . . $ ConfigItem#m_bList.[0]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[0]); // No
433 break;
434 }
435
436 // set the value than update
437 m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue. = currvalue;
438
439 // Update(int result);
440
441 return true;
442 }
443
444 bool ConfigItemcxx . . $ ConfigItem#::SetCurrentValuecxx . . $ ConfigItem#SetCurrentValue(d45380cd2068a9c8).(float currvalue, bool call_back) {
445 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
446 return false;
447 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_FLOATcxx . . $ `Descent3/ConfigItem.h:78:9`!)
448 return false;
449
450 // do some error checking
451 switch (m_iTypecxx . . $ ConfigItem#m_iType.) {
452 case CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!:
453 if (currvalue < m_fMincxx . . $ ConfigItem#m_fMin.)
454 currvalue = m_fMincxx . . $ ConfigItem#m_fMin.;
455 if (currvalue >= m_fMaxcxx . . $ ConfigItem#m_fMax.)
456 currvalue = m_fMaxcxx . . $ ConfigItem#m_fMax.;
457 currvalue = ((currvalue - m_fMincxx . . $ ConfigItem#m_fMin.) / m_fUnitcxx . . $ ConfigItem#m_fUnit.);
458 break;
459 case CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!:
460 case CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`!:
461 case CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!:
462 case CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`!:
463 case CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`!:
464 case CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`!:
465 Int3cxx . . $ `misc/pserror.h:247:9`!();
466 break;
467 }
468
469 switch (m_iTypecxx . . $ ConfigItem#m_iType.) {
470 case CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!:
471 m_sListcxx . . $ ConfigItem#m_sList.[0]->SetPoscxx . . $ UISlider#SetPos(d4f767463ce0a6b3).((int)currvalue);
472 UpdateSlidercxx . . $ ConfigItem#UpdateSlider(918ebd27a9ddbad3).(0, call_back);
473 break;
474 case CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`!:
475 case CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!:
476 case CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!:
477 case CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`!:
478 case CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`!:
479 case CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`!:
480 Int3cxx . . $ `misc/pserror.h:247:9`!();
481 break;
482 }
483
484 // Update(int result);
485
486 // set the value than update
487 m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue. = currvalue;
488
489 return true;
490 }
491
492 bool ConfigItemcxx . . $ ConfigItem#::GetInitialValuecxx . . $ ConfigItem#GetInitialValue(18a3c31ed0aa5760).(int *initvalue) {
493 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
494 return false;
495 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!)
496 return false;
497 *initvalue = m_iInitialcxx . . $ ConfigItem#$anonymous_type_0#m_iInitial.;
498 return true;
499 }
500
501 bool ConfigItemcxx . . $ ConfigItem#::GetInitialValuecxx . . $ ConfigItem#GetInitialValue(78ac5d2f3d401626).(bool *initvalue) {
502 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
503 return false;
504 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_BOOLcxx . . $ `Descent3/ConfigItem.h:76:9`!)
505 return false;
506 *initvalue = m_bInitialcxx . . $ ConfigItem#$anonymous_type_0#m_bInitial.;
507 return true;
508 }
509
510 bool ConfigItemcxx . . $ ConfigItem#::GetInitialValuecxx . . $ ConfigItem#GetInitialValue(7f1546a85f5329ec).(float *initvalue) {
511 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
512 return false;
513 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_FLOATcxx . . $ `Descent3/ConfigItem.h:78:9`!)
514 return false;
515 *initvalue = m_fInitialcxx . . $ ConfigItem#$anonymous_type_0#m_fInitial.;
516 return true;
517 }
518
519 void ConfigItemcxx . . $ ConfigItem#::Updatecxx . . $ ConfigItem#Update(d4f767463ce0a6b3).(int result) {
520 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
521 return;
522 if (!m_iIDcxx . . $ ConfigItem#m_iID.)
523 return;
524
525 // first see if this is one of our items
526 int index = -1;
527 for (int i = 0; i < m_iNumIDscxx . . $ ConfigItem#m_iNumIDs.; i++) {
528 if (m_iIDcxx . . $ ConfigItem#m_iID.[i] == result) {
529 index = i;
530 break;
531 }
532 }
533
534 if (index == -1) // it isn't one of ours
535 return;
536
537 // now determine which type of update to call
538 switch (m_iTypecxx . . $ ConfigItem#m_iType.) {
539 case CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`!:
540 UpdateHotSpotListcxx . . $ ConfigItem#UpdateHotSpotList(d4f767463ce0a6b3).(index);
541 break;
542 case CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!:
543 UpdateSlidercxx . . $ ConfigItem#UpdateSlider(918ebd27a9ddbad3).(index);
544 break;
545 case CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`!:
546 UpdateOnOffButtoncxx . . $ ConfigItem#UpdateOnOffButton(d4f767463ce0a6b3).(index);
547 break;
548 case CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!:
549 UpdateListBoxcxx . . $ ConfigItem#UpdateListBox(d4f767463ce0a6b3).(index);
550 break;
551 case CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`!:
552 UpdateYesNoButtoncxx . . $ ConfigItem#UpdateYesNoButton(d4f767463ce0a6b3).(index);
553 break;
554 case CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!:
555 UpdateRadioButtoncxx . . $ ConfigItem#UpdateRadioButton(d4f767463ce0a6b3).(index);
556 break;
557 case CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`!:
558 UpdateCheckBoxcxx . . $ ConfigItem#UpdateCheckBox(d4f767463ce0a6b3).(index);
559 break;
560 default:
561 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Bad ConfigItem Type in Update\n");
562 }
563 }
564
565 void ConfigItemcxx . . $ ConfigItem#::UpdateHotSpotListcxx . . $ ConfigItem#UpdateHotSpotList(d4f767463ce0a6b3).(int index) {
566 ASSERTcxx . . $ `misc/pserror.h:246:9`!((index >= 0) && (index < m_rbCount));
567 m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue. = index;
568 m_rbListcxx . . $ ConfigItem#m_rbList.[m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue.]->Activatecxx . . $ UIRadioButton#Activate(49f6e7a06ebc5aa8).();
569 if (m_iCallbackcxx . . $ ConfigItem#m_iCallback.)
570 (*m_iCallbackcxx . . $ ConfigItem#m_iCallback.)(m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue.);
571 }
572
573 void ConfigItemcxx . . $ ConfigItem#::UpdateSlidercxx . . $ ConfigItem#UpdateSlider(918ebd27a9ddbad3).(int index, bool call_callback) {
574 ASSERTcxx . . $ `misc/pserror.h:246:9`!((index >= 0) && (index < m_sCount));
575 // determine which type of variables int or float
576 char temp[10];
577
578 switch (m_iValueTypecxx . . $ ConfigItem#m_iValueType.) {
579 case CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!:
580 m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue. = (int)(((float)m_sListcxx . . $ ConfigItem#m_sList.[index]->GetPoscxx . . $ UISlider#GetPos(455f465bc33b4cdf).()) * m_fUnitcxx . . $ ConfigItem#m_fUnit. + m_fMincxx . . $ ConfigItem#m_fMin. + 0.5f);
581 if (m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue. > m_fMaxcxx . . $ ConfigItem#m_fMax.)
582 m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue. = m_fMaxcxx . . $ ConfigItem#m_fMax.;
583 snprintf(temp, sizeof(temp), "%d", m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue.);
584 if (m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_PERCENTcxx . . $ `Descent3/ConfigItem.h:81:9`!)
585 strncat(temp, "%", sizeof(temp) - strlen(temp) - 1);
586 if (m_iCallbackcxx . . $ ConfigItem#m_iCallback. && call_callback)
587 (*m_iCallbackcxx . . $ ConfigItem#m_iCallback.)(m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue.);
588 break;
589 case CIV_FLOATcxx . . $ `Descent3/ConfigItem.h:78:9`!:
590 m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue. = ((float)m_sListcxx . . $ ConfigItem#m_sList.[index]->GetPoscxx . . $ UISlider#GetPos(455f465bc33b4cdf).()) * m_fUnitcxx . . $ ConfigItem#m_fUnit. + m_fMincxx . . $ ConfigItem#m_fMin.;
591 if (m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue. > m_fMaxcxx . . $ ConfigItem#m_fMax.)
592 m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue. = m_fMaxcxx . . $ ConfigItem#m_fMax.;
593 if (m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_NODECIMALcxx . . $ `Descent3/ConfigItem.h:82:9`!)
594 snprintf(temp, sizeof(temp), "%.0f", m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue.);
595 else
596 snprintf(temp, sizeof(temp), "%.2f", m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue.);
597 if (m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_PERCENTcxx . . $ `Descent3/ConfigItem.h:81:9`!)
598 strncat(temp, "%", sizeof(temp) - strlen(temp) - 1);
599 if (m_fCallbackcxx . . $ ConfigItem#m_fCallback. && call_callback)
600 (*m_fCallbackcxx . . $ ConfigItem#m_fCallback.)(m_fCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_fCurrentValue.);
601 break;
602 default:
603 Int3cxx . . $ `misc/pserror.h:247:9`!(); // Get Jeff
604 }
605 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{temp, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!};
606 m_tLabel2cxx . . $ ConfigItem#m_tLabel2..SetTitlecxx . . $ UIStatic#SetTitle(52afca12b6cce14a).(&item);
607 }
608
609 void ConfigItemcxx . . $ ConfigItem#::UpdateOnOffButtoncxx . . $ ConfigItem#UpdateOnOffButton(d4f767463ce0a6b3).(int index) {
610 ASSERTcxx . . $ `misc/pserror.h:246:9`!((index >= 0) && (index < m_bCount));
611 m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue. = !m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.;
612 if (m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.)
613 m_bListcxx . . $ ConfigItem#m_bList.[index]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[1]); // On
614 else
615 m_bListcxx . . $ ConfigItem#m_bList.[index]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[0]); // Off
616 if (m_bCallbackcxx . . $ ConfigItem#m_bCallback.)
617 (*m_bCallbackcxx . . $ ConfigItem#m_bCallback.)(m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.);
618 }
619
620 void ConfigItemcxx . . $ ConfigItem#::UpdateListBoxcxx . . $ ConfigItem#UpdateListBox(d4f767463ce0a6b3).(int index) {
621 ASSERTcxx . . $ `misc/pserror.h:246:9`!((index >= 0) && (index < m_lbCount));
622 m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue. = m_lbListcxx . . $ ConfigItem#m_lbList.[index]->GetSelectedIndexcxx . . $ UIListBox#GetSelectedIndex(455f465bc33b4cdf).();
623 if (m_iCallbackcxx . . $ ConfigItem#m_iCallback.)
624 (*m_iCallbackcxx . . $ ConfigItem#m_iCallback.)(m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue.);
625 }
626
627 void ConfigItemcxx . . $ ConfigItem#::UpdateYesNoButtoncxx . . $ ConfigItem#UpdateYesNoButton(d4f767463ce0a6b3).(int index) {
628 ASSERTcxx . . $ `misc/pserror.h:246:9`!((index >= 0) && (index < m_bCount));
629 m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue. = !m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.;
630 if (m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.)
631 m_bListcxx . . $ ConfigItem#m_bList.[index]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[1]); // Yes
632 else
633 m_bListcxx . . $ ConfigItem#m_bList.[index]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[0]); // No
634 if (m_bCallbackcxx . . $ ConfigItem#m_bCallback.)
635 (*m_bCallbackcxx . . $ ConfigItem#m_bCallback.)(m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.);
636 }
637
638 void ConfigItemcxx . . $ ConfigItem#::UpdateCheckBoxcxx . . $ ConfigItem#UpdateCheckBox(d4f767463ce0a6b3).(int index) {
639 ASSERTcxx . . $ `misc/pserror.h:246:9`!((index >= 0) && (index < m_hsCount));
640 m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue. = !m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.;
641 if (m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.)
642 m_hsListcxx . . $ ConfigItem#m_hsList.[index]->SetStatescxx . . $ UIHotspot#SetStates(ca92f25ca46ed94).(m_tiListcxx . . $ ConfigItem#m_tiList.[2], m_tiListcxx . . $ ConfigItem#m_tiList.[3]); // Checked
643 else
644 m_hsListcxx . . $ ConfigItem#m_hsList.[index]->SetStatescxx . . $ UIHotspot#SetStates(ca92f25ca46ed94).(m_tiListcxx . . $ ConfigItem#m_tiList.[0], m_tiListcxx . . $ ConfigItem#m_tiList.[1]); // Unchecked
645
646 if (m_bCallbackcxx . . $ ConfigItem#m_bCallback.)
647 (*m_bCallbackcxx . . $ ConfigItem#m_bCallback.)(m_bCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_bCurrentValue.);
648 }
649
650 void ConfigItemcxx . . $ ConfigItem#::UpdateRadioButtoncxx . . $ ConfigItem#UpdateRadioButton(d4f767463ce0a6b3).(int index) {
651 ASSERTcxx . . $ `misc/pserror.h:246:9`!((index >= 0) && (index < m_rbCount));
652 m_rbListcxx . . $ ConfigItem#m_rbList.[index]->Activatecxx . . $ UIRadioButton#Activate(49f6e7a06ebc5aa8).();
653 m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue. = index;
654
655 if (m_iCallbackcxx . . $ ConfigItem#m_iCallback.)
656 (*m_iCallbackcxx . . $ ConfigItem#m_iCallback.)(m_iCurrentValuecxx . . $ ConfigItem#$anonymous_type_1#m_iCurrentValue.);
657 }
658
659 void ConfigItemcxx . . $ ConfigItem#::Addcxx . . $ ConfigItem#Add(c2886f81a411d68e).(int count, ...) {
660 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
661 return;
662
663 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_tiCount == 0);
664
665 va_listcxx . . $ va_list# marker;
666 va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(marker, count);
667 int i;
668 UITextItemcxx . . $ UITextItem# *uitemp;
669
670 switch (m_iTypecxx . . $ ConfigItem#m_iType.) {
671 case CIT_HOTSPOTLISTcxx . . $ `Descent3/ConfigItem.h:67:9`!:
672 ASSERTcxx . . $ `misc/pserror.h:246:9`!(count > 0);
673 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_rbCount == 0);
674 // we need count text items
675 // we need count radiobuttons
676 // we need count IDs
677 m_tiCountcxx . . $ ConfigItem#m_tiCount. = count;
678 m_tiListcxx . . $ ConfigItem#m_tiList. = (UITextItemcxx . . $ UITextItem# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(UITextItem *) * m_tiCount);
679 m_rbCountcxx . . $ ConfigItem#m_rbCount. = count;
680 m_rbListcxx . . $ ConfigItem#m_rbList. = (UIRadioButtoncxx . . $ UIRadioButton# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(UIRadioButton *) * m_rbCount);
681 m_iNumIDscxx . . $ ConfigItem#m_iNumIDs. = count;
682 m_iIDcxx . . $ ConfigItem#m_iID. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * m_iNumIDs);
683 // make sure mallocs are ok
684 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_tiList) && (m_rbList) && (m_iID));
685 // initialize variables
686 // adjust the curr x/y for the list
687 curr_xcxx . . $ ConfigItem#curr_x. = 0;
688 curr_ycxx . . $ ConfigItem#curr_y. = 0;
689 for (i = 0; i < m_iNumIDscxx . . $ ConfigItem#m_iNumIDs.; i++) {
690 // get unique ID
691 m_iIDcxx . . $ ConfigItem#m_iID.[i] = GetUniqueIDcxx . . $ GetUniqueID(b126dc7c1de90089).();
692 // allocate text item
693 m_tiListcxx . . $ ConfigItem#m_tiList.[i] = new UITextItemcxx . . $ UITextItem#;
694 // make sure allocation ok
695 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_tiList[i]);
696 uitemp = va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(marker, UITextItem *);
697 (*m_tiListcxx . . $ ConfigItem#m_tiList.[i]) =cxx . . $ UITextItem#`operator=`(5ad635489e71ed3b). *uitemp;
698 (*m_tiListcxx . . $ ConfigItem#m_tiList.[i]).set_alphacxx . . $ UITextItem#set_alpha(ac50b47256ae7414).(255);
699 // allocate radio button
700 m_rbListcxx . . $ ConfigItem#m_rbList.[i] = new UIRadioButtoncxx . . $ UIRadioButton#;
701 // make sure allocation ok
702 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_rbList[i]);
703 if (i)
704 m_rbListcxx . . $ ConfigItem#m_rbList.[i]->Createcxx . . $ UIRadioButton#Create(2c6e3f78865b93cb).(m_hWndcxx . . $ ConfigItem#m_hWnd., m_rbListcxx . . $ ConfigItem#m_rbList.[i - 1], m_iIDcxx . . $ ConfigItem#m_iID.[i], m_tiListcxx . . $ ConfigItem#m_tiList.[i], m_Xcxx . . $ ConfigItem#m_X. + curr_xcxx . . $ ConfigItem#curr_x., m_Ycxx . . $ ConfigItem#m_Y. + curr_ycxx . . $ ConfigItem#curr_y.,
705 m_tiListcxx . . $ ConfigItem#m_tiList.[i]->widthcxx . . $ UITextItem#width(b126dc7c1de90089).(), m_tiListcxx . . $ ConfigItem#m_tiList.[i]->heightcxx . . $ UITextItem#height(b126dc7c1de90089).(), UIF_FITcxx . . $ `ui/ui.h:343:9`! | UIRB_NOBUTTONcxx . . $ `ui/ui.h:359:9`!);
706 else
707 m_rbListcxx . . $ ConfigItem#m_rbList.[i]->Createcxx . . $ UIRadioButton#Create(2c6e3f78865b93cb).(m_hWndcxx . . $ ConfigItem#m_hWnd., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, m_iIDcxx . . $ ConfigItem#m_iID.[i], m_tiListcxx . . $ ConfigItem#m_tiList.[i], m_Xcxx . . $ ConfigItem#m_X. + curr_xcxx . . $ ConfigItem#curr_x., m_Ycxx . . $ ConfigItem#m_Y. + curr_ycxx . . $ ConfigItem#curr_y., m_tiListcxx . . $ ConfigItem#m_tiList.[i]->widthcxx . . $ UITextItem#width(b126dc7c1de90089).(),
708 m_tiListcxx . . $ ConfigItem#m_tiList.[i]->heightcxx . . $ UITextItem#height(b126dc7c1de90089).(), UIF_FITcxx . . $ `ui/ui.h:343:9`! | UIRB_NOBUTTONcxx . . $ `ui/ui.h:359:9`!);
709
710 (*m_tiListcxx . . $ ConfigItem#m_tiList.[i]).set_colorcxx . . $ UITextItem#set_color(cb2f890c2fdad230).(UICOL_HOTSPOT_HIcxx . . $ `Descent3/newui.h:217:9`!);
711 m_rbListcxx . . $ ConfigItem#m_rbList.[i]->SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!, m_tiListcxx . . $ ConfigItem#m_tiList.[i]);
712 (*m_tiListcxx . . $ ConfigItem#m_tiList.[i]).set_colorcxx . . $ UITextItem#set_color(cb2f890c2fdad230).(UICOL_HOTSPOT_LOcxx . . $ `Descent3/newui.h:214:9`!);
713 m_rbListcxx . . $ ConfigItem#m_rbList.[i]->SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_INACTIVEcxx . . $ `ui/ui.h:543:9`!, m_tiListcxx . . $ ConfigItem#m_tiList.[i]);
714 (*m_tiListcxx . . $ ConfigItem#m_tiList.[i]).set_colorcxx . . $ UITextItem#set_color(cb2f890c2fdad230).(UICOL_HOTSPOT_HIcxx . . $ `Descent3/newui.h:217:9`!);
715 m_rbListcxx . . $ ConfigItem#m_rbList.[i]->SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_HILITEcxx . . $ `ui/ui.h:544:9`!, m_tiListcxx . . $ ConfigItem#m_tiList.[i]);
716
717 // adjust curr x/y
718 curr_xcxx . . $ ConfigItem#curr_x. += (m_rbListcxx . . $ ConfigItem#m_rbList.[i]->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() + HOTSPOTLIST_GAPcxx . . $ `Descent3/ConfigItem.h:85:9`!);
719 }
720 // Initialize Config Item to initial value
721 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iValueType == CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!);
722 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_iInitial >= 0) && (m_iInitial < m_iNumIDs));
723 m_rbListcxx . . $ ConfigItem#m_rbList.[m_iInitialcxx . . $ ConfigItem#$anonymous_type_0#m_iInitial.]->Activatecxx . . $ UIRadioButton#Activate(49f6e7a06ebc5aa8).();
724 break;
725 case CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!: {
726 // only 1 slider per config item
727 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_sCount == 0);
728 // we need 1 slider
729 // we need 1 ID
730 m_sCountcxx . . $ ConfigItem#m_sCount. = 1;
731 m_sListcxx . . $ ConfigItem#m_sList. = (NewUISlidercxx . . $ NewUISlider# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(NewUISlider *) * 1);
732 m_iNumIDscxx . . $ ConfigItem#m_iNumIDs. = 1;
733 m_iIDcxx . . $ ConfigItem#m_iID. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * 1);
734 // make sure mallocs are ok
735 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_sList) && (m_iID));
736 // get unique ID
737 m_iIDcxx . . $ ConfigItem#m_iID.[0] = GetUniqueIDcxx . . $ GetUniqueID(b126dc7c1de90089).();
738 // allocate slider
739 m_sListcxx . . $ ConfigItem#m_sList.[0] = new NewUISlidercxx . . $ NewUISlider#;
740 // make sure allocation ok
741 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_sList[0]);
742 m_sListcxx . . $ ConfigItem#m_sList.[0]->Createcxx . . $ NewUISlider#Create(f04546128259b10e).(m_hWndcxx . . $ ConfigItem#m_hWnd., m_iIDcxx . . $ ConfigItem#m_iID.[0], m_Xcxx . . $ ConfigItem#m_X., m_Ycxx . . $ ConfigItem#m_Y., UIF_FITcxx . . $ `ui/ui.h:343:9`!);
743 char temp[10];
744 switch (m_iValueTypecxx . . $ ConfigItem#m_iValueType.) {
745 case CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!:
746 snprintf(temp, sizeof(temp), "%d", m_iInitialcxx . . $ ConfigItem#$anonymous_type_0#m_iInitial.);
747 if (m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_PERCENTcxx . . $ `Descent3/ConfigItem.h:81:9`!)
748 strncat(temp, "%", sizeof(temp) - strlen(temp) - 1);
749 break;
750 case CIV_FLOATcxx . . $ `Descent3/ConfigItem.h:78:9`!:
751 if (m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_NODECIMALcxx . . $ `Descent3/ConfigItem.h:82:9`!)
752 snprintf(temp, sizeof(temp), "%.0f", m_fInitialcxx . . $ ConfigItem#$anonymous_type_0#m_fInitial.);
753 else
754 snprintf(temp, sizeof(temp), "%.2f", m_fInitialcxx . . $ ConfigItem#$anonymous_type_0#m_fInitial.);
755 if (m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_PERCENTcxx . . $ `Descent3/ConfigItem.h:81:9`!)
756 strncat(temp, "%", sizeof(temp) - strlen(temp) - 1);
757 break;
758 }
759 UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{temp, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!};
760 m_tLabel2cxx . . $ ConfigItem#m_tLabel2..Createcxx . . $ UIText#Create(c90f152919fa414d).(m_hWndcxx . . $ ConfigItem#m_hWnd., &item, m_Xcxx . . $ ConfigItem#m_X. + 155, m_Ycxx . . $ ConfigItem#m_Y. + 7, UIF_FITcxx . . $ `ui/ui.h:343:9`!);
761 m_sListcxx . . $ ConfigItem#m_sList.[0]->SetSelectChangeCallbackcxx . . $ UISlider#SetSelectChangeCallback(af3d7c1df3fe7292).(CISliderCallbackcxx . . $ CISliderCallback(6ca3d68f5c5f0975)., this);
762 break;
763 }
764 case CIT_ONOFFBUTTONcxx . . $ `Descent3/ConfigItem.h:69:9`!:
765 // only 1 on/off button per config item
766 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_bCount == 0);
767 // we need 2 text items ("On" and "Off")
768 // we need 1 button
769 // we need 1 ID
770 m_bCountcxx . . $ ConfigItem#m_bCount. = 1;
771 m_bListcxx . . $ ConfigItem#m_bList. = (NewUIButtoncxx . . $ NewUIButton# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(NewUIButton *) * 1);
772 m_tiCountcxx . . $ ConfigItem#m_tiCount. = 2;
773 m_tiListcxx . . $ ConfigItem#m_tiList. = (UITextItemcxx . . $ UITextItem# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(UITextItem *) * 2);
774 m_iNumIDscxx . . $ ConfigItem#m_iNumIDs. = 1;
775 m_iIDcxx . . $ ConfigItem#m_iID. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * 1);
776 // make sure mallocs mallocs are ok
777 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_tiList) && (m_bList) && (m_iID));
778 // adjust the curr x/y for the button
779 curr_xcxx . . $ ConfigItem#curr_x. = 0;
780 curr_ycxx . . $ ConfigItem#curr_y. = 0;
781 // get unique ID
782 m_iIDcxx . . $ ConfigItem#m_iID.[0] = GetUniqueIDcxx . . $ GetUniqueID(b126dc7c1de90089).();
783 // allocate text items
784 m_tiListcxx . . $ ConfigItem#m_tiList.[0] = new UITextItemcxx . . $ UITextItem#(TXT_OFFcxx . . $ `Descent3/stringtable.h:110:9`!, UICOL_BUTTON_LOcxx . . $ `Descent3/newui.h:223:9`!);
785 m_tiListcxx . . $ ConfigItem#m_tiList.[1] = new UITextItemcxx . . $ UITextItem#(TXT_ONcxx . . $ `Descent3/stringtable.h:111:9`!, UICOL_BUTTON_HIcxx . . $ `Descent3/newui.h:224:9`!);
786 // make sure allocation ok
787 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_tiList[0]) && (m_tiList[1]));
788 // allocate buttonCreate
789 m_bListcxx . . $ ConfigItem#m_bList.[0] = new NewUIButtoncxx . . $ NewUIButton#;
790 // make sure allocation ok
791 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_bList[0]);
792 m_bListcxx . . $ ConfigItem#m_bList.[0]->Createcxx . . $ NewUIButton#Create(55c0967870198d96).(m_hWndcxx . . $ ConfigItem#m_hWnd., m_iIDcxx . . $ ConfigItem#m_iID.[0], m_tiListcxx . . $ ConfigItem#m_tiList.[0], m_Xcxx . . $ ConfigItem#m_X. + curr_xcxx . . $ ConfigItem#curr_x., m_Ycxx . . $ ConfigItem#m_Y. + curr_ycxx . . $ ConfigItem#curr_y., m_tiListcxx . . $ ConfigItem#m_tiList.[0]->widthcxx . . $ UITextItem#width(b126dc7c1de90089).(),
793 m_tiListcxx . . $ ConfigItem#m_tiList.[0]->heightcxx . . $ UITextItem#height(b126dc7c1de90089).(), UIF_FITcxx . . $ `ui/ui.h:343:9`!);
794 // Initialize Config Item to initial value
795 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iValueType == CIV_BOOLcxx . . $ `Descent3/ConfigItem.h:76:9`!);
796 if (m_bInitialcxx . . $ ConfigItem#$anonymous_type_0#m_bInitial.)
797 m_bListcxx . . $ ConfigItem#m_bList.[0]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[1]); // On
798 else
799 m_bListcxx . . $ ConfigItem#m_bList.[0]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[0]); // Off
800 break;
801 case CIT_LISTBOXcxx . . $ `Descent3/ConfigItem.h:70:9`!:
802 ASSERTcxx . . $ `misc/pserror.h:246:9`!(count > 0);
803 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_lbCount == 0);
804 // we need count text items (one for each item in list box)
805 // we need 1 listbox
806 // we need 1 ID
807 m_lbCountcxx . . $ ConfigItem#m_lbCount. = 1;
808 m_lbListcxx . . $ ConfigItem#m_lbList. = (NewUIListBoxcxx . . $ NewUIListBox# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(NewUIListBox *) * 1);
809 m_tiCountcxx . . $ ConfigItem#m_tiCount. = count;
810 m_tiListcxx . . $ ConfigItem#m_tiList. = (UITextItemcxx . . $ UITextItem# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(UITextItem *) * m_tiCount);
811 m_iNumIDscxx . . $ ConfigItem#m_iNumIDs. = 1;
812 m_iIDcxx . . $ ConfigItem#m_iID. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * 1);
813 // make sure mallocs ok
814 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_lbList) && (m_tiList) && (m_iID));
815 // adjust the curr x/y for the listbox
816 curr_xcxx . . $ ConfigItem#curr_x. = 0;
817 curr_ycxx . . $ ConfigItem#curr_y. = m_tLabelcxx . . $ ConfigItem#m_tLabel..Hcxx . . $ UIObject#H(455f465bc33b4cdf).() + LISTBOX_LABELGAPcxx . . $ `Descent3/ConfigItem.h:86:9`!;
818 // get unique ID
819 m_iIDcxx . . $ ConfigItem#m_iID.[0] = GetUniqueIDcxx . . $ GetUniqueID(b126dc7c1de90089).();
820 // allocate list box
821 m_lbListcxx . . $ ConfigItem#m_lbList.[0] = new NewUIListBoxcxx . . $ NewUIListBox#;
822 // check allocation
823 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_lbList[0]);
824 m_lbListcxx . . $ ConfigItem#m_lbList.[0]->Createcxx . . $ NewUIListBox#Create(43707b8add2f137d).(m_hWndcxx . . $ ConfigItem#m_hWnd., m_iIDcxx . . $ ConfigItem#m_iID.[0], m_Xcxx . . $ ConfigItem#m_X. + curr_xcxx . . $ ConfigItem#curr_x., m_Ycxx . . $ ConfigItem#m_Y. + curr_ycxx . . $ ConfigItem#curr_y., m_Wcxx . . $ ConfigItem#m_W., m_Hcxx . . $ ConfigItem#m_H., UIF_FITcxx . . $ `ui/ui.h:343:9`!);
825 // allocate text items and put them in
826 for (i = 0; i < m_tiCountcxx . . $ ConfigItem#m_tiCount.; i++) {
827 // create the text item
828 m_tiListcxx . . $ ConfigItem#m_tiList.[i] = new UITextItemcxx . . $ UITextItem#;
829 // make sure allocation ok
830 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_tiList[i]);
831 (*m_tiListcxx . . $ ConfigItem#m_tiList.[i]) =cxx . . $ UITextItem#`operator=`(5ad635489e71ed3b). (*(va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(marker, UITextItem *)));
832 // add textitem to listbox
833 m_lbListcxx . . $ ConfigItem#m_lbList.[0]->AddItemcxx . . $ UIListBox#AddItem(f57aa2fef0df48a8).(m_tiListcxx . . $ ConfigItem#m_tiList.[i]);
834 }
835 // Initialize Config Item to initial value
836 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iValueType == CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!);
837 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_iInitial >= 0) && (m_iInitial < count));
838 m_lbListcxx . . $ ConfigItem#m_lbList.[0]->SetSelectChangeCallbackcxx . . $ UIListBox#SetSelectChangeCallback(af3d7c1df3fe7292).(CIListBoxCallbackcxx . . $ CIListBoxCallback(6ca3d68f5c5f0975)., this);
839 m_lbListcxx . . $ ConfigItem#m_lbList.[0]->SetSelectedIndexcxx . . $ UIListBox#SetSelectedIndex(d4f767463ce0a6b3).(m_iInitialcxx . . $ ConfigItem#$anonymous_type_0#m_iInitial.);
840 break;
841 case CIT_YESNOBUTTONcxx . . $ `Descent3/ConfigItem.h:71:9`!:
842 // only 1 yes/no button per config item
843 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_bCount == 0);
844 // we need 2 text items ("Yes" and "No")
845 // we need 1 button
846 // we need 1 ID
847 m_bCountcxx . . $ ConfigItem#m_bCount. = 1;
848 m_bListcxx . . $ ConfigItem#m_bList. = (NewUIButtoncxx . . $ NewUIButton# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(NewUIButton *) * 1);
849 m_tiCountcxx . . $ ConfigItem#m_tiCount. = 2;
850 m_tiListcxx . . $ ConfigItem#m_tiList. = (UITextItemcxx . . $ UITextItem# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(UITextItem *) * 2);
851 m_iNumIDscxx . . $ ConfigItem#m_iNumIDs. = 1;
852 m_iIDcxx . . $ ConfigItem#m_iID. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * 1);
853 // make sure mallocs mallocs are ok
854 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_tiList) && (m_bList) && (m_iID));
855 // adjust the curr x/y for the button
856 curr_xcxx . . $ ConfigItem#curr_x. = 0;
857 curr_ycxx . . $ ConfigItem#curr_y. = 0;
858 // get unique ID
859 m_iIDcxx . . $ ConfigItem#m_iID.[0] = GetUniqueIDcxx . . $ GetUniqueID(b126dc7c1de90089).();
860 // allocate text items
861 m_tiListcxx . . $ ConfigItem#m_tiList.[0] = new UITextItemcxx . . $ UITextItem#(TXT_NOcxx . . $ `Descent3/stringtable.h:112:9`!, UICOL_BUTTON_LOcxx . . $ `Descent3/newui.h:223:9`!);
862 m_tiListcxx . . $ ConfigItem#m_tiList.[1] = new UITextItemcxx . . $ UITextItem#(TXT_YEScxx . . $ `Descent3/stringtable.h:113:9`!, UICOL_BUTTON_HIcxx . . $ `Descent3/newui.h:224:9`!);
863 // make sure allocation ok
864 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_tiList[0]) && (m_tiList[1]));
865 // allocate buttonCreate
866 m_bListcxx . . $ ConfigItem#m_bList.[0] = new NewUIButtoncxx . . $ NewUIButton#;
867 // make sure allocation ok
868 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_bList[0]);
869 m_bListcxx . . $ ConfigItem#m_bList.[0]->Createcxx . . $ NewUIButton#Create(55c0967870198d96).(m_hWndcxx . . $ ConfigItem#m_hWnd., m_iIDcxx . . $ ConfigItem#m_iID.[0], m_tiListcxx . . $ ConfigItem#m_tiList.[0], m_Xcxx . . $ ConfigItem#m_X. + curr_xcxx . . $ ConfigItem#curr_x., m_Ycxx . . $ ConfigItem#m_Y. + curr_ycxx . . $ ConfigItem#curr_y., m_tiListcxx . . $ ConfigItem#m_tiList.[0]->widthcxx . . $ UITextItem#width(b126dc7c1de90089).(),
870 m_tiListcxx . . $ ConfigItem#m_tiList.[0]->heightcxx . . $ UITextItem#height(b126dc7c1de90089).(), UIF_FITcxx . . $ `ui/ui.h:343:9`!);
871 // Initialize Config Item to initial value
872 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iValueType == CIV_BOOLcxx . . $ `Descent3/ConfigItem.h:76:9`!);
873 if (m_bInitialcxx . . $ ConfigItem#$anonymous_type_0#m_bInitial.)
874 m_bListcxx . . $ ConfigItem#m_bList.[0]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[1]); // Yes
875 else
876 m_bListcxx . . $ ConfigItem#m_bList.[0]->SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(m_tiListcxx . . $ ConfigItem#m_tiList.[0]); // No
877 break;
878 case CIT_CHECKBOXcxx . . $ `Descent3/ConfigItem.h:73:9`!:
879 // only 1 checkbox per config item
880 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_bCount == 0);
881 // we need 4 text items (a checked and unchecked box hightlited and not)
882 // we need 1 hotspot
883 // we need 1 ID
884 m_hsCountcxx . . $ ConfigItem#m_hsCount. = 1;
885 m_hsListcxx . . $ ConfigItem#m_hsList. = (UIHotspotcxx . . $ UIHotspot# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(UIHotspot *) * 1);
886 m_tiCountcxx . . $ ConfigItem#m_tiCount. = 4;
887 m_tiListcxx . . $ ConfigItem#m_tiList. = (UITextItemcxx . . $ UITextItem# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(UITextItem *) * 4);
888 m_iNumIDscxx . . $ ConfigItem#m_iNumIDs. = 1;
889 m_iIDcxx . . $ ConfigItem#m_iID. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * 1);
890 // make sure mallocs are ok
891 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_hsList) && (m_tiList) && (m_iID));
892 // adjust the curr x/y for the checkbox
893 curr_xcxx . . $ ConfigItem#curr_x. = 0;
894 curr_ycxx . . $ ConfigItem#curr_y. = 0;
895 // get unique ID
896 m_iIDcxx . . $ ConfigItem#m_iID.[0] = GetUniqueIDcxx . . $ GetUniqueID(b126dc7c1de90089).();
897 // allocate text items
898 char buffer[256];
899 snprintf(buffer, sizeof(buffer), "%c %s", UI_CHECKBOX_OFF_CHARcxx . . $ `Descent3/ConfigItem.cpp:108:9`!, ((UITextItemcxx . . $ UITextItem# *)m_tLabelcxx . . $ ConfigItem#m_tLabel..GetItemcxx . . $ UIStatic#GetItem(fcbccdc2fac69c8e).())->GetBuffercxx . . $ UITextItem#GetBuffer(a9f41ea0e82d88cf).());
900 m_tiListcxx . . $ ConfigItem#m_tiList.[0] = new UITextItemcxx . . $ UITextItem#(buffer, UICOL_HOTSPOT_LOcxx . . $ `Descent3/newui.h:214:9`!);
901 m_tiListcxx . . $ ConfigItem#m_tiList.[1] = new UITextItemcxx . . $ UITextItem#(buffer, UICOL_HOTSPOT_HIcxx . . $ `Descent3/newui.h:217:9`!);
902 snprintf(buffer, sizeof(buffer), "%c %s", UI_CHECKBOX_ON_CHARcxx . . $ `Descent3/ConfigItem.cpp:109:9`!, ((UITextItemcxx . . $ UITextItem# *)m_tLabelcxx . . $ ConfigItem#m_tLabel..GetItemcxx . . $ UIStatic#GetItem(fcbccdc2fac69c8e).())->GetBuffercxx . . $ UITextItem#GetBuffer(a9f41ea0e82d88cf).());
903 m_tiListcxx . . $ ConfigItem#m_tiList.[2] = new UITextItemcxx . . $ UITextItem#(buffer, UICOL_HOTSPOT_LOcxx . . $ `Descent3/newui.h:214:9`!);
904 m_tiListcxx . . $ ConfigItem#m_tiList.[3] = new UITextItemcxx . . $ UITextItem#(buffer, UICOL_HOTSPOT_HIcxx . . $ `Descent3/newui.h:217:9`!);
905 // make sure allocation ok
906 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_tiList[0]) && (m_tiList[1]));
907 // allocate hot spots
908 m_hsListcxx . . $ ConfigItem#m_hsList.[0] = new UIHotspotcxx . . $ UIHotspot#;
909 // make sure allocation ok
910 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_hsList[0]);
911 m_hsListcxx . . $ ConfigItem#m_hsList.[0]->Createcxx . . $ UIHotspot#Create(ee4237d76742fc72).(m_hWndcxx . . $ ConfigItem#m_hWnd., m_iIDcxx . . $ ConfigItem#m_iID.[0], -1, m_tiListcxx . . $ ConfigItem#m_tiList.[0], m_tiListcxx . . $ ConfigItem#m_tiList.[1], m_Xcxx . . $ ConfigItem#m_X. + curr_xcxx . . $ ConfigItem#curr_x., m_Ycxx . . $ ConfigItem#m_Y. + curr_ycxx . . $ ConfigItem#curr_y.,
912 m_tiListcxx . . $ ConfigItem#m_tiList.[0]->widthcxx . . $ UITextItem#width(b126dc7c1de90089).(), m_tiListcxx . . $ ConfigItem#m_tiList.[0]->heightcxx . . $ UITextItem#height(b126dc7c1de90089).(), UIF_FITcxx . . $ `ui/ui.h:343:9`!);
913 // Initialize Config Item to initial value
914 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iValueType == CIV_BOOLcxx . . $ `Descent3/ConfigItem.h:76:9`!);
915 if (m_bInitialcxx . . $ ConfigItem#$anonymous_type_0#m_bInitial.)
916 m_hsListcxx . . $ ConfigItem#m_hsList.[0]->SetStatescxx . . $ UIHotspot#SetStates(ca92f25ca46ed94).(m_tiListcxx . . $ ConfigItem#m_tiList.[2], m_tiListcxx . . $ ConfigItem#m_tiList.[3]);
917 else
918 m_hsListcxx . . $ ConfigItem#m_hsList.[0]->SetStatescxx . . $ UIHotspot#SetStates(ca92f25ca46ed94).(m_tiListcxx . . $ ConfigItem#m_tiList.[0], m_tiListcxx . . $ ConfigItem#m_tiList.[1]);
919 // remove the title so it's not drawn
920 m_tLabelcxx . . $ ConfigItem#m_tLabel..Destroycxx . . $ UIGadget#Destroy(49f6e7a06ebc5aa8).();
921 break;
922 case CIT_RADIOBUTTONcxx . . $ `Descent3/ConfigItem.h:72:9`!:
923 ASSERTcxx . . $ `misc/pserror.h:246:9`!(count > 0);
924 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_rbCount == 0);
925 // we need count text items
926 // we need count radio buttons
927 // we need count IDs
928 m_tiCountcxx . . $ ConfigItem#m_tiCount. = count;
929 m_tiListcxx . . $ ConfigItem#m_tiList. = (UITextItemcxx . . $ UITextItem# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(UITextItem *) * m_tiCount);
930 m_rbCountcxx . . $ ConfigItem#m_rbCount. = count;
931 m_rbListcxx . . $ ConfigItem#m_rbList. = (UIRadioButtoncxx . . $ UIRadioButton# **)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(UIRadioButton *) * m_rbCount);
932 m_iNumIDscxx . . $ ConfigItem#m_iNumIDs. = count;
933 m_iIDcxx . . $ ConfigItem#m_iID. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * m_iNumIDs);
934 // make sure mallocs are ok
935 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_tiList) && (m_rbList) && (m_iID));
936 // adjust the curr x/y for the list of radio buttons
937 curr_xcxx . . $ ConfigItem#curr_x. = 0;
938
939 int offset;
940 bool use_group;
941 use_group = (bool)((m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_USEGROUPcxx . . $ `Descent3/ConfigItem.h:83:9`!) != 0);
942
943 if (m_Xcxx . . $ ConfigItem#m_X.) {
944 curr_ycxx . . $ ConfigItem#curr_y. = 0;
945 offset = 8;
946 } else {
947 m_Xcxx . . $ ConfigItem#m_X. = m_auxXcxx . . $ ConfigItem#m_auxX.;
948 curr_ycxx . . $ ConfigItem#curr_y. = RADIOBUTTON_LABELGAPcxx . . $ `Descent3/ConfigItem.h:87:9`! + 10;
949
950 if (use_group) {
951 offset = 5;
952 } else {
953 offset = 0;
954 }
955 }
956
957 int start_y, w, max_width;
958
959 start_y = curr_ycxx . . $ ConfigItem#curr_y.;
960 max_width = 0;
961
962 for (i = 0; i < count; i++) {
963 // get unique ID
964 m_iIDcxx . . $ ConfigItem#m_iID.[i] = GetUniqueIDcxx . . $ GetUniqueID(b126dc7c1de90089).();
965 // allocate text items
966 m_tiListcxx . . $ ConfigItem#m_tiList.[i] = new UITextItemcxx . . $ UITextItem#;
967 // make sure allocation ok
968 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_tiList[i]);
969 (*m_tiListcxx . . $ ConfigItem#m_tiList.[i]) =cxx . . $ UITextItem#`operator=`(5ad635489e71ed3b). (*(va_argcxx . . $ `<external>/8105065126723003039/stdarg.h:53:9`!(marker, UITextItem *)));
970
971 m_tiListcxx . . $ ConfigItem#m_tiList.[i]->set_colorcxx . . $ UITextItem#set_color(cb2f890c2fdad230).(UICOL_HOTSPOT_LOcxx . . $ `Descent3/newui.h:214:9`!);
972
973 // m_tiList[i]->set_alpha(UIALPHA_HOTSPOT_LO);
974 // allocate radio button
975 m_rbListcxx . . $ ConfigItem#m_rbList.[i] = new UIRadioButtoncxx . . $ UIRadioButton#;
976 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_rbList[i]);
977 if (i)
978 m_rbListcxx . . $ ConfigItem#m_rbList.[i]->Createcxx . . $ UIRadioButton#Create(2c6e3f78865b93cb).(m_hWndcxx . . $ ConfigItem#m_hWnd., m_rbListcxx . . $ ConfigItem#m_rbList.[i - 1], m_iIDcxx . . $ ConfigItem#m_iID.[i], m_tiListcxx . . $ ConfigItem#m_tiList.[i], m_Xcxx . . $ ConfigItem#m_X. + curr_xcxx . . $ ConfigItem#curr_x. + offset, m_Ycxx . . $ ConfigItem#m_Y. + curr_ycxx . . $ ConfigItem#curr_y., m_Wcxx . . $ ConfigItem#m_W.,
979 m_Hcxx . . $ ConfigItem#m_H., UIF_FITcxx . . $ `ui/ui.h:343:9`!);
980 else
981 m_rbListcxx . . $ ConfigItem#m_rbList.[i]->Createcxx . . $ UIRadioButton#Create(2c6e3f78865b93cb).(m_hWndcxx . . $ ConfigItem#m_hWnd., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, m_iIDcxx . . $ ConfigItem#m_iID.[i], m_tiListcxx . . $ ConfigItem#m_tiList.[i], m_Xcxx . . $ ConfigItem#m_X. + curr_xcxx . . $ ConfigItem#curr_x. + offset, m_Ycxx . . $ ConfigItem#m_Y. + curr_ycxx . . $ ConfigItem#curr_y., m_Wcxx . . $ ConfigItem#m_W., m_Hcxx . . $ ConfigItem#m_H.,
982 UIF_FITcxx . . $ `ui/ui.h:343:9`!);
983
984 // store the max width
985 w = m_rbListcxx . . $ ConfigItem#m_rbList.[i]->Wcxx . . $ UIObject#W(455f465bc33b4cdf).();
986 if (w > max_width)
987 max_width = w;
988
989 // adjust curr x/y
990 curr_ycxx . . $ ConfigItem#curr_y. += (m_tiListcxx . . $ ConfigItem#m_tiList.[i]->heightcxx . . $ UITextItem#height(b126dc7c1de90089).() + RADIOBUTTON_GAPcxx . . $ `Descent3/ConfigItem.h:88:9`!);
991 }
992
993 if (m_iFlagscxx . . $ ConfigItem#m_iFlags. & CIF_USEGROUPcxx . . $ `Descent3/ConfigItem.h:83:9`! && m_labeltextcxx . . $ ConfigItem#m_labeltext.) {
994 // create the group box now
995
996 // we may need to update the width depending on width of title
997 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(SMALL_FONTcxx . . $ `Descent3/gamefont.h:103:9`!);
998 int w = grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(m_labeltextcxx . . $ ConfigItem#m_labeltext.);
999 if (w > max_width)
1000 max_width = w;
1001
1002 m_Hcxx . . $ ConfigItem#m_H. = curr_ycxx . . $ ConfigItem#curr_y. - start_y + 15; // generate real height
1003 m_Wcxx . . $ ConfigItem#m_W. = max_width + 20; // generate real width
1004
1005 // Create the group box
1006 m_gGroupcxx . . $ ConfigItem#m_gGroup..Createcxx . . $ UIGroup#Create(33c6c9652d183a8e).(m_hWndcxx . . $ ConfigItem#m_hWnd., m_labeltextcxx . . $ ConfigItem#m_labeltext., m_auxXcxx . . $ ConfigItem#m_auxX., m_Ycxx . . $ ConfigItem#m_Y., m_Wcxx . . $ ConfigItem#m_W., m_Hcxx . . $ ConfigItem#m_H., UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!, UICOL_HOTSPOT_LOcxx . . $ `Descent3/newui.h:214:9`!);
1007 }
1008
1009 // Initialize Config Item to initial value
1010 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iValueType == CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!);
1011 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_iInitial >= 0) && (m_iInitial < m_iNumIDs));
1012 m_rbListcxx . . $ ConfigItem#m_rbList.[m_iInitialcxx . . $ ConfigItem#$anonymous_type_0#m_iInitial.]->Activatecxx . . $ UIRadioButton#Activate(49f6e7a06ebc5aa8).();
1013 break;
1014 default:
1015 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Bad ConfigItem Type in Add\n");
1016 }
1017 va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(marker);
1018 }
1019 void ConfigItemcxx . . $ ConfigItem#::SetRangecxx . . $ ConfigItem#SetRange(b1146eedae1e1d0b).(int min, int max, int range) {
1020 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
1021 return;
1022 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iType == CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!);
1023 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iValueType == CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!);
1024 ASSERTcxx . . $ `misc/pserror.h:246:9`!(max > min);
1025 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_iCurrentValue >= min) && (m_iCurrentValue <= max));
1026
1027 m_fMincxx . . $ ConfigItem#m_fMin. = min;
1028 m_fMaxcxx . . $ ConfigItem#m_fMax. = max;
1029 m_sListcxx . . $ ConfigItem#m_sList.[0]->SetRangecxx . . $ UISlider#SetRange(d4f767463ce0a6b3).(range + 1);
1030 m_fUnitcxx . . $ ConfigItem#m_fUnit. = ((float)max - min) / ((float)range);
1031
1032 // figure out how far in is the position
1033 m_sListcxx . . $ ConfigItem#m_sList.[0]->SetPoscxx . . $ UISlider#SetPos(d4f767463ce0a6b3).((int)(((float)(m_iInitialcxx . . $ ConfigItem#$anonymous_type_0#m_iInitial. - min)) / m_fUnitcxx . . $ ConfigItem#m_fUnit.));
1034 }
1035
1036 void ConfigItemcxx . . $ ConfigItem#::SetRangecxx . . $ ConfigItem#SetRange(b9f8a67be5c7b53e).(float min, float max, int range) {
1037 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
1038 return;
1039 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iType == CIT_SLIDERcxx . . $ `Descent3/ConfigItem.h:68:9`!);
1040 ASSERTcxx . . $ `misc/pserror.h:246:9`!(m_iValueType == CIV_FLOATcxx . . $ `Descent3/ConfigItem.h:78:9`!);
1041 ASSERTcxx . . $ `misc/pserror.h:246:9`!(max > min);
1042 ASSERTcxx . . $ `misc/pserror.h:246:9`!((m_fCurrentValue >= min) && (m_fCurrentValue <= max));
1043
1044 m_fMincxx . . $ ConfigItem#m_fMin. = min;
1045 m_fMaxcxx . . $ ConfigItem#m_fMax. = max;
1046 m_sListcxx . . $ ConfigItem#m_sList.[0]->SetRangecxx . . $ UISlider#SetRange(d4f767463ce0a6b3).(range + 1);
1047 m_fUnitcxx . . $ ConfigItem#m_fUnit. = (max - min) / ((float)range);
1048
1049 // figure out the real positions
1050 m_sListcxx . . $ ConfigItem#m_sList.[0]->SetPoscxx . . $ UISlider#SetPos(d4f767463ce0a6b3).((int)((m_fInitialcxx . . $ ConfigItem#$anonymous_type_0#m_fInitial. - min) / m_fUnitcxx . . $ ConfigItem#m_fUnit.));
1051 }
1052
1053 void ConfigItemcxx . . $ ConfigItem#::SetCallbackcxx . . $ ConfigItem#SetCallback(3bb669cff3be67f9).(void (*callback)(float)) {
1054 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
1055 return;
1056 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_FLOATcxx . . $ `Descent3/ConfigItem.h:78:9`!)
1057 return;
1058 m_fCallbackcxx . . $ ConfigItem#m_fCallback. = callback;
1059 }
1060
1061 void ConfigItemcxx . . $ ConfigItem#::SetCallbackcxx . . $ ConfigItem#SetCallback(94eb4457dc8d4d10).(void (*callback)(int)) {
1062 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
1063 return;
1064 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_INTcxx . . $ `Descent3/ConfigItem.h:77:9`!)
1065 return;
1066 m_iCallbackcxx . . $ ConfigItem#m_iCallback. = callback;
1067 }
1068
1069 void ConfigItemcxx . . $ ConfigItem#::SetCallbackcxx . . $ ConfigItem#SetCallback(ea22beb3ee77eebe).(void (*callback)(bool)) {
1070 if (!m_bAlivecxx . . $ ConfigItem#m_bAlive.)
1071 return;
1072 if (m_iValueTypecxx . . $ ConfigItem#m_iValueType. != CIV_BOOLcxx . . $ `Descent3/ConfigItem.h:76:9`!)
1073 return;
1074 m_bCallbackcxx . . $ ConfigItem#m_bCallback. = callback;
1075 }
1076
1077 int GetUniqueIDcxx . . $ GetUniqueID(b126dc7c1de90089).(void) {
1078 static int count = 0xB0;
1079 count++;
1080 return count;
1081 }
1082
1083 void CIListBoxCallbackcxx . . $ CIListBoxCallback(6ca3d68f5c5f0975).(int ID, void *ptr) {}
1084
1085 void CISliderCallbackcxx . . $ CISliderCallback(6ca3d68f5c5f0975).(int ID, void *ptr) {
1086 ConfigItemcxx . . $ ConfigItem# *ci = (ConfigItemcxx . . $ ConfigItem# *)ptr;
1087 if (!ci)
1088 return;
1089 ci->Updatecxx . . $ ConfigItem#Update(d4f767463ce0a6b3).(ID);
1090 }