Re-do HUD scaling.

This commit is contained in:
Mari the Deer 2021-12-18 02:03:24 +01:00
commit a0e1f2f7a6
19 changed files with 152 additions and 163 deletions

View file

@ -42,12 +42,12 @@ nosave int swwm_maxtargetdist = 2000; // maximum distance for target healthbars
nosave int swwm_maxtargets = 40; // maximum targeter healthbars to display (0 = unlimited)
nosave int swwm_maxscorenums = 0; // maximum score numbers to display (0 = unlimited)
nosave int swwm_maxdamnums = 0; // maximum damage/healing numbers to display (0 = unlimited)
nosave int swwm_hudscale = 0; // HUD scaling (0 = use GZDoom scaling)
nosave int swwm_barscale = 2; // target healthbar scaling (0 = use GZDoom scaling)
nosave int swwm_scrscale = 2; // score scaling (0 = use GZDoom scaling)
nosave int swwm_numscale = 3; // damnum scaling (0 = use GZDoom scaling)
nosave int swwm_poiscale = 1; // point of interest scaling (0 = use GZDoom scaling)
nosave int swwm_detscale = 2; // item sense scaling (0 = use GZDoom scaling)
nosave bool swwm_hudscale = false; // HUD scaling (false = tight scaling, true = loose scaling)
nosave int swwm_barscalerel = -1; // target healthbar scaling (relative)
nosave int swwm_numscalerel = 0; // damnum scaling (relative)
nosave int swwm_scrscalerel = -1; // score scaling (relative)
nosave int swwm_poiscalerel = -2; // point of interest scaling (relative)
nosave int swwm_detscalerel = -1; // item sense scaling (relative)
server bool swwm_blood = true; // custom blood/gibbing
server int swwm_maxblood = 200; // max blood effects at any time
server int swwm_maxgibs = 100; // max gibs at any time

View file

@ -91,7 +91,8 @@ SWWM_NUMSCALE = "Number Scaling";
SWWM_SCRSCALE = "Score Scaling";
SWWM_POISCALE = "POI Scaling";
SWWM_DETSCALE = "Item Sense Scaling";
SWWM_GZSCALE = "Use GZDoom Setting";
SWWM_TFITSCALE = "Tight Fit";
SWWM_LFITSCALE = "Loose Fit";
SWWM_BLOOD = "Enable Custom Blood";
SWWM_FUZZ = "Enable Animated Menu BG";
SWWM_BUSTERPAUSE = "Pause on Wallbuster Reload";
@ -297,12 +298,12 @@ TOOLTIP_SWWM_MAXTARGETDIST = "Limit the farthest distance at which healthbars fo
TOOLTIP_SWWM_MAXTARGETS = "Limit the amount of healthbars to display on-screen. Helps keep the screen less cluttered.";
TOOLTIP_SWWM_MAXDAMNUMS = "Limit the amount of damage/healing numbers to display on-screen. Helps keep the screen less cluttered.";
TOOLTIP_SWWM_MAXSCORENUMS = "Limit the amount of score numbers to display on-screen. Helps keep the screen less cluttered.";
TOOLTIP_SWWM_HUDSCALE = "Scaling factor of the HUD. Set to 0 to use GZDoom's own HUD scaling.";
TOOLTIP_SWWM_BARSCALE = "Scaling factor for targetter healthbars. Set to 0 to use GZDoom's own HUD scaling.";
TOOLTIP_SWWM_NUMSCALE = "Scaling factor for damage/healing numbers. Set to 0 to use GZDoom's own HUD scaling.";
TOOLTIP_SWWM_SCRSCALE = "Scaling factor for score numbers. Set to 0 to use GZDoom's own HUD scaling.";
TOOLTIP_SWWM_POISCALE = "Scaling factor for points of interest. Set to 0 to use GZDoom's own HUD scaling.";
TOOLTIP_SWWM_DETSCALE = "Scaling factor for sensed items. Set to 0 to use GZDoom's own HUD scaling.";
TOOLTIP_SWWM_HUDSCALE = "Scaling factor of the HUD. \"Tight\" scales to fit the width of the full HUD, while \"Loose\" is recommended for ultrawide to avoid overlaps.";
TOOLTIP_SWWM_BARSCALEREL = "Relative scaling factor for targetter healthbars. A factor of 0 matches the HUD scale.";
TOOLTIP_SWWM_NUMSCALEREL = "Relative scaling factor for damage/healing numbers. A factor of 0 matches the HUD scale.";
TOOLTIP_SWWM_SCRSCALEREL = "Relative scaling factor for score numbers. A factor of 0 matches the HUD scale.";
TOOLTIP_SWWM_POISCALEREL = "Relative scaling factor for points of interest. A factor of 0 matches the HUD scale.";
TOOLTIP_SWWM_DETSCALEREL = "Relative scaling factor for sensed items. A factor of 0 matches the HUD scale.";
TOOLTIP_SWWM_BLOOD = "Enable custom blood and gore effects, adapted from Soundless Mound. I'd honestly recommend Nashgore instead, it's better.";
TOOLTIP_SWWM_FUZZ = "Toggling this off is recommended if you're recording/streaming as this effect can harm video quality.";
TOOLTIP_SWWM_CBTPAUSE = "The game will pause while the Wallbuster reload menu is open (only in singleplayer).";

View file

