Merge branch 'new-menu-font' into 'master'

Menu Polish Pass 2: new font, big hand, sleek slider, option drawers

See merge request KartKrew/Kart!1748
This commit is contained in:
Oni 2023-12-30 03:56:10 +00:00
commit bbefffa738
13 changed files with 402 additions and 202 deletions

View file

@ -965,6 +965,7 @@ extern struct optionsmenu_s {
tic_t ticker; // How long the menu's been open for
menu_anim_t offset; // To make the icons move smoothly when we transition!
menu_anim_t box;
// For moving the button when we get into a submenu. it's smooth and cool! (normal x/y and target x/y.)
// this is only used during menu transitions.
@ -1202,6 +1203,11 @@ void M_HandleImageDef(INT32 choice);
#define recommendedflags V_GREENMAP
#define warningflags V_ORANGEMAP
#define M_ALTCOLOR V_ORANGEMAP
void M_DrawCursorHand(INT32 x, INT32 y);
void M_DrawUnderline(INT32 left, INT32 right, INT32 y);
// For some menu highlights
UINT16 M_GetCvPlayerColor(UINT8 pnum);

View file

@ -98,10 +98,10 @@ fixed_t M_DueFrac(tic_t start, tic_t duration)
}
#define SKULLXOFF -32
#define LINEHEIGHT 16
#define STRINGHEIGHT 8
#define LINEHEIGHT 17
#define STRINGHEIGHT 9
#define FONTBHEIGHT 20
#define SMALLLINEHEIGHT 8
#define SMALLLINEHEIGHT 9
#define SLIDER_RANGE 10
#define SLIDER_WIDTH (8*SLIDER_RANGE+6)
#define SERVERS_PER_PAGE 11
@ -112,65 +112,59 @@ static void M_CentreText(INT32 xoffs, INT32 y, const char *string)
{
INT32 x;
//added : 02-02-98 : centre on 320, because V_DrawString centers on vid.width...
x = ((BASEVIDWIDTH - V_StringWidth(string, V_OLDSPACING))>>1) + xoffs;
V_DrawString(x,y,V_OLDSPACING,string);
x = ((BASEVIDWIDTH - V_MenuStringWidth(string, 0))>>1) + xoffs;
V_DrawMenuString(x,y,0,string);
}
// A smaller 'Thermo', with range given as percents (0-100)
static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop)
static INT32 M_SliderX(INT32 range)
{
INT32 i;
INT32 range;
patch_t *p;
for (i = 0; cv->PossibleValue[i+1].strvalue; i++);
x = BASEVIDWIDTH - x - SLIDER_WIDTH;
if (ontop)
{
V_DrawCharacter(x - 16 - (skullAnimCounter/5), y,
'\x1C' | highlightflags, false); // left arrow
V_DrawCharacter(x+(SLIDER_RANGE*8) + 8 + (skullAnimCounter/5), y,
'\x1D' | highlightflags, false); // right arrow
}
if ((range = atoi(cv->defaultvalue)) != cv->value)
{
range = ((range - cv->PossibleValue[0].value) * 100 /
(cv->PossibleValue[1].value - cv->PossibleValue[0].value));
if (range < 0)
range = 0;
if (range > 100)
range = 100;
// draw the default
p = W_CachePatchName("M_SLIDEC", PU_CACHE);
V_DrawScaledPatch(x - 4 + (((SLIDER_RANGE)*8 + 4)*range)/100, y, 0, p);
}
V_DrawScaledPatch(x - 8, y, 0, W_CachePatchName("M_SLIDEL", PU_CACHE));
p = W_CachePatchName("M_SLIDEM", PU_CACHE);
for (i = 0; i < SLIDER_RANGE; i++)
V_DrawScaledPatch (x+i*8, y, 0,p);
p = W_CachePatchName("M_SLIDER", PU_CACHE);
V_DrawScaledPatch(x+SLIDER_RANGE*8, y, 0, p);
range = ((cv->value - cv->PossibleValue[0].value) * 100 /
(cv->PossibleValue[1].value - cv->PossibleValue[0].value));
if (range < 0)
range = 0;
if (range > 100)
range = 100;
return -4 + (((SLIDER_RANGE)*8 + 4)*range)/100;
}
// A smaller 'Thermo', with range given as percents (0-100)
static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop)
{
x = BASEVIDWIDTH - x - SLIDER_WIDTH;
V_DrawFill(x - 5, y + 3, SLIDER_WIDTH + 3, 5, 31);
V_DrawFill(x - 4, y + 4, SLIDER_WIDTH, 2, orangemap[0]);
if (ontop)
{
V_DrawMenuString(x - 16 - (skullAnimCounter/5), y,
highlightflags, "\x1C"); // left arrow
V_DrawMenuString(x+(SLIDER_RANGE*8) + 8 + (skullAnimCounter/5), y,
highlightflags, "\x1D"); // right arrow
}
INT32 range = cv->PossibleValue[1].value - cv->PossibleValue[0].value;
INT32 val = atoi(cv->defaultvalue);
val = (val - cv->PossibleValue[0].value) * 100 / range;
// draw the default tick
V_DrawFill(x + M_SliderX(val), y + 2, 3, 4, 31);
val = (cv->value - cv->PossibleValue[0].value) * 100 / range;
INT32 px = x + M_SliderX(val);
// draw the slider cursor
p = W_CachePatchName("M_SLIDEC", PU_CACHE);
V_DrawScaledPatch(x - 4 + (((SLIDER_RANGE)*8 + 4)*range)/100, y, 0, p);
V_DrawFill(px - 1, y - 1, 5, 11, 31);
V_DrawFill(px, y, 2, 8, aquamap[0]);
}
void M_DrawCursorHand(INT32 x, INT32 y)
{
V_DrawScaledPatch(x - 24 - (I_GetTime() % 16 < 8), y, 0, W_CachePatchName("M_CURSOR", PU_CACHE));
}
void M_DrawUnderline(INT32 left, INT32 right, INT32 y)
{
if (menutransition.tics == menutransition.dest)
V_DrawFill(left - 1, y + 5, (right - left) + 11, 2, 31);
}
static patch_t *addonsp[NUM_EXT+5];
@ -894,7 +888,7 @@ void M_DrawMenuMessage(void)
}
V_DrawString((BASEVIDWIDTH - V_StringWidth(string, 0))/2, y, 0, string);
y += 8;
y += 9;
}
}
@ -1083,9 +1077,9 @@ void M_DrawGenericMenu(void)
cursory = y;
if ((currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING)
V_DrawString(x, y, 0, currentMenu->menuitems[i].text);
V_DrawMenuString(x, y, 0, currentMenu->menuitems[i].text);
else
V_DrawString(x, y, highlightflags, currentMenu->menuitems[i].text);
V_DrawMenuString(x, y, highlightflags, currentMenu->menuitems[i].text);
// Cvar specific handling
switch (currentMenu->menuitems[i].status & IT_TYPE)
@ -1109,7 +1103,7 @@ void M_DrawGenericMenu(void)
if (itemOn == i)
{
xoffs += 8;
V_DrawString(x + (skullAnimCounter/5) + 6, y + 12, highlightflags, "\x1D");
V_DrawMenuString(x + (skullAnimCounter/5) + 6, y + 12, highlightflags, "\x1D");
}
V_DrawString(x + xoffs + 8, y + 12, 0, cv->string);
@ -1118,15 +1112,15 @@ void M_DrawGenericMenu(void)
}
break;
default:
w = V_StringWidth(cv->string, 0);
V_DrawString(BASEVIDWIDTH - x - w, y,
w = V_MenuStringWidth(cv->string, 0);
V_DrawMenuString(BASEVIDWIDTH - x - w, y,
((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags), cv->string);
if (i == itemOn)
{
V_DrawCharacter(BASEVIDWIDTH - x - 10 - w - (skullAnimCounter/5), y,
'\x1C' | highlightflags, false); // left arrow
V_DrawCharacter(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y,
'\x1D' | highlightflags, false); // right arrow
V_DrawMenuString(BASEVIDWIDTH - x - 10 - w - (skullAnimCounter/5), y,
highlightflags, "\x1C"); // left arrow
V_DrawMenuString(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y,
highlightflags, "\x1D"); // right arrow
}
break;
}
@ -1135,7 +1129,7 @@ void M_DrawGenericMenu(void)
y += STRINGHEIGHT;
break;
case IT_STRING2:
V_DrawString(x, y, 0, currentMenu->menuitems[i].text);
V_DrawMenuString(x, y, 0, currentMenu->menuitems[i].text);
/* FALLTHRU */
case IT_DYLITLSPACE:
y += SMALLLINEHEIGHT;
@ -1151,21 +1145,21 @@ void M_DrawGenericMenu(void)
y = currentMenu->y+currentMenu->menuitems[i].mvar1;
/* FALLTHRU */
case IT_TRANSTEXT2:
V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text);
V_DrawMenuString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text);
y += SMALLLINEHEIGHT;
break;
case IT_QUESTIONMARKS:
if (currentMenu->menuitems[i].mvar1)
y = currentMenu->y+currentMenu->menuitems[i].mvar1;
V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
V_DrawMenuString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
y += SMALLLINEHEIGHT;
break;
case IT_HEADERTEXT: // draws 16 pixels to the left, in yellow text
if (currentMenu->menuitems[i].mvar1)
y = currentMenu->y+currentMenu->menuitems[i].mvar1;
V_DrawString(x-16, y, highlightflags, currentMenu->menuitems[i].text);
V_DrawMenuString(x-16, y, highlightflags, currentMenu->menuitems[i].text);
y += SMALLLINEHEIGHT;
break;
}
@ -1185,7 +1179,7 @@ void M_DrawGenericMenu(void)
{
V_DrawScaledPatch(currentMenu->x - 24, cursory, 0,
W_CachePatchName("M_CURSOR", PU_CACHE));
V_DrawString(currentMenu->x, cursory, highlightflags, currentMenu->menuitems[itemOn].text);
V_DrawMenuString(currentMenu->x, cursory, highlightflags, currentMenu->menuitems[itemOn].text);
}
}
@ -1354,12 +1348,12 @@ void M_DrawHorizontalMenu(void)
}
if (itemOn != 0)
V_DrawCharacter((BASEVIDWIDTH - width)/2 + 3 - (skullAnimCounter/5), y + 1,
'\x1C' | highlightflags, false); // left arrow
V_DrawMenuString((BASEVIDWIDTH - width)/2 + 3 - (skullAnimCounter/5), y + 1,
highlightflags, "\x1C"); // left arrow
if (itemOn != currentMenu->numitems-1)
V_DrawCharacter((BASEVIDWIDTH + width)/2 - 10 + (skullAnimCounter/5), y + 1,
'\x1D' | highlightflags, false); // right arrow
V_DrawMenuString((BASEVIDWIDTH + width)/2 - 10 + (skullAnimCounter/5), y + 1,
highlightflags, "\x1D"); // right arrow
}
#define MAXMSGLINELEN 256
@ -1371,7 +1365,7 @@ void M_DrawHorizontalMenu(void)
void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines)
{
// Solid color textbox.
V_DrawFill(x+5, y+5, width*8+6, boxlines*8+6, 159);
V_DrawFill(x+5, y+5, width*7+6, boxlines*9+6, 159);
//V_DrawFill(x+8, y+8, width*8, boxlines*8, 31);
}
@ -1434,7 +1428,7 @@ void M_DrawMessageMenu(void)
}
}
V_DrawString((BASEVIDWIDTH - V_StringWidth(string, 0))/2,y,0,string);
V_DrawMenuString((BASEVIDWIDTH - V_MenuStringWidth(string, 0))/2,y,0,string);
y += 8; //SHORT(hu_font[0]->height);
}
}
@ -2032,7 +2026,7 @@ static void M_DrawCharSelectPreview(UINT8 num)
UINT8 cy = ypos+16 + (i*10);
if (p->changeselect == i)
V_DrawScaledPatch(xpos, cy, 0, W_CachePatchName("M_CURSOR", PU_CACHE));
M_DrawCursorHand(xpos + 20, cy);
V_DrawThinString(xpos+16, cy, (p->changeselect == i ? highlightflags : 0), choices[i]);
}
@ -2548,30 +2542,31 @@ void M_DrawRaceDifficulty(void)
INT32 f = (i == itemOn) ? highlightflags : 0;
V_DrawString(140 + tx + (i == itemOn ? 1 : 0), y, f, currentMenu->menuitems[i].text);
if (currentMenu->menuitems[i].status & IT_CVAR)
{
// implicitely we'll only take care of normal cvars
INT32 cx = 260 + tx;
consvar_t *cv = currentMenu->menuitems[i].itemaction.cvar;
V_DrawCenteredString(cx, y, f, cv->string);
if (i == itemOn)
{
INT32 w = V_StringWidth(cv->string, 0)/2;
INT32 w = V_MenuStringWidth(cv->string, 0)/2;
V_DrawCharacter(cx - 10 - w - (skullAnimCounter/5), y, '\x1C' | highlightflags, false); // left arrow
V_DrawCharacter(cx + w + 2 + (skullAnimCounter/5), y, '\x1D' | highlightflags, false); // right arrow
M_DrawUnderline(140, 260 + w, y);
V_DrawMenuString(cx - 10 - w - (skullAnimCounter/5), y, highlightflags, "\x1C"); // left arrow
V_DrawMenuString(cx + w + 2 + (skullAnimCounter/5), y, highlightflags, "\x1D"); // right arrow
}
V_DrawCenteredMenuString(cx, y, f, cv->string);
}
V_DrawMenuString(140 + tx + (i == itemOn ? 1 : 0), y, f, currentMenu->menuitems[i].text);
if (i == itemOn)
{
V_DrawScaledPatch(140 + tx - 24, y, 0,
W_CachePatchName("M_CURSOR", PU_CACHE));
M_DrawCursorHand(140 + tx, y);
}
y += 10;
@ -3352,7 +3347,7 @@ void M_DrawTimeAttack(void)
if (!mapheaderinfo[map])
{
V_DrawRightAlignedString(rightedge-12, opty, 0, "No map!?");
V_DrawRightAlignedMenuString(rightedge-12, opty, 0, "No map!?");
return;
}
@ -3438,7 +3433,7 @@ void M_DrawTimeAttack(void)
if ((gametypes[levellist.newgametype]->rules & GTR_CIRCUIT)
&& (mapheaderinfo[map]->numlaps != 1))
{
V_DrawRightAlignedString(rightedge-12, timeheight, highlightflags, "BEST LAP:");
V_DrawRightAlignedMenuString(rightedge-12, timeheight, M_ALTCOLOR, "BEST LAP:");
K_drawKartTimestamp(laprec, 162+t, timeheight+6, 0, 2);
timeheight += 30;
}
@ -3447,7 +3442,7 @@ void M_DrawTimeAttack(void)
timeheight += 15;
}
V_DrawRightAlignedString(rightedge-12, timeheight, highlightflags, "BEST TIME:");
V_DrawRightAlignedMenuString(rightedge-12, timeheight, M_ALTCOLOR, "BEST TIME:");
K_drawKartTimestamp(timerec, 162+t, timeheight+6, 0, 1);
// SPB Attack control hint + menu overlay
@ -3480,16 +3475,26 @@ void M_DrawTimeAttack(void)
case IT_HEADERTEXT:
V_DrawString(leftedge, opty, highlightflags, currentMenu->menuitems[i].text);
V_DrawMenuString(leftedge, opty, M_ALTCOLOR, currentMenu->menuitems[i].text);
opty += 10;
break;
case IT_STRING:
if (i >= currentMenu->numitems-1)
V_DrawRightAlignedString(rightedge, opty, f, currentMenu->menuitems[i].text);
{
V_DrawRightAlignedMenuString(rightedge, opty, f, currentMenu->menuitems[i].text);
if (i == itemOn)
M_DrawCursorHand(rightedge - V_MenuStringWidth(currentMenu->menuitems[i].text, 0), opty);
}
else
V_DrawString(leftedge, opty, f, currentMenu->menuitems[i].text);
{
V_DrawMenuString(leftedge, opty, f, currentMenu->menuitems[i].text);
if (i == itemOn)
M_DrawCursorHand(leftedge, opty);
}
opty += 10;
// Cvar specific handling
@ -3533,12 +3538,12 @@ void M_DrawTimeAttack(void)
if (str)
{
w = V_StringWidth(str, optflags);
V_DrawString(leftedge+12, opty, optflags, str);
w = V_MenuStringWidth(str, optflags);
V_DrawMenuString(leftedge+12, opty, optflags, str);
if (drawarrows)
{
V_DrawCharacter(leftedge+12 - 10 - (skullAnimCounter/5), opty, '\x1C' | f, false); // left arrow
V_DrawCharacter(leftedge+12 + w + 2+ (skullAnimCounter/5), opty, '\x1D' | f, false); // right arrow
V_DrawMenuString(leftedge+12 - 10 - (skullAnimCounter/5), opty, f, "\x1C"); // left arrow
V_DrawMenuString(leftedge+12 + w + 2+ (skullAnimCounter/5), opty, f, "\x1D"); // right arrow
}
opty += 10;
}
@ -4205,17 +4210,107 @@ void M_DrawOptions(void)
}
static void M_DrawOptionsBoxTerm(INT32 x, INT32 top, INT32 bottom)
{
INT32 px = x - 20;
V_DrawFill(px, top + 4, 2, bottom - top, orangemap[0]);
V_DrawFill(px + 1, top + 5, 2, bottom - top, 31);
V_DrawFill(BASEVIDWIDTH - px - 2, top + 4, 2, bottom - top, orangemap[0]);
V_DrawFill(BASEVIDWIDTH - px, top + 5, 1, bottom - top, 31);
V_DrawFill(px, bottom + 2, BASEVIDWIDTH - (2 * px), 2, orangemap[0]);
V_DrawFill(px, bottom + 3, BASEVIDWIDTH - (2 * px), 2, 31);
}
void M_DrawGenericOptions(void)
{
INT32 x = currentMenu->x - M_EaseWithTransition(Easing_Linear, 5 * 48), y = currentMenu->y, w, i, cursory = 0;
INT32 x = currentMenu->x - M_EaseWithTransition(Easing_Linear, 5 * 48), y = currentMenu->y, w, i, cursory = -100;
INT32 expand = -1;
INT32 boxy = 0;
boolean collapse = false;
boolean opening = false;
fixed_t boxt = 0;
M_DrawMenuTooltips();
M_DrawOptionsMovingButton();
for (i = itemOn; i >= 0; --i)
{
switch (currentMenu->menuitems[i].status & IT_DISPLAY)
{
case IT_DYBIGSPACE:
goto box_found;
case IT_HEADERTEXT:
expand = i;
goto box_found;
}
}
box_found:
if (optionsmenu.box.dist != expand)
{
optionsmenu.box.dist = expand;
optionsmenu.box.start = I_GetTime();
}
for (i = 0; i < currentMenu->numitems; i++)
{
if (i == itemOn)
boolean term = false;
switch (currentMenu->menuitems[i].status & IT_DISPLAY)
{
case IT_DYBIGSPACE:
collapse = false;
term = (boxy != 0);
break;
case IT_HEADERTEXT:
collapse = (i != expand);
if (collapse)
{
term = (boxy != 0);
}
else
{
if (menutransition.tics == menutransition.dest)
{
INT32 px = x - 20;
V_DrawFill(px, y + 6, BASEVIDWIDTH - (2 * px), 2, orangemap[0]);
V_DrawFill(px + 1, y + 7, BASEVIDWIDTH - (2 * px), 2, 31);
}
y += 2;
boxy = y;
boxt = optionsmenu.box.dist == expand ? M_DueFrac(optionsmenu.box.start, 5) : FRACUNIT;
opening = boxt < FRACUNIT;
}
break;
default:
if (collapse)
continue;
}
if (term)
{
if (menutransition.tics == menutransition.dest)
M_DrawOptionsBoxTerm(x, boxy, Easing_Linear(boxt, boxy, y));
y += SMALLLINEHEIGHT;
boxy = 0;
opening = false;
}
if (i == itemOn && !opening)
{
cursory = y;
M_DrawUnderline(x, BASEVIDWIDTH - x, y);
}
switch (currentMenu->menuitems[i].status & IT_DISPLAY)
{
case IT_PATCH:
@ -4245,19 +4340,50 @@ void M_DrawGenericOptions(void)
break;
#endif
case IT_STRING:
case IT_WHITESTRING:
case IT_WHITESTRING: {
if (opening)
{
if ((currentMenu->menuitems[i].status & IT_TYPE) == IT_CVAR &&
(currentMenu->menuitems[i].status & IT_CVARTYPE) == IT_CV_STRING)
{
y += LINEHEIGHT;
}
y += STRINGHEIGHT;
break;
}
INT32 px = x + ((currentMenu->menuitems[i].status & IT_TYPE) == IT_SUBMENU ? 8 : 0);
if (i == itemOn)
cursory = y;
if ((currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING)
V_DrawString(x + (i == itemOn ? 1 : 0), y, 0, currentMenu->menuitems[i].text);
{
if (i == itemOn)
V_DrawMenuString(px + 1, y, highlightflags, currentMenu->menuitems[i].text);
else
V_DrawMenuString(px, y, 0, currentMenu->menuitems[i].text);
}
else
V_DrawString(x, y, highlightflags, currentMenu->menuitems[i].text);
V_DrawMenuString(px, y, highlightflags, currentMenu->menuitems[i].text);
// Cvar specific handling
switch (currentMenu->menuitems[i].status & IT_TYPE)
case IT_CVAR:
{
{
case IT_SUBMENU: {
UINT8 ch = currentMenu->menuitems[i].text[0];
V_DrawMenuString(
x + (i == itemOn ? 1 + skullAnimCounter/5 : 0),
y - 1,
// Use color of first character in text label
i == itemOn ? highlightflags : (((max(ch, 0x80) - 0x80) & 15) << V_CHARCOLORSHIFT),
"\x1D"
);
break;
}
case IT_CVAR: {
consvar_t *cv = currentMenu->menuitems[i].itemaction.cvar;
switch (currentMenu->menuitems[i].status & IT_CVARTYPE)
{
@ -4274,39 +4400,42 @@ void M_DrawGenericOptions(void)
if (itemOn == i)
{
xoffs += 8;
V_DrawString(x + (skullAnimCounter/5) + 6, y + 12, highlightflags, "\x1D");
V_DrawMenuString(x + (skullAnimCounter/5) + 7, y + 11, highlightflags, "\x1D");
}
V_DrawString(x + xoffs + 8, y + 12, 0, cv->string);
y += 16;
y += LINEHEIGHT;
}
break;
default: {
boolean isDefault = CV_IsSetToDefault(cv);
w = V_StringWidth(cv->string, 0);
V_DrawString(BASEVIDWIDTH - x - w, y,
w = V_MenuStringWidth(cv->string, 0);
V_DrawMenuString(BASEVIDWIDTH - x - w, y,
(!isDefault ? warningflags : highlightflags), cv->string);
if (i == itemOn)
{
V_DrawCharacter(BASEVIDWIDTH - x - 10 - w - (skullAnimCounter/5), y,
'\x1C' | highlightflags, false); // left arrow
V_DrawCharacter(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y,
'\x1D' | highlightflags, false); // right arrow
V_DrawMenuString(BASEVIDWIDTH - x - 10 - w - (skullAnimCounter/5), y - 1,
highlightflags, "\x1C"); // left arrow
V_DrawMenuString(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y - 1,
highlightflags, "\x1D"); // right arrow
}
if (!isDefault)
{
V_DrawCharacter(BASEVIDWIDTH - x + (i == itemOn ? 13 : 5), y - 2, '.' | warningflags, false);
V_DrawMenuString(BASEVIDWIDTH - x + (i == itemOn ? 13 : 5), y - 2, warningflags, ".");
}
break;
}
}
break;
}
y += STRINGHEIGHT;
break;
}
y += STRINGHEIGHT;
break;
}
case IT_STRING2:
V_DrawString(x, y, 0, currentMenu->menuitems[i].text);
V_DrawMenuString(x, y, 0, currentMenu->menuitems[i].text);
/* FALLTHRU */
case IT_DYLITLSPACE:
case IT_SPACE:
@ -4323,26 +4452,29 @@ void M_DrawGenericOptions(void)
y = currentMenu->y+currentMenu->menuitems[i].mvar1;
/* FALLTHRU */
case IT_TRANSTEXT2:
V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text);
V_DrawMenuString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text);
y += SMALLLINEHEIGHT;
break;
case IT_QUESTIONMARKS:
if (currentMenu->menuitems[i].mvar1)
y = currentMenu->y+currentMenu->menuitems[i].mvar1;
V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
V_DrawMenuString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text));
y += SMALLLINEHEIGHT;
break;
case IT_HEADERTEXT: // draws 16 pixels to the left, in yellow text
if (currentMenu->menuitems[i].mvar1)
y = currentMenu->y+currentMenu->menuitems[i].mvar1;
V_DrawString(x-16, y, highlightflags, currentMenu->menuitems[i].text);
y += SMALLLINEHEIGHT;
V_DrawMenuString(x - (collapse ? 0 : 16), y, M_ALTCOLOR, currentMenu->menuitems[i].text);
y += SMALLLINEHEIGHT + 1;
break;
}
}
if (boxy && menutransition.tics == menutransition.dest)
M_DrawOptionsBoxTerm(x, boxy, Easing_Linear(boxt, boxy, y));
// DRAW THE SKULL CURSOR
if (((currentMenu->menuitems[itemOn].status & IT_DISPLAY) == IT_PATCH)
|| ((currentMenu->menuitems[itemOn].status & IT_DISPLAY) == IT_NOTHING))
@ -4352,9 +4484,7 @@ void M_DrawGenericOptions(void)
}
else
{
V_DrawScaledPatch(x - 24, cursory, 0,
W_CachePatchName("M_CURSOR", PU_CACHE));
V_DrawString(x + 1, cursory, highlightflags, currentMenu->menuitems[itemOn].text);
M_DrawCursorHand(x, cursory);
}
}
@ -4375,10 +4505,10 @@ void M_DrawProfileErase(void)
if (i == optionsmenu.eraseprofilen)
{
cursory = y;
V_DrawScaledPatch(x - 24, cursory, 0, W_CachePatchName("M_CURSOR", PU_CACHE));
M_DrawCursorHand(x, cursory);
}
V_DrawString(x, y,
V_DrawMenuString(x, y,
(i == optionsmenu.eraseprofilen ? highlightflags : 0),
va("%sPRF%03d - %s (%s)",
(cv_currprofile.value == i) ? "[In use] " : "",
@ -4462,8 +4592,7 @@ void M_DrawEditProfile(void)
{
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_CACHE);
V_DrawCharacter(x - 10 - (skullAnimCounter/5), y+1,
'\x1C' | highlightflags, false); // left arrow
V_DrawMenuString(x - 10 - (skullAnimCounter/5), y+1, highlightflags, "\x1C"); // left arrow
}
// Text
@ -4597,13 +4726,13 @@ void M_DrawProfileControls(void)
switch (currentMenu->menuitems[i].status & IT_DISPLAY)
{
case IT_HEADERTEXT:
V_DrawFill(0, y+17, 124, 1, 0); // underline
V_DrawString(x, y+8, 0, currentMenu->menuitems[i].text);
V_DrawFill(0, y+18, 124, 1, 0); // underline
V_DrawMenuString(x, y+8, 0, currentMenu->menuitems[i].text);
y += spacing;
break;
case IT_STRING:
V_DrawString(x, y+1, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text);
V_DrawMenuString(x, y+2, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text);
y += spacing;
break;
@ -4617,19 +4746,19 @@ void M_DrawProfileControls(void)
drawnpatch = true;
}
else
V_DrawString(x, y+1, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text);
V_DrawMenuString(x, y+2, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text);
if (currentMenu->menuitems[i].status & IT_CVAR) // not the proper way to check but this menu only has normal onoff cvars.
{
INT32 w;
consvar_t *cv = currentMenu->menuitems[i].itemaction.cvar;
w = V_StringWidth(cv->string, 0);
V_DrawString(x + 12, y + 12, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags), cv->string);
w = V_MenuStringWidth(cv->string, 0);
V_DrawMenuString(x + 12, y + 13, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags), cv->string);
if (i == itemOn)
{
V_DrawCharacter(x - (skullAnimCounter/5), y+12, '\x1C' | highlightflags, false); // left arrow
V_DrawCharacter(x + 12 + w + 2 + (skullAnimCounter/5) , y+12, '\x1D' | highlightflags, false); // right arrow
V_DrawMenuString(x - (skullAnimCounter/5), y+12, highlightflags, "\x1C"); // left arrow
V_DrawMenuString(x + 12 + w + 2 + (skullAnimCounter/5) , y+13, highlightflags, "\x1D"); // right arrow
}
}
else if (currentMenu->menuitems[i].status & IT_CONTROL)
@ -4774,7 +4903,7 @@ void M_DrawVideoModes(void)
M_DrawMenuTooltips();
M_DrawOptionsMovingButton();
V_DrawCenteredString(BASEVIDWIDTH/2 + t, currentMenu->y,
V_DrawCenteredMenuString(BASEVIDWIDTH/2 + t, currentMenu->y,
highlightflags, "Choose mode, reselect to change default");
row = 41 + t;
@ -4782,12 +4911,12 @@ void M_DrawVideoModes(void)
for (i = 0; i < optionsmenu.vidm_nummodes; i++)
{
if (i == optionsmenu.vidm_selected)
V_DrawString(row, col, highlightflags, optionsmenu.modedescs[i].desc);
V_DrawMenuString(row, col, highlightflags, optionsmenu.modedescs[i].desc);
// Show multiples of 320x200 as green.
else
V_DrawString(row, col, (optionsmenu.modedescs[i].goodratio) ? recommendedflags : 0, optionsmenu.modedescs[i].desc);
V_DrawMenuString(row, col, (optionsmenu.modedescs[i].goodratio) ? recommendedflags : 0, optionsmenu.modedescs[i].desc);
col += 8;
col += 9;
if ((i % optionsmenu.vidm_column_size) == (optionsmenu.vidm_column_size-1))
{
row += 7*13;
@ -4803,11 +4932,11 @@ void M_DrawVideoModes(void)
va("Previewing mode %c%dx%d",
(SCR_IsAspectCorrect(vid.width, vid.height)) ? 0x83 : 0x80,
vid.width, vid.height));
M_CentreText(t, currentMenu->y + 75+8,
M_CentreText(t, currentMenu->y + 75+9,
"Press ENTER again to keep this mode");
M_CentreText(t, currentMenu->y + 75+16,
M_CentreText(t, currentMenu->y + 75+18,
va("Wait %d second%s", testtime, (testtime > 1) ? "s" : ""));
M_CentreText(t, currentMenu->y + 75+24,
M_CentreText(t, currentMenu->y + 75+27,
"or press ESC to return");
}
@ -4817,12 +4946,12 @@ void M_DrawVideoModes(void)
va("Current mode is %c%dx%d",
(SCR_IsAspectCorrect(vid.width, vid.height)) ? 0x83 : 0x80,
vid.width, vid.height));
M_CentreText(t, currentMenu->y + 75+8,
M_CentreText(t, currentMenu->y + 75+9,
va("Default mode is %c%dx%d",
(SCR_IsAspectCorrect(cv_scr_width.value, cv_scr_height.value)) ? 0x83 : 0x80,
cv_scr_width.value, cv_scr_height.value));
V_DrawCenteredString(BASEVIDWIDTH/2 + t, currentMenu->y + 75+24,
V_DrawCenteredMenuString(BASEVIDWIDTH/2 + t, currentMenu->y + 75+24,
recommendedflags, "Modes marked in GREEN are recommended.");
/*
V_DrawCenteredString(BASEVIDWIDTH/2 + t, currentMenu->y + 75+16,
@ -4834,10 +4963,9 @@ void M_DrawVideoModes(void)
// Draw the cursor for the VidMode menu
i = 41 - 10 + ((optionsmenu.vidm_selected / optionsmenu.vidm_column_size)*7*13) + t;
j = currentMenu->y + 14 + ((optionsmenu.vidm_selected % optionsmenu.vidm_column_size)*8);
j = currentMenu->y + 14 + ((optionsmenu.vidm_selected % optionsmenu.vidm_column_size)*9);
V_DrawScaledPatch(i - 8, j, 0,
W_CachePatchName("M_CURSOR", PU_CACHE));
M_DrawCursorHand(i + 14, j);
}
// Gameplay Item Tggles:
@ -5203,8 +5331,8 @@ void M_DrawPause(void)
INT32 w = V_LSTitleLowStringWidth(selectabletext, selectableflags)/2;
V_DrawLSTitleLowString(220-w + offset*2, 103, selectableflags, selectabletext);
V_DrawCharacter(220-w + offset*2 - 8 - (skullAnimCounter/5), 103+6, '\x1C' | selectableflags, false); // left arrow
V_DrawCharacter(220+w + offset*2 + (skullAnimCounter/5), 103+6, '\x1D' | selectableflags, false); // right arrow
V_DrawMenuString(220-w + offset*2 - 8 - (skullAnimCounter/5), 103+6, selectableflags, "\1C"); // left arrow
V_DrawMenuString(220+w + offset*2 + (skullAnimCounter/5), 103+6, selectableflags, "\1D"); // right arrow
}
if (maintext != NULL)
@ -5517,9 +5645,9 @@ void M_DrawAddons(void)
M_CacheAddonPatches();
if (Playing())
V_DrawCenteredString(BASEVIDWIDTH/2, 4, warningflags, "Adding files mid-game may cause problems.");
V_DrawCenteredMenuString(BASEVIDWIDTH/2, 4, warningflags, "Adding files mid-game may cause problems.");
else
V_DrawCenteredString(BASEVIDWIDTH/2, 4, 0,
V_DrawCenteredMenuString(BASEVIDWIDTH/2, 4, 0,
LOCATIONSTRING1);
// DRAW MENU
@ -5544,7 +5672,7 @@ void M_DrawAddons(void)
if (itemOn == 0)
{
xoffs += 8;
V_DrawString(x + (skullAnimCounter/5) - 20, y+8, highlightflags, "\x1D");
V_DrawMenuString(x + (skullAnimCounter/5) - 20, y+8, highlightflags, "\x1D");
}
V_DrawString(x + xoffs - 18, y+8, tflag, str);
}
@ -5588,7 +5716,7 @@ void M_DrawAddons(void)
i = m - (2*numaddonsshown + 1);
if (i != 0)
V_DrawString(19, y+4 - (skullAnimCounter/5), highlightflags, "\x1A");
V_DrawMenuString(19, y+4 - (skullAnimCounter/5), highlightflags, "\x1A");
if (skullAnimCounter < 4)
flashcol = V_GetStringColormap(highlightflags);
@ -5629,7 +5757,7 @@ void M_DrawAddons(void)
}
if (m != (ssize_t)sizedirmenu)
V_DrawString(19, y-12 + (skullAnimCounter/5), highlightflags, "\x1B");
V_DrawMenuString(19, y-12 + (skullAnimCounter/5), highlightflags, "\x1B");
if (m < (2*numaddonsshown + 1))
{
@ -5644,7 +5772,7 @@ void M_DrawAddons(void)
m = numwadfiles-(mainwads+musicwads+1);
V_DrawCenteredString(BASEVIDWIDTH/2, y+4, (majormods ? highlightflags : V_TRANSLUCENT), va("%ld ADD-ON%s LOADED", (long)m, (m == 1) ? "" : "S")); //+2 for music, sounds, +1 for bios.pk3
V_DrawCenteredMenuString(BASEVIDWIDTH/2, y+4, (majormods ? highlightflags : V_TRANSLUCENT), va("%ld ADD-ON%s LOADED", (long)m, (m == 1) ? "" : "S")); //+2 for music, sounds, +1 for bios.pk3
}
#undef addonsseperation
@ -6620,7 +6748,7 @@ void M_DrawChallenges(void)
if (gamedata->challengegrid == NULL || challengesmenu.extradata == NULL)
{
V_DrawCenteredString(x, y, V_REDMAP, "No challenges available!?");
V_DrawCenteredMenuString(x, y, V_REDMAP, "No challenges available!?");
goto challengedesc;
}
@ -6969,8 +7097,8 @@ static void M_DrawStatsMaps(void)
}
if (location)
V_DrawCharacter(10, 80-(skullAnimCounter/5),
'\x1A' | highlightflags, false); // up arrow
V_DrawMenuString(10, 80-(skullAnimCounter/5),
highlightflags, "\x1A"); // up arrow
i = -1;
@ -7136,8 +7264,8 @@ static void M_DrawStatsMaps(void)
}
bottomarrow:
if (dobottomarrow)
V_DrawCharacter(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5),
'\x1B' | highlightflags, false); // down arrow
V_DrawMenuString(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5),
highlightflags, "\x1B"); // down arrow
}
#undef STATSSTEP
@ -7157,8 +7285,8 @@ static void M_DrawStatsChars(void)
}
if (location)
V_DrawCharacter(10, y-(skullAnimCounter/5),
'\x1A' | highlightflags, false); // up arrow
V_DrawMenuString(10, y-(skullAnimCounter/5),
highlightflags, "\x1A"); // up arrow
i = -1;
@ -7191,8 +7319,8 @@ static void M_DrawStatsChars(void)
bottomarrow:
if (dobottomarrow)
V_DrawCharacter(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5),
'\x1B' | highlightflags, false); // down arrow
V_DrawMenuString(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5),
highlightflags, "\x1B"); // down arrow
UINT32 x = BASEVIDWIDTH - 20 - 90;
y = 88;
@ -7244,8 +7372,8 @@ static void M_DrawStatsGP(void)
}
if (location)
V_DrawCharacter(10, y-(skullAnimCounter/5),
'\x1A' | highlightflags, false); // up arrow
V_DrawMenuString(10, y-(skullAnimCounter/5),
highlightflags, "\x1A"); // up arrow
const INT32 width = 53;
@ -7321,8 +7449,8 @@ static void M_DrawStatsGP(void)
bottomarrow:
if (dobottomarrow)
V_DrawCharacter(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5),
'\x1B' | highlightflags, false); // down arrow
V_DrawMenuString(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5),
highlightflags, "\x1B"); // down arrow
}
#undef STATSSTEP
@ -7374,11 +7502,11 @@ void M_DrawStatistics(void)
V_DrawThinString((BASEVIDWIDTH - pagenamewidth)/2, 12, 0, pagename);
}
V_DrawCharacter((BASEVIDWIDTH - pagenamewidth)/2 - 10 - (skullAnimCounter/5), 12,
'\x1C', false); // left arrow
V_DrawMenuString((BASEVIDWIDTH - pagenamewidth)/2 - 10 - (skullAnimCounter/5), 12,
0, "\x1C"); // left arrow
V_DrawCharacter((BASEVIDWIDTH + pagenamewidth)/2 + 2 + (skullAnimCounter/5), 12,
'\x1D', false); // right arrow
V_DrawMenuString((BASEVIDWIDTH + pagenamewidth)/2 + 2 + (skullAnimCounter/5), 12,
0, "\x1D"); // right arrow
}
beststr[0] = 0;
@ -7600,7 +7728,7 @@ void M_DrawSoundTest(void)
{
UINT32 currenttime = min(Music_Elapsed(tune), Music_TotalDuration(tune));
V_DrawRightAlignedString(x + 272-1, 18+32, 0,
V_DrawRightAlignedMenuString(x + 272-1, 18+32, 0,
va("%02u:%02u",
G_TicsToMinutes(currenttime, true),
G_TicsToSeconds(currenttime)
@ -7614,7 +7742,7 @@ void M_DrawSoundTest(void)
{
UINT32 exittime = Music_TotalDuration(tune);
V_DrawRightAlignedString(x + 272-1, 18+32+10, 0,
V_DrawRightAlignedMenuString(x + 272-1, 18+32+10, 0,
va("%02u:%02u",
G_TicsToMinutes(exittime, true),
G_TicsToSeconds(exittime)
@ -7797,8 +7925,8 @@ void M_DrawSoundTest(void)
x += 25;
}
V_DrawCharacter(cursorx - 4, currentMenu->y - 8 - (skullAnimCounter/5),
'\x1B' | V_SNAPTOTOP|highlightflags, false); // up arrow
V_DrawMenuString(cursorx - 4, currentMenu->y - 8 - (skullAnimCounter/5),
V_SNAPTOTOP|highlightflags, "\x1B"); // up arrow
}
#ifdef HAVE_DISCORDRPC

View file

@ -980,6 +980,15 @@ static void M_HandleMenuInput(void)
M_OpenVirtualKeyboard(thisMenuKey == -1); // If we entered this menu by pressing a menu Key, default to keyboard typing, otherwise use controller.
return;
}
else if (M_MenuExtraPressed(pid))
{
if (!(currentMenu->behaviourflags & MBF_SOUNDLESS))
S_StartSound(NULL, sfx_s3k5b);
M_ChangeCvar(-1);
M_SetMenuDelay(pid);
return;
}
}
else

View file

@ -983,14 +983,14 @@ void EggTV::draw_replay(const Replay& replay) const
{
Draw row = box.xy(39, 104).align(Draw::Align::kLeft);
auto pair = [&row](int x, auto label, auto text)
auto pair = [&row](int x, int y, auto label, auto text)
{
row = row.y(10);
row.y(-1).flags(V_AQUAMAP).font(Draw::Font::kThin).text(label);
row.x(x).font(Draw::Font::kConsole).text(text);
row.flags(V_AQUAMAP).font(Draw::Font::kThin).text(label);
row.xy(x, y).font(Draw::Font::kMenu).text(text);
};
Draw gametype = row.font(Draw::Font::kConsole);
Draw gametype = row.font(Draw::Font::kMenu);
if (race)
{
@ -1003,15 +1003,15 @@ void EggTV::draw_replay(const Replay& replay) const
if (winner)
{
pair(38, "WINNER", winner->name);
pair(38, 1, "WINNER", winner->name);
if (replay.gametype().ranks_time())
{
pair(32, "TIME", player_time_string(*winner));
pair(32, 0, "TIME", player_time_string(*winner));
}
else if (replay.gametype().ranks_points())
{
pair(32, "SCORE", player_points_string(*winner));
pair(32, 0, "SCORE", player_points_string(*winner));
}
}
}
@ -1115,7 +1115,7 @@ void EggTV::draw_standings(const Replay& replay) const
);
Draw row = Draw(StandingsOffsets::kLeft - x, StandingsOffsets::kTop + y)
.clipx(StandingsOffsets::kLeft, StandingsOffsets::kRight).font(Draw::Font::kConsole).align(Draw::Align::kRight);
.clipx(StandingsOffsets::kLeft, StandingsOffsets::kRight).font(Draw::Font::kMenu).align(Draw::Align::kRight);
std::size_t start = standingsRow_.pos();

View file

@ -16,10 +16,15 @@ namespace
void draw_routine()
{
Draw row = Draw(0, currentMenu->y).font(Draw::Font::kConsole);
Draw row = Draw(0, currentMenu->y).font(Draw::Font::kMenu);
M_DrawEditProfileTooltips();
if (optionsmenu.profile != NULL)
{
M_DrawProfileCard(optionsmenu.optx, optionsmenu.opty, false, optionsmenu.profile);
}
for (int i = 0; i < currentMenu->numitems; ++i)
{
const menuitem_t& it = currentMenu->menuitems[i];
@ -30,6 +35,12 @@ void draw_routine()
Draw h = row.x(currentMenu->x);
if (selected)
{
M_DrawUnderline(h.x(), BASEVIDWIDTH - 18, h.y());
M_DrawCursorHand(h.x(), h.y());
}
if ((it.status & IT_HEADERTEXT) == IT_HEADERTEXT)
{
h
@ -46,28 +57,29 @@ void draw_routine()
if ((it.status & IT_TYPE) == IT_CVAR)
{
auto val = Draw::TextElement(it.itemaction.cvar->string).font(Draw::Font::kConsole);
bool isDefault = CV_IsSetToDefault(it.itemaction.cvar);
auto val = Draw::TextElement(it.itemaction.cvar->string).font(Draw::Font::kMenu);
h = row.x(BASEVIDWIDTH - 16).flags(highlightflags);
h.align(Draw::Align::kRight).text(val);
h = row.x(BASEVIDWIDTH - 18);
h.align(Draw::Align::kRight).flags(isDefault ? highlightflags : warningflags).text(val);
if (selected)
{
Draw ar = h.flags(highlightflags);
int ofs = skullAnimCounter / 5;
h.x(-val.width() - 10 - ofs).text("\x1C");
h.x(2 + ofs).text("\x1D");
ar.x(-val.width() - 10 - ofs).text("\x1C");
ar.x(2 + ofs).text("\x1D");
}
if (!isDefault)
{
h.x(selected ? 12 : 5).y(-1).flags(warningflags).text(".");
}
}
}
row = row.y(11);
}
// Finally, draw the card ontop
if (optionsmenu.profile != NULL)
{
M_DrawProfileCard(optionsmenu.optx, optionsmenu.opty, false, optionsmenu.profile);
}
}
}; // namespace

View file

@ -6,9 +6,16 @@
menuitem_t OPTIONS_Server[] =
{
{IT_HEADER, "Advertising...", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR | IT_CV_STRING, "Server Name", "Change the name of your server.",
NULL, {.cvar = &cv_servername}, 0, 0},
{IT_HEADER, "Progression...", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Intermission", "Set how long to stay on the result screen.",
NULL, {.cvar = &cv_inttime}, 0, 0},
@ -19,7 +26,7 @@ menuitem_t OPTIONS_Server[] =
NULL, {.cvar = &cv_votetime}, 0, 0},
{IT_SPACE | IT_NOTHING, NULL, NULL,
{IT_HEADER, "Joining...", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Maximum Players", "How many players can play at once.",
@ -37,13 +44,18 @@ menuitem_t OPTIONS_Server[] =
{IT_STRING | IT_CVAR, "Pause Permissions", "Sets who can pause the game.",
NULL, {.cvar = &cv_pause}, 0, 0},
{IT_HEADER, "Chat...", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Mute Chat", "Prevents non-admins from sending chat messages.",
NULL, {.cvar = &cv_mute}, 0, 0},
{IT_STRING | IT_CVAR, "Chat Spam Protection", "Prevents too many message from a single player.",
NULL, {.cvar = &cv_chatspamprotection}, 0, 0},
{IT_SPACE | IT_NOTHING, NULL, NULL,
{IT_SPACE | IT_DYBIGSPACE, NULL, NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_SUBMENU, "Advanced...", "Advanced options. Be careful when messing with these!",

View file

@ -6,9 +6,16 @@
menuitem_t OPTIONS_ServerAdvanced[] =
{
{IT_HEADER, "Master Server", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR | IT_CV_STRING, "Server Browser Address", "Default is \'https://ms.kartkrew.org/ms/api\'",
NULL, {.cvar = &cv_masterserver}, 0, 0},
{IT_HEADER, "Network Connection", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Resynch. Attempts", "How many times to attempt sending data to desynchronized players.",
NULL, {.cvar = &cv_resynchattempts}, 0, 0},
@ -24,7 +31,8 @@ menuitem_t OPTIONS_ServerAdvanced[] =
{IT_STRING | IT_CVAR, "Join Timeout (tics)", "Players taking too long to join are kicked.",
NULL, {.cvar = &cv_jointimeout}, 0, 0},
{IT_SPACE | IT_NOTHING, NULL, NULL,
{IT_HEADER, "Addon Downloading", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Max File Transfer", "Maximum size of the files that can be downloaded from joining clients. (KB)",
@ -33,7 +41,8 @@ menuitem_t OPTIONS_ServerAdvanced[] =
{IT_STRING | IT_CVAR, "File Transfer Speed", "File transfer packet rate. Larger values send more data.",
NULL, {.cvar = &cv_downloadspeed}, 0, 0},
{IT_SPACE | IT_NOTHING, NULL, NULL,
{IT_HEADER, "Logging", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Log Joiner IPs", "Shows the IP of connecting players.",

View file

@ -55,7 +55,7 @@ struct Slider
if (selected)
{
int ofs = skullAnimCounter / 5;
Draw arrows = h.font(Draw::Font::kConsole).align(Draw::Align::kLeft).flags(highlightflags);
Draw arrows = h.font(Draw::Font::kMenu).align(Draw::Align::kLeft).flags(highlightflags);
arrows.x(-10 - ofs).text("\x1C");
arrows.x(kWidth + 2 + ofs).text("\x1D");
@ -88,7 +88,7 @@ struct Slider
{
h
.x(kWidth / 2)
.font(Draw::Font::kConsole)
.font(Draw::Font::kMenu)
.align(Draw::Align::kCenter)
.flags(V_40TRANS)
.text("S I L E N T");
@ -191,7 +191,7 @@ void draw_routine()
);
}
y += 8;
y += 9;
}
}

View file

@ -65,7 +65,7 @@ menu_t OPTIONS_VideoDef = {
&OPTIONS_MainDef,
0,
OPTIONS_Video,
32, 80-8,
48, 80-8,
SKINCOLOR_PLAGUE, 0,
MBF_DRAWBGWHILEPLAYING,
NULL,

View file

@ -51,7 +51,7 @@ menu_t OPTIONS_VideoOGLDef = {
&OPTIONS_VideoDef,
0,
OPTIONS_VideoOGL,
32, 80,
48, 80,
SKINCOLOR_PLAGUE, 0,
MBF_DRAWBGWHILEPLAYING,
NULL,

View file

@ -172,6 +172,9 @@ int Draw::font_to_fontno(Font font)
case Font::kTimer:
return TIMER_FONT;
case Font::kMenu:
return MENU_FONT;
}
return TINY_FONT;

View file

@ -37,6 +37,7 @@ public:
kZVote,
kPing,
kTimer,
kMenu,
};
enum class Align

View file

@ -2175,6 +2175,20 @@ static inline fixed_t BunchedCharacterDim(
return 0;
}
static inline fixed_t MenuCharacterDim(
fixed_t scale,
fixed_t chw,
INT32 hchw,
INT32 dupx,
fixed_t * cwp)
{
(void)chw;
(void)hchw;
(void)dupx;
(*cwp) = FixedMul(std::max(1, (*cwp) - 2) << FRACBITS, scale);
return 0;
}
static inline fixed_t GamemodeCharacterDim(
fixed_t scale,
fixed_t chw,
@ -2352,6 +2366,12 @@ static void V_GetFontSpecification(int fontno, INT32 flags, fontspec_t *result)
else
result->dim_fn = BunchedCharacterDim;
break;
case MENU_FONT:
if (result->chw)
result->dim_fn = CenteredCharacterDim;
else
result->dim_fn = MenuCharacterDim;
break;
case KART_FONT:
if (result->chw)
result->dim_fn = FixedCharacterDim;