display page number in setup menus (#1274)

* display page number in setup menus

Fixes #1270

* white space clean up, while at it

* draw page counter in the bottom line

* more clean-up
This commit is contained in:
Fabian Greffrath 2023-11-21 11:00:25 +01:00 committed by GitHub
parent 1dd33d8cc3
commit 0de9800c97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -338,7 +338,7 @@ void M_DrawGeneral(void); // killough 10/98
void M_DrawString(int,int,int,const char*);
// [FG] alternative text for missing menu graphics lumps
void M_DrawTitle(int x, int y, const char *patch, const char *alttext);
void M_DrawTitle(int x, int y, const char *patch, const char *alttext, int pages);
menu_t NewDef; // phares 5/04/98
@ -635,7 +635,7 @@ void M_DrawEpisode(void)
// [crispy] force status bar refresh
inhelpscreens = true;
M_DrawTitle(54,EpiDef.y - 25,"M_EPISOD","WHICH EPISODE?");
M_DrawTitle(54, EpiDef.y - 25, "M_EPISOD", "WHICH EPISODE?", 0);
}
void M_Episode(int choice)
@ -2073,7 +2073,7 @@ void M_DrawBackground(char *patchname)
void M_DrawSetup(void)
{
M_DrawTitle(124,15,"M_SETUP","SETUP");
M_DrawTitle(124, 15, "M_SETUP", "SETUP", 0);
}
/////////////////////////////
@ -3168,7 +3168,7 @@ void M_DrawKeybnd(void)
// Set up the Key Binding screen
M_DrawBackground("FLOOR4_6"); // Draw background
M_DrawTitle(84,2,"M_KEYBND","KEY BINDINGS");
M_DrawTitle(84, 2, "M_KEYBND", "KEY BINDINGS", arrlen(keys_settings));
M_DrawInstructions();
M_DrawScreenItems(current_setup_menu);
@ -3324,7 +3324,7 @@ void M_DrawWeapons(void)
inhelpscreens = true; // killough 4/6/98: Force status bar redraw
M_DrawBackground("FLOOR4_6"); // Draw background
M_DrawTitle(109,2,"M_WEAP","WEAPONS");
M_DrawTitle(109, 2, "M_WEAP", "WEAPONS", arrlen(weap_settings));
M_DrawInstructions();
M_DrawScreenItems(current_setup_menu);
@ -3522,7 +3522,7 @@ void M_DrawStatusHUD(void)
inhelpscreens = true; // killough 4/6/98: Force status bar redraw
M_DrawBackground("FLOOR4_6"); // Draw background
M_DrawTitle(59,2,"M_STAT","STATUS BAR / HUD");
M_DrawTitle(59, 2, "M_STAT", "STATUS BAR / HUD", arrlen(stat_settings));
M_DrawInstructions();
M_DrawScreenItems(current_setup_menu);
@ -3761,7 +3761,7 @@ void M_DrawAutoMap(void)
inhelpscreens = true; // killough 4/6/98: Force status bar redraw
M_DrawBackground("FLOOR4_6"); // Draw background
M_DrawTitle(109,2,"M_AUTO","AUTOMAP");
M_DrawTitle(109, 2, "M_AUTO", "AUTOMAP", arrlen(auto_settings));
M_DrawInstructions();
M_DrawScreenItems(current_setup_menu);
@ -3901,7 +3901,7 @@ void M_DrawEnemy(void)
inhelpscreens = true;
M_DrawBackground("FLOOR4_6"); // Draw background
M_DrawTitle(114,2,"M_ENEM","ENEMIES");
M_DrawTitle(114, 2, "M_ENEM", "ENEMIES", arrlen(enem_settings));
M_DrawInstructions();
M_DrawScreenItems(current_setup_menu);
@ -4499,7 +4499,7 @@ void M_DrawGeneral(void)
inhelpscreens = true;
M_DrawBackground("FLOOR4_6"); // Draw background
M_DrawTitle(114,2,"M_GENERL","GENERAL");
M_DrawTitle(114, 2, "M_GENERL", "GENERAL", arrlen(gen_settings));
M_DrawInstructions();
M_DrawScreenItems(current_setup_menu);
@ -4713,7 +4713,7 @@ void M_DrawCompat(void)
inhelpscreens = true;
M_DrawBackground("FLOOR4_6"); // Draw background
M_DrawTitle(52,2,"M_COMPAT","DOOM COMPATIBILITY");
M_DrawTitle(52, 2, "M_COMPAT", "DOOM COMPATIBILITY", arrlen(comp_settings));
M_DrawInstructions();
M_DrawScreenItems(current_setup_menu);
@ -4845,7 +4845,7 @@ void M_DrawMessages(void)
{
inhelpscreens = true;
M_DrawBackground("FLOOR4_6"); // Draw background
M_DrawTitle(103,2,"M_MESS","MESSAGES");
M_DrawTitle(103, 2, "M_MESS", "MESSAGES", arrlen(mess_settings));
M_DrawInstructions();
M_DrawScreenItems(current_setup_menu);
if (default_verify)
@ -4916,7 +4916,7 @@ void M_DrawChatStrings(void)
{
inhelpscreens = true;
M_DrawBackground("FLOOR4_6"); // Draw background
M_DrawTitle(83,2,"M_CHAT","CHAT STRINGS");
M_DrawTitle(83, 2, "M_CHAT", "CHAT STRINGS", arrlen(chat_settings));
M_DrawInstructions();
M_DrawScreenItems(current_setup_menu);
@ -5461,7 +5461,7 @@ void M_DrawCredits(void) // killough 10/98: credit screen
sprintf(mbftext_s, PROJECT_STRING);
inhelpscreens = true;
M_DrawBackground(gamemode==shareware ? "CEIL5_1" : "MFLR8_4");
M_DrawTitle(42,9,"MBFTEXT",mbftext_s);
M_DrawTitle(42, 9, "MBFTEXT", mbftext_s, 0);
M_DrawScreenItems(cred_settings);
}
@ -7231,17 +7231,25 @@ void M_WriteText (int x,int y,const char *string)
// [FG] alternative text for missing menu graphics lumps
void M_DrawTitle(int x, int y, const char *patch, const char *alttext)
void M_DrawTitle(int x, int y, const char *patch, const char *alttext, int pages)
{
if (W_CheckNumForName(patch) >= 0)
V_DrawPatchDirect(x,y,W_CacheLumpName(patch,PU_CACHE));
else
{
// patch doesn't exist, draw some text in place of it
strcpy(menu_buffer,alttext);
M_DrawMenuString(160-(M_StringWidth(alttext)/2),
y+8-(M_StringHeight(alttext)/2), // assumes patch height 16
CR_TITLE);
M_snprintf(menu_buffer, sizeof(menu_buffer), "%s", alttext);
M_DrawMenuString(ORIGWIDTH/2 - M_StringWidth(alttext)/2,
y + 8 - M_StringHeight(alttext)/2, // assumes patch height 16
CR_TITLE);
}
if (pages > 2)
{
M_snprintf(menu_buffer, sizeof(menu_buffer), "page %d/%d",
mult_screens_index + 1, pages - 1);
M_DrawMenuString(ORIGWIDTH/2 - M_StringWidth(menu_buffer)/2,
M_Y_PREVNEXT, CR_TITLE);
}
}