@ -91,7 +91,8 @@ SWWM_NUMSCALE = "Escala de Números";
SWWM_SCRSCALE = "Escala de Puntuaciones";
SWWM_POISCALE = "Escala de Puntos de Interés";
SWWM_DETSCALE = "Escala de Sensor de Ítems";
SWWM_GZSCALE = "Usar Opción de GZDoom";
SWWM_TFITSCALE = "Escalado Ajustado";
SWWM_LFITSCALE = "Escalado Holgado";
SWWM_BLOOD = "Habilitar Sangre Personalizada";
SWWM_FUZZ = "Habilitar Fondo Animado de Menú";
SWWM_BUSTERPAUSE = "Pausar en Recarga de Wallbuster";
@ -296,12 +297,12 @@ TOOLTIP_SWWM_MAXTARGETDIST = "Limita la distancia máxima a la que se muestran l
TOOLTIP_SWWM_MAXTARGETS = "Limita la cantidad de barras de salud a mostrar en pantalla. Ayuda a mantener la pantalla más despejada.";
TOOLTIP_SWWM_MAXDAMNUMS = "Limita la cantidad de números de daño/curación a mostrar en pantalla. Ayuda a mantener la pantalla más despejada.";
TOOLTIP_SWWM_MAXSCORENUMS = "Limita la cantidad de números de puntuación a mostrar en pantalla. Ayuda a mantener la pantalla más despejada.";
TOOLTIP_SWWM_HUDSCALE = "Factor de escalado del HUD. Pon a 0 para usar el escalado de HUD de GZDoom.";
TOOLTIP_SWWM_BARSCALE = "Factor de escalado para las barras de salud. Pon a 0 para usar el escalado de HUD de GZDoom.";
TOOLTIP_SWWM_NUMSCALE = "Factor de escalado para los números de daño/salud. Pon a 0 para usar el escalado de HUD de GZDoom.";
TOOLTIP_SWWM_SCRSCALE = "Factor de escalado para los números de puntuación. Pon a 0 para usar el escalado de HUD de GZDoom.";
TOOLTIP_SWWM_POISCALE = "Factor de escalado para los puntos de interés. Pon a 0 para usar el escalado de HUD de GZDoom.";
TOOLTIP_SWWM_DETSCALE = "Factor de escalado para los ítems detectados. Pon a 0 para usar el escalado de HUD de GZDoom.";
TOOLTIP_SWWM_HUDSCALE = "Factor de escalado del HUD. El escalado \"Ajustado\" intenta que quepa todo el HUD en el ancho de la pantalla, mientras que el \"Holgado\" está recomendado para pantallas ultrawide.";
TOOLTIP_SWWM_BARSCALEREL = "Factor de escalado relativo para las barras de salud. Un factor de 0 es igual al escalado del HUD.";
TOOLTIP_SWWM_NUMSCALEREL = "Factor de escalado relativo para los números de daño/salud. Un factor de 0 es igual al escalado del HUD.";
TOOLTIP_SWWM_SCRSCALEREL = "Factor de escalado relativo para los números de puntuación. Un factor de 0 es igual al escalado del HUD.";
TOOLTIP_SWWM_POISCALEREL = "Factor de escalado relativo para los puntos de interés. Un factor de 0 es igual al escalado del HUD.";
TOOLTIP_SWWM_DETSCALEREL = "Factor de escalado relativo para los ítems detectados. Un factor de 0 es igual al escalado del HUD.";
TOOLTIP_SWWM_BLOOD = "Activa efectos de sangre y vísceras personalizados, adaptados de Soundless Mound. Sinceramente, recomendaría usar Nashgore, es mejor.";
TOOLTIP_SWWM_FUZZ = "Desactivar esto es recomendado si estás grabando o haciendo streaming, ya que este effecto puede dañar la calidad del vídeo.";
TOOLTIP_SWWM_CBTPAUSE = "El juego será pausado mientras el menú de recarga de Wallbuster está abierto (sólo en modo de un jugador).";

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.2pre r89 \cu(Sat 18 Dec 00:50:11 CET 2021)\c-";
SWWM_SHORTVER="\cw1.2pre r89 \cu(2021-12-18 00:50:11)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.2pre r91 \cu(Sat 18 Dec 02:07:11 CET 2021)\c-";
SWWM_SHORTVER="\cw1.2pre r91 \cu(2021-12-18 02:07:11)\c-";

View file

