diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 04d8fdaec..e7d643a3b 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -305,6 +305,10 @@ void HU_Init(void) PR ("4GTFN"); REG; + DIG (2); + PR ("GENEFN"); + REG; + DIG (1); DIM (0, 10); diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 58f2ef1ae..b3e1ebbec 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -77,6 +77,8 @@ enum X (GTOL4), X (GTFN4), + X (GENESIS), + X (TALLNUM), X (NIGHTSNUM), X (PINGNUM), diff --git a/src/k_dialogue.cpp b/src/k_dialogue.cpp index 99b999fd6..cbba6c0e1 100644 --- a/src/k_dialogue.cpp +++ b/src/k_dialogue.cpp @@ -294,9 +294,26 @@ void Dialogue::Tick(void) { slide += kSlideSpeed; } + + if (P_LevelIsFrozen()) + { + if (fade > 0) + { + fade--; + } + } + else if (fade < 5) + { + fade++; + } } else { + if (fade > 0) + { + fade--; + } + if (slide > 0) { slide -= kSlideSpeed; @@ -342,6 +359,11 @@ INT32 Dialogue::SlideAmount(fixed_t multiplier) return Easing_OutCubic(slide, 0, multiplier); } +INT32 Dialogue::FadeAmount(void) +{ + return fade; +} + void Dialogue::Draw(void) { if (slide == 0) @@ -516,6 +538,7 @@ void Dialogue::Unset(void) Dismiss(); SetSpeaker(); slide = 0; + fade = 0; current_era = 0; } @@ -547,3 +570,8 @@ INT32 K_GetDialogueSlide(fixed_t multiplier) { return g_dialogue.SlideAmount(multiplier); } + +INT32 K_GetDialogueFade(void) +{ + return g_dialogue.FadeAmount(); +} diff --git a/src/k_dialogue.h b/src/k_dialogue.h index fca78c627..1edec2914 100644 --- a/src/k_dialogue.h +++ b/src/k_dialogue.h @@ -27,6 +27,7 @@ void K_TickDialogue(void); boolean K_DialogueFreeze(void); INT32 K_GetDialogueSlide(fixed_t multiplier); +INT32 K_GetDialogueFade(void); #ifdef __cplusplus } // extern "C" diff --git a/src/k_dialogue.hpp b/src/k_dialogue.hpp index 678cc36b0..79eeb3557 100644 --- a/src/k_dialogue.hpp +++ b/src/k_dialogue.hpp @@ -47,6 +47,7 @@ public: void Draw(void); INT32 SlideAmount(fixed_t multiplier); + INT32 FadeAmount(void); void Dismiss(void); void Unset(void); @@ -94,6 +95,7 @@ private: bool active; fixed_t slide; + INT32 fade; bool dismissable; bool freeze; diff --git a/src/k_hud.cpp b/src/k_hud.cpp index afc8e5ab0..183afba6d 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -7654,6 +7654,31 @@ void K_drawKartHUD(void) { if (g_emeraldWin) K_drawEmeraldWin(false); + + // Tacitcal Normie Countermeasure + INT32 dfade = K_GetDialogueFade(); + if (dfade) + { + V_DrawFadeScreen(31, dfade); // Fade out + + srb2::Draw normiedraw = srb2::Draw() + .clipx(0.f, BASEVIDWIDTH) + .y((BASEVIDHEIGHT - 36)/2) + .flags((10 - dfade)<(timeinmap)) % normiew); + + while (normiex < BASEVIDWIDTH) + { + normiedraw + .x(normiex) + .text(normietext); + normiex += normiew; + } + } } // In case of font debugging break glass @@ -8271,16 +8296,17 @@ void K_DrawMarginSticker(INT32 x, INT32 y, INT32 width, INT32 flags, boolean isS V_DrawFixedPatch((x + width)*FRACUNIT, y*FRACUNIT, FRACUNIT, flags|V_FLIP, stickerEnd, NULL); } -// common fonts: 0 = thin, 8 = menu. sorry we have to launder a C++ enum in here INT32 K_DrawGameControl(UINT16 x, UINT16 y, UINT8 player, const char *str, UINT8 alignment, UINT8 font, UINT32 flags) { using srb2::Draw; - Draw::TextElement text = Draw::TextElement().as(player).parse(str).font((Draw::Font)font); + Draw draw = Draw(x, y).align((Draw::Align)alignment).flags(flags); + + Draw::TextElement text = Draw::TextElement().as(player).parse(str).font(draw.fontno_to_font(font)); INT32 width = text.width(); - Draw(x, y).align((srb2::Draw::Align)alignment).flags(flags).text(text); + draw.text(text); return width; } diff --git a/src/k_menu.h b/src/k_menu.h index 3b1151aae..4847a988f 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1458,6 +1458,8 @@ extern struct challengesmenu_s { boolean chaokeyadd, keywasadded; UINT8 chaokeyhold; + UINT16 tutorialfound; + boolean requestflip; UINT16 unlockcount[CMC_MAX]; diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 976a76556..94357b020 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -839,7 +839,7 @@ void M_DrawMenuMessage(void) workx -= K_DrawGameControl( workx+2, worky+2, 0, " ", - 2, 8, 0 + 2, MENU_FONT, 0 ); if (menumessage.confirmstr) @@ -863,7 +863,7 @@ void M_DrawMenuMessage(void) workx -= K_DrawGameControl( workx+2, worky+2, 0, " ", - 2, 8, 0 + 2, MENU_FONT, 0 ); } @@ -1257,7 +1257,7 @@ static INT32 M_DrawRejoinIP(INT32 x, INT32 y, INT32 tx) V_DrawMenuString(x - 10 - (skullAnimCounter/5), y, f, "\x1C"); // left arrow V_DrawMenuString(x + w + 2+ (skullAnimCounter/5), y, f, "\x1D"); // right arrow V_DrawThinString(x, y, f, text); - K_DrawGameControl(BASEVIDWIDTH + 4 + tx, y, 0, " Rejoin", 2, 0, V_ORANGEMAP); + K_DrawGameControl(BASEVIDWIDTH + 4 + tx, y, 0, " Rejoin", 2, TINY_FONT, V_ORANGEMAP); return shift; } @@ -2462,11 +2462,11 @@ void M_DrawCharacterSelect(void) if (!optionsmenu.profile) // Does nothing on this screen { - K_DrawGameControl(BASEVIDWIDTH/2, kTop, pid, " Info Default", 1, 0, 0); + K_DrawGameControl(BASEVIDWIDTH/2, kTop, pid, " Info Default", 1, TINY_FONT, 0); } else { - K_DrawGameControl(BASEVIDWIDTH/2+62, kTop, pid, " Accept Back Default", 1, 0, 0); + K_DrawGameControl(BASEVIDWIDTH/2+62, kTop, pid, " Accept Back Default", 1, TINY_FONT, 0); } } @@ -2745,11 +2745,11 @@ void M_DrawRaceDifficulty(void) switch (it->mvar2) { case MBT_Y: - K_DrawGameControl(cx + 24, cy + 22, 0, activated ? "" : "", 0, 8, 0); + K_DrawGameControl(cx + 24, cy + 22, 0, activated ? "" : "", 0, MENU_FONT, 0); break; case MBT_Z: - K_DrawGameControl(cx + 24, cy + 22, 0, activated ? "" : "", 0, 8, 0); + K_DrawGameControl(cx + 24, cy + 22, 0, activated ? "" : "", 0, MENU_FONT, 0); break; } break; @@ -3868,7 +3868,7 @@ void M_DrawTimeAttack(void) if (M_EncoreAttackTogglePermitted()) { - K_DrawGameControl(buttonx + 35, buttony - 3, 0, "", 0, 8, 0); + K_DrawGameControl(buttonx + 35, buttony - 3, 0, "", 0, MENU_FONT, 0); } if ((timeattackmenu.spbflicker == 0 || timeattackmenu.ticker % 2) == (cv_dummyspbattack.value == 1)) @@ -5559,7 +5559,7 @@ void M_DrawProfileControls(void) UINT16 oldsetting = cv_descriptiveinput->value; CV_StealthSetValue(cv_descriptiveinput, cv_dummyprofiledescriptiveinput.value); INT32 xpos = BASEVIDWIDTH - 12; - xpos = K_DrawGameControl(xpos, ypos, 0, " / Clear", 2, 0, 0); + xpos = K_DrawGameControl(xpos, ypos, 0, " / Clear", 2, TINY_FONT, 0); CV_StealthSetValue(cv_descriptiveinput, oldsetting); } @@ -6330,16 +6330,16 @@ void M_DrawPause(void) } else if (gametype == GT_TUTORIAL) { - K_DrawGameControl(4, 184 - 60 + offset/2, 0, " Steering", 0, 0, 0); - K_DrawGameControl(4, 184 - 45 + offset/2, 0, " Accelerate", 0, 0, 0); - K_DrawGameControl(4, 184 - 30 + offset/2, 0, " Look Back", 0, 0, 0); - K_DrawGameControl(4, 184 - 15 + offset/2, 0, " Spindash", 0, 0, 0); - K_DrawGameControl(4, 184 - 0 + offset/2, 0, " Item/Rings", 0, 0, 0); + K_DrawGameControl(4, 184 - 60 + offset/2, 0, " Steering", 0, TINY_FONT, 0); + K_DrawGameControl(4, 184 - 45 + offset/2, 0, " Accelerate", 0, TINY_FONT, 0); + K_DrawGameControl(4, 184 - 30 + offset/2, 0, " Look Back", 0, TINY_FONT, 0); + K_DrawGameControl(4, 184 - 15 + offset/2, 0, " Spindash", 0, TINY_FONT, 0); + K_DrawGameControl(4, 184 - 0 + offset/2, 0, " Item/Rings", 0, TINY_FONT, 0); - K_DrawGameControl(90, 184 - 45 + offset/2, 0, " Brake", 0, 0, 0); - K_DrawGameControl(90, 184 - 30 + offset/2, 0, " Respawn", 0, 0, 0); - K_DrawGameControl(90, 184 - 15 + offset/2, 0, " Dialogue / Action", 0, 0, 0); - K_DrawGameControl(90, 184 - 0 + offset/2, 0, " Drift", 0, 0, 0); + K_DrawGameControl(90, 184 - 45 + offset/2, 0, " Brake", 0, TINY_FONT, 0); + K_DrawGameControl(90, 184 - 30 + offset/2, 0, " Respawn", 0, TINY_FONT, 0); + K_DrawGameControl(90, 184 - 15 + offset/2, 0, " Dialogue / Action", 0, TINY_FONT, 0); + K_DrawGameControl(90, 184 - 0 + offset/2, 0, " Drift", 0, TINY_FONT, 0); } else { @@ -6448,7 +6448,7 @@ void M_DrawKickHandler(void) (playerkickmenu.adminpowered) ? "You are using Admin Tools. Kick Ban" : K_GetMidVoteLabel(menucallvote), - 1, 0, 0 + 1, TINY_FONT, 0 ); } @@ -7523,7 +7523,7 @@ static void M_DrawChallengePreview(INT32 x, INT32 y) y = BASEVIDHEIGHT-16; V_DrawGamemodeString(x, y - 33, 0, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_MENUCACHE), M_UseAlternateTitleScreen() ? "On" : "Off"); - K_DrawGameControl(x, y, 0, " Toggle", 0, 0, 0); + K_DrawGameControl(x, y, 0, " Toggle", 0, TINY_FONT, 0); // K_drawButtonAnim(x, y, 0, kp_button_a[1], challengesmenu.ticker); // x += SHORT(kp_button_a[1][0]->width); // V_DrawThinString(x, y + 1, highlightflags, "Toggle"); @@ -7590,9 +7590,9 @@ static void M_DrawChallengePreview(INT32 x, INT32 y) } if (!pushed) - K_DrawGameControl(x, y, 0, " E Side", 0, 0, 0); + K_DrawGameControl(x, y, 0, " E Side", 0, TINY_FONT, 0); else - K_DrawGameControl(x, y, 0, " E Side", 0, 0, 0); + K_DrawGameControl(x, y, 0, " E Side", 0, TINY_FONT, 0); // K_drawButton(x&FRACUNIT, y*FRACUNIT, 0, kp_button_l, pushed); // x += SHORT(kp_button_l[0]->width); // V_DrawThinString(x, y + 1, (pushed ? V_GRAYMAP : highlightflags), "E Side"); @@ -7615,9 +7615,9 @@ static void M_DrawChallengePreview(INT32 x, INT32 y) } if (!pushed) - K_DrawGameControl(x, y, 0, " Play CD", 0, 0, 0); + K_DrawGameControl(x, y, 0, " Play CD", 0, TINY_FONT, 0); else - K_DrawGameControl(x, y, 0, " Play CD", 0, 0, 0); + K_DrawGameControl(x, y, 0, " Play CD", 0, TINY_FONT, 0); // K_drawButton(x*FRACUNIT, y*FRACUNIT, 0, kp_button_a[1], pushed); // x += SHORT(kp_button_a[1][0]->width); // V_DrawThinString(x, y + 1, (pushed ? V_GRAYMAP : highlightflags), "Play CD"); @@ -7700,7 +7700,7 @@ static void M_DrawChallengeKeys(INT32 tilex, INT32 tiley) K_DrawGameControl( 24, 16, 0, keybuttonpress ? "" : "", - 0, 0, 0 + 0, TINY_FONT, 0 ); // Metyr of rounds played that contribute to Chao Key generation @@ -9432,13 +9432,13 @@ void M_DrawDiscordRequests(void) /* K_DrawSticker(x, y + 26, stickerWidth, 0, true); - K_DrawGameControl(x, y+22, 0, "", 0, 0, V_SNAPTORIGHT); + K_DrawGameControl(x, y+22, 0, "", 0, TINY_FONT, V_SNAPTORIGHT); // K_drawButtonAnim(x, y + 22, V_SNAPTORIGHT, kp_button_a[1], discordrequestmenu.ticker); */ - UINT32 bigwidth = K_DrawGameControl(x, y+22, 0, " Accept Decline", 0, 0, V_SNAPTORIGHT); + UINT32 bigwidth = K_DrawGameControl(x, y+22, 0, " Accept Decline", 0, TINY_FONT, V_SNAPTORIGHT); K_DrawSticker(x, y + 26, bigwidth, 0, true); - K_DrawGameControl(x, y+22, 0, " Accept Decline", 0, 0, V_SNAPTORIGHT); + K_DrawGameControl(x, y+22, 0, " Accept Decline", 0, TINY_FONT, V_SNAPTORIGHT); /* V_DrawThinString((x + xoffs), y + 24, 0, acceptText); @@ -9447,7 +9447,7 @@ void M_DrawDiscordRequests(void) K_drawButtonAnim((x + xoffs), y + 22, V_SNAPTORIGHT, kp_button_b[1], discordrequestmenu.ticker); xoffs += declineButtonWidth; - xoffs += K_DrawGameControl(x + xoffs, y+22, 0, "", 0, 0, V_SNAPTORIGHT); + xoffs += K_DrawGameControl(x + xoffs, y+22, 0, "", 0, TINY_FONT, V_SNAPTORIGHT); K_drawButtonAnim((x + xoffs), y + 22, V_SNAPTORIGHT, kp_button_x[1], discordrequestmenu.ticker); xoffs += altDeclineButtonWidth; diff --git a/src/k_zvote.c b/src/k_zvote.c index be005c110..0eb9db702 100644 --- a/src/k_zvote.c +++ b/src/k_zvote.c @@ -1136,7 +1136,7 @@ void K_DrawMidVote(void) K_DrawGameControl( x/FRACUNIT - 4, y/FRACUNIT + exc->height - 8, id, pressed ? "" : "", - 0, 8, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_SPLITSCREEN + 0, MENU_FONT, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_SPLITSCREEN ); /* K_drawButton( @@ -1260,7 +1260,7 @@ void K_DrawMidVote(void) K_DrawGameControl( x/FRACUNIT-20, y/FRACUNIT + 2, id, pressed ? "" : "", - 0, 8, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_SPLITSCREEN + 0, MENU_FONT, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_SPLITSCREEN ); /* K_drawButton( diff --git a/src/m_cond.c b/src/m_cond.c index d3d54a3fe..54d5725e5 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -2570,6 +2570,10 @@ static const char *M_GetConditionString(condition_t *cn) Z_Free(title); return work; } + + case UC_CONDITIONSET: + return va("INVALID CN RECURSION \"%d\"", cn->requirement); + case UC_UNLOCKABLE: // Requires unlockable x to be obtained return va("get %s", gamedata->unlocked[cn->requirement-1] @@ -3015,20 +3019,17 @@ static const char *M_GetConditionString(condition_t *cn) default: break; } - // UC_MAPTRIGGER and UC_CONDITIONSET are explicitly very hard to support proper descriptions for + // UC_MAPTRIGGER and the like are explicitly very hard to support proper descriptions for return va("UNSUPPORTED CONDITION \"%d\"", cn->type); } char *M_BuildConditionSetString(UINT16 unlockid) { - conditionset_t *c = NULL; - UINT32 lastID = 0; condition_t *cn; size_t len = 1024, worklen; static char message[1024] = ""; const char *work = NULL; size_t i; - UINT8 stopasap = 0; message[0] = '\0'; @@ -3049,61 +3050,102 @@ char *M_BuildConditionSetString(UINT16 unlockid) len--; } - c = &conditionSets[unlockables[unlockid].conditionset-1]; + struct conditionset_traverser_s { + conditionset_t *c; + size_t i; + UINT32 lastID; + UINT8 stopasap; + }; - for (i = 0; i < c->numconditions; ++i) - { - cn = &c->condition[i]; + struct conditionset_traverser_s current = {0}; + current.c = &conditionSets[unlockables[unlockid].conditionset-1]; + current.i = current.lastID = current.stopasap = 0; - if (i > 0) + struct conditionset_traverser_s restore = {0}; + restore.c = NULL; + + do { + if (current.stopasap == UINT8_MAX) { - worklen = 0; - if (lastID != cn->id) + // Sentinel value for recursion + current.stopasap = 0; + } + else if (restore.c) + { + // De-recur + current = restore; + current.i++; + + restore.c = NULL; + } + + for (; current.i < current.c->numconditions; ++current.i) + { + cn = ¤t.c->condition[current.i]; + + if (current.i > 0) { - stopasap = 0; - worklen = 6; - strncat(message, " - OR ", len); + worklen = 0; + if (current.lastID != cn->id) + { + current.stopasap = 0; + worklen = 6; + strncat(message, " - OR ", len); + } + else if (current.stopasap == 0 && cn->type != UC_COMMA) + { + worklen = 1; + strncat(message, " ", len); + } + len -= worklen; } - else if (stopasap == 0 && cn->type != UC_COMMA) + + current.lastID = cn->id; + + if (current.stopasap == 1) { - worklen = 1; - strncat(message, " ", len); + // Secret challenge -- show unrelated condition IDs + continue; } + + if (cn->type == UC_CONDITIONSET + && restore.c == NULL + && cn->requirement + && cn->requirement <= MAXCONDITIONSETS) + { + // Conditionset description! Can only recursion once at a time + restore = current; + current.c = &conditionSets[cn->requirement-1]; + current.i = current.lastID = 0; + current.stopasap = UINT8_MAX; + break; + } + + work = M_GetConditionString(cn); + if (work == NULL) + { + current.stopasap = 1; + if (message[0] && message[1]) + work = "???"; + else + work = "(Find other secrets to learn about this...)"; + } + else if (cn->type == UC_DESCRIPTIONOVERRIDE) + { + current.stopasap = 2; + } + worklen = strlen(work); + + strncat(message, work, len); len -= worklen; - } - lastID = cn->id; - - if (stopasap == 1) - { - // Secret challenge -- show unrelated condition IDs - continue; + if (current.stopasap == 2) + { + // Description override - hide all further ones + break; + } } - - work = M_GetConditionString(cn); - if (work == NULL) - { - stopasap = 1; - if (message[0] && message[1]) - work = "???"; - else - work = "(Find other secrets to learn about this...)"; - } - else if (cn->type == UC_DESCRIPTIONOVERRIDE) - { - stopasap = 2; - } - worklen = strlen(work); - - strncat(message, work, len); - len -= worklen; - - if (stopasap == 2) - { - // Description override - hide all further ones - break; - } - } + } while (restore.c); if (message[0] == '\0') { diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index 828605c38..64b07d8a8 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -376,6 +376,7 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu) challengesmenu.requestnew = false; challengesmenu.chaokeyadd = false; challengesmenu.keywasadded = false; + challengesmenu.tutorialfound = NEXTMAP_INVALID; challengesmenu.chaokeyhold = 0; challengesmenu.unlockcondition = NULL; @@ -479,6 +480,7 @@ boolean M_CanKeyHiliTile(void) enum { CCTUTORIAL_KEYGEN = 0, CCTUTORIAL_MAJORSKIP, + CCTUTORIAL_TUTORIAL, // I heard you like tutorials, so I... } cctutorial_e; static void M_ChallengesTutorial(UINT8 option) @@ -512,6 +514,25 @@ static void M_ChallengesTutorial(UINT8 option) gamedata->majorkeyskipattempted = true; break; } + case CCTUTORIAL_TUTORIAL: + { + M_StartMessage("New Tutorial Data", + va(M_GetText( + "A new piece of Eggman and Tails'\n" + "short adventure has been decrypted.\n" + "\n" + "You can find \"""\x87""%s""\x80""\" on\n" + "the Tutorials menu under Extras!\n" + "\n" + "These may sometimes be needed for progression.\n" + ), (challengesmenu.tutorialfound < nummapheaders + && mapheaderinfo[challengesmenu.tutorialfound] + ? mapheaderinfo[challengesmenu.tutorialfound]->menuttl + : "ERROR!?" + )), NULL, MM_NOTHING, NULL, "Got it!"); + challengesmenu.tutorialfound = NEXTMAP_INVALID; + break; + } default: { M_StartMessage("M_ChallengesTutorial ERROR", @@ -725,6 +746,28 @@ void M_ChallengesTick(void) gamedata->unlocked[challengesmenu.currentunlock] = true; M_UpdateUnlockablesAndExtraEmblems(true, true); + if (challengesmenu.tutorialfound == NEXTMAP_INVALID + && ref->type == SECRET_MAP) + { + // Map exists... + UINT16 mapnum = M_UnlockableMapNum(ref); + if (mapnum < nummapheaders && mapheaderinfo[mapnum]) + { + // is tutorial... + INT32 guessgt = G_GuessGametypeByTOL(mapheaderinfo[mapnum]->typeoflevel); + if (guessgt == GT_TUTORIAL) + { + // and isn't the playground? + if (!tutorialplaygroundmap + || strcmp(tutorialplaygroundmap, mapheaderinfo[mapnum]->lumpname)) + { + // Pop an alert up! + challengesmenu.tutorialfound = mapnum; + } + } + } + } + // Update shown description just in case..? if (challengesmenu.unlockcondition) Z_Free(challengesmenu.unlockcondition); @@ -801,6 +844,11 @@ void M_ChallengesTick(void) // not ideal but at least unlikely to // get at same time?? :V } + else if (challengesmenu.tutorialfound != NEXTMAP_INVALID) + { + M_ChallengesTutorial(CCTUTORIAL_TUTORIAL); + // Also no keygen, but that can come later. + } else if (gamedata->chaokeytutorial == false && challengesmenu.keywasadded == true) { diff --git a/src/menus/transient/pause-addonoptions.cpp b/src/menus/transient/pause-addonoptions.cpp index 2f3f69526..5b7c11896 100644 --- a/src/menus/transient/pause-addonoptions.cpp +++ b/src/menus/transient/pause-addonoptions.cpp @@ -264,7 +264,7 @@ void draw_menu() draw.x(BASEVIDWIDTH/2).font(Draw::Font::kGamemode).text(mode_strings[menu_mode()]); if (server || IsPlayerAdmin(consoleplayer)) - K_DrawGameControl(draw.x() + 8, draw.y()-6, 0, M_MenuButtonHeld(0, MBT_Y) ? " Switch Page" : " Switch Page", 0, 8, 0); + K_DrawGameControl(draw.x() + 8, draw.y()-6, 0, M_MenuButtonHeld(0, MBT_Y) ? " Switch Page" : " Switch Page", 0, MENU_FONT, 0); // K_drawButton((draw.x() + 8) * FRACUNIT, (draw.y() + 8) * FRACUNIT, 0, kp_button_y[0], M_MenuButtonHeld(0, MBT_Y)); draw = draw.y(32 + kMargin); diff --git a/src/menus/transient/pause-cheats.cpp b/src/menus/transient/pause-cheats.cpp index 6f0e38886..5dc70fc39 100644 --- a/src/menus/transient/pause-cheats.cpp +++ b/src/menus/transient/pause-cheats.cpp @@ -208,7 +208,7 @@ void draw_menu() draw = draw.y(27 + kMargin); draw.x(BASEVIDWIDTH/2).font(Draw::Font::kGamemode).text(mode_strings[menu_mode()]); - K_DrawGameControl(draw.x() + 8, draw.y()-6, 0, M_MenuButtonHeld(0, MBT_Y) ? " Switch Page" : " Switch Page", 0, 8, 0); + K_DrawGameControl(draw.x() + 8, draw.y()-6, 0, M_MenuButtonHeld(0, MBT_Y) ? " Switch Page" : " Switch Page", 0, MENU_FONT, 0); // K_drawButton((draw.x() + 8) * FRACUNIT, (draw.y() + 8) * FRACUNIT, 0, kp_button_y[0], M_MenuButtonHeld(0, MBT_Y)); draw = draw.y(32 + kMargin); diff --git a/src/st_stuff.c b/src/st_stuff.c index c5054a602..5263c71d8 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1501,7 +1501,7 @@ void ST_DrawSaveReplayHint(INT32 flags) K_DrawGameControl( BASEVIDWIDTH - 2, 2, 0, (demo.willsave && demo.titlename[0]) ? "Replay will be saved. Change title" : " or Save replay", - 2, 0, flags|V_YELLOWMAP + 2, TINY_FONT, flags|V_YELLOWMAP ); } diff --git a/src/v_draw.cpp b/src/v_draw.cpp index b21e89448..44e971297 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -531,16 +531,66 @@ patch_t* Draw::cache_patch(const char* name) return static_cast(W_CachePatchName(name, PU_CACHE)); } +Draw::Font Draw::fontno_to_font(int font) +{ + switch (font) + { + case TINY_FONT: + default: + return Font::kThin; + + case GM_FONT: + return Font::kGamemode; + + case GENESIS_FONT: + return Font::kGenesis; + + case HU_FONT: + return Font::kConsole; + + case KART_FONT: + return Font::kFreeplay; + + case OPPRF_FONT: + return Font::kZVote; + + case PINGF_FONT: + return Font::kPing; + + case TIMER_FONT: + return Font::kTimer; + + case TINYTIMER_FONT: + return Font::kThinTimer; + + case MENU_FONT: + return Font::kMenu; + + case MED_FONT: + return Font::kMedium; + + case ROLNUM_FONT: + return Font::kRollingNum; + + case RO4NUM_FONT: + return Font::kRollingNum4P; + } +}; + int Draw::font_to_fontno(Font font) { switch (font) { case Font::kThin: + default: return TINY_FONT; case Font::kGamemode: return GM_FONT; + case Font::kGenesis: + return GENESIS_FONT; + case Font::kConsole: return HU_FONT; @@ -571,8 +621,6 @@ int Draw::font_to_fontno(Font font) case Font::kRollingNum4P: return RO4NUM_FONT; } - - return TINY_FONT; }; INT32 Draw::default_font_flags(Font font) diff --git a/src/v_draw.hpp b/src/v_draw.hpp index 9fe9fa2c1..3e26f5e7d 100644 --- a/src/v_draw.hpp +++ b/src/v_draw.hpp @@ -194,6 +194,7 @@ public: { kThin, kGamemode, + kGenesis, kConsole, kFreeplay, kZVote, @@ -205,6 +206,7 @@ public: kRollingNum, kRollingNum4P, }; + Font fontno_to_font(int font); enum class Align { diff --git a/src/v_video.cpp b/src/v_video.cpp index 43340aa52..3255544bd 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -2350,6 +2350,10 @@ static void V_GetFontSpecification(int fontno, INT32 flags, fontspec_t *result) case GM_FONT: result->spacew = 6; break; + case GENESIS_FONT: + result->spacew = 8; + result->right_outline = 0; + break; case FILE_FONT: result->spacew = 0; break; @@ -2390,6 +2394,9 @@ static void V_GetFontSpecification(int fontno, INT32 flags, fontspec_t *result) case GM_FONT: result->lfh = 32; break; + case GENESIS_FONT: + result->lfh = 36; + break; case LSHI_FONT: result->lfh = 56; break;