Do some minor HUD fixes.

* Move HUD text's anchoring to underneath STR instead of above Lives.
* Adjust chat position slightly, to take advantage of SRB2's HUD layout having less content towards the bottom (unlike Kart, where it has roughly equal).
* Fix Match emeralds not displaying while in tab rankings with all-seven invuln/shoes bonus active.
This commit is contained in:
toaster 2019-06-18 18:51:24 +01:00
parent 1d65caa250
commit b0326b6dec
2 changed files with 72 additions and 47 deletions

View File

@ -1327,7 +1327,7 @@ static char *CHAT_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
// 30/7/18: chaty is now the distance at which the lowest point of the chat will be drawn if that makes any sense.
INT16 chatx = 13, chaty = 169; // let's use this as our coordinates, shh
INT16 chatx = 14, chaty = 180; // let's use this as our coordinates
// chat stuff by VincyTM LOL XD!
@ -1502,8 +1502,8 @@ static void HU_drawChatLog(INT32 offset)
if (splitscreen)
{
y -= BASEVIDHEIGHT/2;
if (splitscreen > 1)
y += 16;
//if (splitscreen > 1)
//y += 16;
}
#endif
y -= (G_RingSlingerGametype() ? 16 : 0);
@ -2302,7 +2302,9 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
| V_ALLOWLOWERCASE, tab[i].name);
// Draw emeralds
if (!players[tab[i].num].powers[pw_super]
if (players[tab[i].num].powers[pw_invulnerability] && (players[tab[i].num].powers[pw_invulnerability] == players[tab[i].num].powers[pw_sneakers]) && ((leveltime/7) & 1))
HU_DrawEmeralds(x-12,y+2,255);
else if (!players[tab[i].num].powers[pw_super]
|| ((leveltime/7) & 1))
{
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
@ -2574,7 +2576,9 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
}
// Draw emeralds
if (!players[tab[i].num].powers[pw_super]
if (players[tab[i].num].powers[pw_invulnerability] && (players[tab[i].num].powers[pw_invulnerability] == players[tab[i].num].powers[pw_sneakers]) && ((leveltime/7) & 1))
HU_DrawEmeralds(x-12,y+2,255);
else if (!players[tab[i].num].powers[pw_super]
|| ((leveltime/7) & 1))
{
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
@ -2646,7 +2650,9 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon);
// Draw emeralds
if (!players[tab[i].num].powers[pw_super]
if (players[tab[i].num].powers[pw_invulnerability] && (players[tab[i].num].powers[pw_invulnerability] == players[tab[i].num].powers[pw_sneakers]) && ((leveltime/7) & 1))
HU_DrawEmeralds(x-12,y+2,255);
else if (!players[tab[i].num].powers[pw_super]
|| ((leveltime/7) & 1))
{
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
@ -2746,7 +2752,12 @@ static void HU_Draw32TabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scor
V_DrawFixedPatch((x-10)*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, tagico, 0);
// Draw emeralds
if (!players[tab[i].num].powers[pw_super]
if (players[tab[i].num].powers[pw_invulnerability] && players[tab[i].num].powers[pw_invulnerability] && (players[tab[i].num].powers[pw_invulnerability] == players[tab[i].num].powers[pw_sneakers]) && ((leveltime/7) & 1))
{
HU_Draw32Emeralds(x+60, y+2, 255);
//HU_DrawEmeralds(x-12,y+2,255);
}
else if (!players[tab[i].num].powers[pw_super]
|| ((leveltime/7) & 1))
{
HU_Draw32Emeralds(x+60, y+2, tab[i].emeralds);

View File

@ -1968,37 +1968,27 @@ static void ST_drawMatchHUD(void)
static void ST_drawTextHUD(void)
{
INT32 y = 176 - 16; // HUD_LIVES
boolean dof12 = false, dospecheader = false;
INT32 y = 42 + 16; // HUD_RINGS
boolean donef12 = false;
#define textHUDdraw(str) \
{\
V_DrawThinString(16, y, V_PERPLAYER|V_HUDTRANS|V_SNAPTOLEFT|V_SNAPTOBOTTOM, str);\
y -= 8;\
y += 8;\
}
if (F_GetPromptHideHud(y))
return;
if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && (!stplyr->spectator))
if (stplyr->spectator && (gametype != GT_COOP || stplyr->playerstate == PST_LIVE))
textHUDdraw(M_GetText("\x86""Spectator mode:"))
if (circuitmap)
{
if (leveltime < hidetime * TICRATE)
{
if (stplyr->pflags & PF_TAGIT)
{
textHUDdraw(M_GetText("Waiting for players to hide..."))
textHUDdraw(M_GetText("\x82""You are blindfolded!"))
}
else if (gametype == GT_HIDEANDSEEK)
textHUDdraw(M_GetText("Hide before time runs out!"))
else
textHUDdraw(M_GetText("Flee before you are hunted!"))
}
else if (gametype == GT_HIDEANDSEEK && !(stplyr->pflags & PF_TAGIT))
{
textHUDdraw(M_GetText("You cannot move while hiding."))
dof12 = true;
}
if (stplyr->exiting)
textHUDdraw(M_GetText("\x82""FINISHED!"))
else
textHUDdraw(va("Lap:""\x82 %u/%d", stplyr->laps+1, cv_numlaps.value))
}
if (!stplyr->spectator && stplyr->exiting && cv_playersforexit.value && gametype == GT_COOP)
@ -2027,13 +2017,23 @@ static void ST_drawTextHUD(void)
if (exiting < total)
{
if (!splitscreen && !donef12)
{
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
donef12 = true;
}
total -= exiting;
textHUDdraw(va(M_GetText("%d player%s remaining"), total, ((total == 1) ? "" : "s")))
dof12 = true;
}
}
else if (gametype != GT_COOP && (stplyr->exiting || (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)))
dof12 = true;
{
if (!splitscreen && !donef12)
{
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
donef12 = true;
}
}
else if (!G_PlatformGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) //Death overrides spectator text.
{
INT32 respawntime = cv_respawntime.value - stplyr->deadtimer/TICRATE;
@ -2045,6 +2045,15 @@ static void ST_drawTextHUD(void)
}
else if (stplyr->spectator && (gametype != GT_COOP || stplyr->playerstate == PST_LIVE))
{
if (!splitscreen && !donef12)
{
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
donef12 = true;
}
textHUDdraw(M_GetText("\x82""JUMP:""\x80 Rise"))
textHUDdraw(M_GetText("\x82""SPIN:""\x80 Lower"))
if (G_IsSpecialStage(gamemap) && (maptol & TOL_NIGHTS))
textHUDdraw(M_GetText("\x82""Wait for the stage to end..."))
else if (gametype == GT_COOP)
@ -2076,28 +2085,33 @@ static void ST_drawTextHUD(void)
}
else
textHUDdraw(M_GetText("\x82""FIRE:""\x80 Enter game"))
textHUDdraw(M_GetText("\x82""SPIN:""\x80 Lower"))
textHUDdraw(M_GetText("\x82""JUMP:""\x80 Rise"))
dof12 = true;
dospecheader = true;
}
if (!splitscreen && dof12)
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
if (circuitmap)
if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && (!stplyr->spectator))
{
if (stplyr->exiting)
textHUDdraw(M_GetText("\x82""FINISHED!"))
else
textHUDdraw(va("Lap:""\x82 %u/%d", stplyr->laps+1, cv_numlaps.value))
if (leveltime < hidetime * TICRATE)
{
if (stplyr->pflags & PF_TAGIT)
{
textHUDdraw(M_GetText("\x82""You are blindfolded!"))
textHUDdraw(M_GetText("Waiting for players to hide..."))
}
else if (gametype == GT_HIDEANDSEEK)
textHUDdraw(M_GetText("Hide before time runs out!"))
else
textHUDdraw(M_GetText("Flee before you are hunted!"))
}
else if (gametype == GT_HIDEANDSEEK && !(stplyr->pflags & PF_TAGIT))
{
if (!splitscreen && !donef12)
{
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
donef12 = true;
}
textHUDdraw(M_GetText("You cannot move while hiding."))
}
}
if (dospecheader)
textHUDdraw(M_GetText("\x86""Spectator mode:"))
#undef textHUDdraw
}