@ -73,6 +73,11 @@ OptionValue "SWWMPistolStart"
1, "$SWWM_PISTOLSTART_MAP"
2, "$SWWM_PISTOLSTART_CLUSTER"
}
OptionValue "SWWMHUDScale"
{
0, "$SWWM_TFITSCALE"
1, "$SWWM_LFITSCALE"
}
OptionMenu "SWWMOptionMenu"
{
Class "SWWMOptionMenu"
@ -132,15 +137,15 @@ OptionMenu "SWWMOptionMenu"
ScaleSlider "$SWWM_MAXTARGETS", "swwm_maxtargets", 0, 1000, 1, "$SWWM_UNLIMITED"
ScaleSlider "$SWWM_MAXDAMNUMS", "swwm_maxdamnums", 0, 1000, 1, "$SWWM_UNLIMITED"
ScaleSlider "$SWWM_MAXSCORENUMS", "swwm_maxscorenums", 0, 1000, 1, "$SWWM_UNLIMITED"
ScaleSlider "$SWWM_HUDSCALE", "swwm_hudscale", 0, 8, 1, "$SWWM_GZSCALE"
ScaleSlider "$SWWM_BARSCALE", "swwm_barscale", 0, 8, 1, "$SWWM_GZSCALE"
ScaleSlider "$SWWM_NUMSCALE", "swwm_numscale", 0, 8, 1, "$SWWM_GZSCALE"
ScaleSlider "$SWWM_SCRSCALE", "swwm_scrscale", 0, 8, 1, "$SWWM_GZSCALE"
Option "$SWWM_HUDSCALE", "swwm_hudscale", "SWWMHudScale"
Slider "$SWWM_BARSCALE", "swwm_barscalerel", -4, 4, 1, 0
Slider "$SWWM_NUMSCALE", "swwm_numscalerel", -4, 4, 1, 0
Slider "$SWWM_SCRSCALE", "swwm_scrscalerel", -4, 4, 1, 0
IfGame(Doom, Heretic)
{
ScaleSlider "$SWWM_POISCALE", "swwm_poiscale", 0, 8, 1, "$SWWM_GZSCALE"
Slider "$SWWM_POISCALE", "swwm_poiscalerel", -4, 4, 1, 0
}
ScaleSlider "$SWWM_DETSCALE", "swwm_detscale", 0, 8, 1, "$SWWM_GZSCALE"
Slider "$SWWM_DETSCALE", "swwm_detscalerel", -4, 4, 1, 0
Option "$SWWM_NUMCOLOR_SCR", "swwm_numcolor_scr", "TextColors"
Option "$SWWM_NUMCOLOR_BONUS", "swwm_numcolor_bonus", "TextColors"
Option "$SWWM_NUMCOLOR_DMG", "swwm_numcolor_dmg", "TextColors"

View file

@ -24,12 +24,18 @@ Class SWWMStatusBar : BaseStatusBar
SWWMHandler hnd;
// shared stuff
Vector2 ss, hs;
Vector2 ssb, hsb;
Vector2 ssn, hsn;
Vector2 sss, hss;
Vector2 ssi, hsi;
Vector2 ssd, hsd;
double hs;
double hsb;
double hsn;
double hss;
double hsi;
double hsd;
Vector2 ss;
Vector2 ssb;
Vector2 ssn;
Vector2 sss;
Vector2 ssi;
Vector2 ssd;
int margin;
double FracTic;
double FrameTime;
@ -1105,16 +1111,6 @@ Class SWWMStatusBar : BaseStatusBar
override void Init()
{
Super.Init();
// scaling is set to 640 pixels wide minimum
// and height set so it fits up to ultrawide (2.370:1 ~ 2.4:1)
// ultrawide is honestly an abomination,
// and these numbers should be proof enough of it
// none of the commercially available "21:9" screens even have
// that actual ratio in the first place, what the fuck man
// they dangle anywhere between 12:4, 43:18 and 64:27
// fuck ultrawide, seriously
// get a 16:10 screen instead, it's the best aspect ratio
SetSize(0,640,266);
StatusTex = TexMan.CheckForTexture("graphics/HUD/StatusBox.png",TexMan.Type_Any);
DashTex = TexMan.CheckForTexture("graphics/HUD/DashBar.png",TexMan.Type_Any);
FuelTex[0] = TexMan.CheckForTexture("graphics/HUD/FuelBar.png",TexMan.Type_Any);
@ -1219,9 +1215,9 @@ Class SWWMStatusBar : BaseStatusBar
else tag = String.Format("\cy%s\c-",StringTable.Localize("$SWWM_NEXIT"));
}
}
Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsi.x*smallfont2.StringWidth(tag)/2.)/hsi.x,(vpos.y-hsi.y*smallfont2.GetHeight()/2.)/hsi.y,tag,DTA_VirtualWidthF,ssi.x,DTA_VirtualHeightF,ssi.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsi*smallfont2.StringWidth(tag)/2.)/hsi,(vpos.y-hsi*smallfont2.GetHeight()/2.)/hsi,tag,DTA_VirtualWidthF,ssi.x,DTA_VirtualHeightF,ssi.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
tag = String.Format("\cu(%s\cu)\c-",FormatDist(tdir.length()));
Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsi.x*smallfont2.StringWidth(tag)/2.)/hsi.x,(vpos.y+hsi.y*smallfont2.GetHeight()/2.)/hsi.y,tag,DTA_VirtualWidthF,ssi.x,DTA_VirtualHeightF,ssi.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsi*smallfont2.StringWidth(tag)/2.)/hsi,(vpos.y+hsi*smallfont2.GetHeight()/2.)/hsi,tag,DTA_VirtualWidthF,ssi.x,DTA_VirtualHeightF,ssi.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
}
}
// sensed items
@ -1240,13 +1236,13 @@ Class SWWMStatusBar : BaseStatusBar
double alph = clamp(((s.updated+mtime)-(level.maptime+fractic))/35.,0.,1.);
alph *= clamp(1.5-1.5*(tdir.length()/(thesight?1200.:800.)),0.,1.);
tag = s.tag;
Screen.DrawText(smallfont2,s.vipitem?Font.CR_PURPLE:s.scoreitem?Font.CR_GOLD:Font.CR_GREEN,(vpos.x-hsd.x*smallfont2.StringWidth(tag)/2.)/hsd.x,(vpos.y-hsd.y*smallfont2.GetHeight()/2.)/hsd.y,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawText(smallfont2,s.vipitem?Font.CR_PURPLE:s.scoreitem?Font.CR_GOLD:Font.CR_GREEN,(vpos.x-hsd*smallfont2.StringWidth(tag)/2.)/hsd,(vpos.y-hsd*smallfont2.GetHeight()/2.)/hsd,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
tag = String.Format("\cu(%s\cu)\c-",FormatDist(tdir.length()));
Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsd.x*smallfont2.StringWidth(tag)/2.)/hsd.x,(vpos.y+hsd.y*smallfont2.GetHeight()/2.)/hsd.y,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsd*smallfont2.StringWidth(tag)/2.)/hsd,(vpos.y+hsd*smallfont2.GetHeight()/2.)/hsd,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
if ( s.item is 'SWWMRespawnTimer' )
{
tag = String.Format(StringTable.Localize("$SWWM_TRESPAWN"),s.item.special2/GameTicRate);
Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsd.x*smallfont2.StringWidth(tag)/2.)/hsd.x,(vpos.y+hsd.y*smallfont2.GetHeight()*2)/hsd.y,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawText(smallfont2,Font.CR_WHITE,(vpos.x-hsd*smallfont2.StringWidth(tag)/2.)/hsd,(vpos.y+hsd*smallfont2.GetHeight()*2)/hsd,tag,DTA_VirtualWidthF,ssd.x,DTA_VirtualHeightF,ssd.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
}
}
}
@ -1277,8 +1273,8 @@ Class SWWMStatusBar : BaseStatusBar
if ( thesight && (targ.lasthealth > 0) ) mtime += 105;
double alph = clamp(((targ.updated+mtime)-(level.maptime+fractic))/35.,0.,1.);
Vector2 barsiz = TexMan.GetScaledSize(EnemyBTex);
barsiz.x *= hsb.x;
barsiz.y *= hsb.y;
barsiz.x *= hsb;
barsiz.y *= hsb;
Vector2 barpos = vpos-(barsiz/2.);
barpos.y -= 16.;
Font fnt = swwm_bigtags?smallfont:smallfont2;
@ -1290,37 +1286,37 @@ Class SWWMStatusBar : BaseStatusBar
if ( col == -1 ) col = Font.CR_WHITE;
}
if ( swwm_targettags || targ.myplayer && (tag != "") )
Screen.DrawText(fnt,col,(barpos.x+barsiz.x/2.-(fnt.StringWidth(tag)*hsb.x)/2.)/hsb.x,(barpos.y-fnt.GetHeight()*hsb.y)/hsb.y,tag,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawTexture(EnemyBTex,false,barpos.x/hsb.x,barpos.y/hsb.y,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawText(fnt,col,(barpos.x+barsiz.x/2.-(fnt.StringWidth(tag)*hsb)/2.)/hsb,(barpos.y-fnt.GetHeight()*hsb)/hsb,tag,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawTexture(EnemyBTex,false,barpos.x/hsb,barpos.y/hsb,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
double ht = clamp(targ.intp.GetValue(),0,targ.maxhealth*100);
double hw = (min(ht,targ.maxhealth)*50.)/targ.maxhealth;
if ( targ.mytarget && (targ.mytarget.bInvulnerable || (targ.myplayer && (targ.myplayer.cheats&(CF_GODMODE|CF_GODMODE2))) || targ.mytarget.FindInventory("InvinciballPower")) )
{
Screen.DrawTexture(EnemyHTex[4],false,(barpos.x+2*hsb.x)/hsb.x,(barpos.y+2*hsb.y)/hsb.y,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawTexture(EnemyHTex[4],false,(barpos.x+2*hsb)/hsb,(barpos.y+2*hsb)/hsb,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
}
else
{
Screen.DrawTexture(EnemyHTex[0],false,(barpos.x+2*hsb.x)/hsb.x,(barpos.y+2*hsb.y)/hsb.y,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawTexture(EnemyHTex[0],false,(barpos.x+2*hsb)/hsb,(barpos.y+2*hsb)/hsb,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
if ( ht > targ.maxhealth )
{
hw = (min(ht-targ.maxhealth,targ.maxhealth)*50.)/targ.maxhealth;
Screen.DrawTexture(EnemyHTex[1],false,(barpos.x+2*hsb.x)/hsb.x,(barpos.y+2*hsb.y)/hsb.y,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawTexture(EnemyHTex[1],false,(barpos.x+2*hsb)/hsb,(barpos.y+2*hsb)/hsb,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
}
if ( ht > targ.maxhealth*2 )
{
hw = (min(ht-targ.maxhealth*2,targ.maxhealth*3)*50.)/(targ.maxhealth*3);
Screen.DrawTexture(EnemyHTex[2],false,(barpos.x+2*hsb.x)/hsb.x,(barpos.y+2*hsb.y)/hsb.y,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawTexture(EnemyHTex[2],false,(barpos.x+2*hsb)/hsb,(barpos.y+2*hsb)/hsb,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
}
if ( ht > targ.maxhealth*5 )
{
hw = (min(ht-targ.maxhealth*5,targ.maxhealth*5)*50.)/(targ.maxhealth*5);
Screen.DrawTexture(EnemyHTex[3],false,(barpos.x+2*hsb.x)/hsb.x,(barpos.y+2*hsb.y)/hsb.y,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawTexture(EnemyHTex[3],false,(barpos.x+2*hsb)/hsb,(barpos.y+2*hsb)/hsb,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_WindowRightF,hw,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
}
}
if ( targ.mytarget && targ.mytarget.FindInventory("DivineSpriteEffect") )
{
double falph = clamp((ht-targ.maxhealth*10)/(targ.maxhealth*60.),0.,1.);
Screen.DrawTexture(EnemyHTex[5],false,(barpos.x+2*hsb.x)/hsb.x,(barpos.y+2*hsb.y)/hsb.y,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph*falph,DTA_LegacyRenderStyle,STYLE_Add,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawTexture(EnemyHTex[5],false,(barpos.x+2*hsb)/hsb,(barpos.y+2*hsb)/hsb,DTA_VirtualWidthF,ssb.x,DTA_VirtualHeightF,ssb.y,DTA_KeepRatio,true,DTA_Alpha,alph*falph,DTA_LegacyRenderStyle,STYLE_Add,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
}
}
// floating kill scores and others
@ -1360,9 +1356,9 @@ Class SWWMStatusBar : BaseStatusBar
fo.y = snum.initialspan-(snum.lifespan-fractic);
isscore = true;
}
Vector2 hs0 = isscore?hss:hsn;
double hs0 = isscore?hss:hsn;
Vector2 ss0 = isscore?sss:ssn;
Screen.DrawText(smallfont2,snum.tcolor,(vpos.x-hs0.x*(fo.x+smallfont2.StringWidth(tag)/2.))/hs0.x,(vpos.y-hs0.y*(fo.y+(smallfont2.GetHeight()/2.)))/hs0.y,tag,DTA_VirtualWidthF,ss0.x,DTA_VirtualHeightF,ss0.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawText(smallfont2,snum.tcolor,(vpos.x-hs0*(fo.x+smallfont2.StringWidth(tag)/2.))/hs0,(vpos.y-hs0*(fo.y+(smallfont2.GetHeight()/2.)))/hs0,tag,DTA_VirtualWidthF,ss0.x,DTA_VirtualHeightF,ss0.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
// extra strings (if available)
if ( !swwm_scorebonus ) continue;
fo.y += smallfont2.GetHeight();
@ -1371,7 +1367,7 @@ Class SWWMStatusBar : BaseStatusBar
tag = snum.xstr[i];
if ( snum.xscore[i] == int.max ) tag.AppendFormat(" MAX");
else if ( snum.xscore[i] > 0 ) tag.AppendFormat(" x%d",snum.xscore[i]);
Screen.DrawText(smallfont2,snum.xtcolor[i],(vpos.x-hss.x*(fo.x+smallfont2.StringWidth(tag)/2.))/hss.x,(vpos.y-hss.y*(fo.y+(smallfont2.GetHeight()/2.)))/hss.y,tag,DTA_VirtualWidthF,sss.x,DTA_VirtualHeightF,sss.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawText(smallfont2,snum.xtcolor[i],(vpos.x-hss*(fo.x+smallfont2.StringWidth(tag)/2.))/hss,(vpos.y-hss*(fo.y+(smallfont2.GetHeight()/2.)))/hss,tag,DTA_VirtualWidthF,sss.x,DTA_VirtualHeightF,sss.y,DTA_KeepRatio,true,DTA_Alpha,alph,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
fo.y += smallfont2.GetHeight();
}
}
@ -1692,13 +1688,13 @@ Class SWWMStatusBar : BaseStatusBar
[visible, rv1, rv2] = SWWMUtility.LiangBarsky((-1,-1)*zoomclip,(1,1)*zoomclip,rv1,rv2);
if ( !visible ) continue;
// scale to minimap frame
rv1 *= (HALFMAPSIZE/zoomclip)*hs.x;
rv2 *= (HALFMAPSIZE/zoomclip)*hs.x;
rv1 *= (HALFMAPSIZE/zoomclip)*hs;
rv2 *= (HALFMAPSIZE/zoomclip)*hs;
// offset to minimap center
rv1 += basepos;
rv2 += basepos;
// draw the line
Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs.x*.25),mm_gridcolor);
Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs*.25),mm_gridcolor);
}
for ( int i=0; i<maxlines; i++ )
{
@ -1720,13 +1716,13 @@ Class SWWMStatusBar : BaseStatusBar
[visible, rv1, rv2] = SWWMUtility.LiangBarsky((-1,-1)*zoomclip,(1,1)*zoomclip,rv1,rv2);
if ( !visible ) continue;
// scale to minimap frame
rv1 *= (HALFMAPSIZE/zoomclip)*hs.x;
rv2 *= (HALFMAPSIZE/zoomclip)*hs.x;
rv1 *= (HALFMAPSIZE/zoomclip)*hs;
rv2 *= (HALFMAPSIZE/zoomclip)*hs;
// offset to minimap center
rv1 += basepos;
rv2 += basepos;
// draw the line
Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs.x*.25),mm_gridcolor);
Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs*.25),mm_gridcolor);
}
// draw the origin crosshair
Vector2 tv[4];
@ -1754,13 +1750,13 @@ Class SWWMStatusBar : BaseStatusBar
[visible, rv1, rv2] = SWWMUtility.LiangBarsky((-1,-1)*zoomclip,(1,1)*zoomclip,rv1,rv2);
if ( !visible ) continue;
// scale to minimap frame
rv1 *= (HALFMAPSIZE/zoomclip)*hs.x;
rv2 *= (HALFMAPSIZE/zoomclip)*hs.x;
rv1 *= (HALFMAPSIZE/zoomclip)*hs;
rv2 *= (HALFMAPSIZE/zoomclip)*hs;
// offset to minimap center
rv1 += basepos;
rv2 += basepos;
// draw the line
Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs.x*.75),mm_xhaircolor);
Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs*.75),mm_xhaircolor);
}
}
@ -1808,8 +1804,8 @@ Class SWWMStatusBar : BaseStatusBar
[visible, rv1, rv2] = SWWMUtility.LiangBarsky((-1,-1)*zoomclip,(1,1)*zoomclip,rv1,rv2);
if ( !visible ) continue;
// scale to minimap frame
rv1 *= (HALFMAPSIZE/zoomclip)*hs.x;
rv2 *= (HALFMAPSIZE/zoomclip)*hs.x;
rv1 *= (HALFMAPSIZE/zoomclip)*hs;
rv2 *= (HALFMAPSIZE/zoomclip)*hs;
// offset to minimap center
rv1 += basepos;
rv2 += basepos;
@ -1867,9 +1863,9 @@ Class SWWMStatusBar : BaseStatusBar
if ( isportal )
{
col = Color((col.r+mm_portalcolor.r*7)/8,(col.g+mm_portalcolor.g*7)/8,(col.b+mm_portalcolor.b*7)/8);
Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs.x*.25),col);
Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs*.25),col);
}
else Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs.x*.5),col);
else Screen.DrawThickLine(int(rv1.x),int(rv1.y),int(rv2.x),int(rv2.y),max(1.,hs*.5),col);
}
}
private void DrawMapThings( Vector2 basepos )
@ -1983,14 +1979,14 @@ Class SWWMStatusBar : BaseStatusBar
if ( visible )
{
// scale to minimap frame
x0 *= (HALFMAPSIZE/zoomclip)*hs.x;
x1 *= (HALFMAPSIZE/zoomclip)*hs.x;
x0 *= (HALFMAPSIZE/zoomclip)*hs;
x1 *= (HALFMAPSIZE/zoomclip)*hs;
// offset to minimap center
x0 += basepos;
x1 += basepos;
// draw the line
if ( isportal ) Screen.DrawThickLine(int(x0.x),int(x0.y),int(x1.x),int(x1.y),max(1.,hs.x*.25),col,int(t.smoothalpha*255));
else Screen.DrawThickLine(int(x0.x),int(x0.y),int(x1.x),int(x1.y),max(1.,hs.x*.5),col,int(t.smoothalpha*255));
if ( isportal ) Screen.DrawThickLine(int(x0.x),int(x0.y),int(x1.x),int(x1.y),max(1.,hs*.25),col,int(t.smoothalpha*255));
else Screen.DrawThickLine(int(x0.x),int(x0.y),int(x1.x),int(x1.y),max(1.,hs*.5),col,int(t.smoothalpha*255));
drawn = true;
}
}
@ -2037,20 +2033,20 @@ Class SWWMStatusBar : BaseStatusBar
xx = int(ss.x-(margin+(HALFMAPSIZE+2)*2));
Screen.DrawTexture(MiniBox,false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Vector2 basemappos = (xx+HALFMAPSIZE+2,yy+HALFMAPSIZE+2);
Screen.Dim(mm_backcolor,1.,int((basemappos.x-HALFMAPSIZE)*hs.x),int((basemappos.y-HALFMAPSIZE)*hs.x),int(HALFMAPSIZE*2*hs.x),int(HALFMAPSIZE*2*hs.x));
if ( mm_drawautopage ) Screen.DrawTexture(AutoPage,false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipRight,int((xx+2+HALFMAPSIZE*2)*hs.x),DTA_ClipBottom,int((yy+2+HALFMAPSIZE*2)*hs.x));
Screen.Dim(mm_backcolor,1.,int((basemappos.x-HALFMAPSIZE)*hs),int((basemappos.y-HALFMAPSIZE)*hs),int(HALFMAPSIZE*2*hs),int(HALFMAPSIZE*2*hs));
if ( mm_drawautopage ) Screen.DrawTexture(AutoPage,false,xx+2,yy+2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipRight,int((xx+2+HALFMAPSIZE*2)*hs),DTA_ClipBottom,int((yy+2+HALFMAPSIZE*2)*hs));
// draw dat stuff
if ( swwm_mm_grid ) DrawMapGrid(basemappos*hs.x);
DrawMapLines(basemappos*hs.x);
DrawMapThings(basemappos*hs.x);
if ( swwm_mm_grid ) DrawMapGrid(basemappos*hs);
DrawMapLines(basemappos*hs);
DrawMapThings(basemappos*hs);
// finally, draw the player arrow
Vector2 tv[3];
tv[0] = (0,-4);
tv[1] = (-3,2);
tv[2] = (3,2);
if ( !swwm_mm_rotate ) for ( int i=0; i<3; i++ ) tv[i] = Actor.RotateVector(tv[i],90-ViewRot.x);
for ( int i=0; i<3; i++ ) tv[i] = (tv[i]+basemappos)*hs.x;
for ( int i=0; i<3; i++ ) Screen.DrawThickLine(int(tv[i].x),int(tv[i].y),int(tv[(i+1)%3].x),int(tv[(i+1)%3].y),max(1.,hs.x*.5),mm_yourcolor);
for ( int i=0; i<3; i++ ) tv[i] = (tv[i]+basemappos)*hs;
for ( int i=0; i<3; i++ ) Screen.DrawThickLine(int(tv[i].x),int(tv[i].y),int(tv[(i+1)%3].x),int(tv[(i+1)%3].y),max(1.,hs*.5),mm_yourcolor);
yy += ((HALFMAPSIZE+2)*2)+3;
}
// draw stats and timer when automap is open
@ -2463,7 +2459,7 @@ Class SWWMStatusBar : BaseStatusBar
if ( hnd && (hnd.bossalpha > 0.) ) yy -= int(25*clamp(hnd.bossalpha*2.,0.,1.));
int len = smallfont.StringWidth(ntagstr);
double xx = (ss.x-len)/2.;
Screen.Dim("Black",.8*nalph,int((xx-6)*hs.x),int(yy*hs.y),int((len+12)*hs.x),int((h+4)*hs.y));
Screen.Dim("Black",.8*nalph,int((xx-6)*hs),int(yy*hs),int((len+12)*hs),int((h+4)*hs));
Screen.DrawText(smallfont,ntagcol,int(xx),yy+2,ntagstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,nalph);
}
if ( PickupQueue.Size() <= 0 ) return;
@ -2488,7 +2484,7 @@ Class SWWMStatusBar : BaseStatusBar
if ( len > maxlen ) maxlen = len;
}
double xx = (ss.x-maxlen)/2.;
Screen.Dim("Black",.8*alph,int((xx-6)*hs.x),int((yy-h*(l.Count()-1))*hs.y),int((maxlen+12)*hs.x),int((h*l.Count()+4)*hs.y));
Screen.Dim("Black",.8*alph,int((xx-6)*hs),int((yy-h*(l.Count()-1))*hs),int((maxlen+12)*hs),int((h*l.Count()+4)*hs));
for ( int j=l.Count()-1; j>=0; j-- )
{
int len = smallfont.StringWidth(l.StringAt(j));
@ -2518,7 +2514,7 @@ Class SWWMStatusBar : BaseStatusBar
xx = int((ss.x*ssp-maxlen)/2.);
yy = ss.y*ssp*.375;
yy -= (h*l.Count()+4)/2; // center
Screen.Dim("Black",.8*alph,int((xx-6)*hs.x*hsp),int(yy*hs.y*hsp),int((maxlen+12)*hs.x*hsp),int((h*l.Count()+4)*hs.y*hsp));
Screen.Dim("Black",.8*alph,int((xx-6)*hs*hsp),int(yy*hs*hsp),int((maxlen+12)*hs*hsp),int((h*l.Count()+4)*hs*hsp));
for ( int i=0; i<l.Count(); i++ )
{
int len = smallfont.StringWidth(l.StringAt(i));
@ -2566,7 +2562,7 @@ Class SWWMStatusBar : BaseStatusBar
chatopen = gametic+1; // have to add 1 because DrawChat is called after everything else
double xx = 2;
double yy = ss.y-14;
Screen.Dim("Black",.8,0,Screen.GetHeight()-int(15*hs.y),Screen.GetWidth(),int(15*hs.y));
Screen.Dim("Black",.8,0,Screen.GetHeight()-int(15*hs),Screen.GetWidth(),int(15*hs));
String pname = players[consoleplayer].GetUserName();
// strip colors
SWWMUtility.StripColor(pname);
@ -2580,7 +2576,7 @@ Class SWWMStatusBar : BaseStatusBar
// shift back
xx -= w-(ss.x-4);
// draw trimmed
Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,fullstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipLeft,int(26*hs.x));
Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,fullstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipLeft,int(26*hs));
}
else Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,fullstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
return true;
@ -2698,31 +2694,20 @@ Class SWWMStatusBar : BaseStatusBar
camhidden = true;
else camhidden = false;
BeginHUD();
if ( swwm_hudscale <= 0 ) hs = GetHUDScale();
else hs.x = swwm_hudscale;
hs.y = hs.x;
ss = (Screen.GetWidth()/hs.x,Screen.GetHeight()/hs.y);
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
margin = clamp(swwm_hudmargin,0,40);
if ( swwm_barscale <= 0 ) hsb = GetHUDScale();
else hsb.x = swwm_barscale;
hsb.y = hsb.x;
ssb = (Screen.GetWidth()/hsb.x,Screen.GetHeight()/hsb.y);
if ( swwm_numscale <= 0 ) hsn = GetHUDScale();
else hsn.x = swwm_numscale;
hsn.y = hsn.x;
ssn = (Screen.GetWidth()/hsn.x,Screen.GetHeight()/hsn.y);
if ( swwm_scrscale <= 0 ) hss = GetHUDScale();
else hss.x = swwm_scrscale;
hss.y = hss.x;
sss = (Screen.GetWidth()/hss.x,Screen.GetHeight()/hss.y);
if ( swwm_poiscale <= 0 ) hsi = GetHUDScale();
else hsi.x = swwm_poiscale;
hsi.y = hsi.x;
ssi = (Screen.GetWidth()/hsi.x,Screen.GetHeight()/hsi.y);
if ( swwm_detscale <= 0 ) hsd = GetHUDScale();
else hsd.x = swwm_detscale;
hsd.y = hsd.x;
ssd = (Screen.GetWidth()/hsd.x,Screen.GetHeight()/hsd.y);
hsb = max(hs+swwm_barscalerel,1.);
hsn = max(hs+swwm_numscalerel,1.);
hss = max(hs+swwm_scrscalerel,1.);
hsi = max(hs+swwm_poiscalerel,1.);
hsd = max(hs+swwm_detscalerel,1.);
ssb = (Screen.GetWidth()/hsb,Screen.GetHeight()/hsb);
ssn = (Screen.GetWidth()/hsn,Screen.GetHeight()/hsn);
sss = (Screen.GetWidth()/hss,Screen.GetHeight()/hss);
ssi = (Screen.GetWidth()/hsi,Screen.GetHeight()/hsi);
ssd = (Screen.GetWidth()/hsd,Screen.GetHeight()/hsd);
FracTic = TicFrac;
if ( camhidden )
{

View file

@ -6,7 +6,8 @@ Class PayRespects : HUDMessageBase
Vector2 basepos;
int lifespan, initialspan, starttic;
double scale;
Vector2 hs, ss;
double hs;
Vector2 ss;
int seed, seed2;
static PayRespects PressF()
@ -30,9 +31,8 @@ Class PayRespects : HUDMessageBase
override void ScreenSizeChanged()
{
hs = StatusBar.GetHUDScale()*scale;
hs.y = hs.x;
ss = (Screen.GetWidth()/hs.x,Screen.GetHeight()/hs.y);
hs = CleanXFac*scale;
ss = (Screen.GetWidth(),Screen.GetHeight())/hs;
}
override void Draw( int bottom, int visibility )
@ -76,11 +76,10 @@ Class SWWMOneLiner : HUDMessageBase
override void Draw( int bottom, int visibility )
{
int margin = swwm_hudmargin;
Vector2 hs;
if ( swwm_hudscale <= 0 ) hs = StatusBar.GetHUDScale();
else hs.x = swwm_hudscale;
hs.y = hs.x;
Vector2 ss = (Screen.GetWidth()/hs.x,Screen.GetHeight()/hs.y);
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
String loc = StringTable.Localize(whichline);
if ( loc.Length() <= 0 ) return; // don't draw empty strings
String locs = StringTable.Localize("$SWWM_LQUOTE")..loc..StringTable.Localize("$SWWM_RQUOTE");
@ -98,12 +97,12 @@ Class SWWMOneLiner : HUDMessageBase
double fcurtime = curtime-fractic;
double alph = clamp((fcurtime/20.)+1.,0.,1.);
alph *= clamp((lifespan-fcurtime)/10.,0.,1.);
Screen.Dim("Black",alph*.8,int((Screen.GetWidth()-(maxlen+12)*hs.x)/2.),int(bottom-(margin+2+fh)*hs.y),int((maxlen+12)*hs.x),int((fh+4)*hs.y));
Screen.Dim("Black",alph*.8,int((Screen.GetWidth()-(maxlen+12)*hs)/2.),int(bottom-(margin+2+fh)*hs),int((maxlen+12)*hs),int((fh+4)*hs));
int yy = margin+fh;
for ( int i=0; i<l.Count(); i++ )
{
int len = smallfont.StringWidth(l.StringAt(i));
Screen.DrawText(smallfont,Font.CR_FIRE,int((ss.x-len)/2.),(bottom/hs.y)-yy,l.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
Screen.DrawText(smallfont,Font.CR_FIRE,int((ss.x-len)/2.),(bottom/hs)-yy,l.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
yy -= h;
}
l.Destroy();
@ -179,11 +178,10 @@ Class SWWMAchievementNotification : HUDMessageBase
override void Draw( int bottom, int visibility )
{
double margin = swwm_hudmargin;
Vector2 hs;
if ( swwm_hudscale <= 0 ) hs = StatusBar.GetHUDScale();
else hs.x = swwm_hudscale;
hs.y = hs.x;
Vector2 ss = (Screen.GetWidth()/hs.x,Screen.GetHeight()/hs.y);
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
double fractic = SWWMStatusBar(statusbar)?SWWMStatusBar(statusbar).fractic:0;
double ftics = tics+fractic;
double alpha = (ftics<fadeintics)?(ftics/fadeintics):(ftics<(fadeintics+holdtics))?1.:(1.-(ftics-(fadeintics+holdtics))/fadeouttics);
@ -268,11 +266,10 @@ Class SWWMWeaponTooltip : HUDMessageBase
override void Draw( int bottom, int visibility )
{
if ( tics <= 0 ) return;
Vector2 hs;
if ( swwm_hudscale <= 0 ) hs = StatusBar.GetHUDScale();
else hs.x = swwm_hudscale;
hs.y = hs.x;
Vector2 ss = (Screen.GetWidth()/hs.x,Screen.GetHeight()/hs.y);
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
double fractic = SWWMStatusBar(statusbar)?SWWMStatusBar(statusbar).fractic:0;
double ftics = tics+fractic;
double alpha = (ftics<fadeintics)?(ftics/fadeintics):(ftics<(fadeintics+holdtics))?1.:(1.-(ftics-(fadeintics+holdtics))/fadeouttics);
@ -290,7 +287,7 @@ Class SWWMWeaponTooltip : HUDMessageBase
if ( lw > w ) w = lw;
}
int cw = int(ceil((max(max(w1,w2),w)+8)/6.))*6;
Screen.Dim("Black",.5*alpha,int((pos.x-(cw+4)/2)*hs.x),int((pos.y-(h+6))*hs.y),int((cw+4)*hs.x),int((8+h+4+smallfont.GetHeight()+8+smallfont2.GetHeight()*l.Count())*hs.y));
Screen.Dim("Black",.5*alpha,int((pos.x-(cw+4)/2)*hs),int((pos.y-(h+6))*hs),int((cw+4)*hs),int((8+h+4+smallfont.GetHeight()+8+smallfont2.GetHeight()*l.Count())*hs));
Screen.DrawTexture(icon,false,pos.x,pos.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha,DTA_CenterBottomOffset,true);
pos.y += 4;
Screen.DrawText(smallfont,Font.CR_FIRE,pos.x-w1/2,pos.y,wpn,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
@ -316,7 +313,8 @@ Class SWWMDirectMessage : HUDMessageBase
int enddelay, pausedelay;
int rss;
int fadein, fadeout;
Vector2 ss, hs, origin;
double hs;
Vector2 ss, origin;
SWWMDirectMessage nextmsg; // for chaining messages together from different characters
bool nextdirect; // skips directly to next message without delays or fades
@ -534,10 +532,10 @@ Class SWWMDirectMessage : HUDMessageBase
double fractic = SWWMStatusBar(statusbar)?SWWMStatusBar(statusbar).fractic:0;
if ( seqnum == 0 ) alph = (fadein+fractic)/15.;
else if ( seqnum == (seqcnt+1) ) alph = 1.-(fadeout+fractic)/30.;
if ( swwm_hudscale <= 0 ) hs = StatusBar.GetHUDScale();
else hs.x = swwm_hudscale;
hs.y = hs.x;
ss = (Screen.GetWidth()/hs.x,Screen.GetHeight()/hs.y);
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
origin = (int(ss.x-270)/2,swwm_hudmargin+70);
Screen.DrawTexture(MessageBox,false,origin.x,origin.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
if ( (seqnum < 1) || (seqnum > seqcnt) ) return;

View file

@ -260,7 +260,7 @@ Class SWWMWeapon : Weapon abstract
return Super.GetObituary(victim,inflictor,mod,playerattack);
}
// draw ammo on hud above weapon box
virtual ui void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
virtual ui void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
}
// animations

View file

@ -126,11 +126,10 @@ Class Hellblazer : SWWMWeapon
SWWMUtility.PrepareProjData(projdata,e.ViewPos,e.ViewAngle,e.ViewPitch,e.ViewRoll,players[consoleplayer].fov);
int cliptop = projdata.viewy, clipbottom = projdata.viewy+projdata.viewh,
clipleft = projdata.viewx, clipright = projdata.viewx+projdata.vieww;
Vector2 hs;
if ( swwm_hudscale <= 0 ) hs = StatusBar.GetHUDScale();
else hs.x = swwm_hudscale;
hs.y = hs.x;
Vector2 ss = (Screen.GetWidth()/hs.x,Screen.GetHeight()/hs.y);
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
for ( int i=0; i<3; i++ )
{
if ( !seektarget[i] ) continue;
@ -138,11 +137,11 @@ Class Hellblazer : SWWMWeapon
Vector3 ndc = SWWMUtility.ProjectPoint(projdata,e.viewpos+level.Vec3Diff(e.viewpos,tpos+(0,0,seektarget[i].Height/2)));
if ( ndc.z > 1. ) continue;
Vector2 vpos = SWWMUtility.NDCToViewport(projdata,ndc);
Screen.DrawTexture(LockIcon[curtype],false,vpos.x/hs.x,vpos.y/hs.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_CenterOffset,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
Screen.DrawTexture(LockIcon[curtype],false,vpos.x/hs,vpos.y/hs,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_CenterOffset,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
}
}
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"HellblazerMissiles","HellblazerCrackshots","HellblazerRavagers","HellblazerWarheads"};
if ( !WeaponBox )

View file

@ -29,7 +29,7 @@ Class Wallbuster : SWWMWeapon
if ( curobt is 'PurpleShell' ) return StringTable.Localize("$O_WALLBUSTER_PURPLE");
return Super.GetObituary(victim,inflictor,mod,playerattack);
}
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","BlueShell","PurpleShell"};
/*

View file

@ -17,7 +17,7 @@ Class Eviscerator : SWWMWeapon
transient ui TextureID WeaponBox, AmmoIcon;
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/EvisceratorDisplay.png",TexMan.Type_Any);
if ( !AmmoIcon ) AmmoIcon = TexMan.CheckForTexture("graphics/HUD/EvisceratorShell.png",TexMan.Type_Any);

View file

@ -27,7 +27,7 @@ Class Ynykron : SWWMWeapon
Property ClipCount : clipcount;
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/YnykronDisplay.png",TexMan.Type_Any);
if ( !ChargeBar[0] ) ChargeBar[0] = TexMan.CheckForTexture("graphics/HUD/YnykronBarA.png",TexMan.Type_Any);
@ -36,7 +36,7 @@ Class Ynykron : SWWMWeapon
if ( !BoxSide[1] ) BoxSide[1] = TexMan.CheckForTexture("graphics/HUD/YnykronSideB.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-33,by-44,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/10.)*hs.y);
int ct = int(((by-2)-chg/10.)*hs);
Screen.DrawText(smallfont,Font.CR_FIRE,bx-30,by-15,String.Format("%d",Ammo1.Amount),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(BoxSide[inverted],false,bx-23,by-31,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(ChargeBar[inverted],false,bx-6,by-42,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);

View file

@ -49,13 +49,13 @@ Class DeepImpact : SWWMWeapon
Property ClipCount : clipcount;
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/DeepImpactDisplay.png",TexMan.Type_Any);
if ( !AmmoBar ) AmmoBar = TexMan.CheckForTexture("graphics/HUD/DeepImpactBar.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-36,by-54,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*50./100.))*hs.y);
int ct = int(((by-2)-(chg*50./100.))*hs);
Screen.DrawTexture(AmmoBar,false,bx-7,by-52,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ClipTop,ct);
Screen.DrawText(smallfont,Font.CR_FIRE,bx-35,by-12,String.Format("%3d%%",chg),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}

View file

@ -9,7 +9,7 @@ Class PusherWeapon : SWWMWeapon
transient ui TextureID WeaponBox, ChargeBar;
transient ui DynamicValueInterpolator ChargeInter;
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/PusherDisplay.png",TexMan.Type_Any);
if ( !ChargeBar ) ChargeBar = TexMan.CheckForTexture("graphics/HUD/PusherBar.png",TexMan.Type_Any);

View file

@ -156,7 +156,7 @@ Class Spreadgun : SWWMWeapon
return Super.GetObituary(victim,inflictor,mod,playerattack);
}
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
static const Class<Ammo> types[] = {"RedShell","GreenShell","WhiteShell","BlueShell","BlackShell","PurpleShell","GoldShell"};
if ( !WeaponBox )

View file

@ -13,7 +13,7 @@ Class Sparkster : SWWMWeapon
transient ui DynamicValueInterpolator iclip;
transient int failtime;
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox )
{

View file

@ -13,7 +13,7 @@ Class ExplodiumGun : SWWMWeapon
Property ClipCount : ClipCount;
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/ExplodiumDisplay.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-24,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
@ -585,7 +585,7 @@ Class DualExplodiumGun : SWWMWeapon
Property ClipCount : ClipCount;
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/DualExplodiumDisplay.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-48,by-22,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);

View file

@ -82,7 +82,7 @@ Class CandyGun : SWWMWeapon
return gotstuff, gotspares;
}
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( Amount <= 0 ) return;
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/CandygunDisplay.png",TexMan.Type_Any);

View file

@ -243,7 +243,7 @@ Class SilverBullet : SWWMWeapon
return Super.GetObituary(victim,inflictor,mod,playerattack);
}
override void DrawWeapon( double TicFrac, double bx, double by, Vector2 hs, Vector2 ss )
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox[0] ) WeaponBox[0] = TexMan.CheckForTexture("graphics/HUD/SilverBulletDisplay.png",TexMan.Type_Any);
if ( !WeaponBox[1] ) WeaponBox[1] = TexMan.CheckForTexture("graphics/HUD/SilverBulletZoomDisplay.png",TexMan.Type_Any);