Alt HUD style fully implemented.

This commit is contained in:
Mari the Deer 2022-06-04 01:00:47 +02:00
commit 7c8fe3a11f
6 changed files with 302 additions and 2 deletions

View file

@ -1 +1,296 @@
// DrawWeaponAlt code for all weapons
// Deep Impact
extend Class DeepImpact
{
ui TextureID AltWeaponBox, AltAmmoBar;
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/DeepImpactDisplay.png",TexMan.Type_Any);
if ( !AltAmmoBar ) AltAmmoBar = TexMan.CheckForTexture("graphics/AltHUD/DeepImpactBar.png",TexMan.Type_Any);
Screen.DrawTexture(AltWeaponBox,false,bx-7,by-24,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int chg = clamp(ChargeInter?ChargeInter.GetValue():clipcount,0,100);
int ct = int(((by-2)-(chg*20./100.))*hs);
bool blinking = (failtime>gametic)&&((failtime-gametic)%8>=4);
Screen.DrawTexture(AltAmmoBar,false,bx-5,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipTop,ct,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
}
}
// Explodium Gun
extend Class ExplodiumGun
{
ui TextureID AltWeaponBox, AltRoundTex;
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/ExplodiumDisplay.png",TexMan.Type_Any);
if ( !AltRoundTex ) AltRoundTex = TexMan.CheckForTexture("graphics/AltHUD/ExplodiumRound.png",TexMan.Type_Any);
Screen.DrawTexture(AltWeaponBox,false,bx-9,by-21,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawTexture(AltRoundTex,false,bx-7,by-19,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<clipcount; i++ ) Screen.DrawTexture(AltRoundTex,false,bx-7,by-(16-i*2),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
extend Class DualExplodiumGun
{
ui TextureID AltWeaponBox, AltRoundTex;
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/ExplodiumDisplay.png",TexMan.Type_Any);
if ( !AltRoundTex ) AltRoundTex = TexMan.CheckForTexture("graphics/AltHUD/ExplodiumRound.png",TexMan.Type_Any);
Screen.DrawTexture(AltWeaponBox,false,bx-20,by-21,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawTexture(AltRoundTex,false,bx-18,by-19,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<clipcount; i++ ) Screen.DrawTexture(AltRoundTex,false,bx-18,by-(16-i*2),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AltWeaponBox,false,bx-9,by-21,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( ExplodiumGun(SisterWeapon).chambered ) Screen.DrawTexture(AltRoundTex,false,bx-7,by-19,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<ExplodiumGun(SisterWeapon).clipcount; i++ ) Screen.DrawTexture(AltRoundTex,false,bx-7,by-(16-i*2),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
// Spreadgun
extend Class Spreadgun
{
ui TextureID AltWeaponBox, AltRoundTex[7];
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/SpreadgunDisplay.png",TexMan.Type_Any);
if ( !AltRoundTex[0] ) AltRoundTex[0] = TexMan.CheckForTexture("graphics/AltHUD/ShellRed.png",TexMan.Type_Any);
if ( !AltRoundTex[1] ) AltRoundTex[1] = TexMan.CheckForTexture("graphics/AltHUD/ShellGreen.png",TexMan.Type_Any);
if ( !AltRoundTex[2] ) AltRoundTex[2] = TexMan.CheckForTexture("graphics/AltHUD/ShellWhite.png",TexMan.Type_Any);
if ( !AltRoundTex[3] ) AltRoundTex[3] = TexMan.CheckForTexture("graphics/AltHUD/ShellBlue.png",TexMan.Type_Any);
if ( !AltRoundTex[4] ) AltRoundTex[4] = TexMan.CheckForTexture("graphics/AltHUD/ShellBlack.png",TexMan.Type_Any);
if ( !AltRoundTex[5] ) AltRoundTex[5] = TexMan.CheckForTexture("graphics/AltHUD/ShellPurple.png",TexMan.Type_Any);
if ( !AltRoundTex[6] ) AltRoundTex[6] = TexMan.CheckForTexture("graphics/AltHUD/ShellGold.png",TexMan.Type_Any);
Screen.DrawTexture(AltWeaponBox,false,bx-9,by-6,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( !chambered ) return;
for ( int i=0; i<7; i++ )
{
if ( loadammo != types[i] ) continue;
Screen.DrawTexture(AltRoundTex[i],false,bx-7,by-4,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(fired?128:0,0,0,0));
break;
}
}
}
// Wallbuster (less of a fuck in the alt hud)
extend Class Wallbuster
{
ui TextureID AltWeaponBox, AltRoundTex[4], AltCursorTex;
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell"};
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/WallbusterDisplay.png",TexMan.Type_Any);
if ( !AltRoundTex[0] ) AltRoundTex[0] = TexMan.CheckForTexture("graphics/AltHUD/ShellRed.png",TexMan.Type_Any);
if ( !AltRoundTex[1] ) AltRoundTex[1] = TexMan.CheckForTexture("graphics/AltHUD/ShellGreen.png",TexMan.Type_Any);
if ( !AltRoundTex[2] ) AltRoundTex[2] = TexMan.CheckForTexture("graphics/AltHUD/ShellBlue.png",TexMan.Type_Any);
if ( !AltRoundTex[3] ) AltRoundTex[3] = TexMan.CheckForTexture("graphics/AltHUD/ShellPurple.png",TexMan.Type_Any);
if ( !AltCursorTex ) AltCursorTex = TexMan.CheckForTexture("graphics/AltHUD/WallbusterCursor.png",TexMan.Type_Any);
Screen.DrawTexture(AltWeaponBox,false,bx-11,by-70,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int curpos = 68-(rotation[5]*14+rotation[rotation[5]]*2);
Screen.DrawTexture(AltCursorTex,false,bx-9,by-curpos,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<25; i++ )
{
curpos = 68-(i*2+(i/5)*4);
if ( !loaded[i] ) continue;
for ( int j=0; j<4; j++ )
{
if ( loaded[i] != types[j] ) continue;
Screen.DrawTexture(AltRoundTex[j],false,bx-7,by-curpos,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(fired[i]?128:0,0,0,0));
break;
}
}
}
}
// Eviscerator
extend Class Eviscerator
{
ui TextureID AltWeaponBox, AltRoundTex, AltSpreadIcon[2];
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/EvisceratorDisplay.png",TexMan.Type_Any);
if ( !AltRoundTex ) AltRoundTex = TexMan.CheckForTexture("graphics/AltHUD/EvisceratorRound.png",TexMan.Type_Any);
if ( !AltSpreadIcon[0] ) AltSpreadIcon[0] = TexMan.CheckForTexture("graphics/AltHUD/EvisceratorWide.png",TexMan.Type_Any);
if ( !AltSpreadIcon[1] ) AltSpreadIcon[1] = TexMan.CheckForTexture("graphics/AltHUD/EvisceratorTight.png",TexMan.Type_Any);
Screen.DrawTexture(AltWeaponBox,false,bx-9,by-18,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AltRoundTex,false,bx-7,by-7,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,chambered?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawTexture(AltSpreadIcon[extended],false,bx-7,by-16,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
// Hellblazer
extend Class Hellblazer
{
ui TextureID AltWeaponBox, AltRoundTex[4];
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"HellblazerMissiles","HellblazerCrackshots","HellblazerRavagers","HellblazerWarheads"};
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/HellblazerDisplay.png",TexMan.Type_Any);
if ( !AltRoundTex[0] ) AltRoundTex[0] = TexMan.CheckForTexture("graphics/AltHUD/HellblazerMissile.png",TexMan.Type_Any);
if ( !AltRoundTex[1] ) AltRoundTex[1] = TexMan.CheckForTexture("graphics/AltHUD/HellblazerCrackshot.png",TexMan.Type_Any);
if ( !AltRoundTex[2] ) AltRoundTex[2] = TexMan.CheckForTexture("graphics/AltHUD/HellblazerRavager.png",TexMan.Type_Any);
if ( !AltRoundTex[3] ) AltRoundTex[3] = TexMan.CheckForTexture("graphics/AltHUD/HellblazerWarhead.png",TexMan.Type_Any);
Screen.DrawTexture(AltWeaponBox,false,bx-12,by-28,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int curtype = 0;
for ( int i=0; i<4; i++ )
{
if ( loadammo != types[i] ) continue;
curtype = i;
break;
}
int yy = 26;
switch ( curtype )
{
case 0:
for ( int i=0; i<6; i++ )
{
Screen.DrawTexture(AltRoundTex[0],false,bx-10,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(128,0,0,0):Color(0,0,0,0):magstate[i]?Color(160,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
yy -= 4;
}
break;
case 1:
yy = 24;
for ( int i=0; i<3; i++ )
{
Screen.DrawTexture(AltRoundTex[1],false,bx-10,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(128,0,0,0):Color(0,0,0,0):magstate[i]?Color(160,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
yy -= 8;
}
break;
case 2:
yy = 24;
for ( int i=0; i<3; i++ )
{
Screen.DrawTexture(AltRoundTex[2],false,bx-10,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(128,0,0,0):Color(0,0,0,0):magstate[i]?Color(160,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
yy -= 8;
}
break;
case 3:
yy = 22;
for ( int i=0; i<2; i++ )
{
Screen.DrawTexture(AltRoundTex[3],false,bx-10,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,((i<=magpos)&&(i>=(magpos-preload)))?magstate[i]?Color(128,0,0,0):Color(0,0,0,0):magstate[i]?Color(160,0,0,0):Color(96,0,0,0),DTA_Desaturate,magstate[i]?192:0);
yy -= 12;
}
break;
}
}
}
// Biospark Carbine
extend Class Sparkster
{
ui TextureID AltWeaponBox, AltRoundTex[2];
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/BiosparkDisplay.png",TexMan.Type_Any);
if ( !AltRoundTex[0] ) AltRoundTex[0] = TexMan.CheckForTexture("graphics/AltHUD/BiosparkShot.png",TexMan.Type_Any);
if ( !AltRoundTex[1] ) AltRoundTex[1] = TexMan.CheckForTexture("graphics/AltHUD/BiosparkRed.png",TexMan.Type_Any);
bool blinking = (failtime>gametic)&&((failtime-gametic)%16>=8);
if ( doublestacc )
{
Screen.DrawTexture(AltWeaponBox,false,bx-6,by-24,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(AltWeaponBox,false,bx-6,by-12,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( nomag ) return;
bool bRed;
int yy = 22;
for ( int i=0; i<8; i++ )
{
if ( clipcount <= i ) Screen.DrawTexture(AltRoundTex[0],false,bx-4,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Desaturate,255,DTA_ColorOverlay,Color(160,0,0,0));
else
{
bRed = ((i>=4)&&(clipcount<6)||(i<4)&&(clipcount<2));
Screen.DrawTexture(AltRoundTex[bRed],false,bx-4,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(blinking?96:0,0,0,0));
}
yy -= 2;
if ( i == 3 ) yy -= 4;
}
}
else
{
Screen.DrawTexture(AltWeaponBox,false,bx-6,by-12,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( nomag ) return;
bool bRed;
int yy = 10;
for ( int i=0; i<4; i++ )
{
if ( clipcount <= i ) Screen.DrawTexture(AltRoundTex[0],false,bx-4,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Desaturate,255,DTA_ColorOverlay,Color(160,0,0,0));
else
{
bRed = (clipcount<2);
Screen.DrawTexture(AltRoundTex[bRed],false,bx-4,by-yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(blinking?96:0,0,0,0));
}
yy -= 2;
}
}
}
}
// Silver Bullet JET
extend Class SilverBullet
{
ui TextureID AltWeaponBox[2], AltZoomBar, AltRoundTex[4];
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !AltWeaponBox[0] ) AltWeaponBox[0] = TexMan.CheckForTexture("graphics/AltHUD/SilverBulletDisplay.png",TexMan.Type_Any);
if ( !AltWeaponBox[1] ) AltWeaponBox[1] = TexMan.CheckForTexture("graphics/AltHUD/SilverBulletZoomDisplay.png",TexMan.Type_Any);
if ( !AltZoomBar ) AltZoomBar = TexMan.CheckForTexture("graphics/AltHUD/SilverBulletZoomBar.png",TexMan.Type_Any);
if ( !AltRoundTex[0] ) AltRoundTex[0] = TexMan.CheckForTexture("graphics/AltHUD/SilverBulletXSB.png",TexMan.Type_Any);
if ( !AltRoundTex[1] ) AltRoundTex[1] = TexMan.CheckForTexture("graphics/AltHUD/SilverBulletFCB.png",TexMan.Type_Any);
if ( !AltRoundTex[2] ) AltRoundTex[2] = TexMan.CheckForTexture("graphics/AltHUD/SilverBulletXSBCasing.png",TexMan.Type_Any);
if ( !AltRoundTex[3] ) AltRoundTex[3] = TexMan.CheckForTexture("graphics/AltHUD/SilverBulletFCBCasing.png",TexMan.Type_Any);
int zl = clamp(ZoomInter?ZoomInter.GetValue():int(zoomlevel*10),0,160);
if ( zl >= 10 )
{
Screen.DrawTexture(AltWeaponBox[1],false,bx-14,by-26,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
double zw = zl*10./160.;
Screen.DrawTexture(AltZoomBar,false,bx-12,by-24,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_WindowRightF,zw);
}
Screen.DrawTexture(AltWeaponBox[0],false,bx-14,by-17,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawTexture(AltRoundTex[fcbchambered+fired*2],false,bx-12,by-15,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<clipcount; i++ )
Screen.DrawTexture(AltRoundTex[fcbloaded],false,bx-12,by-(12-i*2),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
// Candy Gun
extend Class CandyGun
{
ui TextureID AltWeaponBox, AltRoundTex;
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/ExplodiumDisplay.png",TexMan.Type_Any);
if ( !AltRoundTex ) AltRoundTex = TexMan.CheckForTexture("graphics/AltHUD/CandyRound.png",TexMan.Type_Any);
Screen.DrawTexture(AltWeaponBox,false,bx-9,by-21,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( chambered ) Screen.DrawTexture(AltRoundTex,false,bx-7,by-19,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<clipcount; i++ ) Screen.DrawTexture(AltRoundTex,false,bx-7,by-(16-i*2),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
// Ynykron
extend Class Ynykron
{
ui TextureID AltWeaponBox, AltChargeBar[2], AltBoxSide[2];
override void DrawWeaponAlt( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !AltWeaponBox ) AltWeaponBox = TexMan.CheckForTexture("graphics/AltHUD/YnykronDisplay.png",TexMan.Type_Any);
if ( !AltChargeBar[0] ) AltChargeBar[0] = TexMan.CheckForTexture("graphics/AltHUD/YnykronBarBeam.png",TexMan.Type_Any);
if ( !AltChargeBar[1] ) AltChargeBar[1] = TexMan.CheckForTexture("graphics/AltHUD/YnykronBarVortex.png",TexMan.Type_Any);
if ( !AltBoxSide[0] ) AltBoxSide[0] = TexMan.CheckForTexture("graphics/AltHUD/YnykronIconBeam.png",TexMan.Type_Any);
if ( !AltBoxSide[1] ) AltBoxSide[1] = TexMan.CheckForTexture("graphics/AltHUD/YnykronIconVortex.png",TexMan.Type_Any);
Screen.DrawTexture(AltWeaponBox,false,bx-9,by-38,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int chg = clamp(ChargeInter?ChargeInter.GetValue():int(chargelevel*10),0,400);
int ct = int(((by-2)-chg/16.)*hs);
Screen.DrawTexture(AltBoxSide[inverted],false,bx-7,by-36,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,clipcount?Color(0,0,0,0):Color(128,0,0,0));
Screen.DrawTexture(AltChargeBar[inverted],false,bx-7,by-27,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,(chargestate==CS_READY)?Color(int(clamp(sin((level.maptime+TicFrac)*8)*40+24,0.,64.)),255,255,255):Color(0,0,0,0),DTA_ClipTop,ct);
}
}