Merge branch 'socmenus2' into viewserver2

This commit is contained in:
NepDisk 2025-06-15 12:36:44 -04:00
commit e340a7f1e6
8 changed files with 488 additions and 558 deletions

View file

@ -1426,6 +1426,7 @@ static void SL_ClearServerList(INT32 connectedserver)
serverlist[i].node = 0;
}
serverlistcount = 0;
M_UpdateNumServerPages();
}
static UINT32 SL_SearchServer(INT32 node)
@ -1466,6 +1467,7 @@ static void SL_InsertServer(serverinfo_pak* info, SINT8 node)
return;/* that's a different mod */
i = serverlistcount++;
M_UpdateNumServerPages();
}
serverlist[i].info = *info;

View file

@ -536,7 +536,8 @@ consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t,
consvar_t cv_gravity = CVAR_INIT ("gravity", "0.8", CV_RESTRICT|CV_FLOAT|CV_CALL, NULL, Gravity_OnChange); // change DEFAULT_GRAVITY if you change this
consvar_t cv_soundtest = CVAR_INIT ("soundtest", "0", CV_CALL, NULL, SoundTest_OnChange);
static CV_PossibleValue_t soundtest_cons_t[] = {{0, "MIN"}, {NUMSFX, "MAX"}};
consvar_t cv_soundtest = CVAR_INIT ("soundtest", "0", CV_CALL, soundtest_cons_t, SoundTest_OnChange);
static CV_PossibleValue_t minitimelimit_cons_t[] = {{15, "MIN"}, {9999, "MAX"}, {0, NULL}};
consvar_t cv_countdowntime = CVAR_INIT ("countdowntime", "30", CV_NETVAR|CV_CHEAT, minitimelimit_cons_t, NULL);

View file

@ -1859,6 +1859,7 @@ static struct { const char *name; consvar_t *var; } HIDDENVARS[] = {
{ "DUMMYNAME", &cv_dummyname },
{ "DUMMYFOLLOWER", &cv_dummyfollower },
{ "DUMMYCOLOR", &cv_dummycolor },
{ "DUMMYSERVERPAGE", &cv_dummyserverpage },
{ NULL, NULL }
};
@ -1907,14 +1908,36 @@ static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
{
menuitem->x = get_number(word2);
}
else if (fastcmp(word, "OFSX"))
{
menuitem->x = get_number(word2);
status |= IT_OFSX;
}
else if (fastcmp(word, "Y"))
{
menuitem->y = get_number(word2);
}
else if (fastcmp(word, "OFSY"))
{
menuitem->y = get_number(word2);
status |= IT_OFSY;
}
else if (fastcmp(word, "OVERLAY"))
{
status |= IT_OVERLAY;
}
else if (fastcmp(word, "TEMPOFFSET"))
{
status |= IT_TEMPORARY;
}
else if (fastcmp(word, "ARGUMENT"))
{
menuitem->argument = get_number(word2);
}
else if (fastcmp(word, "TEXT"))
{
menuitem->text = Z_StrDup(word2);
}
else if (fastcmp(word, "PATCH"))
{
menuitem->patch = Z_StrDup(word2);
@ -1923,36 +1946,42 @@ static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
{
menuitem->tooltip = Z_StrDup(word2);
}
else if (fastncmp(word, "TEXT", 4))
else if (fastcmp(word, "STYLE"))
{
UINT16 flags = IT_STRING;
if (fastcmp(word+4, "HEADER"))
flags = IT_HEADERTEXT;
else if (fastcmp(word+4, "WHITE"))
flags = IT_WHITESTRING;
else if (word[4])
if (status & IT_STYLE)
{
WARN("unknown word '%s'", word);
WARN0("style already set!");
continue;
}
if (status & IT_DISPLAY)
{
WARN0("text already set!");
continue;
}
status |= flags;
menuitem->text = Z_StrDup(word2);
if (fasticmp(word2, "HEADER"))
status |= IT_HEADER|IT_HIGHLIGHT;
else if (fasticmp(word2, "HIGHLIGHT"))
status |= IT_HIGHLIGHT;
else if (fasticmp(word2, "CENTER"))
status |= IT_CENTER;
else if (fasticmp(word2, "CENTER-HIGHLIGHT"))
status |= IT_CENTER|IT_HIGHLIGHT;
else if (fasticmp(word2, "THIN"))
status |= IT_THIN;
else if (fasticmp(word2, "THIN-HIGHLIGHT"))
status |= IT_THIN|IT_HIGHLIGHT;
else if (fasticmp(word2, "PATCH"))
status |= IT_PATCH;
else if (fasticmp(word2, "PATCH-CENTER"))
status |= IT_PATCH|IT_CENTER;
else if (fasticmp(word2, "PATCH-SMALL"))
status |= IT_PATCH|IT_SMALL;
else if (fasticmp(word2, "PATCH-HIGHLIGHT"))
status |= IT_PATCH|IT_HIGHLIGHT;
else
WARN("unknown style '%s'", word2);
}
else if (fastncmp(word, "CVAR", 4))
{
UINT16 flags = IT_CVAR;
UINT16 flags = IT_INTERACT;
if (fastcmp(word+4, "SLIDER"))
flags |= IT_CV_SLIDER;
else if (fastcmp(word+4, "STRING"))
flags |= IT_CV_STRING;
else if (fastcmp(word+4, "INTEGER"))
flags |= IT_CV_INTEGERSTEP;
flags |= IT_SLIDER;
else if (word[4])
{
WARN("unknown word '%s'", word);
@ -1983,18 +2012,14 @@ static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
WARN("unknown menu '%s'", word2);
continue;
}
status |= IT_SUBMENU;
status |= IT_INTERACT;
menuitem->submenu = mn;
}
else if (fastcmp(word, "CALL") || fastcmp(word, "ARROWS"))
{
UINT16 flags;
if (word[0] == 'C')
flags = IT_CALL;
else if (word[0] == 'A')
flags = IT_ARROWS;
else
I_Error("bruh"); // i should probably just make "CALL" the stem for all of these
UINT16 flags = IT_INTERACT;
if (word[0] == 'A')
flags |= IT_ARROWS;
menufunc_f *routine = get_menuroutine(word2);
if (!routine)
@ -2005,11 +2030,6 @@ static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
status |= flags;
menuitem->routine = routine;
}
else if (fastcmp(word, "DUMMY"))
{
status |= IT_DUMMY;
menuitem->routine = NULL;
}
else
WARN("unknown word '%s'", word);
}
@ -2077,7 +2097,6 @@ void readmenu(MYFILE *f, INT32 num)
menudef->menuitems = Z_Realloc(menudef->menuitems, sizeof(menuitem_t)*(menudef->numitems+1), PU_STATIC, NULL);
item = menudef->menuitems + menudef->numitems++;
DEH_Link(word2, &item->info, &menunames);
item->text = "";
}
readmenuitem(f, item);
}
@ -2260,6 +2279,14 @@ void readmenu(MYFILE *f, INT32 num)
{
menudef->scrollheight = get_number(word2);
}
else if (fastcmp(word, "CURSOROFFSET"))
{
menudef->cursoroffset = get_number(word2);
}
else if (fastcmp(word, "LINEHEIGHT"))
{
menudef->lineheight = get_number(word2);
}
else if (fastcmp(word, "ENTERROUTINE"))
{
menufunc_f *routine = get_menuroutine(word2);
@ -2295,6 +2322,10 @@ void readmenu(MYFILE *f, INT32 num)
}
} while (!myfeof(f)); // finish when the line is empty
// default line height
if (!menudef->lineheight)
menudef->lineheight = 8;
Z_Free(s);
}
#undef WARN

