mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add a goofy little jitter to the HUD
- Medium strength at 5 seconds to go - Big strength in overtime
This commit is contained in:
parent
243f38227c
commit
99705faea6
1 changed files with 27 additions and 45 deletions
72
src/k_hud.c
72
src/k_hud.c
|
|
@ -1385,33 +1385,33 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UI
|
|||
// TIME_Y = 6; // 6
|
||||
|
||||
tic_t worktime;
|
||||
boolean dontdraw = false;
|
||||
INT32 jitter = 0;
|
||||
|
||||
INT32 splitflags = 0;
|
||||
if (!mode)
|
||||
{
|
||||
splitflags = V_HUDTRANS|V_SLIDEIN|V_SNAPTOTOP|V_SNAPTORIGHT|V_SPLITSCREEN;
|
||||
|
||||
#ifndef TESTOVERTIMEINFREEPLAY
|
||||
if (battlecapsules) // capsules override any time limit settings
|
||||
;
|
||||
else
|
||||
#endif
|
||||
if (bossinfo.boss == true)
|
||||
;
|
||||
else if (timelimitintics > 0 && (gametyperules & GTR_TIMELIMIT)) // TODO
|
||||
{
|
||||
if (drawtime >= timelimitintics)
|
||||
{
|
||||
if (((drawtime-timelimitintics)/TICRATE) & 1)
|
||||
{
|
||||
dontdraw = true;
|
||||
}
|
||||
jitter = 2;
|
||||
if (drawtime & 2)
|
||||
jitter = -jitter;
|
||||
drawtime = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
drawtime = timelimitintics - drawtime;
|
||||
if (drawtime < 5*TICRATE)
|
||||
{
|
||||
jitter = 1;
|
||||
if (drawtime & 2)
|
||||
jitter = -jitter;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1422,57 +1422,39 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UI
|
|||
|
||||
worktime = drawtime/(60*TICRATE);
|
||||
|
||||
if (worktime >= 100)
|
||||
{
|
||||
jitter = (drawtime & 1 ? 1 : -1);
|
||||
worktime = 99;
|
||||
drawtime = (100*(60*TICRATE))-1;
|
||||
}
|
||||
|
||||
if (mode && !drawtime)
|
||||
V_DrawKartString(TX, TY+3, splitflags, va("--'--\"--"));
|
||||
else if (dontdraw) // overtime flash
|
||||
;
|
||||
else if (worktime < 100) // 99:99:99 only
|
||||
else
|
||||
{
|
||||
// zero minute
|
||||
if (worktime < 10)
|
||||
{
|
||||
V_DrawKartString(TX, TY+3, splitflags, va("0"));
|
||||
// minutes time 0 __ __
|
||||
V_DrawKartString(TX+12, TY+3, splitflags, va("%d", worktime));
|
||||
}
|
||||
// minutes time 0 __ __
|
||||
else
|
||||
V_DrawKartString(TX, TY+3, splitflags, va("%d", worktime));
|
||||
// minutes time 00 __ __
|
||||
V_DrawKartString(TX, TY+3+jitter, splitflags, va("%d", worktime/10));
|
||||
V_DrawKartString(TX+12, TY+3-jitter, splitflags, va("%d", worktime%10));
|
||||
|
||||
// apostrophe location _'__ __
|
||||
V_DrawKartString(TX+24, TY+3, splitflags, va("'"));
|
||||
|
||||
worktime = (drawtime/TICRATE % 60);
|
||||
|
||||
// zero second _ 0_ __
|
||||
if (worktime < 10)
|
||||
{
|
||||
V_DrawKartString(TX+36, TY+3, splitflags, va("0"));
|
||||
// seconds time _ _0 __
|
||||
V_DrawKartString(TX+48, TY+3, splitflags, va("%d", worktime));
|
||||
}
|
||||
// zero second _ 00 __
|
||||
else
|
||||
V_DrawKartString(TX+36, TY+3, splitflags, va("%d", worktime));
|
||||
// seconds time _ 00 __
|
||||
V_DrawKartString(TX+36, TY+3+jitter, splitflags, va("%d", worktime/10));
|
||||
V_DrawKartString(TX+48, TY+3-jitter, splitflags, va("%d", worktime%10));
|
||||
|
||||
// quotation mark location _ __"__
|
||||
V_DrawKartString(TX+60, TY+3, splitflags, va("\""));
|
||||
|
||||
worktime = G_TicsToCentiseconds(drawtime);
|
||||
|
||||
// zero tick _ __ 0_
|
||||
if (worktime < 10)
|
||||
{
|
||||
V_DrawKartString(TX+72, TY+3, splitflags, va("0"));
|
||||
// tics _ __ _0
|
||||
V_DrawKartString(TX+84, TY+3, splitflags, va("%d", worktime));
|
||||
}
|
||||
// zero tick _ __ 00
|
||||
else
|
||||
V_DrawKartString(TX+72, TY+3, splitflags, va("%d", worktime));
|
||||
// tics _ __ 00
|
||||
V_DrawKartString(TX+72, TY+3+jitter, splitflags, va("%d", worktime/10));
|
||||
V_DrawKartString(TX+84, TY+3-jitter, splitflags, va("%d", worktime%10));
|
||||
}
|
||||
else if ((drawtime/TICRATE) & 1)
|
||||
V_DrawKartString(TX, TY+3, splitflags, va("99'59\"99"));
|
||||
|
||||
if (emblemmap && (modeattacking || (mode == 1)) && !demo.playback) // emblem time!
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue