Player-tracking roulette box visibility
This commit is contained in:
parent
387ea9a559
commit
f082cb1439
3 changed files with 21 additions and 2 deletions
|
|
@ -825,6 +825,9 @@ static CV_PossibleValue_t rlplrtrans_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NU
|
|||
// Default is 7 (70% visible; V_30TRANS)
|
||||
consvar_t cv_rouletteplayertrans = CVAR_INIT ("rouletteonplayertrans", "7", CV_SAVE, rlplrtrans_cons_t, NULL);
|
||||
|
||||
// Item box visibility; a separate cvar
|
||||
consvar_t cv_rouletteplayerboxtrans = CVAR_INIT ("rouletteonplayerboxtrans", "10", CV_SAVE, rlplrtrans_cons_t, NULL);
|
||||
|
||||
consvar_t cv_showviewpointtext = CVAR_INIT ("showviewpointtext", "On", CV_SAVE, CV_OnOff, NULL);
|
||||
|
||||
// Intermission time Tails 04-19-2002
|
||||
|
|
@ -1143,6 +1146,7 @@ void D_RegisterServerCommands(void)
|
|||
CV_RegisterVar(&cv_spinoutroll);
|
||||
CV_RegisterVar(&cv_rouletteonplayer);
|
||||
CV_RegisterVar(&cv_rouletteplayertrans);
|
||||
CV_RegisterVar(&cv_rouletteplayerboxtrans);
|
||||
CV_RegisterVar(&cv_showlapemblem);
|
||||
CV_RegisterVar(&cv_lapemblemmode);
|
||||
CV_RegisterVar(&cv_racesplits);
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ extern consvar_t cv_lapemblemmode;
|
|||
extern consvar_t cv_racesplits;
|
||||
extern consvar_t cv_showviewpointtext;
|
||||
extern consvar_t cv_rouletteonplayer;
|
||||
extern consvar_t cv_rouletteplayertrans;
|
||||
extern consvar_t cv_rouletteplayertrans, cv_rouletteplayerboxtrans;
|
||||
|
||||
extern consvar_t cv_skipmapcheck;
|
||||
|
||||
|
|
|
|||
17
src/k_hud.c
17
src/k_hud.c
|
|
@ -1586,6 +1586,7 @@ static void K_drawKartItem(void)
|
|||
|
||||
INT32 hudtrans = V_GetHudTrans();
|
||||
INT32 transflag = (fade) ? V_HUDTRANSHALF : V_HUDTRANS;
|
||||
INT32 boxtransflag = V_HUDTRANS;
|
||||
INT32 transmul = FRACUNIT - (hudtrans * FRACUNIT / 10);
|
||||
|
||||
if (hudtrans > 9)
|
||||
|
|
@ -1596,6 +1597,7 @@ static void K_drawKartItem(void)
|
|||
|
||||
// Let the player pick and choose their visibility level.
|
||||
INT32 roulettetrans = cv_rouletteplayertrans.value;
|
||||
INT32 boxtrans = cv_rouletteplayerboxtrans.value;
|
||||
|
||||
// RadioRacers
|
||||
if (shouldDrawOnPlayer)
|
||||
|
|
@ -1621,7 +1623,10 @@ static void K_drawKartItem(void)
|
|||
}
|
||||
|
||||
if (stplyr->exiting)
|
||||
{
|
||||
roulettetrans = -1;
|
||||
boxtrans = -1;
|
||||
}
|
||||
|
||||
if (roulettetrans > -1)
|
||||
{
|
||||
|
|
@ -1631,6 +1636,15 @@ static void K_drawKartItem(void)
|
|||
{
|
||||
transflag = (fade) ? V_HUDTRANSHALF : V_HUDTRANS;
|
||||
}
|
||||
|
||||
if (boxtrans > -1)
|
||||
{
|
||||
boxtransflag = max(0, min(9, 10 - FixedMul(boxtrans, transmul))) << V_ALPHASHIFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
boxtransflag = V_HUDTRANS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1640,6 +1654,7 @@ static void K_drawKartItem(void)
|
|||
flipamount = info.flipamount;
|
||||
|
||||
INT32 localpatchflags = (transflag|fflags);
|
||||
INT32 boxpatchflags = (boxtransflag|fflags);
|
||||
|
||||
if (localcolor != SKINCOLOR_NONE)
|
||||
{
|
||||
|
|
@ -1653,7 +1668,7 @@ static void K_drawKartItem(void)
|
|||
if (K_UseColorHud())
|
||||
colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
|
||||
|
||||
V_DrawFixedPatch(fx << FRACBITS, fy << FRACBITS, info.hudScale, V_HUDTRANS|fflags, localbg, colormap);
|
||||
V_DrawFixedPatch(fx << FRACBITS, fy << FRACBITS, info.hudScale, boxpatchflags, localbg, colormap);
|
||||
|
||||
// Then, the numbers:
|
||||
if (stplyr->itemamount >= K_GetItemNumberDisplayMin(stplyr->itemtype, tiny) && !stplyr->itemroulette)
|
||||
|
|
|
|||
Loading…
Reference in a new issue