View file

@ -701,7 +701,6 @@ struct menu_routine_s const MENU_ROUTINES[] = {
{ "CANCELCONNECT", &MR_CancelConnect },
{ "SETUPCONTROLSMENU", &MR_SetupControlsMenu },
{ "HANDLECONTROLSMENU", &MR_HandleControlsMenu },
{ "HANDLESERVERPAGE", &MR_HandleServerPage },
{ "REFRESH", &MR_Refresh },
{ "CONNECT", &MR_Connect },
{ "VIDEOMODEMENU", &MR_VideoModeMenu },
@ -750,6 +749,7 @@ struct menu_routine_s const MENU_ROUTINES[] = {
{ "RESTARTAUDIO", &MR_RestartAudio },
{ "QUITVIEWSERVER", &MR_QuitViewServer },
{ "HANDLEVIEWSERVER", &MR_HandleViewServer },
{ "CAMERASETUP", &MR_CameraSetup },
#ifdef HAVE_DISCORDRPC
{ "HANDLEDISCORDREQUESTS", &MR_HandleDiscordRequests },
#endif
@ -758,7 +758,6 @@ struct menu_routine_s const MENU_ROUTINES[] = {
struct menu_drawer_s const MENU_DRAWERS[] = {
{ "DRAWGENERICMENU", &M_DrawGenericMenu },
{ "DRAWCENTEREDMENU", &M_DrawCenteredMenu },
{ "DRAWPAUSEMENU", &M_DrawPauseMenu },
{ "DRAWCHECKLIST", &M_DrawChecklist },
{ "DRAWLEVELSTATS", &M_DrawLevelStats },
@ -766,16 +765,12 @@ struct menu_drawer_s const MENU_DRAWERS[] = {
{ "DRAWTIMEATTACKMENU", &M_DrawTimeAttackMenu },
{ "DRAWMPMAINMENU", &M_DrawMPMainMenu },
{ "DRAWSETUPMULTIPLAYERMENU", &M_DrawSetupMultiPlayerMenu },
{ "DRAWVIDEOMENU", &M_DrawVideoMenu },
{ "DRAWVIDEOMODE", &M_DrawVideoMode },
{ "DRAWSKYROOM", &M_DrawSkyRoom },
{ "DRAWHUDOPTIONS", &M_DrawHUDOptions },
{ "DRAWADDONS", &M_DrawAddons },
{ "DRAWREPLAYSTARTMENU", &M_DrawReplayStartMenu },
{ "DRAWPLAYBACKMENU", &M_DrawPlaybackMenu },
{ "DRAWIMAGEDEF", &M_DrawImageDef },
{ "DRAWMUSICTEST", &M_DrawMusicTest },
{ "DRAWCONTROL", &M_DrawControl },
{ "DRAWJOYSTICK", &M_DrawJoystick },
{ "DRAWMONITORTOGGLES", &M_DrawMonitorToggles },
{ "DRAWCONNECTMENU", &M_DrawConnectMenu },

View file

@ -42,10 +42,7 @@ _(OP_GAMEHUD)
_(OP_OFFSET)
_(OP_CAMERA)
_(OP_P1CAMERA)
_(OP_P2CAMERA)
_(OP_P3CAMERA)
_(OP_P4CAMERA)
_(OP_CAMERASETUP)
_(OP_GAME)
_(OP_BLANKARTGAME)

File diff suppressed because it is too large Load diff

View file

@ -155,40 +155,29 @@ 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, INT32 gt);
// flags for items in the menu
// menu handle (what we do when key is pressed
#define IT_TYPE (1+2+4+8192+16384)
#define IT_CALL 1 // call the function
#define IT_ARROWS 2 // call function with 0 for left arrow and 1 for right arrow in param
#define IT_DUMMY 4 // selectable, but does nothing
#define IT_SUBMENU 8192 // go to sub menu
#define IT_CVAR 16384 // handle as a cvar
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
// display flags
#define IT_DISPLAY (8+16+32)
#define IT_PATCH 8 // a patch or a string with big font
#define IT_STRING 16 // little string (spaced with 10)
#define IT_WHITESTRING 32 // little string in white
#define IT_HEADERTEXT (8+32) // Non-selectable header option, displays in yellow offset to the left a little
IT_ARROWS = 1<<4, // call-type items use arrow keys instead of enter
IT_SLIDER = 1<<5, // cvar-type items display a slider
// flags specific to each item action type
#define IT_ACTION (64+128+256)
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 absolute coordinates, without scrolling
//consvar specific
#define IT_CV_SLIDER 64
#define IT_CV_STRING 128
#define IT_CV_INTEGERSTEP 256 // if cvar is CV_FLOAT, modify it by 1 instead of 0.0625
// extra flags
#define IT_CENTER 512 // if IT_PATCH, center it on screen
#define IT_HIDDEN 1024 // invisible, unselectable
#define IT_GRAYEDOUT 2048 // grayed out, unselectable
#define IT_SECRET 4096 // ??????? ????????????
// carefully chosen to not conflict with V_ flags
#define MDF_CENTERED 0x20
#define MDF_TIMEATTACK 0x40
#define MDF_CONTROLS 0x80
IT_PATCH = 1<<10, // display a patch instead of text
IT_CENTER = 1<<11, // center the text/patch
IT_SMALL = 1<<12, // draw at half scale
IT_THIN = 1<<13, // thin font
IT_HIGHLIGHT = 1<<14, // add highlightflags to text/patch
IT_HEADER = 1<<15, // draw with an offset to the left
IT_STYLE = IT_PATCH|IT_CENTER|IT_SMALL|IT_THIN|IT_HIGHLIGHT|IT_HEADER,
} menuitemflags_t;
#define MAXSTRINGLENGTH 32
@ -227,6 +216,8 @@ struct menu_t
INT16 x, y; // x, y of menu
INT16 scrollheight; // height of scrolling area
INT16 lastOn; // last item user was on in menu
INT16 cursoroffset; // X offset of cursor
INT16 lineheight; // default Y offset to add for each item
menufunc_f *enterroutine; // called before enter a menu
menufunc_f *quitroutine; // called before quit a menu
menufunc_f *keyhandler; // called before key press is processed
@ -267,7 +258,6 @@ INT32 MR_ConnectMenuModChecks(INT32 choice);
INT32 MR_CancelConnect(INT32 choice);
INT32 MR_SetupControlsMenu(INT32 arg);
INT32 MR_HandleControlsMenu(INT32 ch);
INT32 MR_HandleServerPage(INT32 choice);
INT32 MR_Refresh(INT32 choice);
INT32 MR_Connect(INT32 arg);
INT32 MR_VideoModeMenu(INT32 choice);
@ -314,12 +304,12 @@ INT32 MR_HandleMonitorToggles(INT32 choice);
INT32 MR_RestartAudio(INT32 choice);
INT32 MR_QuitViewServer(INT32 choice);
INT32 MR_HandleViewServer(INT32 choice);
INT32 MR_CameraSetup(INT32 arg);
#ifdef HAVE_DISCORDRPC
INT32 MR_HandleDiscordRequests(INT32 choice);
#endif
void M_DrawGenericMenu(void);
void M_DrawCenteredMenu(void);
void M_DrawPauseMenu(void);
void M_DrawChecklist(void);
void M_DrawLevelStats(void);
@ -328,16 +318,12 @@ void M_DrawTimeAttackMenu(void);
void M_DrawMPMainMenu(void);
void M_DrawSetupMultiPlayerMenu(void);
void M_DrawConnectMenu(void);
void M_DrawVideoMenu(void);
void M_DrawVideoMode(void);
void M_DrawSkyRoom(void);
void M_DrawHUDOptions(void);
void M_DrawAddons(void);
void M_DrawReplayStartMenu(void);
void M_DrawPlaybackMenu(void);
void M_DrawImageDef(void);
void M_DrawMusicTest(void);
void M_DrawControl(void);
void M_DrawJoystick(void);
void M_DrawMonitorToggles(void);
void M_DrawViewServer(void);
@ -407,12 +393,15 @@ extern consvar_t cv_dummyattackingrings, cv_dummyattackingstacking, cv_dummyatt
extern consvar_t cv_dummyattackingslipdash, cv_dummyattackingpurpledrift;
extern consvar_t cv_dummystaff;
extern consvar_t cv_dummymultiplayer, cv_dummyip, cv_dummyname, cv_dummyfollower, cv_dummycolor;
extern consvar_t cv_dummyserverpage;
extern consvar_t cv_menucaps;
// allow menu text to be displayed in lowercase
#define MENUCAPS (!cv_menucaps.value ? V_ALLOWLOWERCASE : 0)
extern CV_PossibleValue_t gametype_cons_t[];
void M_UpdateNumServerPages(void);
extern char dummystaffname[22];
extern INT16 startmap;

View file

@ -2618,17 +2618,17 @@ static CV_PossibleValue_t CV_CamSpeed[] = {{0, "MIN"}, {1*FRACUNIT, "MAX"}, {0,
static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NULL}};
consvar_t cv_cam_dist[MAXSPLITSCREENPLAYERS] = {
CVAR_INIT ("cam_dist", "190", CV_FLOAT|CV_SAVE, NULL, NULL),
CVAR_INIT ("cam2_dist", "190", CV_FLOAT|CV_SAVE, NULL, NULL),
CVAR_INIT ("cam3_dist", "190", CV_FLOAT|CV_SAVE, NULL, NULL),
CVAR_INIT ("cam4_dist", "190", CV_FLOAT|CV_SAVE, NULL, NULL)
CVAR_INIT ("cam_dist", "190", CV_FLOAT|CV_SAVE, CV_Signed, NULL),
CVAR_INIT ("cam2_dist", "190", CV_FLOAT|CV_SAVE, CV_Signed, NULL),
CVAR_INIT ("cam3_dist", "190", CV_FLOAT|CV_SAVE, CV_Signed, NULL),
CVAR_INIT ("cam4_dist", "190", CV_FLOAT|CV_SAVE, CV_Signed, NULL)
};
consvar_t cv_cam_height[MAXSPLITSCREENPLAYERS] = {
CVAR_INIT ("cam_height", "75", CV_FLOAT|CV_SAVE, NULL, NULL),
CVAR_INIT ("cam2_height", "75", CV_FLOAT|CV_SAVE, NULL, NULL),
CVAR_INIT ("cam3_height", "75", CV_FLOAT|CV_SAVE, NULL, NULL),
CVAR_INIT ("cam4_height", "75", CV_FLOAT|CV_SAVE, NULL, NULL)
CVAR_INIT ("cam_height", "75", CV_FLOAT|CV_SAVE, CV_Signed, NULL),
CVAR_INIT ("cam2_height", "75", CV_FLOAT|CV_SAVE, CV_Signed, NULL),
CVAR_INIT ("cam3_height", "75", CV_FLOAT|CV_SAVE, CV_Signed, NULL),
CVAR_INIT ("cam4_height", "75", CV_FLOAT|CV_SAVE, CV_Signed, NULL)
};
consvar_t cv_cam_still[MAXSPLITSCREENPLAYERS] = {