Implement weapon first-use tooltips.
Change some cvar defaults.
This commit is contained in:
parent
4677ca7d4f
commit
894f2ed46a
36 changed files with 399 additions and 12 deletions
|
|
@ -18,6 +18,7 @@ Class BlackfireIgniter : SWWMWeapon
|
|||
Tag "$T_BLACKFIRE";
|
||||
Inventory.PickupMessage "$T_BLACKFIRE";
|
||||
Obituary "$O_BLACKFIRE";
|
||||
SWWMWeapon.Tooltip "$TT_BLACKFIRE";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Blackfire.png";
|
||||
Weapon.SlotNumber 7;
|
||||
Weapon.SlotPriority 2.;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ Class PlasmaBlast : SWWMWeapon
|
|||
Tag "$T_PLASMABLAST";
|
||||
Inventory.PickupMessage "$T_PLASMABLAST";
|
||||
Obituary "$O_PLASMABLAST";
|
||||
SWWMWeapon.Tooltip "$TT_PLASMABLAST";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_PlasmaBlast.png";
|
||||
Weapon.SlotNumber 2;
|
||||
Weapon.SlotPriority 3.;
|
||||
|
|
@ -44,6 +45,7 @@ Class DualPlasmaBlast : SWWMWeapon
|
|||
{
|
||||
Tag "$T_PLASMABLAST2";
|
||||
Obituary "$O_PLASMABLAST";
|
||||
SWWMWeapon.Tooltip "$TT_PLASMABLAST2";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_PlasmaBlast2.png";
|
||||
Weapon.SlotNumber 2;
|
||||
Weapon.SlotPriority 4.;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ Class ItamexHammer : SWWMWeapon
|
|||
Tag "$T_HAMMER";
|
||||
Inventory.PickupMessage "$I_HAMMER";
|
||||
Obituary "$O_HAMMER";
|
||||
SWWMWeapon.Tooltip "$TT_HAMMER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_ItamexHammer.png";
|
||||
Weapon.SlotNumber 1;
|
||||
Weapon.SlotPriority 3.;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ Class HeavyMahSheenGun : SWWMWeapon
|
|||
Tag "$T_SHEENHMG";
|
||||
Inventory.PickupMessage "$I_SHEENHMG";
|
||||
Obituary "$O_SHEENHMG";
|
||||
SWWMWeapon.Tooltip "$TT_SHEENHMG";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_SheenHMG.png";
|
||||
Weapon.SlotNumber 5;
|
||||
Weapon.SlotPriority 2.;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ Class GrandLance : SWWMWeapon
|
|||
Tag "$T_GRANDLANCE";
|
||||
Inventory.PickupMessage "$T_GRANDLANCE";
|
||||
Obituary "$O_GRANDLANCE";
|
||||
SWWMWeapon.Tooltip "$TT_GRANDLANCE";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_GrandLance.png";
|
||||
Weapon.SlotNumber 0;
|
||||
Weapon.SlotPriority 2.;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ Class Quadravol : SWWMWeapon
|
|||
Tag "$T_QUADRAVOL";
|
||||
Inventory.PickupMessage "$I_QUADRAVOL";
|
||||
Obituary "$O_QUADRAVOL";
|
||||
SWWMWeapon.Tooltip "$TT_QUADRAVOL";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Quadravol.png";
|
||||
Weapon.SlotNumber 6;
|
||||
Weapon.SlotPriority 2.;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ Class PuntzerBeta : SWWMWeapon
|
|||
Tag "$T_PUNTZERBETA";
|
||||
Inventory.PickupMessage "$I_PUNTZERBETA";
|
||||
Obituary "$O_PUNTZERBETA";
|
||||
SWWMWeapon.Tooltip "$TT_PUNTZERBETA";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_PuntzerBeta.png";
|
||||
Weapon.SlotNumber 3;
|
||||
Weapon.SlotPriority 2.;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ Class PuntzerGamma : SWWMWeapon
|
|||
Tag "$T_PUNTZERGAMMA";
|
||||
Inventory.PickupMessage "$I_PUNTZERGAMMA";
|
||||
Obituary "$O_PUNTZERGAMMA";
|
||||
SWWMWeapon.Tooltip "$TT_PUNTZERGAMMA";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_PuntzerGamma.png";
|
||||
Weapon.SlotNumber 4;
|
||||
Weapon.SlotPriority 2.;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ Class RayKhom : SWWMWeapon
|
|||
Tag "$T_RAYKHOM";
|
||||
Inventory.PickupMessage "$T_RAYKHOM";
|
||||
Obituary "$O_RAYKHOM";
|
||||
SWWMWeapon.Tooltip "$TT_RAYKHOM";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_RayKhom.png";
|
||||
Weapon.SlotNumber 9;
|
||||
Weapon.SlotPriority 2.;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ Class EMPCarbine : SWWMWeapon
|
|||
Tag "$T_EMPCARBINE";
|
||||
Inventory.PickupMessage "$I_EMPCARBINE";
|
||||
Obituary "$O_EMPCARBINE";
|
||||
SWWMWeapon.Tooltip "$TT_EMPCARBINE";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_EMPCarbine.png";
|
||||
Weapon.SlotNumber 8;
|
||||
Weapon.SlotPriority 2.;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ Class ModernSparkster : SWWMWeapon
|
|||
Tag "$T_NEWSPARKSTER";
|
||||
Inventory.PickupMessage "$I_NEWSPARKSTER";
|
||||
Obituary "$O_NEWSPARKSTER";
|
||||
SWWMWeapon.Tooltip "$TT_NEWSPARKSTER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_NewSparkster.png";
|
||||
Weapon.SlotNumber 6;
|
||||
Weapon.SlotPriority 3.;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ Class FistGun : SWWMWeapon
|
|||
Tag "$T_FISTGUN";
|
||||
Inventory.PickupMessage "$T_FISTGUN";
|
||||
Obituary "$O_FISTGUN";
|
||||
SWWMWeapon.Tooltip "$TT_FISTGUN";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_FistGun.png";
|
||||
Weapon.SlotNumber 1;
|
||||
Weapon.SlotPriority 4.;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ Class MisterRifle : SWWMWeapon
|
|||
Tag "$T_MORTALRIFLE";
|
||||
Inventory.PickupMessage "$T_MORTALRIFLE";
|
||||
Obituary "$O_MORTALRIFLE";
|
||||
SWWMWeapon.Tooltip "$TT_MORTALRIFLE";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_MortalRifle.png";
|
||||
Weapon.SlotNumber 9;
|
||||
Weapon.SlotPriority 3.;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ Class RafanKos : SWWMWeapon
|
|||
Tag "$T_RAFANKOS";
|
||||
Inventory.PickupMessage "$T_RAFANKOS";
|
||||
Obituary "$O_RAFANKOS";
|
||||
SWWMWeapon.Tooltip "$TT_RAFANKOS";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_RafanKos.png";
|
||||
Weapon.SlotNumber 0;
|
||||
Weapon.SlotPriority 3.;
|
||||
|
|
|
|||
|
|
@ -119,6 +119,18 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
|
||||
override bool ProcessMidPrint( Font fnt, String msg, bool bold )
|
||||
{
|
||||
// hack lol
|
||||
if ( msg.Left(15) ~== "swwmwpntooltip." )
|
||||
{
|
||||
String wname = msg.Mid(15);
|
||||
Class<SWWMWeapon> w = wname;
|
||||
if ( w )
|
||||
{
|
||||
let tt = new("SWWMWeaponTooltip").Init(w);
|
||||
AttachMessage(tt,-2910);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
SWWMDirectMessage m, m2;
|
||||
// check for Korax lines, add them to chat (and reply to some of them)
|
||||
bool koraxline = false;
|
||||
|
|
|
|||
|
|
@ -245,6 +245,81 @@ Class SWWMSewerCount : HUDMessageBase
|
|||
}
|
||||
}
|
||||
|
||||
// weapon tooltips
|
||||
Class SWWMWeaponTooltip : HUDMessageBase
|
||||
{
|
||||
TextureID icon;
|
||||
String wpn, txt;
|
||||
double tics, holdtics, fadeintics, fadeouttics;
|
||||
transient Font tewifont, mplusfont, miniwifont, k6x8font;
|
||||
transient BrokenLines l;
|
||||
|
||||
SWWMWeaponTooltip Init( Class<SWWMWeapon> weapon )
|
||||
{
|
||||
let def = GetDefaultByType(weapon);
|
||||
icon = def.Icon;
|
||||
wpn = def.GetTag();
|
||||
txt = def.tooltip;
|
||||
holdtics = 90;
|
||||
fadeintics = 20;
|
||||
fadeouttics = 30;
|
||||
tics = -10;
|
||||
return self;
|
||||
}
|
||||
|
||||
override bool Tick()
|
||||
{
|
||||
return (++tics > holdtics+fadeintics+fadeouttics);
|
||||
}
|
||||
|
||||
override void Draw( int bottom, int visibility )
|
||||
{
|
||||
if ( tics <= 0 ) return;
|
||||
if ( !tewifont ) tewifont = Font.GetFont('TewiShaded');
|
||||
if ( !mplusfont ) mplusfont = Font.GetFont('MPlusShaded');
|
||||
if ( !miniwifont ) miniwifont = Font.GetFont('MiniwiShaded');
|
||||
if ( !k6x8font ) k6x8font = Font.GetFont('k6x8Shaded');
|
||||
let fnt = tewifont;
|
||||
let fnt2 = miniwifont;
|
||||
if ( language ~== "jp" )
|
||||
{
|
||||
fnt = mplusfont;
|
||||
fnt2 = k6x8font;
|
||||
}
|
||||
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 alpha = (tics<fadeintics)?(tics/fadeintics):(tics<(fadeintics+holdtics))?1.:(1.-(tics-(fadeintics+holdtics))/fadeouttics);
|
||||
int w, h;
|
||||
[w, h] = TexMan.GetSize(icon);
|
||||
Vector2 pos = (int(ss.x/2),int(ss.y/2)+8+h);
|
||||
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 += 2;
|
||||
w = fnt.StringWidth(wpn);
|
||||
Screen.DrawText(fnt,Font.CR_FIRE,pos.x-w/2,pos.y,wpn,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
if ( !l ) l = fnt2.BreakLines(txt,600);
|
||||
int w1 = w;
|
||||
w = 0;
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
{
|
||||
let lw = fnt2.StringWidth(l.StringAt(i));
|
||||
if ( lw > w ) w = lw;
|
||||
}
|
||||
// underline
|
||||
int cw = int(ceil((max(w1,w)+8)/6.))*6;
|
||||
for ( int i=0; i<cw; i+=6 )
|
||||
Screen.DrawChar(fnt,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);
|
||||
pos.y += fnt.GetHeight()+8;
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(fnt2,Font.CR_WHITE,pos.x-w/2,pos.y,l.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
|
||||
pos.y += fnt2.GetHeight();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Used sparingly for some events
|
||||
Class SWWMDirectMessage : HUDMessageBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ Class SWWMStats : Thinker
|
|||
Array<MonsterKill> mstats;
|
||||
Array<LevelStat> lstats;
|
||||
Array<Class<Weapon> > alreadygot;
|
||||
Array<Class<SWWMWeapon> > sawtooltip;
|
||||
int favweapon;
|
||||
// these two are used for mission updates
|
||||
Array<int> clustervisit;
|
||||
|
|
@ -60,6 +61,19 @@ Class SWWMStats : Thinker
|
|||
return false;
|
||||
}
|
||||
|
||||
void SendTooltip( Class<SWWMWeapon> which )
|
||||
{
|
||||
if ( !swwm_weapontooltips ) return;
|
||||
for ( int i=0; i<sawtooltip.Size(); i++ )
|
||||
{
|
||||
if ( sawtooltip[i] == which ) return;
|
||||
}
|
||||
sawtooltip.Push(which);
|
||||
// this is kinda hacky but hey, as long as it works
|
||||
if ( myplayer == players[consoleplayer] )
|
||||
Console.MidPrint(null,"swwmwpntooltip."..which.GetClassName());
|
||||
}
|
||||
|
||||
private Class<Weapon> WeaponFromInflictor( Actor inflictor, Name damagetype )
|
||||
{
|
||||
Class<Weapon> which = myplayer.ReadyWeapon?myplayer.ReadyWeapon.GetClass():null;
|
||||
|
|
|
|||
|
|
@ -9,9 +9,10 @@ Class SWWMWeapon : Weapon abstract
|
|||
transient bool hastravelled;
|
||||
transient int autoupsnd;
|
||||
private int SWeaponFlags;
|
||||
|
||||
String tooltip;
|
||||
Class<Ammo> dropammotype;
|
||||
|
||||
Property Tooltip : tooltip;
|
||||
Property DropAmmoType : dropammotype;
|
||||
|
||||
FlagDef NoFirstGive : SWeaponFlags, 0; // don't give ammo on first pickup (for weapons with a clip count)
|
||||
|
|
@ -346,11 +347,17 @@ Class SWWMWeapon : Weapon abstract
|
|||
override void Tick()
|
||||
{
|
||||
Super.Tick();
|
||||
if ( Owner && autoupsnd && (level.maptime >= autoupsnd) )
|
||||
if ( !Owner ) return;
|
||||
if ( autoupsnd && (level.maptime >= autoupsnd) )
|
||||
{
|
||||
autoupsnd = 0;
|
||||
PlayUpSound(Owner);
|
||||
}
|
||||
if ( !Owner.player || (Owner.player.ReadyWeapon != self) || !(Owner.player.WeaponState&WF_WEAPONSWITCHOK) || (Owner.player.WeaponState&WF_DISABLESWITCH) )
|
||||
return;
|
||||
let demo = Demolitionist(Owner);
|
||||
if ( demo && demo.mystats && tooltip )
|
||||
demo.mystats.SendTooltip(GetClass());
|
||||
}
|
||||
action void A_SWWMFlash( StateLabel flashlabel = null )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -652,6 +652,7 @@ Class Hellblazer : SWWMWeapon
|
|||
Tag "$T_HELLBLAZER";
|
||||
Inventory.PickupMessage "$I_HELLBLAZER";
|
||||
Obituary "$O_HELLBLAZER";
|
||||
SWWMWeapon.Tooltip "$TT_HELLBLAZER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Hellblazer.png";
|
||||
Weapon.SlotNumber 6;
|
||||
Weapon.SelectionOrder 700;
|
||||
|
|
|
|||
|
|
@ -852,6 +852,7 @@ Class Wallbuster : SWWMWeapon
|
|||
Tag "$T_WALLBUSTER";
|
||||
Inventory.PickupMessage "$I_WALLBUSTER";
|
||||
Obituary "$O_WALLBUSTER_RED";
|
||||
SWWMWeapon.Tooltip "$TT_WALLBUSTER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Wallbuster.png";
|
||||
Weapon.SlotNumber 4;
|
||||
Weapon.SelectionOrder 400;
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ Class Eviscerator : SWWMWeapon
|
|||
Tag "$T_EVISCERATOR";
|
||||
Inventory.PickupMessage "$I_EVISCERATOR";
|
||||
Obituary "$O_EVISCERATOR";
|
||||
SWWMWeapon.Tooltip "$TT_EVISCERATOR";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Eviscerator.png";
|
||||
Weapon.SlotNumber 5;
|
||||
Weapon.UpSound "eviscerator/select";
|
||||
|
|
|
|||
|
|
@ -237,6 +237,7 @@ Class Ynykron : SWWMWeapon
|
|||
Tag "$T_YNYKRON";
|
||||
Inventory.PickupMessage "$T_YNYKRON";
|
||||
Obituary "$O_YNYKRON";
|
||||
SWWMWeapon.Tooltip "$TT_YNYKRON";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Ynykron.png";
|
||||
Weapon.SlotNumber 0;
|
||||
Weapon.SelectionOrder 9000;
|
||||
|
|
|
|||
|
|
@ -326,6 +326,7 @@ Class DeepImpact : SWWMWeapon
|
|||
Tag "$T_DEEPIMPACT";
|
||||
Inventory.PickupMessage "$I_DEEPIMPACT";
|
||||
Obituary "$O_DEEPIMPACT_WEAK";
|
||||
SWWMWeapon.Tooltip "$TT_DEEPIMPACT";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_DeepImpact.png";
|
||||
Weapon.UpSound "deepimpact/select";
|
||||
Weapon.SlotNumber 1;
|
||||
|
|
|
|||
|
|
@ -256,6 +256,7 @@ Class PusherWeapon : SWWMWeapon
|
|||
Tag "$T_PUSHER";
|
||||
Inventory.PickupMessage "$I_PUSHER";
|
||||
Obituary "$O_PUSHER";
|
||||
SWWMWeapon.Tooltip "$TT_PUSHER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Pusher.png";
|
||||
Weapon.UpSound "pusher/select";
|
||||
Weapon.SlotNumber 1;
|
||||
|
|
|
|||
|
|
@ -886,6 +886,7 @@ Class Spreadgun : SWWMWeapon
|
|||
Tag "$T_SPREADGUN";
|
||||
Inventory.PickupMessage "$I_SPREADGUN";
|
||||
Obituary "$O_SPREADGUN";
|
||||
SWWMWeapon.Tooltip "$TT_SPREADGUN";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Spreadgun.png";
|
||||
Weapon.UpSound "spreadgun/select";
|
||||
Weapon.SlotNumber 3;
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ Class Sparkster : SWWMWeapon
|
|||
Tag "$T_SPARKSTER";
|
||||
Inventory.PickupMessage "$I_SPARKSTER";
|
||||
Obituary "$O_SPARKSTER";
|
||||
SWWMWeapon.Tooltip "$TT_SPARKSTER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Sparkster.png";
|
||||
Weapon.SlotNumber 7;
|
||||
Weapon.UpSound "biospark/select";
|
||||
|
|
|
|||
|
|
@ -328,6 +328,7 @@ Class ExplodiumGun : SWWMWeapon
|
|||
Tag "$T_EXPLODIUM";
|
||||
Inventory.PickupMessage "$T_EXPLODIUM";
|
||||
Obituary "$O_EXPLODIUM";
|
||||
SWWMWeapon.Tooltip "$TT_EXPLODIUM";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_ExplodiumGun.png";
|
||||
Weapon.UpSound "explodium/select";
|
||||
Weapon.SlotNumber 2;
|
||||
|
|
@ -791,6 +792,7 @@ Class DualExplodiumGun : SWWMWeapon
|
|||
{
|
||||
Tag "$T_EXPLODIUM2";
|
||||
Obituary "$O_EXPLODIUM";
|
||||
SWWMWeapon.Tooltip "$TT_EXPLODIUM2";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_ExplodiumGun2.png";
|
||||
Weapon.UpSound "explodium/select";
|
||||
Weapon.SisterWeapon "ExplodiumGun";
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ Class CandyGun : SWWMWeapon
|
|||
Tag "$T_CANDYGUN";
|
||||
Inventory.PickupMessage "$I_CANDYGUN";
|
||||
Obituary "$O_CANDYGUN";
|
||||
SWWMWeapon.Tooltip "$TT_CANDYGUN";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_CandyGun.png";
|
||||
Weapon.UpSound "explodium/select";
|
||||
Weapon.SlotNumber 9;
|
||||
|
|
|
|||
|
|
@ -937,6 +937,7 @@ Class SilverBullet : SWWMWeapon
|
|||
Tag "$T_SILVERBULLET";
|
||||
Inventory.PickupMessage "$T_SILVERBULLET";
|
||||
Obituary "$O_SILVERBULLET";
|
||||
SWWMWeapon.Tooltip "$TT_SILVERBULLET";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_SilverBullet.png";
|
||||
Weapon.SlotNumber 8;
|
||||
Weapon.SelectionOrder 800;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue