From a434e760c5d307ff38629465eb9161178f502ee9 Mon Sep 17 00:00:00 2001 From: Lach Date: Sun, 25 May 2025 16:28:31 +1000 Subject: [PATCH 1/3] Add rank mode label to intermission tally screens (EXP/MOBIUMS) --- src/y_inter.cpp | 94 +++++++++++++++++++++++++++++++++++++++++++++++++ src/y_inter.h | 1 + 2 files changed, 95 insertions(+) diff --git a/src/y_inter.cpp b/src/y_inter.cpp index b0c0f64c1..4c4956551 100644 --- a/src/y_inter.cpp +++ b/src/y_inter.cpp @@ -951,6 +951,18 @@ void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset) i--; } while (true); + + if (standings->rankingsmode) + { + if (standings->isduel) + { + Y_DrawRankMode(BASEVIDWIDTH / 2 + xoffset, BASEVIDHEIGHT - 19, true); + } + else + { + Y_DrawRankMode(x + 122, returny - yspacing + 7, false); + } + } } // @@ -1627,6 +1639,88 @@ void Y_DrawIntermissionButton(INT32 startslide, INT32 through, boolean widescree } } +// +// Y_DrawRankMode +// +// Draws EXP or MOBIUMS label depending on context. +// x and y designate the coordinates of the most bottom-right pixel to draw from (because it is the left extent and patch heights that vary), +// or the bottom-center if center is true. +// +void Y_DrawRankMode(INT32 x, INT32 y, boolean center) +{ + boolean useMobiums = (powertype != PWRLV_DISABLED); + INT32 textWidth, middleLeftEdge, middleRightEdge, middleWidth; + + char text[8]; + char iconPatchName[8]; + UINT8 iconWidth; // the graphic paddings are inconsistent... + UINT8 *iconColormap; + UINT8 *stickerColormap; + + patch_t *iconPatch; + patch_t *stickerTail = static_cast(W_CachePatchName("INT_STK1", PU_CACHE)); + patch_t *stickerMiddle = static_cast(W_CachePatchName("INT_STK2", PU_CACHE)); + patch_t *stickerHead = center ? stickerTail : static_cast(W_CachePatchName("INT_STK3", PU_CACHE)); + UINT32 stickerHeadFlags = 0; + UINT8 stickerHeadOffset = 0; + + if (useMobiums) + { + snprintf(text, sizeof text, "MOBIUMS"); + snprintf(iconPatchName, sizeof iconPatchName, "K_STMOB"); + iconWidth = 22; + iconColormap = R_GetTranslationColormap(TC_DEFAULT, static_cast(SKINCOLOR_NONE), GTC_CACHE); + stickerColormap = R_GetTranslationColormap(TC_DEFAULT, static_cast(SKINCOLOR_TEA), GTC_CACHE); + } + else + { + snprintf(text, sizeof text, "EXP"); + snprintf(iconPatchName, sizeof iconPatchName, "K_STEXP"); + iconWidth = 16; + iconColormap = R_GetTranslationColormap(TC_RAINBOW, static_cast(SKINCOLOR_MUSTARD), GTC_CACHE); + stickerColormap = R_GetTranslationColormap(TC_DEFAULT, static_cast(SKINCOLOR_MUSTARD), GTC_CACHE); + } + + iconPatch = static_cast(W_CachePatchName(iconPatchName, PU_CACHE)); + textWidth = (INT32)V_ThinStringWidth(text, 0); + middleLeftEdge = x - iconWidth - textWidth - 8; + middleRightEdge = x - stickerHead->width; + middleWidth = middleRightEdge - middleLeftEdge; + + if (center) + { + // flip the right-hand sticker tail and keep it left-aligned + stickerHeadFlags |= V_FLIP; + stickerHeadOffset += stickerHead->width; + + // sliiightly extend the right side of the sticker + middleWidth += 2; + middleRightEdge += 2; + + // shift all components to the right so that our x coordinates are center-aligned + #define CENTER_SHIFT (stickerHead->width + middleWidth / 2) + x += CENTER_SHIFT; + middleLeftEdge += CENTER_SHIFT; + middleRightEdge += CENTER_SHIFT; + #undef CENTER_SHIFT + } + + // draw sticker + V_DrawMappedPatch(middleRightEdge + stickerHeadOffset, y - stickerHead->height, stickerHeadFlags, stickerHead, stickerColormap); + V_DrawStretchyFixedPatch( + middleLeftEdge << FRACBITS, + (y - stickerMiddle->height) << FRACBITS, + (middleWidth << FRACBITS) / stickerMiddle->width + 1, + FRACUNIT, + 0, stickerMiddle, stickerColormap + ); + V_DrawMappedPatch(middleLeftEdge - stickerTail->width, y - stickerTail->height, 0, stickerTail, stickerColormap); + + // draw icon and text + V_DrawMappedPatch(x - iconPatch->width - 6, y - iconPatch->height + 4, 0, iconPatch, iconColormap); + V_DrawThinString(middleLeftEdge - 1, y - 9, 0, text); +} + void Y_DrawIntermissionHeader(fixed_t x, fixed_t y, boolean gotthrough, const char *headerstring, boolean showroundnum, boolean small) { const INT32 v_width = (small ? BASEVIDWIDTH/2 : BASEVIDWIDTH); diff --git a/src/y_inter.h b/src/y_inter.h index 572b4a6d1..de0fe7179 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -56,6 +56,7 @@ void Y_Ticker(void); void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset); void Y_RoundQueueDrawer(y_data_t *standings, INT32 offset, boolean doanimations, boolean widescreen); void Y_DrawIntermissionButton(INT32 startslide, INT32 through, boolean widescreen); +void Y_DrawRankMode(INT32 x, INT32 y, boolean center); void Y_StartIntermission(void); void Y_MidIntermission(void); From d0a8d4df79440aa462294322b15743a66cc7ae02 Mon Sep 17 00:00:00 2001 From: Lach Date: Sun, 25 May 2025 17:05:34 +1000 Subject: [PATCH 2/3] Change "usepwrlv" cvar name to "mobiums" --- src/cvars.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cvars.cpp b/src/cvars.cpp index 2ea673fdc..98df32ddb 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -728,7 +728,7 @@ consvar_t cv_kartspeed = UnsavedNetVar("gamespeed", "Auto Gear").values(kartspee consvar_t cv_teamplay = UnsavedNetVar("teamplay", "Off").on_off(); -consvar_t cv_kartusepwrlv = UnsavedNetVar("usepwrlv", "Yes").yes_no(); +consvar_t cv_kartusepwrlv = UnsavedNetVar("mobiums", "Yes").yes_no(); void LiveStudioAudience_OnChange(void); #ifdef DEVELOP From 212603838d6193e17394d5102803f5f3841617ab Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Sun, 25 May 2025 04:48:48 -0400 Subject: [PATCH 3/3] "use pwr.lv" into "use mobiums" The only other case I can think of, I'd like to leave "PWR" on the master server --- src/menus/options-server-1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menus/options-server-1.c b/src/menus/options-server-1.c index 877d0e223..a6640a6e6 100644 --- a/src/menus/options-server-1.c +++ b/src/menus/options-server-1.c @@ -39,7 +39,7 @@ menuitem_t OPTIONS_Server[] = {IT_STRING | IT_CVAR, "CPU Level", "Bots can fill unused slots. How strong should they be?", NULL, {.cvar = &cv_kartbot}, 0, 0}, - {IT_STRING | IT_CVAR, "Use PWR.LV", "Should players should be rated on their performance?", + {IT_STRING | IT_CVAR, "Use Mobiums", "Should players should be rated on their performance?", NULL, {.cvar = &cv_kartusepwrlv}, 0, 0}, {IT_STRING | IT_CVAR, "Antigrief Timer (seconds)", "How long can players stop progressing before they're removed?",