Make weapon tooltips less view-intrusive.

This commit is contained in:
Mari the Deer 2022-02-24 18:50:20 +01:00
commit ba6a01a190
4 changed files with 14 additions and 20 deletions

View file

@ -773,8 +773,8 @@ TT_EVISCERATOR =
"\cfAltfire:\c- Grenade shot.\n"
"\cfZoom:\c- Toggle spread.";
TT_HELLBLAZER =
"\cfFire:\c- Load rockets, release to shoot.\n"
"\cfAltfire:\c- Load grenades, release to shoot.\n"
"\cfFire:\c- Load / shoot rockets.\n"
"\cfAltfire:\c- Load / shoot grenades.\n"
"\cfZoom:\c- Select ammo.\n"
"\cfReload:\c- Reload / switch ammo.\n"
"\cx(More controls in library)\c-";
@ -833,7 +833,7 @@ TT_BLACKFIRE =
"\cfAltfire:\c- Icicle shot.\n"
"\cfReload:\c- Reload canister(s).";
TT_EMPCARBINE =
"\cfFire:\c- Hold to ionize, release to shoot.\n"
"\cfFire:\c- Ionize / shoot.\n"
"\cfAltfire:\c- Multi-target ionization.\n"
"\cfZoom:\c- Use scope.\n"
"\cfReload:\c- Load rods.";

View file

@ -659,8 +659,8 @@ TT_EVISCERATOR =
"\cfSecundario:\c- Disparo de granada.\n"
"\cfZoom:\c- Alternar dispersión.";
TT_HELLBLAZER =
"\cfPrimario:\c- Cargar cohetes, soltar para disparar.\n"
"\cfSecundario:\c- Cargar granadas, soltar para disparar.\n"
"\cfPrimario:\c- Cargar / disparar cohetes.\n"
"\cfSecundario:\c- Cargar / disparar granadas.\n"
"\cfZoom:\c- Seleccionar munición.\n"
"\cfRecarga:\c- Recargar / cambiar munición.\n"
"\cx(Más controles en la biblioteca)\c-";
@ -719,7 +719,7 @@ TT_BLACKFIRE =
"\cfSecundario:\c- Disparo de carámbano.\n"
"\cfRecarga:\c- Recargar frasco(s).";
TT_EMPCARBINE =
"\cfPrimario:\c- Mantener para ionizar, soltar para disparar.\n"
"\cfPrimario:\c- Ionizar / disparar.\n"
"\cfSecundario:\c- Ionización multi-objetivo.\n"
"\cfZoom:\c- Usar mira.\n"
"\cfRecarga:\c- Cargar barras.";

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2pre r170 \cu(Thu 24 Feb 17:02:16 CET 2022)\c-";
SWWM_SHORTVER="\cw1.2pre r170 \cu(2022-02-24 17:02:16)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2pre r171 \cu(Thu 24 Feb 18:50:20 CET 2022)\c-";
SWWM_SHORTVER="\cw1.2pre r171 \cu(2022-02-24 18:50:20)\c-";

View file

@ -237,7 +237,6 @@ Class SWWMSewerCount : HUDMessageBase
// weapon tooltips
Class SWWMWeaponTooltip : HUDMessageBase
{
TextureID icon;
String wpn, txt;
double tics, holdtics, fadeintics, fadeouttics;
transient BrokenLines l;
@ -246,10 +245,9 @@ Class SWWMWeaponTooltip : HUDMessageBase
SWWMWeaponTooltip Init( Class<SWWMWeapon> weapon )
{
let def = GetDefaultByType(weapon);
icon = def.Icon;
wpn = def.GetTag();
txt = StringTable.Localize(def.tooltip);
holdtics = 120;
holdtics = 150;
fadeintics = 5;
fadeouttics = 15;
tics = -10;
@ -273,11 +271,7 @@ Class SWWMWeaponTooltip : HUDMessageBase
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);
int w, h;
[w, h] = TexMan.GetSize(icon);
int w2 = w;
Vector2 pos = (int(ss.x/2),int(ss.y/2)+h/2);
w = smallfont.StringWidth(wpn);
int w = smallfont.StringWidth(wpn);
if ( !l ) l = smallfont2.BreakLines(txt,600);
int w1 = w;
w = 0;
@ -286,10 +280,10 @@ Class SWWMWeaponTooltip : HUDMessageBase
let lw = smallfont2.StringWidth(l.StringAt(i));
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),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;
int cw = int(ceil((max(w1,w)+8)/6.))*6;
int h = smallfont.GetHeight()+8+smallfont2.GetHeight()*l.Count();
Vector2 pos = (int(ss.x/2),ss.y-(swwm_hudmargin+80+h));
Screen.Dim("Black",.5*alpha,int((pos.x-(cw+4)/2)*hs),int((pos.y-2)*hs),int((cw+4)*hs),int((h+4)*hs));
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);
for ( int i=0; i<cw; i+=6 )
Screen.DrawChar(smallfont,Font.CR_FIRE,(pos.x-cw/2)+i,pos.y+6,0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);