HUD: Battle points HUD (1P and 4P versions), displays right next to bumpers

This commit is contained in:
James R 2024-01-17 22:45:17 -08:00
parent 1cb306ac87
commit 1f4bebe6da

View file

@ -114,6 +114,7 @@ static patch_t *kp_rankcapsule;
static patch_t *kp_rankemerald; static patch_t *kp_rankemerald;
static patch_t *kp_rankemeraldflash; static patch_t *kp_rankemeraldflash;
static patch_t *kp_rankemeraldback; static patch_t *kp_rankemeraldback;
static patch_t *kp_pts[2];
static patch_t *kp_goal[2][2]; // [skull][4p] static patch_t *kp_goal[2][2]; // [skull][4p]
static patch_t *kp_goalrod[2]; // [4p] static patch_t *kp_goalrod[2]; // [4p]
@ -451,7 +452,7 @@ void K_LoadKartHUDGraphics(void)
// Extra ranking icons // Extra ranking icons
HU_UpdatePatch(&kp_rankbumper, "K_BLNICO"); HU_UpdatePatch(&kp_rankbumper, "K_BLNICO");
HU_UpdatePatch(&kp_bigbumper, "K_BLNBIG"); HU_UpdatePatch(&kp_bigbumper, "K_BLNREG");
HU_UpdatePatch(&kp_tinybumper[0], "K_BLNA"); HU_UpdatePatch(&kp_tinybumper[0], "K_BLNA");
HU_UpdatePatch(&kp_tinybumper[1], "K_BLNB"); HU_UpdatePatch(&kp_tinybumper[1], "K_BLNB");
HU_UpdatePatch(&kp_ranknobumpers, "K_NOBLNS"); HU_UpdatePatch(&kp_ranknobumpers, "K_NOBLNS");
@ -459,6 +460,8 @@ void K_LoadKartHUDGraphics(void)
HU_UpdatePatch(&kp_rankemerald, "K_EMERC"); HU_UpdatePatch(&kp_rankemerald, "K_EMERC");
HU_UpdatePatch(&kp_rankemeraldflash, "K_EMERW"); HU_UpdatePatch(&kp_rankemeraldflash, "K_EMERW");
HU_UpdatePatch(&kp_rankemeraldback, "K_EMERBK"); HU_UpdatePatch(&kp_rankemeraldback, "K_EMERBK");
HU_UpdatePatch(&kp_pts[0], "K_POINTS");
HU_UpdatePatch(&kp_pts[1], "K_POINT4");
// Battle goal // Battle goal
HU_UpdatePatch(&kp_goal[0][0], "K_ST1GLA"); HU_UpdatePatch(&kp_goal[0][0], "K_ST1GLA");
@ -3359,6 +3362,13 @@ static void K_drawKartBumpersOrKarma(void)
{ {
using srb2::Draw; using srb2::Draw;
int width = 39; int width = 39;
if (!battleprisons)
{
constexpr int kPad = 16;
if (flipflag)
fx -= kPad;
width += kPad;
}
Draw(fx-1 + (flipflag ? width + 3 : 0), fy+1) Draw(fx-1 + (flipflag ? width + 3 : 0), fy+1)
.flags(V_HUDTRANS|V_SLIDEIN|splitflags) .flags(V_HUDTRANS|V_SLIDEIN|splitflags)
.align(flipflag ? Draw::Align::kRight : Draw::Align::kLeft) .align(flipflag ? Draw::Align::kRight : Draw::Align::kLeft)
@ -3400,12 +3410,18 @@ static void K_drawKartBumpersOrKarma(void)
V_DrawMappedPatch(fx-1, fy-2, V_HUDTRANS|V_SLIDEIN|splitflags, kp_rankbumper, colormap); V_DrawMappedPatch(fx-1, fy-2, V_HUDTRANS|V_SLIDEIN|splitflags, kp_rankbumper, colormap);
UINT8 ln[2]; using srb2::Draw;
ln[0] = (bumpers / 10 % 10); Draw row = Draw(fx+12, fy).flags(V_HUDTRANS|V_SLIDEIN|splitflags).font(Draw::Font::kPing);
ln[1] = (bumpers % 10); row.text("{:02}", bumpers);
if (g_pointlimit <= stplyr->roundscore && leveltime % 8 < 4)
V_DrawScaledPatch(fx+13, fy, V_HUDTRANS|V_SLIDEIN|splitflags, kp_facenum[ln[0]]); {
V_DrawScaledPatch(fx+19, fy, V_HUDTRANS|V_SLIDEIN|splitflags, kp_facenum[ln[1]]); row = row.colorize(SKINCOLOR_TANGERINE);
}
row.xy(10, -2).patch(kp_pts[1]);
row
.x(31)
.flags(g_pointlimit <= stplyr->roundscore ? V_STRINGDANCE : 0)
.text("{:02}", stplyr->roundscore);
} }
} }
else else
@ -3429,9 +3445,21 @@ static void K_drawKartBumpersOrKarma(void)
fy += 2; fy += 2;
} }
K_DrawSticker(LAPS_X+12, fy+5, bumpers > 9 ? 64 : 52, V_HUDTRANS|V_SLIDEIN|splitflags, false); K_DrawSticker(LAPS_X+12, fy+5, 75, V_HUDTRANS|V_SLIDEIN|splitflags, false);
V_DrawMappedPatch(LAPS_X+15, fy-5, V_HUDTRANS|V_SLIDEIN|splitflags, kp_bigbumper, colormap); V_DrawMappedPatch(LAPS_X+12, fy-2, V_HUDTRANS|V_SLIDEIN|splitflags, kp_bigbumper, colormap);
V_DrawTimerString(LAPS_X+47, fy+3, V_HUDTRANS|V_SLIDEIN|splitflags, va("%d", bumpers));
using srb2::Draw;
Draw row = Draw(LAPS_X+12+23+1, fy+3).flags(V_HUDTRANS|V_SLIDEIN|splitflags).font(Draw::Font::kThinTimer);
row.text("{:02}", bumpers);
if (g_pointlimit <= stplyr->roundscore && leveltime % 8 < 4)
{
row = row.colorize(SKINCOLOR_TANGERINE);
}
row.xy(12, -2).patch(kp_pts[0]);
row
.x(12+27)
.flags(g_pointlimit <= stplyr->roundscore ? V_STRINGDANCE : 0)
.text("{:02}", stplyr->roundscore);
} }
} }
} }