mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-15 01:01:43 +00:00
Expose battlefullscreen and battlecomebacktimer huds to lua
This commit is contained in:
parent
32d1f75199
commit
54ae277bff
3 changed files with 19 additions and 3 deletions
18
src/k_kart.c
18
src/k_kart.c
|
@ -7838,6 +7838,11 @@ static void K_drawBattleFullscreen(void)
|
|||
INT32 y = -64+(stplyr->kartstuff[k_cardanimation]); // card animation goes from 0 to 164, 164 is the middle of the screen
|
||||
INT32 splitflags = V_SNAPTOTOP; // I don't feel like properly supporting non-green resolutions, so you can have a misuse of SNAPTO instead
|
||||
fixed_t scale = FRACUNIT;
|
||||
boolean drawcomebacktimer = true; // lazy hack because it's cleaner in the long run.
|
||||
#ifdef HAVE_BLUA
|
||||
if (!LUA_HudEnabled(hud_battlecomebacktimer))
|
||||
drawcomebacktimer = false;
|
||||
#endif
|
||||
|
||||
if (splitscreen)
|
||||
{
|
||||
|
@ -7889,7 +7894,7 @@ static void K_drawBattleFullscreen(void)
|
|||
else
|
||||
K_drawKartFinish();
|
||||
}
|
||||
else if (stplyr->kartstuff[k_bumper] <= 0 && stplyr->kartstuff[k_comebacktimer] && comeback && !stplyr->spectator)
|
||||
else if (stplyr->kartstuff[k_bumper] <= 0 && stplyr->kartstuff[k_comebacktimer] && comeback && !stplyr->spectator && drawcomebacktimer)
|
||||
{
|
||||
UINT16 t = stplyr->kartstuff[k_comebacktimer]/(10*TICRATE);
|
||||
INT32 txoff, adjust = (splitscreen > 1) ? 4 : 6; // normal string is 8, kart string is 12, half of that for ease
|
||||
|
@ -8449,8 +8454,15 @@ void K_drawKartHUD(void)
|
|||
|
||||
if (battlefullscreen)
|
||||
{
|
||||
K_drawBattleFullscreen();
|
||||
return;
|
||||
#ifdef HAVE_BLUA
|
||||
if (LUA_HudEnabled(hud_battlefullscreen))
|
||||
{
|
||||
#endif
|
||||
K_drawBattleFullscreen();
|
||||
return;
|
||||
#ifdef HAVE_BLUA
|
||||
} // yes we legit checked if we had lua to close a single bracket. Not my proudest code edit tbh.
|
||||
#endif
|
||||
}
|
||||
|
||||
// Draw the item window
|
||||
|
|
|
@ -21,6 +21,8 @@ enum hud {
|
|||
hud_position,
|
||||
hud_minirankings, // Rankings to the left
|
||||
hud_battlebumpers, // mini rankings battle bumpers.
|
||||
hud_battlefullscreen, // battle huge text (WAIT, WIN, LOSE ...) + karma comeback time
|
||||
hud_battlecomebacktimer, // comeback timer in battlefullscreen. separated for ease of use.
|
||||
hud_wanted,
|
||||
hud_speedometer,
|
||||
hud_freeplay,
|
||||
|
|
|
@ -48,6 +48,8 @@ static const char *const hud_disable_options[] = {
|
|||
"position",
|
||||
"minirankings", // Gametype rankings to the left
|
||||
"battlerankingsbumpers", // bumper drawer for battle. Useful if you want to make a custom battle gamemode without bumpers being involved.
|
||||
"battlefullscreen", // battlefullscreen func (WAIT, ATTACK OR PROTECT ...)
|
||||
"battlecomebacktimer", // come back timer in battlefullscreen
|
||||
"wanted",
|
||||
"speedometer",
|
||||
"freeplay",
|
||||
|
|
Loading…
Reference in a new issue