| 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/newui.cpp $ |
| 21 | * $Revision: 85 $ |
| 22 | * $Date: 4/29/99 3:20a $ |
| 23 | * $Author: Samir $ |
| 24 | * |
| 25 | * New UI Enhancements for D3 |
| 26 | * |
| 27 | * $Log: /DescentIII/main/newui.cpp $ |
| 28 | * |
| 29 | * 85 4/29/99 3:20a Samir |
| 30 | * took out Newui_wait_flag. Not needed. |
| 31 | * |
| 32 | * 84 4/28/99 1:55a Samir |
| 33 | * interface change for UIEdit. |
| 34 | * |
| 35 | * 83 4/25/99 3:35a Jeff |
| 36 | * added a please wait popup dialog when entering telcom |
| 37 | * |
| 38 | * 82 4/22/99 7:41p Matt |
| 39 | * Use new art for old UI. |
| 40 | * |
| 41 | * 81 4/21/99 2:15p Samir |
| 42 | * table file filter fixes. |
| 43 | * |
| 44 | * 80 4/20/99 3:32p Kevin |
| 45 | * made it possible for an edit box to not have a cancel button... used it |
| 46 | * for choosing team count for server |
| 47 | * |
| 48 | * 79 4/20/99 11:46a Samir |
| 49 | * numerous ui 'feel' fixes. |
| 50 | * |
| 51 | * 78 4/18/99 7:55p Samir |
| 52 | * new progress indicator for delays when loading data. |
| 53 | * |
| 54 | * 77 4/15/99 5:28p Samir |
| 55 | * added advanced messagebox |
| 56 | * |
| 57 | * 76 4/06/99 10:44p Samir |
| 58 | * Fixed residue from changes to UID_OK and UID_CANCEL. |
| 59 | * |
| 60 | * 75 3/23/99 9:05p Samir |
| 61 | * don't do sound system calls in wait dialog. time with main menu, since |
| 62 | * that's the place where we have to sync sound initialization with menu |
| 63 | * selection. |
| 64 | * |
| 65 | * 74 3/18/99 10:13a Samir |
| 66 | * wait dialog tied more to menu system. |
| 67 | * |
| 68 | * 73 3/04/99 6:09p Samir |
| 69 | * changed DoWaitMessage to properly center (works for single lines, not |
| 70 | * sure about multiple lines, but since most messages are single lined, it |
| 71 | * works for now.) |
| 72 | * |
| 73 | * 72 3/03/99 5:13a Jeff |
| 74 | * added DoWaitMessage() |
| 75 | * |
| 76 | * 71 3/03/99 4:16a Samir |
| 77 | * added fix for DoEditDialog, setting focus on edit gadget by default for |
| 78 | * all sheets with editboxes (1st one.) |
| 79 | * |
| 80 | * 70 3/01/99 6:55p Samir |
| 81 | * fixed saturation problems with old ui text. |
| 82 | * |
| 83 | * 69 2/27/99 8:34p Samir |
| 84 | * NewuiGameWindow inherits newuiTiledWindow. |
| 85 | * |
| 86 | * 68 2/27/99 4:17p Jeff |
| 87 | * crude fix for text wrapping in DoEdit |
| 88 | * |
| 89 | * 67 2/21/99 6:39p Samir |
| 90 | * new edit box. |
| 91 | * |
| 92 | * 66 2/16/99 12:06p Samir |
| 93 | * added new ui api. |
| 94 | * |
| 95 | * 65 2/07/99 1:17a Jeff |
| 96 | * peppered UI dialogs that were missing NEWUIRES_FORCEQUIT to handle it |
| 97 | * |
| 98 | * 64 1/28/99 6:49p Samir |
| 99 | * frame limit ui system. |
| 100 | * |
| 101 | * 63 12/09/98 4:17p Samir |
| 102 | * messageboxes use new art. |
| 103 | * |
| 104 | * 62 11/19/98 5:40p Kevin |
| 105 | * Demo system |
| 106 | * |
| 107 | * 61 11/02/98 6:00p Jeff |
| 108 | * fixed MessageBox to use new UI artwork...had to redo the way it |
| 109 | * calculates button centers |
| 110 | * |
| 111 | * 60 10/30/98 1:34p Samir |
| 112 | * better sizable UIwindow. |
| 113 | * |
| 114 | * 59 10/23/98 12:53p Samir |
| 115 | * bail from DoUIFrameWithoutInput for multiplayer too. |
| 116 | * |
| 117 | * 58 10/18/98 2:59p Jason |
| 118 | * fixes for beta4 |
| 119 | * |
| 120 | * 57 10/16/98 4:20p Samir |
| 121 | * hotspots replaced by keys Y or N for yesno messagebox. |
| 122 | * |
| 123 | * 56 10/14/98 11:24p Jeff |
| 124 | * fixed DoMessageBox (so keys work in it) |
| 125 | * |
| 126 | * 55 10/12/98 10:23a Samir |
| 127 | * made UI_frame_result non-static. |
| 128 | * |
| 129 | * 54 10/11/98 3:01a Jeff |
| 130 | * made some dialogs multiplayer friendly with multi_bail_ui_menu |
| 131 | * |
| 132 | * 53 10/08/98 7:31p Samir |
| 133 | * moved multi_bail_menu flag to gamesequence.cpp. |
| 134 | * |
| 135 | * 52 10/07/98 6:29p Samir |
| 136 | * bail if multiplayer game ended in ui. |
| 137 | * |
| 138 | * 51 10/07/98 11:24a Jeff |
| 139 | * fixed text centering function |
| 140 | * |
| 141 | * 50 10/06/98 5:34p Jeff |
| 142 | * various UI changes/improvements |
| 143 | * |
| 144 | * 49 9/23/98 6:19p Jeff |
| 145 | * finished up (hopefully) updating the config/ui dialogs to meet our |
| 146 | * standard. Keyboard/joystick config still needs some work |
| 147 | * |
| 148 | * 48 9/23/98 3:07p Jeff |
| 149 | * updated the colors and various other items of config and UI |
| 150 | * |
| 151 | * 47 9/22/98 3:55p Samir |
| 152 | * moved simple callback to NewUI system. |
| 153 | * |
| 154 | * 46 9/14/98 11:22a Samir |
| 155 | * enhanced editboxes |
| 156 | * |
| 157 | * 45 9/10/98 6:33p Samir |
| 158 | * messageboxes should use up to 3 lines of text without a problem. |
| 159 | * |
| 160 | * 44 9/02/98 6:50p Samir |
| 161 | * added new combo box. |
| 162 | * |
| 163 | * 43 9/01/98 4:12p Samir |
| 164 | * added screenshot caparbilities. |
| 165 | * |
| 166 | * 42 9/01/98 12:29p Jeff |
| 167 | * error handling in DoMessageBox (handles extra long strings) |
| 168 | * |
| 169 | * 41 8/31/98 12:38p Samir |
| 170 | * took out hotspots in messageboxes. functionality implented internally. |
| 171 | * |
| 172 | * 40 8/27/98 5:03p Kevin |
| 173 | * Prettied up multiplayer screens and fixed some bugs. |
| 174 | * |
| 175 | * 39 8/27/98 2:51p Samir |
| 176 | * you must specify UIF_BORDER to print the border for a NewUIWindow. |
| 177 | * |
| 178 | * 38 8/24/98 3:12p Samir |
| 179 | * fixed listbox text clipping. |
| 180 | * |
| 181 | * 37 8/20/98 6:46p Samir |
| 182 | * added DoEditDialog. |
| 183 | * |
| 184 | * 36 8/14/98 7:37p Matt |
| 185 | * Since PSFILENAME_LEN is now considered to be the max length of the |
| 186 | * string itself (not counting the terminating null), buffers for file |
| 187 | * name need to be PSFILENAME_LEN+1 bytes long. |
| 188 | * |
| 189 | * 35 7/22/98 2:38p Jeff |
| 190 | * added Y and N keys for the DoMessageBox |
| 191 | * |
| 192 | * 34 6/25/98 12:34p Jeff |
| 193 | * added enter and esc key to DoMessageBox |
| 194 | * |
| 195 | * 33 6/24/98 5:16p Matt |
| 196 | * Don't reset screen mode in DoMessageBox(), so we still see the game |
| 197 | * screen when the pause message is up. |
| 198 | * |
| 199 | * 32 6/22/98 2:34p Samir |
| 200 | * added ability to use a bitmap as background for NewUIWindows. |
| 201 | * |
| 202 | * 31 6/16/98 10:54a Jeff |
| 203 | * |
| 204 | * 30 6/01/98 10:57a Jeff |
| 205 | * (Samir) Fixed bug if a file couldn't be loaded |
| 206 | * |
| 207 | * 29 5/26/98 8:15p Samir |
| 208 | * implemented UIFileDialog's ONDestroy function. |
| 209 | * |
| 210 | * 28 5/25/98 8:18p Samir |
| 211 | * File dialogs implemented. |
| 212 | * |
| 213 | * 27 5/24/98 2:57a Jeff |
| 214 | * updated DoMessageBox to use NewUIButton |
| 215 | * |
| 216 | * 26 5/19/98 6:23p Samir |
| 217 | * added NewUIButton |
| 218 | * |
| 219 | * 25 5/08/98 12:55p Samir |
| 220 | * improved ui handling when switch screen modes. |
| 221 | * |
| 222 | * 24 4/29/98 12:55p Samir |
| 223 | * added titile bar to NewUIWindow. |
| 224 | * |
| 225 | * 23 4/18/98 2:09a Samir |
| 226 | * error checking. |
| 227 | * |
| 228 | * 22 4/13/98 7:01p Samir |
| 229 | * added snazzy listbox and edit box art. |
| 230 | * |
| 231 | * 21 4/10/98 7:51p Samir |
| 232 | * added ui_Flush |
| 233 | * |
| 234 | * 20 4/02/98 12:39p Samir |
| 235 | * don't clear screen in NULL callback. |
| 236 | * |
| 237 | * 19 4/02/98 11:12a Samir |
| 238 | * Always set screen mode to menu for message boxes, and clear screen if |
| 239 | * UICallback if 0. |
| 240 | * |
| 241 | * 18 3/24/98 10:45a Samir |
| 242 | * Added GetUICallback. |
| 243 | * |
| 244 | * 17 3/13/98 12:00p Jeff |
| 245 | * Fixed up DoMessageBox so the text position is correct, it prints a |
| 246 | * window title, and you can specify text color |
| 247 | * |
| 248 | * 16 3/11/98 2:35p Samir |
| 249 | * New message box implemented. |
| 250 | * |
| 251 | * 15 3/10/98 7:26p Samir |
| 252 | * Added new slider. |
| 253 | * |
| 254 | * 14 3/10/98 12:49p Samir |
| 255 | * Bitmapped dialog supported. |
| 256 | * |
| 257 | * 13 3/05/98 6:38p Samir |
| 258 | * Use UI_FONT now. |
| 259 | * |
| 260 | * 12 3/03/98 12:09p Samir |
| 261 | * Clear out keyboard buffer after UI is done. |
| 262 | * |
| 263 | * 11 3/02/98 5:53p Samir |
| 264 | * Default value for alpha of windows is set. |
| 265 | * |
| 266 | * 10 2/15/98 7:07p Samir |
| 267 | * Updated NewUIWindow to UIWindow's changes. |
| 268 | * |
| 269 | * 9 2/13/98 6:37p Samir |
| 270 | * Added DoUIFrameWithoutInput. |
| 271 | * |
| 272 | * 8 1/30/98 7:33p Samir |
| 273 | * Took out 'ok' button. |
| 274 | * |
| 275 | * 7 1/30/98 7:04p Samir |
| 276 | * Added the first NewUIWindow class. |
| 277 | * |
| 278 | * 6 1/26/98 2:15p Samir |
| 279 | * Message box params are char*. |
| 280 | * |
| 281 | * 5 1/18/98 4:22p Samir |
| 282 | * Implemented new UIItem system. |
| 283 | * |
| 284 | * 4 1/13/98 6:29p Samir |
| 285 | * Moved Large Bitmap code from Menu.cpp to newui.cpp. |
| 286 | * |
| 287 | * 3 1/08/98 12:18p Samir |
| 288 | * New menu interface. |
| 289 | * |
| 290 | * 2 1/05/98 10:56a Samir |
| 291 | * New menu stuff. |
| 292 | * |
| 293 | * 1 1/02/98 2:09p Samir |
| 294 | * Initial revision. |
| 295 | * |
| 296 | * |
| 297 | * $NoKeywords: $ |
| 298 | */ |
| 299 | |
| 300 | #include "newui.h"cxx . . $ `<file>/Descent3/newui.h`/ |
| 301 | #include "game.h"cxx . . $ `<file>/Descent3/game.h`/ |
| 302 | #include "descent.h"cxx . . $ `<file>/Descent3/descent.h`/ |
| 303 | #include "renderer.h"cxx . . $ `<file>/lib/renderer.h`/ |
| 304 | #include "3d.h"cxx . . $ `<file>/lib/3d.h`/ |
| 305 | #include "gamefont.h"cxx . . $ `<file>/Descent3/gamefont.h`/ |
| 306 | #include "bitmap.h"cxx . . $ `<file>/lib/bitmap.h`/ |
| 307 | #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/ |
| 308 | #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/ |
| 309 | #include "textaux.h"cxx . . $ `<file>/lib/textaux.h`/ |
| 310 | #include "newui_core.h"cxx . . $ `<file>/Descent3/newui_core.h`/ |
| 311 | #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/ |
| 312 | #include "dedicated_server.h"cxx . . $ `<file>/lib/dedicated_server.h`/ |
| 313 | |
| 314 | #include <stdlib.h> |
| 315 | #include <string.h> |
| 316 | #include <stdarg.h> |
| 317 | |
| 318 | #define MSGBOX_HEIGHTcxx . . $ `Descent3/newui.cpp:318:9`! msgbox.H() |
| 319 | #define BTN_WIDTHcxx . . $ `Descent3/newui.cpp:319:9`! 96 |
| 320 | #define NEWUI_FRAMETIMEcxx . . $ `Descent3/newui.cpp:320:9`! (1.0f / 25.0f) |
| 321 | |
| 322 | ////////////////////////////////////////////////////////////////////////////// |
| 323 | // Declarations |
| 324 | |
| 325 | static structcxx . . $ $anonymous_type_a4675aedcf59f5ce_0# { |
| 326 | int bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.; |
| 327 | chunked_bitmapcxx . . $ chunked_bitmap# chunkcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#chunk.; |
| 328 | } NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_NUMcxx . . $ `Descent3/newui.h:254:9`!]; |
| 329 | |
| 330 | static bool NewUI_initcxx . . $ NewUI_init. = false; |
| 331 | |
| 332 | // closes New UI system |
| 333 | void NewUIClosecxx . . $ NewUIClose(49f6e7a06ebc5aa8).(); |
| 334 | |
| 335 | ////////////////////////////////////////////////////////////////////////////// |
| 336 | // Functions |
| 337 | |
| 338 | // returns x coordinates to use to determine center position of text items for in a window/dialog |
| 339 | // width - total width of dialog/window |
| 340 | // gap - size (in pixels) of the gap you want between the left and right item |
| 341 | // left_item_width - the width (in pixels) of the left item |
| 342 | // right_item_width - the widht (in pixels) of the right item |
| 343 | // lx - will contain the left item's x coord |
| 344 | // rx - will contain the right item's x coord |
| 345 | void GetCenteredTextPoscxx . . $ GetCenteredTextPos(fb34de7af53046bd).(int width, int gap, int left_item_width, int right_item_width, int *lx, int *rx) { |
| 346 | int center_x = width / 2; |
| 347 | |
| 348 | // the left side of the left item should be same distance as the right side of the right item is from the middle |
| 349 | |
| 350 | int width_of_items = gap + left_item_width + right_item_width; |
| 351 | int center_of_items = width_of_items / 2; |
| 352 | |
| 353 | int left_gap = 0, right_gap = 0; |
| 354 | |
| 355 | left_gap = center_of_items - left_item_width; |
| 356 | right_gap = center_of_items - right_item_width; |
| 357 | |
| 358 | *lx = center_x - (left_gap + left_item_width); |
| 359 | *rx = center_x + right_gap; |
| 360 | } |
| 361 | |
| 362 | // returns x coordinates to use to determine center position of text items for in a window/dialog |
| 363 | // width - total width of dialog/window |
| 364 | // gap - size (in pixels) of the gap you want between the left and right item |
| 365 | // left_item_width - the width (in pixels) of the left item |
| 366 | // middle_item_width - the width (in pixels) of the middle item |
| 367 | // right_item_width - the width (in pixels) of the right item |
| 368 | // lx - will contain the left item's x coord |
| 369 | // rx - will contain the right item's x coord |
| 370 | // mx - will contain the middle item's x coord |
| 371 | void GetCenteredTextPoscxx . . $ GetCenteredTextPos(629ce5f67f82a3cd).(int width, int gap, int left_item_width, int middle_item_width, int right_item_width, int *lx, |
| 372 | int *mx, int *rx) { |
| 373 | int center_x = width / 2; |
| 374 | int width_of_items = 2 * gap + left_item_width + middle_item_width + right_item_width; |
| 375 | int center_of_items = width_of_items / 2; |
| 376 | |
| 377 | *lx = center_x - (width_of_items / 2); |
| 378 | *mx = (*lx) + gap + left_item_width; |
| 379 | *rx = (*mx) + gap + middle_item_width; |
| 380 | } |
| 381 | |
| 382 | // load in D3 user interface resources |
| 383 | void NewUIInitcxx . . $ NewUIInit(49f6e7a06ebc5aa8).() { |
| 384 | int i; |
| 385 | |
| 386 | if (NewUI_initcxx . . $ NewUI_init.) { |
| 387 | NewUIClosecxx . . $ NewUIClose(49f6e7a06ebc5aa8).(); |
| 388 | } else { |
| 389 | NewUI_initcxx . . $ NewUI_init. = true; |
| 390 | atexit(NewUIClosecxx . . $ NewUIClose(49f6e7a06ebc5aa8).); |
| 391 | } |
| 392 | |
| 393 | for (i = 0; i < NEWUIBMP_NUMcxx . . $ `Descent3/newui.h:254:9`!; i++) { |
| 394 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[i].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = -3; |
| 395 | } |
| 396 | |
| 397 | // load in bitmap handles here. |
| 398 | int bm_handle; |
| 399 | |
| 400 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_DIALOG_CORNER1cxx . . $ `Descent3/newui.h:257:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3dlg_nw.ogf", 0); |
| 401 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_DIALOG_CORNER2cxx . . $ `Descent3/newui.h:258:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3dlg_ne.ogf", 0); |
| 402 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_DIALOG_CORNER3cxx . . $ `Descent3/newui.h:259:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3dlg_se.ogf", 0); |
| 403 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_DIALOG_CORNER4cxx . . $ `Descent3/newui.h:260:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3dlg_sw.ogf", 0); |
| 404 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_DIALOG_HORIZTOPcxx . . $ `Descent3/newui.h:261:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3dlg_n.ogf", 0); |
| 405 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_DIALOG_VERTRIGHTcxx . . $ `Descent3/newui.h:262:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3dlg_e.ogf", 0); |
| 406 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_DIALOG_HORIZBOTcxx . . $ `Descent3/newui.h:263:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3dlg_s.ogf", 0); |
| 407 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_DIALOG_VERTLEFTcxx . . $ `Descent3/newui.h:264:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3dlg_w.ogf", 0); |
| 408 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_DIALOG_BACKcxx . . $ `Descent3/newui.h:265:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3dlg_bk.ogf", 0); |
| 409 | // NewUI_bitmap_list[NEWUIBMP_DIALOG_PANEL].bmp= bm_AllocLoadFileBitmap("d3dlg_tb.ogf",0); |
| 410 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_MSGBOX_LEFTcxx . . $ `Descent3/newui.h:267:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3mbox_l.ogf", 0); |
| 411 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_MSGBOX_RIGHTcxx . . $ `Descent3/newui.h:268:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3mbox_r.ogf", 0); |
| 412 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_MSGBOX_CENTERcxx . . $ `Descent3/newui.h:269:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3mbox_c.ogf", 0); |
| 413 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_CORNER1cxx . . $ `Descent3/newui.h:275:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("lbTopLeft32.ogf", 0); |
| 414 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_CORNER2cxx . . $ `Descent3/newui.h:276:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("lbTopRight32.ogf", 0); |
| 415 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_CORNER3cxx . . $ `Descent3/newui.h:277:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("lbBottomRight32.ogf", 0); |
| 416 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_CORNER4cxx . . $ `Descent3/newui.h:278:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("lbBottomLeft32.ogf", 0); |
| 417 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_HORIZTOPcxx . . $ `Descent3/newui.h:279:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("lbTop32.ogf", 0); |
| 418 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_VERTRIGHTcxx . . $ `Descent3/newui.h:280:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("lbRight32.ogf", 0); |
| 419 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_HORIZBOTcxx . . $ `Descent3/newui.h:281:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("lbBottom32.ogf", 0); |
| 420 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_VERTLEFTcxx . . $ `Descent3/newui.h:282:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("lbLeft32.ogf", 0); |
| 421 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_BACKcxx . . $ `Descent3/newui.h:283:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_lb_bk.ogf", 0); |
| 422 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_EDIT_LEFTcxx . . $ `Descent3/newui.h:272:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("tbLeft.ogf", 0); |
| 423 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_EDIT_RIGHTcxx . . $ `Descent3/newui.h:274:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("tbRight.ogf", 0); |
| 424 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_EDIT_CENTERcxx . . $ `Descent3/newui.h:273:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("tbCenter.ogf", 0); |
| 425 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_UPcxx . . $ `Descent3/newui.h:284:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_btn_up.ogf", 0); |
| 426 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_DOWNcxx . . $ `Descent3/newui.h:285:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_btn_down.ogf", 0); |
| 427 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_HILITEcxx . . $ `Descent3/newui.h:286:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_btn_hilite.ogf", 0); |
| 428 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_UP_Lcxx . . $ `Descent3/newui.h:287:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_btn_up_l.ogf", 0); |
| 429 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_DOWN_Lcxx . . $ `Descent3/newui.h:288:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_btn_down_l.ogf", 0); |
| 430 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_HILITE_Lcxx . . $ `Descent3/newui.h:289:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_btn_hilite_l.ogf", 0); |
| 431 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_UP_Rcxx . . $ `Descent3/newui.h:290:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_btn_up_r.ogf", 0); |
| 432 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_DOWN_Rcxx . . $ `Descent3/newui.h:291:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_btn_down_r.ogf", 0); |
| 433 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_HILITE_Rcxx . . $ `Descent3/newui.h:292:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3_btn_hilite_r.ogf", 0); |
| 434 | |
| 435 | bm_handle = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3slider.ogf", 0); |
| 436 | if (bm_handle > 0) { |
| 437 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_SLIDER_BUTTONcxx . . $ `Descent3/newui.h:271:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = -2; |
| 438 | bm_CreateChunkedBitmapcxx . . $ bm_CreateChunkedBitmap(b9fa1b176cbdfaf1).(bm_handle, &NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_SLIDER_BUTTONcxx . . $ `Descent3/newui.h:271:9`!].chunkcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#chunk.); |
| 439 | bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle); |
| 440 | } else { |
| 441 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_SLIDER_BUTTONcxx . . $ `Descent3/newui.h:271:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = -1; |
| 442 | } |
| 443 | bm_handle = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("d3sliderbar.ogf", 0); |
| 444 | if (bm_handle > 0) { |
| 445 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_SLIDER_BARcxx . . $ `Descent3/newui.h:270:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = -2; |
| 446 | bm_CreateChunkedBitmapcxx . . $ bm_CreateChunkedBitmap(b9fa1b176cbdfaf1).(bm_handle, &NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_SLIDER_BARcxx . . $ `Descent3/newui.h:270:9`!].chunkcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#chunk.); |
| 447 | bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle); |
| 448 | } else { |
| 449 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_SLIDER_BARcxx . . $ `Descent3/newui.h:270:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = -1; |
| 450 | } |
| 451 | |
| 452 | for (i = 0; i < NEWUIBMP_NUMcxx . . $ `Descent3/newui.h:254:9`!; i++) { |
| 453 | if (NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[i].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. == 0 || NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[i].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. == -1) |
| 454 | Errorcxx . . $ Error(326aeb464d16410c).("Unable to load new user interface bitmap #%d.\n", i); |
| 455 | } |
| 456 | |
| 457 | UITextItemcxx . . $ UITextItem#::SetSaturationFactorcxx . . $ UITextItem#SetSaturationFactor(d4f767463ce0a6b3).(0); |
| 458 | |
| 459 | // new ui init 2 |
| 460 | newuiCore_Initcxx . . $ newuiCore_Init(49f6e7a06ebc5aa8).(); |
| 461 | } |
| 462 | |
| 463 | // closes New UI system |
| 464 | void NewUIClosecxx . . $ NewUIClose(49f6e7a06ebc5aa8).() { |
| 465 | // new ui init 2 |
| 466 | newuiCore_Closecxx . . $ newuiCore_Close(49f6e7a06ebc5aa8).(); |
| 467 | |
| 468 | for (int i = 0; i < NEWUIBMP_NUMcxx . . $ `Descent3/newui.h:254:9`!; i++) { |
| 469 | if (NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[i].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. >= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) { |
| 470 | bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[i].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 471 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[i].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = -1; |
| 472 | } else if (NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[i].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. == -2) { |
| 473 | bm_DestroyChunkedBitmapcxx . . $ bm_DestroyChunkedBitmap(1635f60f4d3c1317).(&NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[i].chunkcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#chunk.); |
| 474 | NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[i].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp. = -1; |
| 475 | } |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | // Displays a 'temporary' dialog with a message |
| 480 | // for example: |
| 481 | // ... |
| 482 | // DoWaitMessage(true,"Please Wait..."); |
| 483 | // ... //some code |
| 484 | // DoWaitMessage(false); |
| 485 | void DoWaitMessagecxx . . $ DoWaitMessage(ee90985596e8b4f9).(bool enable, const char *message) { |
| 486 | static bool opened = false; |
| 487 | static uint8_tcxx . . $ uint8_t# cur_pos = 0; |
| 488 | float curpos_f; |
| 489 | |
| 490 | // if (1) return; |
| 491 | |
| 492 | if (Dedicated_servercxx . . $ Dedicated_server.) |
| 493 | return; |
| 494 | if (!enable && !opened) |
| 495 | return; |
| 496 | if (GetScreenModecxx . . $ GetScreenMode(b126dc7c1de90089).() != SM_MENUcxx . . $ SM_MENU.) { |
| 497 | opened = false; |
| 498 | return; |
| 499 | } |
| 500 | if (enable && !opened) { |
| 501 | opened = true; |
| 502 | cur_pos = -1; |
| 503 | } |
| 504 | if (!enable && opened) { |
| 505 | opened = false; |
| 506 | return; |
| 507 | } |
| 508 | |
| 509 | // render a ui frame |
| 510 | DoUIFramecxx . . $ DoUIFrame(49f6e7a06ebc5aa8).(); |
| 511 | cur_pos++; |
| 512 | if (cur_pos > 10) |
| 513 | cur_pos = 0; |
| 514 | curpos_f = (cur_pos / 10.0f); |
| 515 | |
| 516 | // print our downloading data message. |
| 517 | g3Pointcxx . . $ g3Point# *pntlist[4], points[4]; |
| 518 | int i, rx, ry, rw, rh; |
| 519 | |
| 520 | StartFramecxx . . $ StartFrame(3285c9bef785d51c).(0, 0, Max_window_wcxx . . $ Max_window_w., Max_window_hcxx . . $ Max_window_h.); |
| 521 | grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!); |
| 522 | rw = Max_window_wcxx . . $ Max_window_w.; |
| 523 | rh = grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!) + 8; |
| 524 | rx = 0; |
| 525 | ry = Max_window_hcxx . . $ Max_window_h. - rh; |
| 526 | points[0].p3_sxcxx . . $ g3Point#p3_sx. = rx; |
| 527 | points[0].p3_sycxx . . $ g3Point#p3_sy. = ry; |
| 528 | points[1].p3_sxcxx . . $ g3Point#p3_sx. = rx + rw; |
| 529 | points[1].p3_sycxx . . $ g3Point#p3_sy. = ry; |
| 530 | points[2].p3_sxcxx . . $ g3Point#p3_sx. = rx + rw; |
| 531 | points[2].p3_sycxx . . $ g3Point#p3_sy. = ry + rh; |
| 532 | points[3].p3_sxcxx . . $ g3Point#p3_sx. = rx; |
| 533 | points[3].p3_sycxx . . $ g3Point#p3_sy. = ry + rh; |
| 534 | |
| 535 | for (i = 0; i < 4; i++) { |
| 536 | points[i].p3_zcxx . . $ `lib/3d.h:247:9`! = 0; |
| 537 | points[i].p3_flagscxx . . $ g3Point#p3_flags. = PF_PROJECTEDcxx . . $ `lib/3d.h:214:9`!; |
| 538 | pntlist[i] = &points[i]; |
| 539 | } |
| 540 | |
| 541 | rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(0); |
| 542 | rend_SetTextureTypecxx . . $ rend_SetTextureType(cccd9781d96f97ff).(TT_FLATcxx . . $ TT_FLAT.); |
| 543 | rend_SetAlphaTypecxx . . $ rend_SetAlphaType(4af4fd0e2b26c4ac).(AT_CONSTANTcxx . . $ `lib/renderer.h:400:9`!); |
| 544 | rend_SetLightingcxx . . $ rend_SetLighting(e55526c9d3dd1656).(LS_NONEcxx . . $ LS_NONE.); |
| 545 | rend_SetFlatColorcxx . . $ rend_SetFlatColor(cb2f890c2fdad230).(GR_BLACKcxx . . $ GR_BLACK.); |
| 546 | rend_SetAlphaValuecxx . . $ rend_SetAlphaValue(ac50b47256ae7414).(230); |
| 547 | rend_DrawPolygon2Dcxx . . $ rend_DrawPolygon2D(1464bdba6025a51).(0, pntlist, 4); |
| 548 | |
| 549 | if (cur_pos > 0) { |
| 550 | points[0].p3_sxcxx . . $ g3Point#p3_sx. = rx; |
| 551 | points[0].p3_sycxx . . $ g3Point#p3_sy. = ry + rh - (rh / 2) + 2; |
| 552 | points[1].p3_sxcxx . . $ g3Point#p3_sx. = rx + ((float)rw * curpos_f); |
| 553 | points[1].p3_sycxx . . $ g3Point#p3_sy. = ry + rh - (rh / 2) + 2; |
| 554 | points[2].p3_sxcxx . . $ g3Point#p3_sx. = rx + ((float)rw * curpos_f); |
| 555 | points[2].p3_sycxx . . $ g3Point#p3_sy. = ry + rh; |
| 556 | points[3].p3_sxcxx . . $ g3Point#p3_sx. = rx; |
| 557 | points[3].p3_sycxx . . $ g3Point#p3_sy. = ry + rh; |
| 558 | |
| 559 | rend_SetFlatColorcxx . . $ rend_SetFlatColor(cb2f890c2fdad230).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 0, 0)); |
| 560 | rend_SetAlphaValuecxx . . $ rend_SetAlphaValue(ac50b47256ae7414).(230); |
| 561 | rend_DrawPolygon2Dcxx . . $ rend_DrawPolygon2D(1464bdba6025a51).(0, pntlist, 4); |
| 562 | } |
| 563 | |
| 564 | grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(255); |
| 565 | grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!); |
| 566 | if (message) { |
| 567 | grtext_Putscxx . . $ grtext_Puts(3139f19a0dbb8edf).(0, ry, message); |
| 568 | } else { |
| 569 | grtext_Putscxx . . $ grtext_Puts(3139f19a0dbb8edf).(0, ry, TXT_INITDATAcxx . . $ `Descent3/stringtable.h:154:9`!); |
| 570 | } |
| 571 | grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).(); |
| 572 | |
| 573 | EndFramecxx . . $ EndFrame(49f6e7a06ebc5aa8).(); |
| 574 | rend_Flipcxx . . $ rend_Flip(49f6e7a06ebc5aa8).(); |
| 575 | } |
| 576 | |
| 577 | void DoWaitPopupcxx . . $ DoWaitPopup(ee90985596e8b4f9).(bool enable, const char *message) { |
| 578 | #define FDWM_HEIGHTcxx . . $ `Descent3/newui.cpp:578:9`! 128 |
| 579 | #define FDWM_WIDTHcxx . . $ `Descent3/newui.cpp:579:9`! 256 |
| 580 | |
| 581 | static newuiTiledWindowcxx . . $ newuiTiledWindow# *msgbox = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 582 | static UITextcxx . . $ UIText# text; |
| 583 | static bool opened = false; |
| 584 | newuiSheetcxx . . $ newuiSheet# *sheet; |
| 585 | |
| 586 | if (opened == enable) { |
| 587 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 588 | } |
| 589 | |
| 590 | opened = enable; |
| 591 | |
| 592 | if (enable) { |
| 593 | msgbox = new newuiTiledWindowcxx . . $ newuiTiledWindow#; |
| 594 | |
| 595 | if (msgbox) { |
| 596 | |
| 597 | msgbox->Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 0, FDWM_WIDTHcxx . . $ `Descent3/newui.cpp:579:9`!, FDWM_HEIGHTcxx . . $ `Descent3/newui.cpp:578:9`!); |
| 598 | |
| 599 | sheet = msgbox->GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).(); |
| 600 | if (message) { |
| 601 | char msg[512]; |
| 602 | int w, h; |
| 603 | textaux_WordWrapcxx . . $ textaux_WordWrap(2480230cce71d9d7).(message, msg, FDWM_WIDTHcxx . . $ `Descent3/newui.cpp:579:9`!, MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!); |
| 604 | grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!); |
| 605 | w = grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(msg); |
| 606 | h = grtext_GetTextHeightcxx . . $ grtext_GetTextHeight(5c4306d8553b3696).(msg); |
| 607 | UITextItemcxx . . $ UITextItem# itemcxx . . $ UITextItem#UITextItem(284d3affb5f9e25a).{MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!, msg, NEWUI_MONITORFONT_COLORcxx . . $ `Descent3/newui_core.h:70:9`!}; |
| 608 | text.Createcxx . . $ UIText#Create(c90f152919fa414d).(msgbox, &item, (msgbox->Wcxx . . $ UIObject#W(455f465bc33b4cdf).() - w) / 2, (msgbox->Hcxx . . $ UIObject#H(455f465bc33b4cdf).() - h) / 2); |
| 609 | |
| 610 | // sheet->NewGroup(NULL, , 25); |
| 611 | // sheet->AddText(msg); |
| 612 | } |
| 613 | |
| 614 | msgbox->Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).(); |
| 615 | // sheet->Realize(); |
| 616 | |
| 617 | // fake a DoUI |
| 618 | DoUIFramecxx . . $ DoUIFrame(49f6e7a06ebc5aa8).(); |
| 619 | rend_Flipcxx . . $ rend_Flip(49f6e7a06ebc5aa8).(); |
| 620 | } |
| 621 | } else { |
| 622 | |
| 623 | if (msgbox) { |
| 624 | msgbox->Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).(); |
| 625 | msgbox->Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).(); |
| 626 | delete msgbox; |
| 627 | } |
| 628 | msgbox = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | // puts up a message box with a title and message. |
| 633 | int DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(const char *title, const char *msg, int type, ddgr_colorcxx . . $ ddgr_color# title_color, ddgr_colorcxx . . $ ddgr_color# text_color) { |
| 634 | newuiMessageBoxcxx . . $ newuiMessageBox# mboxcxx . . $ newuiMessageBox#newuiMessageBox(49f6e7a06ebc5aa8).; |
| 635 | newuiSheetcxx . . $ newuiSheet# *sheet; |
| 636 | |
| 637 | int old_screen_mode, res; |
| 638 | char msgbuf[256]; |
| 639 | |
| 640 | // force menu mode |
| 641 | old_screen_mode = GetScreenModecxx . . $ GetScreenMode(b126dc7c1de90089).(); |
| 642 | |
| 643 | textaux_WordWrapcxx . . $ textaux_WordWrap(2480230cce71d9d7).(msg, msgbuf, NEWUI_MSGBOX_SHEET_Wcxx . . $ `Descent3/newui_core.h:637:9`!, MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!); |
| 644 | |
| 645 | // make message box |
| 646 | mbox.Createcxx . . $ newuiMessageBox#Create(34d26762b42c433a).(title, type); |
| 647 | |
| 648 | sheet = mbox.GetSheetcxx . . $ newuiMessageBox#GetSheet(661381a276e5b628).(); |
| 649 | sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 0); |
| 650 | sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(msgbuf); |
| 651 | |
| 652 | mbox.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).(); |
| 653 | res = mbox.DoUIcxx . . $ newuiMessageBox#DoUI(b126dc7c1de90089).(); |
| 654 | mbox.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).(); |
| 655 | |
| 656 | mbox.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).(); |
| 657 | |
| 658 | // restore screen |
| 659 | SetScreenModecxx . . $ SetScreenMode(918ebd27a9ddbad3).(old_screen_mode); |
| 660 | |
| 661 | // return correct value. |
| 662 | return ((res == UID_OKcxx . . $ `ui/ui.h:368:9`!) ? 1 : 0); |
| 663 | } |
| 664 | |
| 665 | // puts up a message box with a title and message. |
| 666 | // define text for buttons, btn0_title, btn1_title, ..., until NULL. |
| 667 | // also define hotkey for button immediately after title is defined. |
| 668 | // |
| 669 | // DoMessageBoxAdvanced("Title", "Hi", "Abort", KEY_A, "Retry", KEY_R, "Cancel", KEY_ESC, NULL) |
| 670 | // |
| 671 | // if button with btn0_title pressed, returns 0, btn1_title, returns 1, etc. |
| 672 | // safe for up to three buttons. |
| 673 | int DoMessageBoxAdvancedcxx . . $ DoMessageBoxAdvanced(39eb0f4656941132).(const char *title, const char *msg, const char *btn0_title, int key0, ...) { |
| 674 | newuiMessageBoxcxx . . $ newuiMessageBox# mboxcxx . . $ newuiMessageBox#newuiMessageBox(49f6e7a06ebc5aa8).; |
| 675 | newuiSheetcxx . . $ newuiSheet# *sheet; |
| 676 | va_listcxx . . $ va_list# args; |
| 677 | const char *curbtntitle; |
| 678 | int i; |
| 679 | |
| 680 | int old_screen_mode, res; |
| 681 | char msgbuf[256]; |
| 682 | |
| 683 | // force menu mode |
| 684 | old_screen_mode = GetScreenModecxx . . $ GetScreenMode(b126dc7c1de90089).(); |
| 685 | |
| 686 | textaux_WordWrapcxx . . $ textaux_WordWrap(2480230cce71d9d7).(msg, msgbuf, NEWUI_MSGBOX_SHEET_Wcxx . . $ `Descent3/newui_core.h:637:9`!, MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!); |
| 687 | |
| 688 | // make message box |
| 689 | mbox.Createcxx . . $ newuiMessageBox#Create(34d26762b42c433a).(title, MSGBOX_NULLcxx . . $ `Descent3/newui_core.h:77:9`!); |
| 690 | i = 0; |
| 691 | if (btn0_title) { |
| 692 | mbox.AddButtoncxx . . $ newuiMessageBox#AddButton(7b85637613228108).(btn0_title, i, key0); |
| 693 | i++; |
| 694 | } |
| 695 | |
| 696 | // go through all titles. |
| 697 | va_startcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:50:9`!(args, key0); |
| 698 | while ((curbtntitle = va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, char *)) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 699 | int key = va_argcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:53:9`!(args, int); |
| 700 | |
| 701 | mbox.AddButtoncxx . . $ newuiMessageBox#AddButton(7b85637613228108).(curbtntitle, i, key); |
| 702 | i++; |
| 703 | if (i == NEWUI_MSGBOX_MAXBTNScxx . . $ `Descent3/newui_core.h:638:9`!) |
| 704 | break; |
| 705 | } |
| 706 | |
| 707 | va_endcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stdarg.h:52:9`!(args); |
| 708 | |
| 709 | sheet = mbox.GetSheetcxx . . $ newuiMessageBox#GetSheet(661381a276e5b628).(); |
| 710 | sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 0); |
| 711 | sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(msgbuf); |
| 712 | |
| 713 | mbox.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).(); |
| 714 | res = mbox.DoUIcxx . . $ newuiMessageBox#DoUI(b126dc7c1de90089).(); |
| 715 | mbox.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).(); |
| 716 | |
| 717 | mbox.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).(); |
| 718 | |
| 719 | // restore screen |
| 720 | SetScreenModecxx . . $ SetScreenMode(918ebd27a9ddbad3).(old_screen_mode); |
| 721 | |
| 722 | // return correct value. |
| 723 | return res; |
| 724 | } |
| 725 | |
| 726 | bool DoEditDialogcxx . . $ DoEditDialog(79e5ffcc21f8a1c7).(const char *title, char *buffer, int buflen, bool showcancel) { |
| 727 | newuiMessageBoxcxx . . $ newuiMessageBox# mboxcxx . . $ newuiMessageBox#newuiMessageBox(49f6e7a06ebc5aa8).; |
| 728 | newuiSheetcxx . . $ newuiSheet# *sheet; |
| 729 | |
| 730 | int old_screen_mode, res; |
| 731 | char msgbuf[256]; |
| 732 | char *edit; |
| 733 | |
| 734 | // force menu mode |
| 735 | old_screen_mode = GetScreenModecxx . . $ GetScreenMode(b126dc7c1de90089).(); |
| 736 | |
| 737 | textaux_WordWrapcxx . . $ textaux_WordWrap(2480230cce71d9d7).(title, msgbuf, NEWUI_MSGBOX_SHEET_Wcxx . . $ `Descent3/newui_core.h:637:9`!, MONITOR9_NEWUI_FONTcxx . . $ `Descent3/gamefont.h:115:9`!); |
| 738 | |
| 739 | // make message box |
| 740 | mbox.Createcxx . . $ newuiMessageBox#Create(34d26762b42c433a).("", showcancel ? MSGBOX_OKCANCELcxx . . $ `Descent3/newui_core.h:79:9`! : MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!); |
| 741 | |
| 742 | sheet = mbox.GetSheetcxx . . $ newuiMessageBox#GetSheet(661381a276e5b628).(); |
| 743 | sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 25); |
| 744 | edit = sheet->AddEditBoxcxx . . $ newuiSheet#AddEditBox(56493f8cd670630f).("", buflen, 0, DEFAULT_NEWUIDcxx . . $ `Descent3/newui_core.h:159:9`!, 0, true); |
| 745 | strcpy(edit, buffer); |
| 746 | |
| 747 | sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 0); |
| 748 | sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(msgbuf); |
| 749 | |
| 750 | mbox.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).(); |
| 751 | res = mbox.DoUIcxx . . $ newuiMessageBox#DoUI(b126dc7c1de90089).(); |
| 752 | mbox.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).(); |
| 753 | |
| 754 | if (res != UID_CANCELcxx . . $ `ui/ui.h:369:9`! && res != NEWUIRES_FORCEQUITcxx . . $ `Descent3/newui_core.h:131:9`!) { |
| 755 | if (strcmp(edit, NEWUI_EDIT_CANCELED_STRcxx . . $ `Descent3/newui_core.h:180:9`!) != 0) { |
| 756 | strcpy(buffer, edit); |
| 757 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "editdialog=%s\n", buffer); |
| 758 | } else { |
| 759 | res = UID_CANCELcxx . . $ `ui/ui.h:369:9`!; |
| 760 | } |
| 761 | } |
| 762 | |
| 763 | mbox.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).(); |
| 764 | |
| 765 | // restore screen |
| 766 | SetScreenModecxx . . $ SetScreenMode(918ebd27a9ddbad3).(old_screen_mode); |
| 767 | |
| 768 | // return correct value. |
| 769 | return ((res != UID_CANCELcxx . . $ `ui/ui.h:369:9`! && res != NEWUIRES_FORCEQUITcxx . . $ `Descent3/newui_core.h:131:9`!) ? true : false); |
| 770 | } |
| 771 | |
| 772 | // puts up a file selector box |
| 773 | // Parameters: max_filename_len - the max length for the filename. filebuf have a length of at least max_filename_len+1 |
| 774 | bool DoFileDialogcxx . . $ DoFileDialog(cba71ae54cf2981d).(const char *title, const char *search_path, const char *ext, char *filebuf, |
| 775 | unsigned max_filename_len) { |
| 776 | NewUIFileDialogcxx . . $ NewUIFileDialog# dlg; |
| 777 | int w = 256, h = 256; |
| 778 | int x = Game_window_wcxx . . $ Game_window_w. / 2 - w / 2; |
| 779 | int y = Game_window_hcxx . . $ Game_window_h. / 2 - h / 2; |
| 780 | |
| 781 | dlg.Createcxx . . $ NewUIFileDialog#Create(86ab65c20c9ce6b4).(title, x, y, w, h, search_path, ext); |
| 782 | |
| 783 | if (dlg.DoModalcxx . . $ NewUIFileDialog#DoModal(c9857a73d68e59ba).()) { |
| 784 | if (strlen(dlg.GetFilenamecxx . . $ NewUIFileDialog#GetFilename(33a1f659e94feb42).()) > max_filename_len) |
| 785 | Errorcxx . . $ Error(326aeb464d16410c).("Runtime error. NewUI system DoFileDialog: (%d,%d)", strlen(dlg.GetFilenamecxx . . $ NewUIFileDialog#GetFilename(33a1f659e94feb42).()), max_filename_len); |
| 786 | strcpy(filebuf, dlg.GetFilenamecxx . . $ NewUIFileDialog#GetFilename(33a1f659e94feb42).()); |
| 787 | return true; |
| 788 | } |
| 789 | |
| 790 | filebuf[0] = 0; |
| 791 | return false; |
| 792 | } |
| 793 | |
| 794 | // shows or hides windows |
| 795 | void OpenUIWindowcxx . . $ OpenUIWindow(e2cbbde2a2931ad2).(UIWindowcxx . . $ UIWindow# *wnd) { |
| 796 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(wnd); |
| 797 | wnd->Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).(); |
| 798 | } |
| 799 | |
| 800 | void CloseUIWindowcxx . . $ CloseUIWindow(e2cbbde2a2931ad2).(UIWindowcxx . . $ UIWindow# *wnd) { |
| 801 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(wnd); |
| 802 | wnd->Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).(); |
| 803 | } |
| 804 | |
| 805 | /////////////////////////////////////////////////////////////////////////////// |
| 806 | // large bitmap library |
| 807 | |
| 808 | int LoadLargeBitmapcxx . . $ LoadLargeBitmap(df64d18e3909f364).(const char *filename, tLargeBitmapcxx . . $ tLargeBitmap# *bmp) { |
| 809 | chunked_bitmapcxx . . $ chunked_bitmap# chunk; |
| 810 | int bm_handle = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(filename), 0); |
| 811 | if (bm_handle == -1) { |
| 812 | bmp->bm_arraycxx . . $ tLargeBitmap#bm_array. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 813 | bmp->bmps_wcxx . . $ tLargeBitmap#bmps_w. = 0; |
| 814 | bmp->bmps_hcxx . . $ tLargeBitmap#bmps_h. = 0; |
| 815 | return 0; |
| 816 | } |
| 817 | |
| 818 | bm_CreateChunkedBitmapcxx . . $ bm_CreateChunkedBitmap(b9fa1b176cbdfaf1).(bm_handle, &chunk); |
| 819 | |
| 820 | if (bm_handle > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) |
| 821 | bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle); |
| 822 | |
| 823 | bmp->bmps_wcxx . . $ tLargeBitmap#bmps_w. = chunk.wcxx . . $ chunked_bitmap#w.; |
| 824 | bmp->bmps_hcxx . . $ tLargeBitmap#bmps_h. = chunk.hcxx . . $ chunked_bitmap#h.; |
| 825 | bmp->bm_arraycxx . . $ tLargeBitmap#bm_array. = chunk.bm_arraycxx . . $ chunked_bitmap#bm_array.; |
| 826 | |
| 827 | return 1; |
| 828 | } |
| 829 | |
| 830 | void FreeLargeBitmapcxx . . $ FreeLargeBitmap(99797d0c91a30e0c).(tLargeBitmapcxx . . $ tLargeBitmap# *bmp) { |
| 831 | chunked_bitmapcxx . . $ chunked_bitmap# chunk; |
| 832 | |
| 833 | chunk.wcxx . . $ chunked_bitmap#w. = bmp->bmps_wcxx . . $ tLargeBitmap#bmps_w.; |
| 834 | chunk.hcxx . . $ chunked_bitmap#h. = bmp->bmps_hcxx . . $ tLargeBitmap#bmps_h.; |
| 835 | chunk.bm_arraycxx . . $ chunked_bitmap#bm_array. = bmp->bm_arraycxx . . $ tLargeBitmap#bm_array.; |
| 836 | bm_DestroyChunkedBitmapcxx . . $ bm_DestroyChunkedBitmap(1635f60f4d3c1317).(&chunk); |
| 837 | } |
| 838 | |
| 839 | void DrawLargeBitmapcxx . . $ DrawLargeBitmap(a00f4917c93a8455).(tLargeBitmapcxx . . $ tLargeBitmap# *bmp, int x, int y, float alpha) { |
| 840 | chunked_bitmapcxx . . $ chunked_bitmap# chunk; |
| 841 | |
| 842 | chunk.wcxx . . $ chunked_bitmap#w. = bmp->bmps_wcxx . . $ tLargeBitmap#bmps_w.; |
| 843 | chunk.hcxx . . $ chunked_bitmap#h. = bmp->bmps_hcxx . . $ tLargeBitmap#bmps_h.; |
| 844 | chunk.bm_arraycxx . . $ chunked_bitmap#bm_array. = bmp->bm_arraycxx . . $ tLargeBitmap#bm_array.; |
| 845 | rend_DrawChunkedBitmapcxx . . $ rend_DrawChunkedBitmap(529c7906ea1e7bf7).(&chunk, x, y, alpha * 255); |
| 846 | } |
| 847 | |
| 848 | /////////////////////////////////////////////////////////////////////////////// |
| 849 | // Listbox procedure. |
| 850 | |
| 851 | uint8_tcxx . . $ uint8_t# NewUIWindow_alphacxx . . $ NewUIWindow_alpha. = 192; |
| 852 | |
| 853 | NewUIWindowcxx . . $ NewUIWindow#::NewUIWindowcxx . . $ NewUIWindow#NewUIWindow(49f6e7a06ebc5aa8).() : UIWindowcxx . . $ UIWindow#UIWindow(49f6e7a06ebc5aa8).() {} |
| 854 | |
| 855 | // initializes the window |
| 856 | void NewUIWindowcxx . . $ NewUIWindow#::Createcxx . . $ NewUIWindow#Create(1559a299834bcdd5).(int x, int y, int w, int h, int flags) { |
| 857 | UIWindowcxx . . $ UIWindow#::Createcxx . . $ UIWindow#Create(1559a299834bcdd5).(x, y, w, h, flags); |
| 858 | UIPrimativeItemcxx . . $ UIPrimativeItem# itemcxx . . $ UIPrimativeItem#UIPrimativeItem(cc289a6b3dfc48da).{GR_BLACKcxx . . $ GR_BLACK., NewUIWindow_alphacxx . . $ NewUIWindow_alpha.}; |
| 859 | UIWindowcxx . . $ UIWindow#::SetBackItemcxx . . $ UIWindow#SetBackItem(52afca12b6cce14a).(&item); |
| 860 | memset(&m_Chunkcxx . . $ NewUIWindow#m_Chunk., 0, sizeof(m_Chunkcxx . . $ NewUIWindow#m_Chunk.)); |
| 861 | } |
| 862 | |
| 863 | // settings and state info |
| 864 | |
| 865 | // ui system overridables |
| 866 | // overridable draws the window background before gadgets |
| 867 | void NewUIWindowcxx . . $ NewUIWindow#::OnDrawcxx . . $ NewUIWindow#OnDraw(49f6e7a06ebc5aa8).() { |
| 868 | UIWindowcxx . . $ UIWindow#::OnDrawcxx . . $ UIWindow#OnDraw(49f6e7a06ebc5aa8).(); |
| 869 | |
| 870 | if (m_Flagscxx . . $ UIWindow#m_Flags. & UIF_BORDERcxx . . $ `ui/ui.h:344:9`!) { |
| 871 | ui_DrawBoxcxx . . $ ui_DrawBox(fe09a4b73d8d396f).(GR_DARKGRAYcxx . . $ GR_DARKGRAY., 0, 0, m_Wcxx . . $ UIObject#m_W., m_Hcxx . . $ UIObject#m_H.); |
| 872 | ui_DrawBoxcxx . . $ ui_DrawBox(fe09a4b73d8d396f).(GR_LIGHTGRAYcxx . . $ GR_LIGHTGRAY., 2, 2, m_Wcxx . . $ UIObject#m_W. - 2, m_Hcxx . . $ UIObject#m_H. - 2); |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | void NewUIWindowcxx . . $ NewUIWindow#::OnDestroycxx . . $ NewUIWindow#OnDestroy(49f6e7a06ebc5aa8).() { bm_DestroyChunkedBitmapcxx . . $ bm_DestroyChunkedBitmap(1635f60f4d3c1317).(&m_Chunkcxx . . $ NewUIWindow#m_Chunk.); } |
| 877 | |
| 878 | void NewUIWindowcxx . . $ NewUIWindow#::LoadBackgroundImagecxx . . $ NewUIWindow#LoadBackgroundImage(85c52e162fed56f9).(const char *image_name) { |
| 879 | UIBitmapItemcxx . . $ UIBitmapItem# back_bmcxx . . $ UIBitmapItem#UIBitmapItem(49f6e7a06ebc5aa8).; |
| 880 | |
| 881 | bm_DestroyChunkedBitmapcxx . . $ bm_DestroyChunkedBitmap(1635f60f4d3c1317).(&m_Chunkcxx . . $ NewUIWindow#m_Chunk.); |
| 882 | memset(&m_Chunkcxx . . $ NewUIWindow#m_Chunk., 0, sizeof(m_Chunkcxx . . $ NewUIWindow#m_Chunk.)); |
| 883 | |
| 884 | if (image_name) { |
| 885 | int bm_handle = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(image_name), 0); |
| 886 | |
| 887 | if (bm_handle <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) { |
| 888 | Errorcxx . . $ Error(326aeb464d16410c).("Unable to load image %s for background.", image_name); |
| 889 | } |
| 890 | |
| 891 | // takes a large static bitmap and breaks it into smaller managable bitmaps |
| 892 | if (!bm_CreateChunkedBitmapcxx . . $ bm_CreateChunkedBitmap(b9fa1b176cbdfaf1).(bm_handle, &m_Chunkcxx . . $ NewUIWindow#m_Chunk.)) { |
| 893 | Errorcxx . . $ Error(326aeb464d16410c).("Failed to chunk background bitmap %s.", image_name); |
| 894 | } |
| 895 | |
| 896 | back_bm.set_chunked_bitmapcxx . . $ UIBitmapItem#set_chunked_bitmap(1635f60f4d3c1317).(&m_Chunkcxx . . $ NewUIWindow#m_Chunk.); |
| 897 | UIWindowcxx . . $ UIWindow#::SetBackItemcxx . . $ UIWindow#SetBackItem(52afca12b6cce14a).(&back_bm); |
| 898 | bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle); |
| 899 | } |
| 900 | } |
| 901 | |
| 902 | /////////////////////////////////////////////////////////////////////////////// |
| 903 | // NewUIGameWindow implementation. |
| 904 | |
| 905 | NewUIGameWindowcxx . . $ NewUIGameWindow#::NewUIGameWindowcxx . . $ NewUIGameWindow#NewUIGameWindow(49f6e7a06ebc5aa8).() {} |
| 906 | |
| 907 | // initializes the window |
| 908 | void NewUIGameWindowcxx . . $ NewUIGameWindow#::Createcxx . . $ NewUIGameWindow#Create(1559a299834bcdd5).(int x, int y, int w, int h, int flags) { |
| 909 | newuiTiledWindowcxx . . $ newuiTiledWindow#::Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, x, y, w, h, flags); |
| 910 | } |
| 911 | |
| 912 | /////////////////////////////////////////////////////////////////////////////// |
| 913 | // NewUIMessageBox implementation. |
| 914 | |
| 915 | NewUIMessageBoxcxx . . $ NewUIMessageBox#::NewUIMessageBoxcxx . . $ NewUIMessageBox#NewUIMessageBox(49f6e7a06ebc5aa8).() : NewUIGameWindowcxx . . $ NewUIGameWindow#() {} |
| 916 | |
| 917 | // initializes the window |
| 918 | void NewUIMessageBoxcxx . . $ NewUIMessageBox#::Createcxx . . $ NewUIMessageBox#Create(748afa4755bc9595).(int x, int y, int w, int flags) { |
| 919 | NewUIGameWindowcxx . . $ NewUIGameWindow#::Createcxx . . $ NewUIGameWindow#Create(1559a299834bcdd5).(x, y, w, 128, flags | UIF_PROCESS_ALLcxx . . $ `ui/ui.h:348:9`!); |
| 920 | } |
| 921 | |
| 922 | // settings and state info |
| 923 | |
| 924 | /////////////////////////////////////////////////////////////////////////////// |
| 925 | // NewUISlider implementation. |
| 926 | |
| 927 | // settings |
| 928 | |
| 929 | void NewUISlidercxx . . $ NewUISlider#::Createcxx . . $ NewUISlider#Create(f04546128259b10e).(UIWindowcxx . . $ UIWindow# *parent, int id, int x, int y, int flags) { |
| 930 | m_Slidercxx . . $ NewUISlider#m_Slider..set_chunked_bitmapcxx . . $ UIBitmapItem#set_chunked_bitmap(1635f60f4d3c1317).(&NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_SLIDER_BUTTONcxx . . $ `Descent3/newui.h:271:9`!].chunkcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#chunk.); |
| 931 | m_SliderBarcxx . . $ NewUISlider#m_SliderBar..set_chunked_bitmapcxx . . $ UIBitmapItem#set_chunked_bitmap(1635f60f4d3c1317).(&NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_SLIDER_BARcxx . . $ `Descent3/newui.h:270:9`!].chunkcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#chunk.); |
| 932 | |
| 933 | UISlidercxx . . $ UISlider#::Createcxx . . $ UISlider#Create(43707b8add2f137d).(parent, id, x, y, 5, 5, flags); |
| 934 | |
| 935 | UISlidercxx . . $ UISlider#::SetSliderSwitchItemcxx . . $ UISlider#SetSliderSwitchItem(52afca12b6cce14a).(&m_Slidercxx . . $ NewUISlider#m_Slider.); |
| 936 | UISlidercxx . . $ UISlider#::SetSliderItemcxx . . $ UISlider#SetSliderItem(52afca12b6cce14a).(&m_SliderBarcxx . . $ NewUISlider#m_SliderBar.); |
| 937 | } |
| 938 | |
| 939 | /////////////////////////////////////////////////////////////////////////////// |
| 940 | // NewUIEdit implementation. |
| 941 | |
| 942 | // settings |
| 943 | |
| 944 | void NewUIEditcxx . . $ NewUIEdit#::Createcxx . . $ NewUIEdit#Create(43707b8add2f137d).(UIWindowcxx . . $ UIWindow# *parent, int id, int x, int y, int w, int h, int flags) { |
| 945 | m_EditLeftcxx . . $ NewUIEdit#m_EditLeft..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_EDIT_LEFTcxx . . $ `Descent3/newui.h:272:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 946 | m_EditCencxx . . $ NewUIEdit#m_EditCen..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_EDIT_CENTERcxx . . $ `Descent3/newui.h:273:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 947 | m_EditRightcxx . . $ NewUIEdit#m_EditRight..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_EDIT_RIGHTcxx . . $ `Descent3/newui.h:274:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 948 | |
| 949 | // adjust w and height acoordingly with bitmap background width and height. |
| 950 | int bk_width = (w - m_EditLeftcxx . . $ NewUIEdit#m_EditLeft..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - m_EditRightcxx . . $ NewUIEdit#m_EditRight..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) / m_EditCencxx . . $ NewUIEdit#m_EditCen..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 951 | int bk_height = 1; |
| 952 | |
| 953 | if (bk_width < 0) |
| 954 | bk_width = 0; |
| 955 | else { |
| 956 | if ((w - m_EditLeftcxx . . $ NewUIEdit#m_EditLeft..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - m_EditRightcxx . . $ NewUIEdit#m_EditRight..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) % m_EditCencxx . . $ NewUIEdit#m_EditCen..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) |
| 957 | bk_width++; |
| 958 | } |
| 959 | |
| 960 | w = (bk_width * m_EditCencxx . . $ NewUIEdit#m_EditCen..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) + m_EditLeftcxx . . $ NewUIEdit#m_EditLeft..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() + m_EditRightcxx . . $ NewUIEdit#m_EditRight..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 961 | h = (bk_height * m_EditLeftcxx . . $ NewUIEdit#m_EditLeft..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).()); |
| 962 | m_TileWidthcxx . . $ NewUIEdit#m_TileWidth. = bk_width; |
| 963 | |
| 964 | UIEditcxx . . $ UIEdit#::Createcxx . . $ UIEdit#Create(43707b8add2f137d).(parent, id, x, y, w, h, flags); |
| 965 | UIEditcxx . . $ UIEdit#::SetTextBoundscxx . . $ UIEdit#SetTextBounds(b1146eedae1e1d0b).(m_EditLeftcxx . . $ NewUIEdit#m_EditLeft..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() / 2, m_Wcxx . . $ UIObject#m_W. - m_EditRightcxx . . $ NewUIEdit#m_EditRight..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).() / 2, 0); |
| 966 | } |
| 967 | |
| 968 | void NewUIEditcxx . . $ NewUIEdit#::OnDrawcxx . . $ NewUIEdit#OnDraw(49f6e7a06ebc5aa8).() { |
| 969 | // draw tiles. |
| 970 | int x, tx; |
| 971 | |
| 972 | tx = x = 0; |
| 973 | |
| 974 | // top row. |
| 975 | m_EditLeftcxx . . $ NewUIEdit#m_EditLeft..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, 0); |
| 976 | x += m_EditRightcxx . . $ NewUIEdit#m_EditRight..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 977 | while (tx++ < m_TileWidthcxx . . $ NewUIEdit#m_TileWidth.) { |
| 978 | m_EditCencxx . . $ NewUIEdit#m_EditCen..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, 0); |
| 979 | x += m_EditCencxx . . $ NewUIEdit#m_EditCen..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 980 | } |
| 981 | m_EditRightcxx . . $ NewUIEdit#m_EditRight..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, 0); |
| 982 | |
| 983 | DrawTextcxx . . $ UIEdit#DrawText(49f6e7a06ebc5aa8).(); |
| 984 | } |
| 985 | |
| 986 | /////////////////////////////////////////////////////////////////////////////// |
| 987 | // NewUIListBox Implementation |
| 988 | |
| 989 | void NewUIListBoxcxx . . $ NewUIListBox#::Createcxx . . $ NewUIListBox#Create(43707b8add2f137d).(UIWindowcxx . . $ UIWindow# *parent, int id, int x, int y, int w, int h, int flags) { |
| 990 | m_BackNWcxx . . $ NewUIListBox#m_BackNW..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_CORNER1cxx . . $ `Descent3/newui.h:275:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 991 | m_BackNcxx . . $ NewUIListBox#m_BackN..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_HORIZTOPcxx . . $ `Descent3/newui.h:279:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 992 | m_BackNEcxx . . $ NewUIListBox#m_BackNE..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_CORNER2cxx . . $ `Descent3/newui.h:276:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 993 | m_BackEcxx . . $ NewUIListBox#m_BackE..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_VERTRIGHTcxx . . $ `Descent3/newui.h:280:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 994 | m_BackSEcxx . . $ NewUIListBox#m_BackSE..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_CORNER3cxx . . $ `Descent3/newui.h:277:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 995 | m_BackScxx . . $ NewUIListBox#m_BackS..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_HORIZBOTcxx . . $ `Descent3/newui.h:281:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 996 | m_BackSWcxx . . $ NewUIListBox#m_BackSW..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_CORNER4cxx . . $ `Descent3/newui.h:278:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 997 | m_BackWcxx . . $ NewUIListBox#m_BackW..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_VERTLEFTcxx . . $ `Descent3/newui.h:282:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 998 | m_Backcxx . . $ NewUIListBox#m_Back..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_LIST_BACKcxx . . $ `Descent3/newui.h:283:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 999 | |
| 1000 | // adjust w and height acoordingly with bitmap background width and height. |
| 1001 | int bk_width = (w - m_BackNWcxx . . $ NewUIListBox#m_BackNW..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - m_BackNEcxx . . $ NewUIListBox#m_BackNE..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) / m_BackNcxx . . $ NewUIListBox#m_BackN..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1002 | int bk_height = (h - m_BackNWcxx . . $ NewUIListBox#m_BackNW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).() - m_BackSWcxx . . $ NewUIListBox#m_BackSW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).()) / m_BackWcxx . . $ NewUIListBox#m_BackW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).(); |
| 1003 | |
| 1004 | if (bk_width < 0) |
| 1005 | bk_width = 0; |
| 1006 | else { |
| 1007 | if ((w - m_BackNWcxx . . $ NewUIListBox#m_BackNW..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - m_BackNEcxx . . $ NewUIListBox#m_BackNE..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) % m_BackNcxx . . $ NewUIListBox#m_BackN..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) |
| 1008 | bk_width++; |
| 1009 | } |
| 1010 | |
| 1011 | if (bk_height < 0) |
| 1012 | bk_height = 0; |
| 1013 | else { |
| 1014 | if ((h - m_BackNWcxx . . $ NewUIListBox#m_BackNW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).() - m_BackSWcxx . . $ NewUIListBox#m_BackSW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).()) % m_BackWcxx . . $ NewUIListBox#m_BackW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).()) |
| 1015 | bk_height++; |
| 1016 | } |
| 1017 | |
| 1018 | w = (bk_width * m_BackNcxx . . $ NewUIListBox#m_BackN..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) + m_BackNWcxx . . $ NewUIListBox#m_BackNW..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() + m_BackNEcxx . . $ NewUIListBox#m_BackNE..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1019 | h = (bk_height * m_BackWcxx . . $ NewUIListBox#m_BackW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).()) + m_BackNWcxx . . $ NewUIListBox#m_BackNW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).() + m_BackSWcxx . . $ NewUIListBox#m_BackSW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).(); |
| 1020 | m_TileWidthcxx . . $ NewUIListBox#m_TileWidth. = bk_width; |
| 1021 | m_TileHeightcxx . . $ NewUIListBox#m_TileHeight. = bk_height; |
| 1022 | |
| 1023 | UIListBoxcxx . . $ UIListBox#::Createcxx . . $ UIListBox#Create(43707b8add2f137d).(parent, id, x, y, w, h, flags); |
| 1024 | |
| 1025 | // redefine special paramaeters for the new listbox |
| 1026 | m_TextOffXcxx . . $ UIListBox#m_TextOffX. = m_BackWcxx . . $ NewUIListBox#m_BackW..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() / 2; |
| 1027 | m_TextOffYcxx . . $ UIListBox#m_TextOffY. = m_BackNcxx . . $ NewUIListBox#m_BackN..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).() / 2; |
| 1028 | m_CXcxx . . $ UIListBox#m_CX. = m_TextOffXcxx . . $ UIListBox#m_TextOffX.; |
| 1029 | m_CYcxx . . $ UIListBox#m_CY. = m_TextOffYcxx . . $ UIListBox#m_TextOffY.; |
| 1030 | m_CX2cxx . . $ UIListBox#m_CX2. = m_Wcxx . . $ UIObject#m_W. - m_TextOffXcxx . . $ UIListBox#m_TextOffX.; |
| 1031 | m_CY2cxx . . $ UIListBox#m_CY2. = m_Hcxx . . $ UIObject#m_H. - m_TextOffYcxx . . $ UIListBox#m_TextOffY.; |
| 1032 | } |
| 1033 | |
| 1034 | void NewUIListBoxcxx . . $ NewUIListBox#::OnDrawcxx . . $ NewUIListBox#OnDraw(49f6e7a06ebc5aa8).() { |
| 1035 | int x, y, tx, ty; |
| 1036 | |
| 1037 | // draw tiles. |
| 1038 | tx = x = 0; |
| 1039 | ty = y = 0; |
| 1040 | |
| 1041 | // top row. |
| 1042 | m_BackNWcxx . . $ NewUIListBox#m_BackNW..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y); |
| 1043 | x += m_BackNWcxx . . $ NewUIListBox#m_BackNW..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1044 | while (tx++ < m_TileWidthcxx . . $ NewUIListBox#m_TileWidth.) { |
| 1045 | m_BackNcxx . . $ NewUIListBox#m_BackN..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y); |
| 1046 | x += m_BackNcxx . . $ NewUIListBox#m_BackN..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1047 | } |
| 1048 | m_BackNEcxx . . $ NewUIListBox#m_BackNE..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y); |
| 1049 | |
| 1050 | x = 0; |
| 1051 | y += m_BackNWcxx . . $ NewUIListBox#m_BackNW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).(); |
| 1052 | |
| 1053 | // mid rows. |
| 1054 | while (ty++ < m_TileHeightcxx . . $ NewUIListBox#m_TileHeight.) { |
| 1055 | m_BackWcxx . . $ NewUIListBox#m_BackW..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y); |
| 1056 | x += m_BackWcxx . . $ NewUIListBox#m_BackW..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1057 | tx = 0; |
| 1058 | while (tx++ < m_TileWidthcxx . . $ NewUIListBox#m_TileWidth.) { |
| 1059 | m_Backcxx . . $ NewUIListBox#m_Back..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y); |
| 1060 | x += m_Backcxx . . $ NewUIListBox#m_Back..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1061 | } |
| 1062 | m_BackEcxx . . $ NewUIListBox#m_BackE..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y); |
| 1063 | x = 0; |
| 1064 | y += m_BackWcxx . . $ NewUIListBox#m_BackW..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).(); |
| 1065 | } |
| 1066 | |
| 1067 | // bottom row. |
| 1068 | m_BackSWcxx . . $ NewUIListBox#m_BackSW..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y); |
| 1069 | x += m_BackSWcxx . . $ NewUIListBox#m_BackSW..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1070 | tx = 0; |
| 1071 | while (tx++ < m_TileWidthcxx . . $ NewUIListBox#m_TileWidth.) { |
| 1072 | m_BackScxx . . $ NewUIListBox#m_BackS..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y); |
| 1073 | x += m_BackScxx . . $ NewUIListBox#m_BackS..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1074 | } |
| 1075 | m_BackSEcxx . . $ NewUIListBox#m_BackSE..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, y); |
| 1076 | |
| 1077 | // draw text! |
| 1078 | UIListBoxcxx . . $ UIListBox#::OnDrawcxx . . $ UIListBox#OnDraw(49f6e7a06ebc5aa8).(); |
| 1079 | } |
| 1080 | |
| 1081 | // NewUIComboBox |
| 1082 | // displays a listbox just one item. |
| 1083 | |
| 1084 | void NewUIComboBoxcxx . . $ NewUIComboBox#::Createcxx . . $ NewUIComboBox#Create(d616eeffcc609617).(UIWindowcxx . . $ UIWindow# *parent, int id, int x, int y, int w, int flags) { |
| 1085 | int h; |
| 1086 | |
| 1087 | m_CmbLeftcxx . . $ NewUIComboBox#m_CmbLeft..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_EDIT_LEFTcxx . . $ `Descent3/newui.h:272:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1088 | m_CmbCencxx . . $ NewUIComboBox#m_CmbCen..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_EDIT_CENTERcxx . . $ `Descent3/newui.h:273:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1089 | m_CmbRightcxx . . $ NewUIComboBox#m_CmbRight..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_EDIT_RIGHTcxx . . $ `Descent3/newui.h:274:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1090 | |
| 1091 | // adjust w and height acoordingly with bitmap background width and height. |
| 1092 | int bk_width = (w - m_CmbLeftcxx . . $ NewUIComboBox#m_CmbLeft..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - m_CmbRightcxx . . $ NewUIComboBox#m_CmbRight..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) / m_CmbCencxx . . $ NewUIComboBox#m_CmbCen..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1093 | int bk_height = 1; |
| 1094 | |
| 1095 | if (bk_width < 0) |
| 1096 | bk_width = 0; |
| 1097 | else { |
| 1098 | if ((w - m_CmbLeftcxx . . $ NewUIComboBox#m_CmbLeft..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - m_CmbRightcxx . . $ NewUIComboBox#m_CmbRight..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) % m_CmbCencxx . . $ NewUIComboBox#m_CmbCen..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) |
| 1099 | bk_width++; |
| 1100 | } |
| 1101 | |
| 1102 | w = (bk_width * m_CmbCencxx . . $ NewUIComboBox#m_CmbCen..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) + m_CmbLeftcxx . . $ NewUIComboBox#m_CmbLeft..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() + m_CmbRightcxx . . $ NewUIComboBox#m_CmbRight..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1103 | h = (bk_height * m_CmbLeftcxx . . $ NewUIComboBox#m_CmbLeft..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).()); |
| 1104 | m_TileWidthcxx . . $ NewUIComboBox#m_TileWidth. = bk_width; |
| 1105 | |
| 1106 | UIComboBoxcxx . . $ UIComboBox#::Createcxx . . $ UIComboBox#Create(43707b8add2f137d).(parent, id, x, y, w, h, flags); |
| 1107 | m_CXcxx . . $ UIComboBox#m_CX. = m_CmbLeftcxx . . $ NewUIComboBox#m_CmbLeft..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() / 2; |
| 1108 | m_CYcxx . . $ UIComboBox#m_CY. = 1 + m_CmbLeftcxx . . $ NewUIComboBox#m_CmbLeft..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).() / 4; |
| 1109 | m_CX2cxx . . $ UIComboBox#m_CX2. = m_Wcxx . . $ UIObject#m_W. - m_CmbRightcxx . . $ NewUIComboBox#m_CmbRight..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() / 2; |
| 1110 | m_CY2cxx . . $ UIComboBox#m_CY2. = m_Hcxx . . $ UIObject#m_H. - m_CmbRightcxx . . $ NewUIComboBox#m_CmbRight..heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).() / 4; |
| 1111 | } |
| 1112 | |
| 1113 | void NewUIComboBoxcxx . . $ NewUIComboBox#::OnDrawcxx . . $ NewUIComboBox#OnDraw(49f6e7a06ebc5aa8).() { |
| 1114 | // draw tiles. |
| 1115 | int x, tx; |
| 1116 | |
| 1117 | tx = x = 0; |
| 1118 | |
| 1119 | // top row. |
| 1120 | m_CmbLeftcxx . . $ NewUIComboBox#m_CmbLeft..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, 0); |
| 1121 | x += m_CmbRightcxx . . $ NewUIComboBox#m_CmbRight..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1122 | while (tx++ < m_TileWidthcxx . . $ NewUIComboBox#m_TileWidth.) { |
| 1123 | m_CmbCencxx . . $ NewUIComboBox#m_CmbCen..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, 0); |
| 1124 | x += m_CmbCencxx . . $ NewUIComboBox#m_CmbCen..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1125 | } |
| 1126 | m_CmbRightcxx . . $ NewUIComboBox#m_CmbRight..drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, 0); |
| 1127 | |
| 1128 | // draw text! |
| 1129 | UIComboBoxcxx . . $ UIComboBox#::OnDrawcxx . . $ UIComboBox#OnDraw(49f6e7a06ebc5aa8).(); |
| 1130 | } |
| 1131 | |
| 1132 | /////////////////////////////////////////////////////////////////////////////// |
| 1133 | // NewUIButton Implementation |
| 1134 | |
| 1135 | #define NEWBTN_HEIGHTcxx . . $ `Descent3/newui.cpp:1135:9`! 25 |
| 1136 | |
| 1137 | void NewUIButtoncxx . . $ NewUIButton#::Createcxx . . $ NewUIButton#Create(55c0967870198d96).(UIWindowcxx . . $ UIWindow# *parent, int id, UIItemcxx . . $ UIItem# *item, int x, int y, int w, int h, int flags) { |
| 1138 | flags |= UIF_FITcxx . . $ `ui/ui.h:343:9`!; |
| 1139 | |
| 1140 | m_BtnUpCcxx . . $ NewUIButton#m_BtnUpC..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_UPcxx . . $ `Descent3/newui.h:284:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1141 | m_BtnDownCcxx . . $ NewUIButton#m_BtnDownC..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_DOWNcxx . . $ `Descent3/newui.h:285:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1142 | m_BtnHiliteCcxx . . $ NewUIButton#m_BtnHiliteC..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_HILITEcxx . . $ `Descent3/newui.h:286:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1143 | m_BtnUpLcxx . . $ NewUIButton#m_BtnUpL..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_UP_Lcxx . . $ `Descent3/newui.h:287:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1144 | m_BtnDownLcxx . . $ NewUIButton#m_BtnDownL..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_DOWN_Lcxx . . $ `Descent3/newui.h:288:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1145 | m_BtnHiliteLcxx . . $ NewUIButton#m_BtnHiliteL..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_HILITE_Lcxx . . $ `Descent3/newui.h:289:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1146 | m_BtnUpRcxx . . $ NewUIButton#m_BtnUpR..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_UP_Rcxx . . $ `Descent3/newui.h:290:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1147 | m_BtnDownRcxx . . $ NewUIButton#m_BtnDownR..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_DOWN_Rcxx . . $ `Descent3/newui.h:291:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1148 | m_BtnHiliteRcxx . . $ NewUIButton#m_BtnHiliteR..set_bitmapcxx . . $ UIBitmapItem#set_bitmap(d4f767463ce0a6b3).(NewUI_bitmap_listcxx . . $ NewUI_bitmap_list.[NEWUIBMP_BTN_HILITE_Rcxx . . $ `Descent3/newui.h:292:9`!].bmpcxx . . $ $anonymous_type_a4675aedcf59f5ce_0#bmp.); |
| 1149 | |
| 1150 | // adjust w and height acoordingly with bitmap background width and height. |
| 1151 | UIButtoncxx . . $ UIButton#::Createcxx . . $ UIButton#Create(55c0967870198d96).(parent, id, item, x, y, w, h, flags); |
| 1152 | OnFormatcxx . . $ NewUIButton#OnFormat(49f6e7a06ebc5aa8).(); |
| 1153 | } |
| 1154 | |
| 1155 | void NewUIButtoncxx . . $ NewUIButton#::SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(UIItemcxx . . $ UIItem# *item) { |
| 1156 | UIButtoncxx . . $ UIButton#::SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_DISABLEDcxx . . $ `ui/ui.h:542:9`!, item); |
| 1157 | UIButtoncxx . . $ UIButton#::SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_INACTIVEcxx . . $ `ui/ui.h:543:9`!, item); |
| 1158 | UIButtoncxx . . $ UIButton#::SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_HILITEcxx . . $ `ui/ui.h:544:9`!, item); |
| 1159 | UIButtoncxx . . $ UIButton#::SetStateItemcxx . . $ UIButton#SetStateItem(be8be563f9cef951).(UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!, item); |
| 1160 | } |
| 1161 | |
| 1162 | // drawing behavior of the new bitmap. |
| 1163 | void NewUIButtoncxx . . $ NewUIButton#::OnDrawcxx . . $ NewUIButton#OnDraw(49f6e7a06ebc5aa8).() { |
| 1164 | // draw tiles. |
| 1165 | int x, tx; |
| 1166 | UIBitmapItemcxx . . $ UIBitmapItem# *ltile = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, *ctile = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, *rtile = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1167 | |
| 1168 | tx = x = 0; |
| 1169 | |
| 1170 | // top row. |
| 1171 | switch (m_Statecxx . . $ UIButton#m_State.) { |
| 1172 | case UI_BTS_DISABLEDcxx . . $ `ui/ui.h:542:9`!: |
| 1173 | case UI_BTS_INACTIVEcxx . . $ `ui/ui.h:543:9`!: |
| 1174 | ltile = &m_BtnUpLcxx . . $ NewUIButton#m_BtnUpL.; |
| 1175 | rtile = &m_BtnUpRcxx . . $ NewUIButton#m_BtnUpR.; |
| 1176 | ctile = &m_BtnUpCcxx . . $ NewUIButton#m_BtnUpC.; |
| 1177 | break; |
| 1178 | |
| 1179 | case UI_BTS_HILITEcxx . . $ `ui/ui.h:544:9`!: |
| 1180 | ltile = &m_BtnHiliteLcxx . . $ NewUIButton#m_BtnHiliteL.; |
| 1181 | rtile = &m_BtnHiliteRcxx . . $ NewUIButton#m_BtnHiliteR.; |
| 1182 | ctile = &m_BtnHiliteCcxx . . $ NewUIButton#m_BtnHiliteC.; |
| 1183 | break; |
| 1184 | |
| 1185 | case UI_BTS_ACTIVATEDcxx . . $ `ui/ui.h:545:9`!: |
| 1186 | ltile = &m_BtnDownLcxx . . $ NewUIButton#m_BtnDownL.; |
| 1187 | rtile = &m_BtnDownRcxx . . $ NewUIButton#m_BtnDownR.; |
| 1188 | ctile = &m_BtnDownCcxx . . $ NewUIButton#m_BtnDownC.; |
| 1189 | break; |
| 1190 | |
| 1191 | default: |
| 1192 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(0); |
| 1193 | } |
| 1194 | |
| 1195 | ltile->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, 0); |
| 1196 | x += ltile->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1197 | while (tx++ < m_TileWidthcxx . . $ NewUIButton#m_TileWidth.) { |
| 1198 | ctile->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, 0); |
| 1199 | x += ctile->widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1200 | } |
| 1201 | rtile->drawcxx . . $ UIBitmapItem#draw(84329bcd07240ccf).(x, 0); |
| 1202 | |
| 1203 | // draw title |
| 1204 | if (GetStateItemcxx . . $ UIButton#GetStateItem(6e2eddbf98f33a4f).(m_Statecxx . . $ UIButton#m_State.)) { |
| 1205 | UIItemcxx . . $ UIItem# *item = GetStateItemcxx . . $ UIButton#GetStateItem(6e2eddbf98f33a4f).(m_Statecxx . . $ UIButton#m_State.); |
| 1206 | int x = (m_Wcxx . . $ UIObject#m_W. / 2 - item->widthcxx . . $ UIItem#width(b126dc7c1de90089).() / 2); |
| 1207 | int y = (m_Hcxx . . $ UIObject#m_H. / 2 - item->heightcxx . . $ UIItem#height(b126dc7c1de90089).() / 2); |
| 1208 | item->drawcxx . . $ UIItem#draw(84329bcd07240ccf).(x, y); |
| 1209 | } |
| 1210 | } |
| 1211 | |
| 1212 | // override: called when resized or before drawing. |
| 1213 | void NewUIButtoncxx . . $ NewUIButton#::OnFormatcxx . . $ NewUIButton#OnFormat(49f6e7a06ebc5aa8).() { |
| 1214 | int bk_width; |
| 1215 | int bk_height; |
| 1216 | |
| 1217 | // check fit flag than resize according to bitmap aligned coords, then call UIGadget's one that does |
| 1218 | // centering! |
| 1219 | if ((m_Flagscxx . . $ UIGadget#m_Flags. & UIF_FITcxx . . $ `ui/ui.h:343:9`!) && m_BtnTitlecxx . . $ NewUIButton#m_BtnTitle.) { |
| 1220 | m_Wcxx . . $ UIObject#m_W. = m_BtnTitlecxx . . $ NewUIButton#m_BtnTitle.->widthcxx . . $ UIItem#width(b126dc7c1de90089).() + 10; |
| 1221 | } |
| 1222 | |
| 1223 | bk_width = (m_Wcxx . . $ UIObject#m_W. - m_BtnUpLcxx . . $ NewUIButton#m_BtnUpL..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - m_BtnUpRcxx . . $ NewUIButton#m_BtnUpR..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) / m_BtnUpCcxx . . $ NewUIButton#m_BtnUpC..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1224 | bk_height = 1; |
| 1225 | |
| 1226 | if (bk_width < 0) |
| 1227 | bk_width = 0; |
| 1228 | else { |
| 1229 | if ((m_Wcxx . . $ UIObject#m_W. - m_BtnUpLcxx . . $ NewUIButton#m_BtnUpL..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() - m_BtnUpRcxx . . $ NewUIButton#m_BtnUpR..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) % m_BtnUpCcxx . . $ NewUIButton#m_BtnUpC..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) |
| 1230 | bk_width++; |
| 1231 | } |
| 1232 | |
| 1233 | m_Wcxx . . $ UIObject#m_W. = (bk_width * m_BtnUpCcxx . . $ NewUIButton#m_BtnUpC..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).()) + m_BtnUpLcxx . . $ NewUIButton#m_BtnUpL..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).() + m_BtnUpRcxx . . $ NewUIButton#m_BtnUpR..widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(); |
| 1234 | m_Hcxx . . $ UIObject#m_H. = NEWBTN_HEIGHTcxx . . $ `Descent3/newui.cpp:1135:9`!; |
| 1235 | m_TileWidthcxx . . $ NewUIButton#m_TileWidth. = bk_width; |
| 1236 | |
| 1237 | UIGadgetcxx . . $ UIGadget#::OnFormatcxx . . $ UIGadget#OnFormat(49f6e7a06ebc5aa8).(); |
| 1238 | } |
| 1239 | |
| 1240 | /////////////////////////////////////////////////////////////////////////////// |
| 1241 | // NewUIFileDialog |
| 1242 | // this draws a file lister. |
| 1243 | |
| 1244 | #define UID_FILELISTcxx . . $ `Descent3/newui.cpp:1244:9`! 0x100 |
| 1245 | |
| 1246 | void NewUIFileDialogcxx . . $ NewUIFileDialog#::Createcxx . . $ NewUIFileDialog#Create(86ab65c20c9ce6b4).(const char *title, int x, int y, int w, int h, const char *path, const char *filecard) { |
| 1247 | int list_y, list_w, list_h; |
| 1248 | |
| 1249 | NewUIGameWindowcxx . . $ NewUIGameWindow#::Createcxx . . $ NewUIGameWindow#Create(1559a299834bcdd5).(x, y, w, h); |
| 1250 | |
| 1251 | strcpy(m_SearchExtcxx . . $ NewUIFileDialog#m_SearchExt., filecard); |
| 1252 | SetSearchPathcxx . . $ NewUIFileDialog#SetSearchPath(85c52e162fed56f9).(path); |
| 1253 | |
| 1254 | list_w = w - 48; |
| 1255 | list_h = h - 64; |
| 1256 | list_y = 24; |
| 1257 | |
| 1258 | UITextItemcxx . . $ UITextItem# itemTitlecxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{(char *)title}; |
| 1259 | m_TitleStrcxx . . $ NewUIFileDialog#m_TitleStr..Createcxx . . $ UIText#Create(c90f152919fa414d).(this, &itemTitle, 0, 5, UIF_CENTERcxx . . $ `ui/ui.h:342:9`!); |
| 1260 | m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..Createcxx . . $ NewUIListBox#Create(43707b8add2f137d).(this, UID_FILELISTcxx . . $ `Descent3/newui.cpp:1244:9`!, 0, list_y, list_w, list_h, UIF_CENTERcxx . . $ `ui/ui.h:342:9`!); |
| 1261 | UITextItemcxx . . $ UITextItem# itemListcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!}; |
| 1262 | m_Okcxx . . $ NewUIFileDialog#m_Ok..Createcxx . . $ NewUIButton#Create(55c0967870198d96).(this, UID_OKcxx . . $ `ui/ui.h:368:9`!, &itemList, 32, m_Hcxx . . $ UIObject#m_H. - 32, 0, 0, UIF_FITcxx . . $ `ui/ui.h:343:9`!); |
| 1263 | UITextItemcxx . . $ UITextItem# itemCancelcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!}; |
| 1264 | m_Cancelcxx . . $ NewUIFileDialog#m_Cancel..Createcxx . . $ NewUIButton#Create(55c0967870198d96).(this, UID_CANCELcxx . . $ `ui/ui.h:369:9`!, &itemCancel, m_Wcxx . . $ UIObject#m_W. - m_Okcxx . . $ NewUIFileDialog#m_Ok..Wcxx . . $ UIObject#W(455f465bc33b4cdf).() - 32, m_Hcxx . . $ UIObject#m_H. - 32, 0, 0, UIF_FITcxx . . $ `ui/ui.h:343:9`!); |
| 1265 | |
| 1266 | m_FileItemscxx . . $ NewUIFileDialog#m_FileItems. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1267 | |
| 1268 | UpdateListcxx . . $ NewUIFileDialog#UpdateList(49f6e7a06ebc5aa8).(); |
| 1269 | } |
| 1270 | |
| 1271 | void NewUIFileDialogcxx . . $ NewUIFileDialog#::SetSearchPathcxx . . $ NewUIFileDialog#SetSearchPath(85c52e162fed56f9).(const char *path) { strcpy(m_SearchPathcxx . . $ NewUIFileDialog#m_SearchPath., path); } |
| 1272 | |
| 1273 | const char *NewUIFileDialogcxx . . $ NewUIFileDialog#::GetFilenamecxx . . $ NewUIFileDialog#GetFilename(33a1f659e94feb42).() { return m_NewPathcxx . . $ NewUIFileDialog#m_NewPath.; } |
| 1274 | |
| 1275 | void NewUIFileDialogcxx . . $ NewUIFileDialog#::UpdateListcxx . . $ NewUIFileDialog#UpdateList(49f6e7a06ebc5aa8).() { |
| 1276 | char search_str[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!]; |
| 1277 | char filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!]; |
| 1278 | |
| 1279 | // remove items from listbox, free them. |
| 1280 | while (m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..GetNumItemscxx . . $ UIListBox#GetNumItems(455f465bc33b4cdf).()) { |
| 1281 | UIItemcxx . . $ UIItem# *item = m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..GetItemcxx . . $ UIListBox#GetItem(546e15a08a69e3a5).(0); |
| 1282 | m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..RemoveItemcxx . . $ UIListBox#RemoveItem(f57aa2fef0df48a8).(item); |
| 1283 | delete item; |
| 1284 | } |
| 1285 | |
| 1286 | // read in all files that have all search parameters met |
| 1287 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(search_str, m_SearchPathcxx . . $ NewUIFileDialog#m_SearchPath., m_SearchExtcxx . . $ NewUIFileDialog#m_SearchExt., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 1288 | |
| 1289 | if (ddio_FindFileStartcxx . . $ ddio_FindFileStart(84e74a5521f49206).(search_str, filename)) { |
| 1290 | UIItemcxx . . $ UIItem# *item = new UITextItemcxx . . $ UITextItem#(filename); |
| 1291 | m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..AddItemcxx . . $ UIListBox#AddItem(f57aa2fef0df48a8).(item); |
| 1292 | |
| 1293 | while (ddio_FindNextFilecxx . . $ ddio_FindNextFile(c6b7e35ff6de5671).(filename)) { |
| 1294 | item = new UITextItemcxx . . $ UITextItem#(filename); |
| 1295 | m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..AddItemcxx . . $ UIListBox#AddItem(f57aa2fef0df48a8).(item); |
| 1296 | } |
| 1297 | |
| 1298 | ddio_FindFileClosecxx . . $ ddio_FindFileClose(49f6e7a06ebc5aa8).(); |
| 1299 | } |
| 1300 | } |
| 1301 | |
| 1302 | bool NewUIFileDialogcxx . . $ NewUIFileDialog#::DoModalcxx . . $ NewUIFileDialog#DoModal(c9857a73d68e59ba).() { |
| 1303 | bool exit_menu = false, return_value = false; |
| 1304 | |
| 1305 | this->Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).(); |
| 1306 | |
| 1307 | // update file list in listbox. |
| 1308 | UpdateListcxx . . $ NewUIFileDialog#UpdateList(49f6e7a06ebc5aa8).(); |
| 1309 | |
| 1310 | while (!exit_menu) { |
| 1311 | const char *filename; |
| 1312 | int index; |
| 1313 | int result; |
| 1314 | |
| 1315 | result = DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).(); |
| 1316 | |
| 1317 | switch (result) { |
| 1318 | case NEWUIRES_FORCEQUITcxx . . $ `Descent3/newui_core.h:131:9`!: |
| 1319 | case UID_CANCELcxx . . $ `ui/ui.h:369:9`!: |
| 1320 | exit_menu = true; |
| 1321 | return_value = false; |
| 1322 | break; |
| 1323 | |
| 1324 | case UID_OKcxx . . $ `ui/ui.h:368:9`!: |
| 1325 | case UID_FILELISTcxx . . $ `Descent3/newui.cpp:1244:9`!: |
| 1326 | index = m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..GetSelectedIndexcxx . . $ UIListBox#GetSelectedIndex(455f465bc33b4cdf).(); |
| 1327 | filename = ((UITextItemcxx . . $ UITextItem# *)m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..GetItemcxx . . $ UIListBox#GetItem(546e15a08a69e3a5).(index))->GetBuffercxx . . $ UITextItem#GetBuffer(a9f41ea0e82d88cf).(); |
| 1328 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(strlen(filename) < (_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!)); |
| 1329 | strcpy(m_NewPathcxx . . $ NewUIFileDialog#m_NewPath., filename); |
| 1330 | return_value = true; |
| 1331 | exit_menu = true; |
| 1332 | break; |
| 1333 | } |
| 1334 | } |
| 1335 | |
| 1336 | this->Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).(); |
| 1337 | this->Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).(); |
| 1338 | |
| 1339 | return return_value; |
| 1340 | } |
| 1341 | |
| 1342 | void NewUIFileDialogcxx . . $ NewUIFileDialog#::OnDestroycxx . . $ NewUIFileDialog#OnDestroy(49f6e7a06ebc5aa8).() { |
| 1343 | // remove items from listbox, free them. |
| 1344 | while (m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..GetNumItemscxx . . $ UIListBox#GetNumItems(455f465bc33b4cdf).()) { |
| 1345 | UIItemcxx . . $ UIItem# *item = m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..GetItemcxx . . $ UIListBox#GetItem(546e15a08a69e3a5).(0); |
| 1346 | m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox..RemoveItemcxx . . $ UIListBox#RemoveItem(f57aa2fef0df48a8).(item); |
| 1347 | delete item; |
| 1348 | } |
| 1349 | |
| 1350 | UIWindowcxx . . $ UIWindow#::OnDestroycxx . . $ UIWindow#OnDestroy(49f6e7a06ebc5aa8).(); |
| 1351 | } |
| 1352 | |
| 1353 | //@@class NewUIFileDialog: public NewUIGameWindow |
| 1354 | //@@{ |
| 1355 | //@@ NewUIListBox m_ListBox; |
| 1356 | //@@ NewUIButton m_Ok; |
| 1357 | //@@ |
| 1358 | //@@ char m_SearchPath[_MAX_PATH]; |
| 1359 | //@@ char m_SearchExt[PSFILENAME_LEN]; |
| 1360 | //@@ char m_NewPath[_MAX_PATH]; |
| 1361 | //@@ |
| 1362 | //@@public: |
| 1363 | //@@ void Create(int x, int y, int w, int h, const char *path, const char *ext); |
| 1364 | //@@ |
| 1365 | //@@}; |