23 #ifndef M4_BURGER_GUI_GAME_MENU_H 24 #define M4_BURGER_GUI_GAME_MENU_H 26 #include "graphics/surface.h" 27 #include "m4/m4_types.h" 28 #include "m4/graphics/gr_buff.h" 29 #include "m4/gui/gui_univ.h" 35 typedef bool (*ItemHandlerFunction)(
void *theItem, int32 eventType, int32 event, int32 x, int32 y,
void **currItem);
36 typedef void (*DrawFunction)(
void *source,
void *dest, int32 x1, int32 y1, int32 x2, int32 y2);
37 typedef void (*DestroyFunction)(
void *theItem);
38 typedef M4CALLBACK CALLBACK;
40 typedef M4sprite Sprite;
59 DestroyFunction destroy;
60 ItemHandlerFunction itemEventHandler;
79 int32 thumbX, maxThumbX;
88 int32 thumbY, minThumbY, maxThumbY;
110 EventHandler menuEventHandler;
114 bool menu_Initialize(
RGB8 *myPalette);
115 guiMenu *menu_Create(Sprite *backgroundSprite, int32 x1, int32 y1, int32 scrnFlags);
116 void menu_Destroy(
guiMenu *myMenu);
117 void menu_Configure(
guiMenu *myMenu, CALLBACK cb_return, CALLBACK cb_esc);
118 GrBuff *menu_CopyBackground(
guiMenu *myMenu, int32 x, int32 y, int32 w, int32 h);
126 menuItem *menu_MsgAdd(
guiMenu *myMenu, int32 tag, int32 x, int32 y, int32 w, int32 h,
bool transparent =
false);
131 bool button_Handler(
void *theItem, int32 eventType, int32 event, int32 x, int32 y,
void **currItem);
132 menuItem *menu_ButtonAdd(
guiMenu *myMenu, int32 tag, int32 x, int32 y, int32 w, int32 h, CALLBACK callback =
nullptr,
133 int32 buttonType = 0,
bool ghosted =
false,
bool transparent =
false,
134 const char *prompt =
nullptr, ItemHandlerFunction i_handler = button_Handler);
139 menuItem *menu_HSliderAdd(
guiMenu *myMenu, int32 tag, int32 x, int32 y, int32 w, int32 h,
140 int32 initPercent = 0, CALLBACK callback =
nullptr,
bool transparent =
false);
143 menuItem *menu_VSliderAdd(
guiMenu *myMenu, int32 tag, int32 x, int32 y, int32 w, int32 h,
144 int32 initPercent = 0, CALLBACK callback =
nullptr,
bool transparent =
false);
145 void menu_DisableVSlider(
menuItem *myItem, int32 tag,
guiMenu *myMenu);
149 menuItem *menu_TextFieldAdd(
guiMenu *myMenu, int32 tag, int32 x, int32 y, int32 w, int32 h, int32 initFlags,
150 const char *prompt =
nullptr, int32 specialtag = 0, CALLBACK callback =
nullptr,
bool transparent =
false);
153 extern void CreateGameMenu(
RGB8 *myPalette);
154 extern void CreateOptionsMenu(
RGB8 *myPalette);
155 extern void CreateF2SaveMenu(
RGB8 *myPalette);
156 extern void CreateLoadMenu(
RGB8 *myPalette);
157 extern void CreateF3LoadMenu(
RGB8 *myPalette);
160 void CreateLoadMenuFromMain(
RGB8 *myPalette);
161 void CreateGameMenuFromMain(
RGB8 *myPalette);
168 #define MEMORY_NEEDED 0 // bytes needed for menus to work 169 #define MENU_DEPTH 9 // video depth for menu popup boxes 170 #define MAX_SLOTS 99 // number of save games you can have 171 #define MAX_SLOTS_SHOWN 8 // number of slots in the scrolling field 184 #define TEXT_COLOR_GREY_HILITE 192 185 #define TEXT_COLOR_GREY_FOREGROUND 210 186 #define TEXT_COLOR_GREY_SHADOW 229 188 #define TEXT_COLOR_NORM_HILITE 3 189 #define TEXT_COLOR_NORM_FOREGROUND 2 190 #define TEXT_COLOR_NORM_SHADOW 1 192 #define TEXT_COLOR_OVER_HILITE 3 193 #define TEXT_COLOR_OVER_FOREGROUND 2 194 #define TEXT_COLOR_OVER_SHADOW 1 196 #define TEXT_COLOR_PRESS_HILITE 3 197 #define TEXT_COLOR_PRESS_FOREGROUND 2 198 #define TEXT_COLOR_PRESS_SHADOW 1 200 #define SLIDER_BAR_COLOR 129 208 #define GAME_MENU_X 190 209 #define GAME_MENU_Y 100 210 #define GAME_MENU_W 260 211 #define GAME_MENU_H 198 213 enum game_menu_sprites {
224 enum game_menu_button_tags {
238 #define GM_OPTIONS_X 45 239 #define GM_OPTIONS_Y 94 240 #define GM_OPTIONS_W 24 241 #define GM_OPTIONS_H 24 243 #define GM_RESUME_X 45 244 #define GM_RESUME_Y 135 245 #define GM_RESUME_W 24 246 #define GM_RESUME_H 24 248 #define GM_QUIT_X 141 249 #define GM_QUIT_Y 135 253 #define GM_SAVE_X 141 258 #define GM_LOAD_X 141 267 #define SAVE_LOAD_MENU_X 145 268 #define SAVE_LOAD_MENU_Y 10 269 #define SAVE_LOAD_MENU_W 344 270 #define SAVE_LOAD_MENU_H 460 272 enum save_load_menu_sprites {
317 enum save_load_menu_item_tags {
327 #define SL_SAVE_X 214 328 #define SL_SAVE_Y 384 332 #define SL_LOAD_X 214 333 #define SL_LOAD_Y 384 342 #define SL_DOWN_X 293 343 #define SL_DOWN_Y 363 347 #define SL_SLIDER_X 291 348 #define SL_SLIDER_Y 255 349 #define SL_SLIDER_W 23 350 #define SL_SLIDER_H 127 352 #define SL_CANCEL_X 139 353 #define SL_CANCEL_Y 384 354 #define SL_CANCEL_W 74 355 #define SL_CANCEL_H 43 357 #define SL_SAVE_LABEL_X 50 358 #define SL_SAVE_LABEL_Y 241 359 #define SL_SAVE_LABEL_W 70 360 #define SL_SAVE_LABEL_H 16 362 #define SL_LOAD_LABEL_X 50 363 #define SL_LOAD_LABEL_Y 241 364 #define SL_LOAD_LABEL_W 70 365 #define SL_LOAD_LABEL_H 16 367 #define SL_SCROLL_FIELD_X 50 368 #define SL_SCROLL_FIELD_Y 256 369 #define SL_SCROLL_FIELD_W 238 370 #define SL_SCROLL_FIELD_H 121 372 #define SL_SCROLL_LINE_W 238 373 #define SL_SCROLL_LINE_H 15 //was 16 375 #define SL_THUMBNAIL_X 66 376 #define SL_THUMBNAIL_Y 28 377 #define SL_THUMBNAIL_W 215 378 #define SL_THUMBNAIL_H 162 383 enum options_menu_sprites {
405 #define OPTIONS_MENU_X 175 406 #define OPTIONS_MENU_Y 100 407 #define OPTIONS_MENU_W 298 408 #define OPTIONS_MENU_H 218 410 enum option_menu_item_tags {
414 OM_TAG_DIGESTABILITY,
417 #define OM_DONE_X 168 418 #define OM_DONE_Y 141 422 #define OM_CANCEL_X 93 423 #define OM_CANCEL_Y 141 424 #define OM_CANCEL_W 74 425 #define OM_CANCEL_H 43 429 #define OM_DIGI_W 212 432 #define OM_DIGESTABILITY_X 47 433 #define OM_DIGESTABILITY_Y 104 434 #define OM_DIGESTABILITY_W 212 435 #define OM_DIGESTABILITY_H 24 440 enum error_menu_sprites {
450 enum error_menu_tags {
453 #define ERROR_MENU_X 100 454 #define ERROR_MENU_Y 100 455 #define ERROR_MENU_W 100 456 #define ERROR_MENU_H 100 458 #define EM_RETURN_X 15 459 #define EM_RETURN_Y 15 460 #define EM_RETURN_W 15 461 #define EM_RETURN_H 15 466 bool menuSystemInitialized =
false;
467 bool interfaceWasVisible =
false;
468 RGB8 *menuPalette =
nullptr;
469 bool dumpedCodes =
false;
470 bool dumpedBackground =
false;
480 char *menuSeriesResource =
nullptr;
481 MemHandle menuSeriesHandle =
nullptr;
482 int32 menuSeriesOffset = 0;
483 int32 menuSeriesPalOffset = 0;
485 Font *menuFont =
nullptr;
488 int32 spriteCount = 0;
489 Sprite **menuSprites =
nullptr;
493 char **slotTitles =
nullptr;
494 bool *slotInUse =
nullptr;
495 int32 firstSlotIndex = 0;
496 int32 slotSelected = -1;
497 bool deleteSaveDesc =
false;
499 Sprite **thumbNails =
nullptr;
500 Sprite *saveLoadThumbNail =
nullptr;
502 int32 sizeofThumbData = -1;
503 int32 thumbIndex = 0;
505 bool currMenuIsSave =
true;
506 bool saveLoadFromHotkey =
false;
507 bool gameMenuFromMain =
false;
509 int32 remember_digi_volume = 0;
510 int32 remember_digestability = 0;
517 void CreateGameMenuMain(
RGB8 *myPalette);
Definition: m4_types.h:88
Definition: database.h:28