mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'item-roulette-numbers' into 'master'
Roulette numbers when the roulette can give you more than 1 of an item Closes #974 See merge request KartKrew/Kart!2010
This commit is contained in:
commit
1345439d7c
6 changed files with 64 additions and 15 deletions
|
|
@ -319,6 +319,15 @@ void HU_Init(void)
|
||||||
PR ("PRFN");
|
PR ("PRFN");
|
||||||
REG;
|
REG;
|
||||||
|
|
||||||
|
DIM ('0', 10);
|
||||||
|
DIG (2);
|
||||||
|
|
||||||
|
PR ("ROLNUM");
|
||||||
|
REG;
|
||||||
|
|
||||||
|
PR ("RO4NUM");
|
||||||
|
REG;
|
||||||
|
|
||||||
DIG (3);
|
DIG (3);
|
||||||
|
|
||||||
ADIM (KART);
|
ADIM (KART);
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,8 @@ enum
|
||||||
X (NIGHTSNUM),
|
X (NIGHTSNUM),
|
||||||
X (PINGNUM),
|
X (PINGNUM),
|
||||||
X (PROFNUM),
|
X (PROFNUM),
|
||||||
|
X (ROLNUM),
|
||||||
|
X (RO4NUM),
|
||||||
|
|
||||||
X (KART),
|
X (KART),
|
||||||
X (TIMER),
|
X (TIMER),
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -308,6 +308,12 @@ int Draw::font_to_fontno(Font font)
|
||||||
|
|
||||||
case Font::kMedium:
|
case Font::kMedium:
|
||||||
return MED_FONT;
|
return MED_FONT;
|
||||||
|
|
||||||
|
case Font::kRollingNum:
|
||||||
|
return ROLNUM_FONT;
|
||||||
|
|
||||||
|
case Font::kRollingNum4P:
|
||||||
|
return RO4NUM_FONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TINY_FONT;
|
return TINY_FONT;
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ public:
|
||||||
kThinTimer,
|
kThinTimer,
|
||||||
kMenu,
|
kMenu,
|
||||||
kMedium,
|
kMedium,
|
||||||
|
kRollingNum,
|
||||||
|
kRollingNum4P,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Align
|
enum class Align
|
||||||
|
|
|
||||||
|
|
@ -2342,6 +2342,12 @@ static void V_GetFontSpecification(int fontno, INT32 flags, fontspec_t *result)
|
||||||
case PINGF_FONT:
|
case PINGF_FONT:
|
||||||
result->spacew = 3;
|
result->spacew = 3;
|
||||||
break;
|
break;
|
||||||
|
case ROLNUM_FONT:
|
||||||
|
result->spacew = 17;
|
||||||
|
break;
|
||||||
|
case RO4NUM_FONT:
|
||||||
|
result->spacew = 9;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (fontno)
|
switch (fontno)
|
||||||
|
|
@ -2373,6 +2379,12 @@ static void V_GetFontSpecification(int fontno, INT32 flags, fontspec_t *result)
|
||||||
case PINGF_FONT:
|
case PINGF_FONT:
|
||||||
result->lfh = 10;
|
result->lfh = 10;
|
||||||
break;
|
break;
|
||||||
|
case ROLNUM_FONT:
|
||||||
|
result->lfh = 33;
|
||||||
|
break;
|
||||||
|
case RO4NUM_FONT:
|
||||||
|
result->lfh = 15;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (fontno)
|
switch (fontno)
|
||||||
|
|
@ -2432,6 +2444,8 @@ static void V_GetFontSpecification(int fontno, INT32 flags, fontspec_t *result)
|
||||||
break;
|
break;
|
||||||
case OPPRF_FONT:
|
case OPPRF_FONT:
|
||||||
case PINGF_FONT:
|
case PINGF_FONT:
|
||||||
|
case ROLNUM_FONT:
|
||||||
|
case RO4NUM_FONT:
|
||||||
if (result->chw)
|
if (result->chw)
|
||||||
result->dim_fn = FixedCharacterDim;
|
result->dim_fn = FixedCharacterDim;
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue