Show keys in the HUD in Hexen.

This commit is contained in:
Mari the Deer 2021-02-22 17:48:28 +01:00
commit 345d9e25bb
2 changed files with 9 additions and 7 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r300 \cu(Mon 22 Feb 17:01:58 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r300 \cu(2021-02-22 17:01:58)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r301 \cu(Mon 22 Feb 17:48:28 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r301 \cu(2021-02-22 17:48:28)\c-";

View file

@ -1231,8 +1231,7 @@ Class SWWMStatusBar : BaseStatusBar
}
yy += 3;
}
// in doom/heretic (draw key icons)
if ( !(gameinfo.gametype&(GAME_DOOMCHEX|GAME_HERETIC)) ) return;
// draw key icons
Vector2 keypos = (ss.x-(margin+2),yy);
int colc = 0;
double colh = 0;
@ -1259,14 +1258,17 @@ Class SWWMStatusBar : BaseStatusBar
if ( i >= j ) i--;
}
}
int maxcolc = (gameinfo.gametype&GAME_DOOMCHEX)?6:4;
for ( int i=0; i<klist.Size(); i++ )
{
let k = klist[i];
Vector2 siz = TexMan.GetScaledSize(k.Icon);
Screen.DrawTexture(k.Icon,false,keypos.x-siz.x,keypos.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
// Hexen key icons aren't meant for this kind of HUD
TextureID icon = (k is 'HexenKey')?k.SpawnState.GetSpriteTexture(0):k.Icon;
Vector2 siz = TexMan.GetScaledSize(icon);
Screen.DrawTexture(icon,false,keypos.x-siz.x,keypos.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_TopLeft,true);
keypos.x -= siz.x+2;
colh = max(colh,siz.y);
if ( ++colc == 8 )
if ( ++colc == maxcolc )
{
keypos.x = ss.x-(margin+2);
keypos.y += colh+2;