diff --git a/src/cvars.cpp b/src/cvars.cpp index 1cd32e4cb..2b439d89e 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -859,7 +859,13 @@ consvar_t cv_kartdebugnodes = ServerCheat("debugnodes", "Off").on_off().descript consvar_t cv_1pswap = PlayerCheat("1pswap", "1").min_max(1, MAXSPLITSCREENPLAYERS).description("Let P1's Profile control a different splitscreen player"); #ifdef DEVELOP - consvar_t cv_debugchallenges = PlayerCheat("debugchallenges", "Off").on_off().description("Chao keys are infinite, unlock any tile, relock tiles, animations play quickly"); + consvar_t cv_debugchallenges = PlayerCheat("debugchallenges", "Off").description("Chao keys are infinite, unlock any tile, relock tiles, animations play quickly").values({ + {1, "MIN"}, + {UINT16_MAX-1, "MAX"}, + {0, "Off"}, + {-1, "On"}, + {-2, "Tag"}, + }); #endif consvar_t cv_debugfinishline = PlayerCheat("debugfinishline", "Off").on_off().description("Highlight finish lines, respawn lines, death pits and instakill planes with high contrast colors"); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index fcca6aad0..d07be720a 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -6185,9 +6185,13 @@ void M_DrawAddons(void) static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili) { +#ifdef DEVELOP + extern consvar_t cv_debugchallenges; +#endif unlockable_t *ref = NULL; patch_t *pat = missingpat; UINT8 *colormap = NULL, *bgmap = NULL; + INT32 tileflags = 0; fixed_t siz, accordion; UINT16 id, num; boolean unlockedyet; @@ -6205,6 +6209,16 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili // Okay, this is what we want to draw. ref = &unlockables[num]; +#ifdef DEVELOP + if (cv_debugchallenges.value > 0 && + cv_debugchallenges.value != ref->conditionset) + { + // Searching for a conditionset, fade out any tiles + // that don't match. + tileflags = V_80TRANS; + } +#endif + unlockedyet = !((gamedata->unlocked[num] == false) || (challengesmenu.pending && num == challengesmenu.currentunlock && challengesmenu.unlockanim <= UNLOCKTIME)); @@ -6275,7 +6289,7 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili (x*FRACUNIT) + (SHORT(pat->width)*(FRACUNIT-accordion)/2), y*FRACUNIT, accordion, FRACUNIT, - 0, pat, + tileflags, pat, bgmap ); @@ -6285,9 +6299,12 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili || challengesmenu.extradata[id].flip > (3*TILEFLIP_MAX)/4); #ifdef DEVELOP - extern consvar_t cv_debugchallenges; if (cv_debugchallenges.value) + { + // Show the content of every tile without needing to + // flip them. categoryside = false; + } #endif if (categoryside) @@ -6471,7 +6488,7 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili ((x + 5)*FRACUNIT) + (32*(FRACUNIT-accordion)/2), (y + 5)*FRACUNIT, FixedDiv(32*accordion, siz), FixedDiv(32 << FRACBITS, siz), - 0, pat, + tileflags, pat, colormap ); } @@ -6481,17 +6498,13 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili ((x + 2)*FRACUNIT) + (16*(FRACUNIT-accordion)/2), (y + 2)*FRACUNIT, FixedDiv(16*accordion, siz), FixedDiv(16 << FRACBITS, siz), - 0, pat, + tileflags, pat, colormap ); } drawborder: - if (!hili) - { - return; - } - + if (hili) { boolean maj = (ref != NULL && ref->majorunlock); char buffer[9]; @@ -6509,6 +6522,17 @@ drawborder: colormap ); } + +#ifdef DEVELOP + if (cv_debugchallenges.value == -2 || + cv_debugchallenges.value > 0) + { + // Display the conditionset for this tile. + V_DrawThinString(x, y, + ref->conditionset == cv_debugchallenges.value ? V_AQUAMAP : V_GRAYMAP, + va("%u", ref->conditionset)); + } +#endif } #define challengetransparentstrength 8