mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Draw numbers for roulette items that give more than 1
- Bottom centered - Except orbinaut x2, x3, x4 - Except ballhog x5
This commit is contained in:
parent
9a7af6c592
commit
c3f852ddaf
1 changed files with 31 additions and 15 deletions
|
|
@ -1371,6 +1371,7 @@ static void K_drawKartItem(void)
|
||||||
// Set to 'no item' just in case.
|
// Set to 'no item' just in case.
|
||||||
const UINT8 offset = ((r_splitscreen > 1) ? 1 : 0);
|
const UINT8 offset = ((r_splitscreen > 1) ? 1 : 0);
|
||||||
patch_t *localpatch[3] = { kp_nodraw, kp_nodraw, kp_nodraw };
|
patch_t *localpatch[3] = { kp_nodraw, kp_nodraw, kp_nodraw };
|
||||||
|
UINT8 localamt[3] = {0, 0, 0};
|
||||||
patch_t *localbg = ((offset) ? kp_itembg[2] : kp_itembg[0]);
|
patch_t *localbg = ((offset) ? kp_itembg[2] : kp_itembg[0]);
|
||||||
patch_t *localinv = ((offset) ? kp_invincibility[((leveltime % (6*3)) / 3) + 7] : kp_invincibility[(leveltime % (7*3)) / 3]);
|
patch_t *localinv = ((offset) ? kp_invincibility[((leveltime % (6*3)) / 3) + 7] : kp_invincibility[(leveltime % (7*3)) / 3]);
|
||||||
INT32 fx = 0, fy = 0, fflags = 0; // final coords for hud and flags...
|
INT32 fx = 0, fy = 0, fflags = 0; // final coords for hud and flags...
|
||||||
|
|
@ -1403,14 +1404,19 @@ static void K_drawKartItem(void)
|
||||||
{
|
{
|
||||||
case KITEM_INVINCIBILITY:
|
case KITEM_INVINCIBILITY:
|
||||||
localpatch[i] = localinv;
|
localpatch[i] = localinv;
|
||||||
|
localamt[i] = amt;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KITEM_ORBINAUT:
|
case KITEM_ORBINAUT:
|
||||||
localpatch[i] = kp_orbinaut[(offset ? 4 : std::min(amt-1, 3))];
|
localpatch[i] = kp_orbinaut[(offset ? 4 : std::min(amt-1, 3))];
|
||||||
|
if (amt > 4)
|
||||||
|
localamt[i] = amt;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
localpatch[i] = K_GetCachedItemPatch(item, offset);
|
localpatch[i] = K_GetCachedItemPatch(item, offset);
|
||||||
|
if (item != KITEM_BALLHOG || amt != 5)
|
||||||
|
localamt[i] = amt;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1586,25 +1592,35 @@ static void K_drawKartItem(void)
|
||||||
V_SLIDEIN|fflags
|
V_SLIDEIN|fflags
|
||||||
);
|
);
|
||||||
|
|
||||||
|
auto draw_item = [&](fixed_t y, int i)
|
||||||
|
{
|
||||||
|
const UINT8 *colormap = (localcolor[i] ? R_GetTranslationColormap(colormode[i], localcolor[i], GTC_CACHE) : NULL);
|
||||||
V_DrawFixedPatch(
|
V_DrawFixedPatch(
|
||||||
fx<<FRACBITS, (fy<<FRACBITS) + rouletteOffset + rouletteSpace,
|
fx<<FRACBITS, (fy<<FRACBITS) + rouletteOffset + y,
|
||||||
FRACUNIT, V_HUDTRANS|V_SLIDEIN|fflags,
|
FRACUNIT, V_HUDTRANS|V_SLIDEIN|fflags,
|
||||||
localpatch[0], (localcolor[0] ? R_GetTranslationColormap(colormode[0], localcolor[0], GTC_CACHE) : NULL)
|
localpatch[i], colormap
|
||||||
);
|
|
||||||
V_DrawFixedPatch(
|
|
||||||
fx<<FRACBITS, (fy<<FRACBITS) + rouletteOffset - rouletteSpace,
|
|
||||||
FRACUNIT, V_HUDTRANS|V_SLIDEIN|fflags,
|
|
||||||
localpatch[2], (localcolor[2] ? R_GetTranslationColormap(colormode[2], localcolor[2], GTC_CACHE) : NULL)
|
|
||||||
);
|
);
|
||||||
|
if (localamt[i] > 1)
|
||||||
|
{
|
||||||
|
using srb2::Draw;
|
||||||
|
Draw(
|
||||||
|
fx + rouletteCrop.x + FixedToFloat(rouletteSpace/2),
|
||||||
|
fy + rouletteCrop.y + FixedToFloat(rouletteOffset + y + rouletteSpace) - (r_splitscreen > 1 ? 15 : 33))
|
||||||
|
.font(r_splitscreen > 1 ? Draw::Font::kRollingNum4P : Draw::Font::kRollingNum)
|
||||||
|
.align(Draw::Align::kCenter)
|
||||||
|
.flags(V_HUDTRANS|V_SLIDEIN|fflags)
|
||||||
|
.colormap(colormap)
|
||||||
|
.text("{}", localamt[i]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
draw_item(rouletteSpace, 0);
|
||||||
|
draw_item(-rouletteSpace, 2);
|
||||||
|
|
||||||
if (stplyr->itemRoulette.active == true)
|
if (stplyr->itemRoulette.active == true)
|
||||||
{
|
{
|
||||||
// Draw the item underneath the box.
|
// Draw the item underneath the box.
|
||||||
V_DrawFixedPatch(
|
draw_item(0, 1);
|
||||||
fx<<FRACBITS, (fy<<FRACBITS) + rouletteOffset,
|
|
||||||
FRACUNIT, V_HUDTRANS|V_SLIDEIN|fflags,
|
|
||||||
localpatch[1], (localcolor[1] ? R_GetTranslationColormap(colormode[1], localcolor[1], GTC_CACHE) : NULL)
|
|
||||||
);
|
|
||||||
V_ClearClipRect();
|
V_ClearClipRect();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue