// BLANKART //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 2011-2016 by Matthew "Kaito Sinclaire" Walsh. // Copyright (C) 1999-2025 by Sonic Team Junior. // Copyright (C) 2026 by Team BlanKart. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. // See the 'LICENSE' file for more details. //----------------------------------------------------------------------------- /// \file m_menu.h /// \brief Menu widget stuff, selection and such #ifndef __X_MENU__ #define __X_MENU__ #include "doomstat.h" // for NUMGAMETYPES #include "d_event.h" #include "command.h" #include "f_finale.h" // for ttmode_enum #include "i_threads.h" #include "mserv.h" #include "r_skins.h" // for SKINNAMESIZE #ifdef __cplusplus extern "C" { #endif // Compatibility with old-style named NiGHTS replay files. #define OLDNREPLAYNAME // // MENUS // // max size of menu stack #define NUMMENULEVELS 8 // Menu IDs sectioned by numeric places to signify hierarchy typedef enum { #define _(name, ...) MN_##name, #include "info/menus.h" #undef _ MN_FIRSTFREESLOT, MN_LASTFREESLOT = MN_FIRSTFREESLOT + 128, MAXMENUTYPES, } menutype_t; extern menutype_t menustack[NUMMENULEVELS]; void M_InitMenuPresTables(void); void M_ChangeMenuMusic(void); void M_SetMenuCurBackground(void); void M_SetMenuCurFadeValue(void); void M_SetMenuCurTitlePics(void); // Called by main loop, // saves config file and calls I_Quit when user exits. // Even when the menu is not displayed, // this can resize the view and change game parameters. // Does all the real work of the menu interaction. boolean M_Responder(event_t *ev); // Called by main loop, runs for demo playback. If this returns true, nullify any further user input. boolean M_DemoResponder(event_t *ev); // Called by main loop, only used for menu (skull cursor) animation. void M_Ticker(void); // Called by main loop, draws the menus directly into the screen buffer. void M_Drawer(void); // Called by D_SRB2Main, loads the config file. void M_Init(void); // Called by intro code to force menu up upon a keypress, // does nothing if menu is already up. void M_StartControlPanel(void); // Called on new server add, or other reasons void M_SortServerList(void); // Draws a box with a texture inside as background for messages void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines); // Used in d_netcmd to restart time attack INT32 MR_ModeAttackRetry(INT32 choice); // the function to show a message box typing with the string inside // string must be static (not in the stack) // routine is a function taking a INT32 in parameter typedef enum { MM_NOTHING = 0, // is just displayed until the user do someting MM_YESNO, // routine is called with only 'y' or 'n' in param MM_EVENTHANDLER // the same of above but without 'y' or 'n' restriction // and routine is void routine(event_t *) (ex: set control) } menumessagetype_t; #define M_StartMessage(string, routine, itemtype) M_StartMessage2(string, (void (*)(void))routine, itemtype) void M_StartMessage2(const char *string, void (*routine)(void), menumessagetype_t itemtype); typedef enum { M_NOT_WAITING, M_WAITING_VERSION, M_WAITING_SERVERS, } M_waiting_mode_t; extern M_waiting_mode_t m_waiting_mode; typedef enum { LLM_CREATESERVER, LLM_CUPSELECT, LLM_TIMEATTACK, LLM_ITEMBREAKER, LLM_BOSS, LLM__MAX, } levellistmode_e; // Called by linux_x/i_video_xshm.c void M_QuitResponse(INT32 ch); // Determines whether to show a level in the list (platter version does not need to be exposed) boolean M_CanShowLevelInList(INT32 mapnum); typedef enum { IT_INTERACT = 1<<0, // item can be interacted with IT_HIDDEN = 1<<1, // item is invisible and cannot be interacted with (has priority over IT_INTERACT) IT_GRAYEDOUT = 1<<2, // item is grayed out and non-interactible IT_SECRET = 1<<3, // item text is displayed with question marks and non-interactible IT_ARROWS = 1<<4, // call-type items use arrow keys instead of enter IT_SLIDER = 1<<5, // cvar-type items display a slider IT_OFSX = 1<<6, // X coordinate is relative to current position IT_OFSY = 1<<7, // ditto IT_TEMPORARY = 1<<8, // with IT_OFS*, offset applies only to this item IT_OVERLAY = 1<<9, // item is drawn at screen coordinates, without scrolling IT_CENTER = 1<<10, // center the text/patch IT_RIGHT = 1<<11, // right-align the text/patch IT_SMALL = 1<<12, // draw at half scale IT_STICKER = 1<<13, // draw a sticker behind the text #define sh 14 ITH_NONE = 0<patch ITF_PATCH = 5<patch ITF_IMAGETYPE = ITF_PATCH, ITF_MASK = 0x7<