| 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.h $ |
| 21 | * $Revision: 49 $ |
| 22 | * $Date: 4/27/99 8:51a $ |
| 23 | * $Author: Matt $ |
| 24 | * |
| 25 | * New UI Enhancements for D3 |
| 26 | * |
| 27 | * $Log: /DescentIII/Main/newui.h $ |
| 28 | * |
| 29 | * 49 4/27/99 8:51a Matt |
| 30 | * Added defines for dialog title sizes |
| 31 | * |
| 32 | * 48 4/26/99 9:12p Matt |
| 33 | * Made the hotspot color full bright for old newui to make up for the |
| 34 | * removal of saturation. |
| 35 | * |
| 36 | * 47 4/25/99 3:35a Jeff |
| 37 | * added a please wait popup dialog when entering telcom |
| 38 | * |
| 39 | * 46 4/24/99 11:13p Jeff |
| 40 | * added flags for creating a newui window for a title bar |
| 41 | * |
| 42 | * 45 4/20/99 3:32p Kevin |
| 43 | * made it possible for an edit box to not have a cancel button... used it |
| 44 | * for choosing team count for server |
| 45 | * |
| 46 | * 44 4/16/99 3:58a Jeff |
| 47 | * for linux builds include linux_fix.h to get rid of some errors for |
| 48 | * stricmp |
| 49 | * |
| 50 | * 43 4/15/99 5:28p Samir |
| 51 | * added advanced messagebox |
| 52 | * |
| 53 | * 42 3/05/99 11:38a Kevin |
| 54 | * new color scheme |
| 55 | * |
| 56 | * 41 3/03/99 5:14a Jeff |
| 57 | * added DoWaitMessage() |
| 58 | * |
| 59 | * 40 2/28/99 3:06a Jeff |
| 60 | * adjust ok/cancel y offset for new ui artwork |
| 61 | * |
| 62 | * 39 2/27/99 8:34p Samir |
| 63 | * NewuiGameWindow inherits newuiTiledWindow. |
| 64 | * |
| 65 | * 38 2/21/99 6:39p Samir |
| 66 | * new edit box. |
| 67 | * |
| 68 | * 37 2/16/99 12:06p Samir |
| 69 | * added new ui api. |
| 70 | * |
| 71 | * 36 12/09/98 4:17p Samir |
| 72 | * messageboxes use new art. |
| 73 | * |
| 74 | * 35 11/10/98 5:17p Jeff |
| 75 | * fixed define for OK_CANCEL for new ui artwork |
| 76 | * |
| 77 | * 34 10/07/98 6:27p Samir |
| 78 | * added code to quit menus if mutliplayer bailed. |
| 79 | * |
| 80 | * 33 10/06/98 5:34p Jeff |
| 81 | * various UI changes/improvements |
| 82 | * |
| 83 | * 32 9/28/98 4:35p Jeff |
| 84 | * general UI changes and improvements |
| 85 | * |
| 86 | * 31 9/23/98 3:08p Jeff |
| 87 | * updated the colors and various other items of config and UI |
| 88 | * |
| 89 | * 30 9/22/98 3:55p Samir |
| 90 | * moved simple callback to NewUI system. |
| 91 | * |
| 92 | * 29 9/02/98 6:50p Samir |
| 93 | * added new combo box. |
| 94 | * |
| 95 | * 28 9/02/98 2:54p Jeff |
| 96 | * added defines for text colors to be used throughout the game...fixed up |
| 97 | * buddy menu too |
| 98 | * |
| 99 | * 27 8/27/98 2:52p Samir |
| 100 | * changing window system to work in two modes. |
| 101 | * |
| 102 | * 26 8/20/98 6:46p Samir |
| 103 | * added DoEditDialog. |
| 104 | * |
| 105 | * 25 8/19/98 2:18p Jeff |
| 106 | * changed ddio_CleanPath |
| 107 | * |
| 108 | * 24 8/14/98 7:37p Matt |
| 109 | * Since PSFILENAME_LEN is now considered to be the max length of the |
| 110 | * string itself (not counting the terminating null), buffers for file |
| 111 | * name need to be PSFILENAME_LEN+1 bytes long. |
| 112 | * |
| 113 | * 23 7/29/98 5:39p Jeff |
| 114 | * added DoPathFileDialog |
| 115 | * |
| 116 | * 22 6/22/98 2:34p Samir |
| 117 | * added ability to use a bitmap as background for NewUIWindows. |
| 118 | * |
| 119 | * 21 6/05/98 5:35p Samir |
| 120 | * added Class functions to all newui classes. |
| 121 | * |
| 122 | * 20 5/26/98 8:16p Samir |
| 123 | * implemented UIFileDialog's ONDestroy function. |
| 124 | * |
| 125 | * 19 5/25/98 8:18p Samir |
| 126 | * File dialogs implemented. |
| 127 | * |
| 128 | * 18 5/19/98 6:23p Samir |
| 129 | * added NewUIButton |
| 130 | * |
| 131 | * 17 4/29/98 12:55p Samir |
| 132 | * added titile bar to NewUIWindow. |
| 133 | * |
| 134 | * 16 4/13/98 7:01p Samir |
| 135 | * added snazzy listbox and edit box art. |
| 136 | * |
| 137 | * 15 3/24/98 10:45a Samir |
| 138 | * Added GetUICallback. |
| 139 | * |
| 140 | * 14 3/13/98 12:00p Jeff |
| 141 | * Fixed up DoMessageBox so the text position is correct, it prints a |
| 142 | * window title, and you can specify text color |
| 143 | * |
| 144 | * 13 3/11/98 2:35p Samir |
| 145 | * New message box implemented. |
| 146 | * |
| 147 | * 12 3/10/98 7:26p Samir |
| 148 | * Added new slider. |
| 149 | * |
| 150 | * 11 3/10/98 12:49p Samir |
| 151 | * Bitmapped dialog supported. |
| 152 | * |
| 153 | * 10 3/02/98 5:53p Samir |
| 154 | * Default value for alpha of windows is set. |
| 155 | * |
| 156 | * 9 2/15/98 7:07p Samir |
| 157 | * Updated NewUIWindow to UIWindow's changes. |
| 158 | * |
| 159 | * 8 2/13/98 6:37p Samir |
| 160 | * Added DoUIFrameWithoutInput. |
| 161 | * |
| 162 | * 7 2/02/98 4:31p Samir |
| 163 | * Added prototype for DoUIFrame. |
| 164 | * |
| 165 | * 6 1/30/98 7:04p Samir |
| 166 | * Added the first NewUIWindow class. |
| 167 | * |
| 168 | * 5 1/26/98 2:15p Samir |
| 169 | * Message box params are char*. |
| 170 | * |
| 171 | * 4 1/13/98 6:29p Samir |
| 172 | * Moved Large Bitmap code from Menu.cpp to newui.cpp. |
| 173 | * |
| 174 | * 3 1/08/98 12:18p Samir |
| 175 | * New menu interface. |
| 176 | * |
| 177 | * 2 1/05/98 10:56a Samir |
| 178 | * New menu stuff. |
| 179 | * |
| 180 | * 1 1/02/98 2:09p Samir |
| 181 | * Initial revision |
| 182 | * |
| 183 | * |
| 184 | * $NoKeywords: $ |
| 185 | */ |
| 186 | |
| 187 | #ifndef NEWUI_H |
| 188 | #define NEWUI_Hcxx . . $ `Descent3/newui.h:188:9`! |
| 189 | |
| 190 | #if defined(POSIXcxx . . $ `<built-in>:480:9`!) |
| 191 | #include "linux_fix.h"cxx . . $ `<file>/linux/linux_fix.h`/ //fix some of the stricmp's |
| 192 | #endif |
| 193 | |
| 194 | #include "newui_core.h"cxx . . $ `<file>/Descent3/newui_core.h`/ |
| 195 | |
| 196 | // flags for creating a newui window |
| 197 | #define NUWF_TITLENONEcxx . . $ `Descent3/newui.h:197:9`! 0x00000000 // don't display a title bar |
| 198 | #define NUWF_TITLESMALLcxx . . $ `Descent3/newui.h:198:9`! 0x00100000 // display a small title bar |
| 199 | #define NUWF_TITLEMEDcxx . . $ `Descent3/newui.h:199:9`! 0x00200000 // display a medium size title bar |
| 200 | #define NUWF_TITLELARGEcxx . . $ `Descent3/newui.h:200:9`! 0x00300000 // display a large title bar |
| 201 | #define NUWF_TITLEBARMASKcxx . . $ `Descent3/newui.h:201:9`! 0x00300000 // mask to use with flags to get title bar flags |
| 202 | |
| 203 | #define NEWUI_GETTITLEBARcxx . . $ `Descent3/newui.h:203:9`!(flags) (flags & NUWF_TITLEBARMASKcxx . . $ `Descent3/newui.h:201:9`!) |
| 204 | |
| 205 | // the sizes of the various title bars |
| 206 | #define NUW_TITLESMALL_WIDTHcxx . . $ `Descent3/newui.h:206:9`! 64 |
| 207 | #define NUW_TITLEMED_WIDTHcxx . . $ `Descent3/newui.h:207:9`! 128 |
| 208 | #define NUW_TITLELARGE_WIDTHcxx . . $ `Descent3/newui.h:208:9`! 196 |
| 209 | |
| 210 | ////////////////////////////////////////////////////////////////////////////// |
| 211 | // Definitions |
| 212 | |
| 213 | // The following defines are RGB definitions for colors that should be used throughout the UI for text |
| 214 | #define UICOL_HOTSPOT_LOcxx . . $ `Descent3/newui.h:214:9`! \ |
| 215 | GR_RGB(85, 234, 3) // Color for a hotspot when it isn't in focus//GR_RGB(50,50,255) // Color for a hotspot |
| 216 | // when it isn't in focus |
| 217 | #define UICOL_HOTSPOT_HIcxx . . $ `Descent3/newui.h:217:9`! GR_WHITE // Color for a hotspot when it is in focus |
| 218 | #define UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`! GR_RGB(206, 254, 241) // Color for text that is used for labels |
| 219 | #define UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`! GR_RGB(207, 248, 105) // Color for window title text |
| 220 | #define UICOL_TEXT_AUXcxx . . $ `Descent3/newui.h:220:9`! GR_RGB(200, 200, 200) // Color for auxillary text (text that isn't a label) |
| 221 | #define UICOL_LISTBOX_LOcxx . . $ `Descent3/newui.h:221:9`! GR_RGB(85, 234, 3) // Color for listbox text that isn't in focus |
| 222 | #define UICOL_LISTBOX_HIcxx . . $ `Descent3/newui.h:222:9`! GR_RGB(207, 248, 105) // Color for listbox text that is in focus |
| 223 | #define UICOL_BUTTON_LOcxx . . $ `Descent3/newui.h:223:9`! GR_RGB(85, 234, 3) // Color for text on a button that isn't in focus |
| 224 | #define UICOL_BUTTON_HIcxx . . $ `Descent3/newui.h:224:9`! GR_RGB(207, 248, 105) // Color for text on a button that is in focus |
| 225 | #define UIALPHA_HOTSPOT_LOcxx . . $ `Descent3/newui.h:225:9`! 192 // Alpha value for hotspots not in focus |
| 226 | #define UIALPHA_HOTSPOT_HIcxx . . $ `Descent3/newui.h:226:9`! 255 // Alpha value for hotspots in focus |
| 227 | |
| 228 | // returns x coordinates to use to determine center position of text items for in a window/dialog |
| 229 | // width - total width of dialog/window |
| 230 | // gap - size (in pixels) of the gap you want between the left and right item |
| 231 | // left_item_width - the width (in pixels) of the left item |
| 232 | // right_item_width - the widht (in pixels) of the right item |
| 233 | // lx - will contain the left item's x coord |
| 234 | // rx - will contain the right item's x coord |
| 235 | void GetCenteredTextPoscxx . . $ GetCenteredTextPos(fb34de7af53046bd).(int width, int gap, int left_item_width, int right_item_width, int *lx, int *rx); |
| 236 | // returns x coordinates to use to determine center position of text items for in a window/dialog |
| 237 | // width - total width of dialog/window |
| 238 | // gap - size (in pixels) of the gap you want between the left and right item |
| 239 | // left_item_width - the width (in pixels) of the left item |
| 240 | // middle_item_width - the width (in pixels) of the middle item |
| 241 | // right_item_width - the width (in pixels) of the right item |
| 242 | // lx - will contain the left item's x coord |
| 243 | // rx - will contain the right item's x coord |
| 244 | // mx - will contain the middle item's x coord |
| 245 | void GetCenteredTextPoscxx . . $ GetCenteredTextPos(629ce5f67f82a3cd).(int width, int gap, int left_item_width, int middle_item_width, int right_item_width, int *lx, |
| 246 | int *mx, int *rx); |
| 247 | |
| 248 | // The following defines are y offset values to be used for "OK","Cancel" and "Done" (take the height of the window |
| 249 | // minus the offset to get the correct y) |
| 250 | #define OKCANCEL_YOFFSETcxx . . $ `Descent3/newui.h:250:9`! 50 // subtract this from the height of the window |
| 251 | |
| 252 | #define UI_BORDERSIZEcxx . . $ `Descent3/newui.h:252:9`! 20 |
| 253 | |
| 254 | #define NEWUIBMP_NUMcxx . . $ `Descent3/newui.h:254:9`! 48 |
| 255 | |
| 256 | // bitmap ids for user interface bitmaps. |
| 257 | #define NEWUIBMP_DIALOG_CORNER1cxx . . $ `Descent3/newui.h:257:9`! 0 |
| 258 | #define NEWUIBMP_DIALOG_CORNER2cxx . . $ `Descent3/newui.h:258:9`! 1 |
| 259 | #define NEWUIBMP_DIALOG_CORNER3cxx . . $ `Descent3/newui.h:259:9`! 2 |
| 260 | #define NEWUIBMP_DIALOG_CORNER4cxx . . $ `Descent3/newui.h:260:9`! 3 |
| 261 | #define NEWUIBMP_DIALOG_HORIZTOPcxx . . $ `Descent3/newui.h:261:9`! 4 |
| 262 | #define NEWUIBMP_DIALOG_VERTRIGHTcxx . . $ `Descent3/newui.h:262:9`! 5 |
| 263 | #define NEWUIBMP_DIALOG_HORIZBOTcxx . . $ `Descent3/newui.h:263:9`! 6 |
| 264 | #define NEWUIBMP_DIALOG_VERTLEFTcxx . . $ `Descent3/newui.h:264:9`! 7 |
| 265 | #define NEWUIBMP_DIALOG_BACKcxx . . $ `Descent3/newui.h:265:9`! 8 |
| 266 | #define NEWUIBMP_DIALOG_PANELcxx . . $ `Descent3/newui.h:266:9`! 9 |
| 267 | #define NEWUIBMP_MSGBOX_LEFTcxx . . $ `Descent3/newui.h:267:9`! 10 |
| 268 | #define NEWUIBMP_MSGBOX_RIGHTcxx . . $ `Descent3/newui.h:268:9`! 11 |
| 269 | #define NEWUIBMP_MSGBOX_CENTERcxx . . $ `Descent3/newui.h:269:9`! 12 |
| 270 | #define NEWUIBMP_SLIDER_BARcxx . . $ `Descent3/newui.h:270:9`! 13 |
| 271 | #define NEWUIBMP_SLIDER_BUTTONcxx . . $ `Descent3/newui.h:271:9`! 14 |
| 272 | #define NEWUIBMP_EDIT_LEFTcxx . . $ `Descent3/newui.h:272:9`! 15 |
| 273 | #define NEWUIBMP_EDIT_CENTERcxx . . $ `Descent3/newui.h:273:9`! 16 |
| 274 | #define NEWUIBMP_EDIT_RIGHTcxx . . $ `Descent3/newui.h:274:9`! 17 |
| 275 | #define NEWUIBMP_LIST_CORNER1cxx . . $ `Descent3/newui.h:275:9`! 18 |
| 276 | #define NEWUIBMP_LIST_CORNER2cxx . . $ `Descent3/newui.h:276:9`! 19 |
| 277 | #define NEWUIBMP_LIST_CORNER3cxx . . $ `Descent3/newui.h:277:9`! 20 |
| 278 | #define NEWUIBMP_LIST_CORNER4cxx . . $ `Descent3/newui.h:278:9`! 21 |
| 279 | #define NEWUIBMP_LIST_HORIZTOPcxx . . $ `Descent3/newui.h:279:9`! 22 |
| 280 | #define NEWUIBMP_LIST_VERTRIGHTcxx . . $ `Descent3/newui.h:280:9`! 23 |
| 281 | #define NEWUIBMP_LIST_HORIZBOTcxx . . $ `Descent3/newui.h:281:9`! 24 |
| 282 | #define NEWUIBMP_LIST_VERTLEFTcxx . . $ `Descent3/newui.h:282:9`! 25 |
| 283 | #define NEWUIBMP_LIST_BACKcxx . . $ `Descent3/newui.h:283:9`! 26 |
| 284 | #define NEWUIBMP_BTN_UPcxx . . $ `Descent3/newui.h:284:9`! 27 |
| 285 | #define NEWUIBMP_BTN_DOWNcxx . . $ `Descent3/newui.h:285:9`! 28 |
| 286 | #define NEWUIBMP_BTN_HILITEcxx . . $ `Descent3/newui.h:286:9`! 29 |
| 287 | #define NEWUIBMP_BTN_UP_Lcxx . . $ `Descent3/newui.h:287:9`! 30 |
| 288 | #define NEWUIBMP_BTN_DOWN_Lcxx . . $ `Descent3/newui.h:288:9`! 31 |
| 289 | #define NEWUIBMP_BTN_HILITE_Lcxx . . $ `Descent3/newui.h:289:9`! 32 |
| 290 | #define NEWUIBMP_BTN_UP_Rcxx . . $ `Descent3/newui.h:290:9`! 33 |
| 291 | #define NEWUIBMP_BTN_DOWN_Rcxx . . $ `Descent3/newui.h:291:9`! 34 |
| 292 | #define NEWUIBMP_BTN_HILITE_Rcxx . . $ `Descent3/newui.h:292:9`! 35 |
| 293 | |
| 294 | // Large Bitmap system |
| 295 | struct tLargeBitmapcxx . . $ tLargeBitmap# { |
| 296 | int bmps_wcxx . . $ tLargeBitmap#bmps_w.; |
| 297 | int bmps_hcxx . . $ tLargeBitmap#bmps_h.; |
| 298 | int *bm_arraycxx . . $ tLargeBitmap#bm_array.; |
| 299 | }; |
| 300 | |
| 301 | // alpha for all NewUIWindows. |
| 302 | extern uint8_tcxx . . $ uint8_t# NewUIWindow_alphacxx . . $ NewUIWindow_alpha.; |
| 303 | |
| 304 | ////////////////////////////////////////////////////////////////////////////// |
| 305 | // Core interface with UI system |
| 306 | |
| 307 | // load in D3 user interface resources |
| 308 | void NewUIInitcxx . . $ NewUIInit(49f6e7a06ebc5aa8).(); |
| 309 | |
| 310 | // closes New UI system |
| 311 | void NewUIClosecxx . . $ NewUIClose(49f6e7a06ebc5aa8).(); |
| 312 | |
| 313 | // shows or hides windows |
| 314 | void OpenUIWindowcxx . . $ OpenUIWindow(e2cbbde2a2931ad2).(UIWindowcxx . . $ UIWindow# *wnd); |
| 315 | void CloseUIWindowcxx . . $ CloseUIWindow(e2cbbde2a2931ad2).(UIWindowcxx . . $ UIWindow# *wnd); |
| 316 | |
| 317 | ////////////////////////////////////////////////////////////////////////////// |
| 318 | // quick and dirty functions |
| 319 | |
| 320 | // Displays a 'temporary' dialog with a message |
| 321 | // for example: |
| 322 | // ... |
| 323 | // DoWaitMessage(true,"Please Wait..."); |
| 324 | // ... //some code |
| 325 | // DoWaitMessage(false); |
| 326 | void DoWaitMessagecxx . . $ DoWaitMessage(ee90985596e8b4f9).(bool enable, const char *message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 327 | void DoWaitPopupcxx . . $ DoWaitPopup(ee90985596e8b4f9).(bool enable, const char *message = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 328 | |
| 329 | // puts up a message box with a title and message. |
| 330 | int DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(const char *title, const char *msg, int type, ddgr_colorcxx . . $ ddgr_color# title_color = UICOL_WINDOW_TITLEcxx . . $ GR_RGB(530956271a9518a5)., |
| 331 | ddgr_colorcxx . . $ ddgr_color# text_color = UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!); |
| 332 | |
| 333 | // puts up a message box with a title and message. |
| 334 | // define text for buttons, btn0_title, btn1_title, ..., until NULL. |
| 335 | // also define hotkey for button immediately after title is defined. |
| 336 | // |
| 337 | // DoMessageBoxAdvanced("Title", "Hi", "Abort", KEY_A, "Retry", KEY_R, "Cancel", KEY_ESC, NULL) |
| 338 | // |
| 339 | // if button with btn0_title pressed, returns 0, btn1_title, returns 1, etc. |
| 340 | // safe for up to three buttons. |
| 341 | int DoMessageBoxAdvancedcxx . . $ DoMessageBoxAdvanced(39eb0f4656941132).(const char *title, const char *msg, const char *btn0_title, int key0, ...); |
| 342 | |
| 343 | // edit dialog. |
| 344 | bool DoEditDialogcxx . . $ DoEditDialog(79e5ffcc21f8a1c7).(const char *title, char *buffer, int buflen, bool showcancel = true); |
| 345 | |
| 346 | // puts up a file selector box |
| 347 | // Parameters: max_filename_len - the max length for the filename. filebuf have a length of at least max_filename_len+1 |
| 348 | bool DoFileDialogcxx . . $ DoFileDialog(cba71ae54cf2981d).(const char *title, const char *search_path, const char *ext, char *filebuf, |
| 349 | unsigned max_filename_len); |
| 350 | |
| 351 | #define PFDF_FILEMUSTEXISTcxx . . $ `Descent3/newui.h:351:9`! 0x0001 |
| 352 | // Displays a file dialog that is very much like a Windows file dialog (you can move around directories) |
| 353 | // save_dialog = is this dialog being used to save file, or load a file. If save, than pass true |
| 354 | // path = on entry is the initial path to start in (must be set...set to 0 length string to go to root directory) |
| 355 | // on exit it is the absolute path to selected file on return (if return is true) must be at least |
| 356 | //_MAX_PATH in size title = Title of the dialog wildc = semicolon seperated list of wildcards |
| 357 | //("*.txt;*.doc;*.exe") |
| 358 | bool DoPathFileDialogcxx . . $ DoPathFileDialog(5d8ce13d0347d7c1).(bool save_dialog, char *path, const char *title, const char *wildc, int flags); |
| 359 | |
| 360 | ////////////////////////////////////////////////////////////////////////////// |
| 361 | // quick and dirty functions |
| 362 | |
| 363 | int LoadLargeBitmapcxx . . $ LoadLargeBitmap(df64d18e3909f364).(const char *filename, tLargeBitmapcxx . . $ tLargeBitmap# *bmp); |
| 364 | void FreeLargeBitmapcxx . . $ FreeLargeBitmap(99797d0c91a30e0c).(tLargeBitmapcxx . . $ tLargeBitmap# *bmp); |
| 365 | void DrawLargeBitmapcxx . . $ DrawLargeBitmap(a00f4917c93a8455).(tLargeBitmapcxx . . $ tLargeBitmap# *bmp, int x, int y, float alpha); |
| 366 | |
| 367 | ////////////////////////////////////////////////////////////////////////////// |
| 368 | // NewUI Classes |
| 369 | |
| 370 | const tUIClasscxx . . $ tUIClass# newuiWindowcxx . . $ newuiWindow. = uiNewClasscxx . . $ uiNewClass., newuiGameWindowcxx . . $ newuiGameWindow. = uiNewClasscxx . . $ uiNewClass. + 1; |
| 371 | // newuiMessageBox = uiNewClass+2, |
| 372 | // newuiSlider = uiNewClass+3, |
| 373 | // newuiEdit = uiNewClass+4, |
| 374 | // newuiListBox = uiNewClass+5, |
| 375 | // newuiButton = uiNewClass+6; |
| 376 | |
| 377 | const tUIClasscxx . . $ tUIClass# newuiNewClasscxx . . $ newuiNewClass. = 1000; |
| 378 | |
| 379 | // NewUIGameWindow |
| 380 | // this draws a UI window, but with a not-so-cool faded background. |
| 381 | |
| 382 | class NewUIWindowcxx . . $ NewUIWindow# : public UIWindowcxx . . $ UIWindow# { |
| 383 | chunked_bitmapcxx . . $ chunked_bitmap# m_Chunkcxx . . $ NewUIWindow#m_Chunk.; |
| 384 | |
| 385 | public: |
| 386 | NewUIWindowcxx . . $ NewUIWindow#NewUIWindow(49f6e7a06ebc5aa8).(); |
| 387 | |
| 388 | void Createcxx . . $ NewUIWindow#Create(1559a299834bcdd5).(int x, int y, int w, int h, int flags = UIF_PROCESS_MENUcxx . . $ `ui/ui.h:347:9`!); |
| 389 | |
| 390 | virtual tUIClasscxx . . $ tUIClass# Classcxx . . $ NewUIWindow#Class(ddd8539a2fcdd4ce).() const { // Overide this function to name the class |
| 391 | return newuiWindowcxx . . $ newuiWindow.; |
| 392 | }; |
| 393 | |
| 394 | // specify filename of image to use as background. |
| 395 | void LoadBackgroundImagecxx . . $ NewUIWindow#LoadBackgroundImage(85c52e162fed56f9).(const char *image_name); |
| 396 | |
| 397 | // ui system overridables |
| 398 | protected: |
| 399 | virtual void OnDrawcxx . . $ NewUIWindow#OnDraw(49f6e7a06ebc5aa8).(); // overridable draws the window background before gadgets |
| 400 | virtual void OnDestroycxx . . $ NewUIWindow#OnDestroy(49f6e7a06ebc5aa8).(); // when window is nuked. |
| 401 | }; |
| 402 | |
| 403 | // NewUIGameWindow |
| 404 | // this draws a UI window, but with the cool standard game dialog background. |
| 405 | |
| 406 | class NewUIGameWindowcxx . . $ NewUIGameWindow# : public newuiTiledWindowcxx . . $ newuiTiledWindow# { |
| 407 | public: |
| 408 | NewUIGameWindowcxx . . $ NewUIGameWindow#NewUIGameWindow(49f6e7a06ebc5aa8).(); |
| 409 | |
| 410 | void Createcxx . . $ NewUIGameWindow#Create(1559a299834bcdd5).(int x, int y, int w, int h, int flags = UIF_PROCESS_MENUcxx . . $ `ui/ui.h:347:9`!); |
| 411 | |
| 412 | virtual tUIClasscxx . . $ tUIClass# Classcxx . . $ NewUIGameWindow#Class(ddd8539a2fcdd4ce).() const { // Overide this function to name the class |
| 413 | return newuiGameWindowcxx . . $ newuiGameWindow.; |
| 414 | }; |
| 415 | }; |
| 416 | |
| 417 | // NewUIMessageBox |
| 418 | // this draws a UI window, but with the cool standard game dialog background. |
| 419 | |
| 420 | class NewUIMessageBoxcxx . . $ NewUIMessageBox# : public NewUIGameWindowcxx . . $ NewUIGameWindow# { |
| 421 | public: |
| 422 | NewUIMessageBoxcxx . . $ NewUIMessageBox#NewUIMessageBox(49f6e7a06ebc5aa8).(); |
| 423 | |
| 424 | void Createcxx . . $ NewUIMessageBox#Create(748afa4755bc9595).(int x, int y, int w, int flags = 0); |
| 425 | }; |
| 426 | |
| 427 | // NewUISlider |
| 428 | // this draws a nicer loking slider. |
| 429 | |
| 430 | class NewUISlidercxx . . $ NewUISlider# : public UISlidercxx . . $ UISlider# { |
| 431 | UIBitmapItemcxx . . $ UIBitmapItem# m_SliderBarcxx . . $ NewUISlider#m_SliderBar.; |
| 432 | UIBitmapItemcxx . . $ UIBitmapItem# m_Slidercxx . . $ NewUISlider#m_Slider.; |
| 433 | |
| 434 | public: |
| 435 | void Createcxx . . $ NewUISlider#Create(f04546128259b10e).(UIWindowcxx . . $ UIWindow# *parent, int id, int x, int y, int flags = 0); |
| 436 | }; |
| 437 | |
| 438 | // NewUIEdit |
| 439 | // this draws a nicer edit box |
| 440 | |
| 441 | class NewUIEditcxx . . $ NewUIEdit# : public UIEditcxx . . $ UIEdit# { |
| 442 | UIBitmapItemcxx . . $ UIBitmapItem# m_EditLeftcxx . . $ NewUIEdit#m_EditLeft.; |
| 443 | UIBitmapItemcxx . . $ UIBitmapItem# m_EditCencxx . . $ NewUIEdit#m_EditCen.; |
| 444 | UIBitmapItemcxx . . $ UIBitmapItem# m_EditRightcxx . . $ NewUIEdit#m_EditRight.; |
| 445 | |
| 446 | int m_TileWidthcxx . . $ NewUIEdit#m_TileWidth.; |
| 447 | |
| 448 | public: |
| 449 | void Createcxx . . $ NewUIEdit#Create(43707b8add2f137d).(UIWindowcxx . . $ UIWindow# *parent, int id, int x, int y, int w, int h, int flags = 0); |
| 450 | |
| 451 | // ui system overridables |
| 452 | protected: |
| 453 | virtual void OnDrawcxx . . $ NewUIEdit#OnDraw(49f6e7a06ebc5aa8).(); // overridable draws the background first |
| 454 | }; |
| 455 | |
| 456 | // NewUIListBox |
| 457 | // this draws a nicer list box |
| 458 | |
| 459 | class NewUIListBoxcxx . . $ NewUIListBox# : public UIListBoxcxx . . $ UIListBox# { |
| 460 | UIBitmapItemcxx . . $ UIBitmapItem# m_BackNWcxx . . $ NewUIListBox#m_BackNW.; |
| 461 | UIBitmapItemcxx . . $ UIBitmapItem# m_BackNcxx . . $ NewUIListBox#m_BackN.; |
| 462 | UIBitmapItemcxx . . $ UIBitmapItem# m_BackNEcxx . . $ NewUIListBox#m_BackNE.; |
| 463 | UIBitmapItemcxx . . $ UIBitmapItem# m_BackEcxx . . $ NewUIListBox#m_BackE.; |
| 464 | UIBitmapItemcxx . . $ UIBitmapItem# m_BackSEcxx . . $ NewUIListBox#m_BackSE.; |
| 465 | UIBitmapItemcxx . . $ UIBitmapItem# m_BackScxx . . $ NewUIListBox#m_BackS.; |
| 466 | UIBitmapItemcxx . . $ UIBitmapItem# m_BackSWcxx . . $ NewUIListBox#m_BackSW.; |
| 467 | UIBitmapItemcxx . . $ UIBitmapItem# m_BackWcxx . . $ NewUIListBox#m_BackW.; |
| 468 | UIBitmapItemcxx . . $ UIBitmapItem# m_Backcxx . . $ NewUIListBox#m_Back.; |
| 469 | |
| 470 | int m_TileWidthcxx . . $ NewUIListBox#m_TileWidth.; |
| 471 | int m_TileHeightcxx . . $ NewUIListBox#m_TileHeight.; |
| 472 | |
| 473 | public: |
| 474 | void Createcxx . . $ NewUIListBox#Create(43707b8add2f137d).(UIWindowcxx . . $ UIWindow# *parent, int id, int x, int y, int w, int h, int flags = 0); |
| 475 | |
| 476 | // ui system overridables |
| 477 | protected: |
| 478 | virtual void OnDrawcxx . . $ NewUIListBox#OnDraw(49f6e7a06ebc5aa8).(); // overridable draws the background first |
| 479 | }; |
| 480 | |
| 481 | // NewUIComboBox |
| 482 | // displays a listbox just one item. |
| 483 | |
| 484 | class NewUIComboBoxcxx . . $ NewUIComboBox# : public UIComboBoxcxx . . $ UIComboBox# { |
| 485 | UIBitmapItemcxx . . $ UIBitmapItem# m_CmbLeftcxx . . $ NewUIComboBox#m_CmbLeft.; |
| 486 | UIBitmapItemcxx . . $ UIBitmapItem# m_CmbCencxx . . $ NewUIComboBox#m_CmbCen.; |
| 487 | UIBitmapItemcxx . . $ UIBitmapItem# m_CmbRightcxx . . $ NewUIComboBox#m_CmbRight.; |
| 488 | |
| 489 | int m_TileWidthcxx . . $ NewUIComboBox#m_TileWidth.; |
| 490 | |
| 491 | public: |
| 492 | void Createcxx . . $ NewUIComboBox#Create(d616eeffcc609617).(UIWindowcxx . . $ UIWindow# *parent, int id, int x, int y, int w, int flags = 0); |
| 493 | |
| 494 | // ui system overridables |
| 495 | protected: |
| 496 | virtual void OnDrawcxx . . $ NewUIComboBox#OnDraw(49f6e7a06ebc5aa8).(); // overridable draws the background first |
| 497 | }; |
| 498 | |
| 499 | // NewUIButton |
| 500 | // a nicer fixed size button. |
| 501 | |
| 502 | class NewUIButtoncxx . . $ NewUIButton# : public UIButtoncxx . . $ UIButton# { |
| 503 | UIBitmapItemcxx . . $ UIBitmapItem# m_BtnUpLcxx . . $ NewUIButton#m_BtnUpL., m_BtnUpCcxx . . $ NewUIButton#m_BtnUpC., m_BtnUpRcxx . . $ NewUIButton#m_BtnUpR.; |
| 504 | UIBitmapItemcxx . . $ UIBitmapItem# m_BtnDownLcxx . . $ NewUIButton#m_BtnDownL., m_BtnDownCcxx . . $ NewUIButton#m_BtnDownC., m_BtnDownRcxx . . $ NewUIButton#m_BtnDownR.; |
| 505 | UIBitmapItemcxx . . $ UIBitmapItem# m_BtnHiliteLcxx . . $ NewUIButton#m_BtnHiliteL., m_BtnHiliteCcxx . . $ NewUIButton#m_BtnHiliteC., m_BtnHiliteRcxx . . $ NewUIButton#m_BtnHiliteR.; |
| 506 | |
| 507 | UIItemcxx . . $ UIItem# *m_BtnTitlecxx . . $ NewUIButton#m_BtnTitle.; |
| 508 | |
| 509 | int m_TileWidthcxx . . $ NewUIButton#m_TileWidth.; |
| 510 | |
| 511 | public: |
| 512 | NewUIButtoncxx . . $ NewUIButton#NewUIButton(49f6e7a06ebc5aa8).() { m_BtnTitlecxx . . $ NewUIButton#m_BtnTitle. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; }; |
| 513 | |
| 514 | virtual ~cxx . . $ NewUIButton#`~NewUIButton`(ced63f7c635d850d).NewUIButtoncxx . . $ NewUIButton#() { |
| 515 | if (m_BtnTitlecxx . . $ NewUIButton#m_BtnTitle.) |
| 516 | delete m_BtnTitlecxx . . $ NewUIButton#m_BtnTitle.; |
| 517 | }; |
| 518 | |
| 519 | void Createcxx . . $ NewUIButton#Create(55c0967870198d96).(UIWindowcxx . . $ UIWindow# *parent, int id, UIItemcxx . . $ UIItem# *item, int x, int y, int w, int h, int flags = 0); |
| 520 | void SetTitlecxx . . $ NewUIButton#SetTitle(52afca12b6cce14a).(UIItemcxx . . $ UIItem# *item); |
| 521 | |
| 522 | // ui system overridables |
| 523 | protected: |
| 524 | virtual void OnDrawcxx . . $ NewUIButton#OnDraw(49f6e7a06ebc5aa8).(); // overridable draws the background first |
| 525 | virtual void OnFormatcxx . . $ NewUIButton#OnFormat(49f6e7a06ebc5aa8).(); // override: called when resized or before drawing. |
| 526 | }; |
| 527 | |
| 528 | // NewUIFileDialog |
| 529 | // this draws a file lister. |
| 530 | |
| 531 | class NewUIFileDialogcxx . . $ NewUIFileDialog# : public NewUIGameWindowcxx . . $ NewUIGameWindow# { |
| 532 | NewUIListBoxcxx . . $ NewUIListBox# m_ListBoxcxx . . $ NewUIFileDialog#m_ListBox.; |
| 533 | NewUIButtoncxx . . $ NewUIButton# m_Okcxx . . $ NewUIFileDialog#m_Ok.; |
| 534 | NewUIButtoncxx . . $ NewUIButton# m_Cancelcxx . . $ NewUIFileDialog#m_Cancel.; |
| 535 | UITextcxx . . $ UIText# m_TitleStrcxx . . $ NewUIFileDialog#m_TitleStr.; |
| 536 | |
| 537 | UITextItemcxx . . $ UITextItem# *m_FileItemscxx . . $ NewUIFileDialog#m_FileItems.; // file item array. |
| 538 | |
| 539 | char m_SearchPathcxx . . $ NewUIFileDialog#m_SearchPath.[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!]; |
| 540 | char m_SearchExtcxx . . $ NewUIFileDialog#m_SearchExt.[PSFILENAME_LENcxx . . $ `lib/pstypes.h:31:9`! + 1]; |
| 541 | char m_NewPathcxx . . $ NewUIFileDialog#m_NewPath.[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!]; |
| 542 | |
| 543 | private: |
| 544 | void UpdateListcxx . . $ NewUIFileDialog#UpdateList(49f6e7a06ebc5aa8).(); |
| 545 | |
| 546 | public: |
| 547 | void Createcxx . . $ NewUIFileDialog#Create(86ab65c20c9ce6b4).(const char *title, int x, int y, int w, int h, const char *path, const char *filecard); |
| 548 | |
| 549 | void SetSearchPathcxx . . $ NewUIFileDialog#SetSearchPath(85c52e162fed56f9).(const char *path); |
| 550 | const char *GetFilenamecxx . . $ NewUIFileDialog#GetFilename(33a1f659e94feb42).(); |
| 551 | |
| 552 | public: |
| 553 | // call this function to execute dialog. |
| 554 | virtual bool DoModalcxx . . $ NewUIFileDialog#DoModal(c9857a73d68e59ba).(); |
| 555 | |
| 556 | protected: |
| 557 | virtual void OnDestroycxx . . $ NewUIFileDialog#OnDestroy(49f6e7a06ebc5aa8).(); |
| 558 | }; |
| 559 | |
| 560 | #endif |