Implement a "weapon bar" (optional).
|
|
@ -79,6 +79,7 @@ server bool swwm_lobdoubled = false; // [LOB] Enable Double Death monster spawn
|
|||
nosave int swwm_bardist = 2000; // distance at which healthbars will be visible (does not affect player bars)
|
||||
nosave bool swwm_oldcheats = false; // has received the "old cheats" dialogue from Zanaveth
|
||||
nosave bool swwm_ccmessage = false; // has received the "corruption cards" dialogue from Cytho
|
||||
nosave bool swwm_useweaponbar = false; // scroll through weapons using a bar, like with inventory items
|
||||
|
||||
// minimap settings
|
||||
nosave bool swwm_mm_enable = true; // show a minimap below the score counter
|
||||
|
|
|
|||
|
|
@ -100,6 +100,66 @@ Material Texture "graphics/HUD/HealthBarD.png"
|
|||
Define "TEX_SIZE" = "vec2(120.,25.)"
|
||||
Texture "noisetex" "textures/graynoise.png"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_DeepImpact.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_ExplodiumGun.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_Spreadgun.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_Wallbuster.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_Eviscerator.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_Hellblazer.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_Sparkster.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_SilverBullet.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_CandyGun.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_Ynykron.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_ItamexHammer.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_PlasmaBlast.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_SheenHMG.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_Quadravol.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/HUD/Icons/W_MortalRifle.png"
|
||||
{
|
||||
Shader "shaders/glsl/Bilinear.fp"
|
||||
}
|
||||
Material Texture "graphics/dsmapfont.png"
|
||||
{
|
||||
Shader "shaders/glsl/AreaName.fp"
|
||||
|
|
|
|||
|
|
@ -118,3 +118,9 @@ HardwareShader PostProcess scene
|
|||
Uniform float ni
|
||||
Texture NoiseTexture "textures/graynoise.png"
|
||||
}
|
||||
HardwareShader PostProcess scene
|
||||
{
|
||||
Name "BokehSel"
|
||||
Shader "shaders/pp/BokehSel.fp" 330
|
||||
Uniform float strength
|
||||
}
|
||||
|
|
|
|||
BIN
graphics/HUD/Icons/W_CandyGun.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
graphics/HUD/Icons/W_DeepImpact.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
graphics/HUD/Icons/W_Eviscerator.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
graphics/HUD/Icons/W_ExplodiumGun.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
graphics/HUD/Icons/W_Hellblazer.png
Normal file
|
After Width: | Height: | Size: 115 KiB |
BIN
graphics/HUD/Icons/W_ItamexHammer.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
graphics/HUD/Icons/W_MortalRifle.png
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
graphics/HUD/Icons/W_PlasmaBlast.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
graphics/HUD/Icons/W_Quadravol.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
graphics/HUD/Icons/W_SheenHMG.png
Normal file
|
After Width: | Height: | Size: 153 KiB |
BIN
graphics/HUD/Icons/W_SilverBullet.png
Normal file
|
After Width: | Height: | Size: 471 KiB |
BIN
graphics/HUD/Icons/W_Sparkster.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
graphics/HUD/Icons/W_Spreadgun.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
graphics/HUD/Icons/W_Wallbuster.png
Normal file
|
After Width: | Height: | Size: 258 KiB |
BIN
graphics/HUD/Icons/W_Ynykron.png
Normal file
|
After Width: | Height: | Size: 322 KiB |
|
|
@ -183,6 +183,7 @@ SWWM_DAMNUMS_COLOR = "Color Damage Numbers";
|
|||
SWWM_SHOWMAPTITLE = "Animated Map Title";
|
||||
SWWM_LOBDOUBLED = "LOB Double Death";
|
||||
SWWM_BARDIST = "Healthbar Distance";
|
||||
SWWM_USEWEAPONBAR = "Alternate Weapon Selection";
|
||||
SWWM_MM_ENABLE = "Show Minimap";
|
||||
SWWM_MM_MISSILES = "Projectiles In Minimap";
|
||||
SWWM_MM_COLORSET = "Minimap Color Set";
|
||||
|
|
@ -274,6 +275,7 @@ TOOLTIP_SWWM_DAMNUMS_COLOR = "Damage numbers will change color based on the type
|
|||
TOOLTIP_SWWM_SHOWMAPTITLE = "Shows an animated title card when entering a map. It's just like Dark Souls!";
|
||||
TOOLTIP_SWWM_LOBDOUBLED = "[Legion of Bones] Enables \"Double Death\", which makes enemies first spawn as their vanilla variants to then turn undead on defeat.";
|
||||
TOOLTIP_SWWM_BARDIST = "Distance in map units at which healthbar visibility will begin to fade. Does not affect the healthbars of other players.";
|
||||
TOOLTIP_SWWM_USEWEAPONBAR = "Enables an alternate method for scrolling through weapons akin to the inventory bar. Use Primary Fire to accept, and Alternate Fire to cancel.";
|
||||
TOOLTIP_SWWMACHIEVEMENTMENU = "View your achievements.";
|
||||
TOOLTIP_SWWM_MM_ENABLE = "Displays a minimap on the top right corner of the screen.";
|
||||
TOOLTIP_SWWM_MM_MISSILES = "Displays projectiles in the minimap. Can be toggled if this clutters too much.";
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ SWWM_DAMNUMS_COLOR = "Colorear Números de Daño";
|
|||
SWWM_SHOWMAPTITLE = "Título de Mapa Animado";
|
||||
SWWM_LOBDOUBLED = "LOB Doble Muerte";
|
||||
SWWM_BARDIST = "Distancia de Barras de Salud";
|
||||
SWWM_USEWEAPONBAR = "Selección Alternativa de Armas";
|
||||
SWWM_MM_ENABLE = "Mostrar Minimapa";
|
||||
SWWM_MM_MISSILES = "Proyectiles en Minimapa";
|
||||
SWWM_MM_COLORSET = "Set de Colores de Minimapa";
|
||||
|
|
@ -272,6 +273,7 @@ TOOLTIP_SWWM_DAMNUMS_COLOR = "Los números de daño cambiarán color en base al
|
|||
TOOLTIP_SWWM_SHOWMAPTITLE = "Muestra una animación de título al entrar en un mapa. ¡Es igualito que Dark Souls!";
|
||||
TOOLTIP_SWWM_LOBDOUBLED = "[Legion of Bones] Habilita \"Doble Muerte\", lo cual hace que los enemigos aparezcan primero como sus variantes vanilla para luego volverse no-muertos al derrotarlos.";
|
||||
TOOLTIP_SWWM_BARDIST = "Distancia en unidades de mapa a la cual la visibilidad de las barras de salud irá desvaneciendo. No afecta a las barras de salud de otros jugadores.";
|
||||
TOOLTIP_SWWM_USEWEAPONBAR = "Habilita un método alternativo para hacer scroll por las armas similar a la barra de inventario. Usa el Fuego Primario para aceptar, y el Fuego Secundario para cancelar.";
|
||||
TOOLTIP_SWWMACHIEVEMENTMENU = "Revisa tus logros.";
|
||||
TOOLTIP_SWWM_MM_ENABLE = "Muestra un minimapa en la esquina superior derecha de la pantalla.";
|
||||
TOOLTIP_SWWM_MM_MISSILES = "Muestra proyectiles en el minimapa. Puede ser desactivado si causa problemas de visibilidad.";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r822 \cu(Tue 4 Jul 13:51:25 CEST 2023)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r822 \cu(2023-07-04 13:51:25)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r823 \cu(Tue 4 Jul 17:05:21 CEST 2023)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r823 \cu(2023-07-04 17:05:21)\c-";
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@ OptionMenu "SWWMOptionMenu"
|
|||
Option "$SWWM_SWAPWEAPONS", "swwm_swapweapons", "YesNo"
|
||||
StaticText " "
|
||||
StaticText "$SWWM_ITITLE", 1
|
||||
Option "$SWWM_USEWEAPONBAR", "swwm_useweaponbar", "YesNo"
|
||||
Option "$SWWM_USETOPICKUP", "swwm_usetopickup", "YesNo"
|
||||
Option "$SWWM_SINGLEFIRST", "swwm_singlefirst", "YesNo"
|
||||
Option "$SWWM_COLLECTANIM", "swwm_collectanim", "YesNo"
|
||||
|
|
|
|||
27
shaders/pp/BokehSel.fp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// blur fade from Spooktober
|
||||
|
||||
#define PI 3.14159265
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 coord = TexCoord;
|
||||
vec2 tsiz = vec2(textureSize(InputTexture,0));
|
||||
vec2 bof = vec2((tsiz.y/tsiz.x),1.)/256.;
|
||||
vec4 res = texture(InputTexture,coord);
|
||||
int rsamples, tstep = 1;
|
||||
float bstep;
|
||||
vec2 rcoord;
|
||||
for ( int i=1; i<=3; i++ )
|
||||
{
|
||||
rsamples = i*3;
|
||||
for ( int j=0; j<rsamples; j++ )
|
||||
{
|
||||
bstep = PI*2.0/rsamples;
|
||||
rcoord = vec2(cos(j*bstep),sin(j*bstep))*i;
|
||||
tstep++;
|
||||
res += texture(InputTexture,coord+rcoord*bof*strength);
|
||||
}
|
||||
}
|
||||
res /= tstep;
|
||||
FragColor = res;
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ Class PlasmaBlast : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_PLASMABLAST";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_PlasmaBlast.png";
|
||||
Inventory.PickupMessage "$T_PLASMABLAST";
|
||||
Obituary "$O_PLASMABLAST";
|
||||
SWWMWeapon.Tooltip "$TT_PLASMABLAST";
|
||||
|
|
|
|||
|
|
@ -208,6 +208,7 @@ Class ItamexHammer : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_HAMMER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_ItamexHammer.png";
|
||||
Inventory.PickupMessage "$I_HAMMER";
|
||||
Obituary "$O_HAMMER";
|
||||
SWWMWeapon.Tooltip "$TT_HAMMER";
|
||||
|
|
|
|||
|
|
@ -341,6 +341,7 @@ Class HeavyMahSheenGun : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_SHEENHMG";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_SheenHMG.png";
|
||||
Inventory.PickupMessage "$I_SHEENHMG";
|
||||
Obituary "$O_SHEENHMG";
|
||||
SWWMWeapon.Tooltip "$TT_SHEENHMG";
|
||||
|
|
|
|||
|
|
@ -1188,6 +1188,7 @@ Class MisterRifle : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_MORTALRIFLE";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_MortalRifle.png";
|
||||
Inventory.PickupMessage "$T_MORTALRIFLE";
|
||||
Obituary "$O_MORTALRIFLE";
|
||||
SWWMWeapon.Tooltip "$TT_MORTALRIFLE";
|
||||
|
|
|
|||
|
|
@ -417,6 +417,7 @@ Class Quadravol : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_QUADRAVOL";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Quadravol.png";
|
||||
Inventory.PickupMessage "$I_QUADRAVOL";
|
||||
Obituary "$O_QUADRAVOL";
|
||||
SWWMWeapon.Tooltip "$TT_QUADRAVOL";
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ extend Class SWWMHandler
|
|||
transient Array<MenuTransaction> checklist;
|
||||
// for the compact hud
|
||||
transient int WeaponFlash[10];
|
||||
// weapon selector
|
||||
transient ui SWWMWeaponSelect wsel;
|
||||
|
||||
override void ConsoleProcess( ConsoleEvent e )
|
||||
{
|
||||
|
|
@ -511,6 +513,24 @@ extend Class SWWMHandler
|
|||
}
|
||||
else if ( e.Name ~== "swwmccstart" )
|
||||
gdat.ccstartonce = true;
|
||||
else if ( e.Name.Left(14) ~== "swwmselweapon." )
|
||||
{
|
||||
Class<Weapon> wpn = e.Name.Mid(14);
|
||||
if ( !wpn ) return;
|
||||
let w = Weapon(players[e.player].mo.FindInventory(wpn));
|
||||
if ( !w ) return;
|
||||
if ( !w.CheckAmmo(Weapon.EitherFire,false) )
|
||||
{
|
||||
S_StartSound("menu/democlose",CHAN_AUTO,CHANF_UI);
|
||||
return;
|
||||
}
|
||||
players[e.player].mo.UseInventory(w);
|
||||
if ( e.player != consoleplayer ) return;
|
||||
bool rslt = (players[e.player].PendingWeapon == w);
|
||||
if ( (w is 'SWWMWeapon') && (players[e.player].PendingWeapon == w.SisterWeapon) )
|
||||
rslt = true; // switching to dual gun
|
||||
S_StartSound(rslt?"menu/demosel":"menu/democlose",CHAN_AUTO,CHANF_UI);
|
||||
}
|
||||
// cheats go here
|
||||
else CheatEvent(e);
|
||||
}
|
||||
|
|
@ -519,13 +539,50 @@ extend Class SWWMHandler
|
|||
{
|
||||
if ( e.Type != InputEvent.TYPE_KeyDown ) return false;
|
||||
// block invprev/next inputs when paused
|
||||
String cmd = Bindings.GetBinding(e.KeyScan);
|
||||
if ( paused )
|
||||
{
|
||||
String cmd = Bindings.GetBinding(e.KeyScan);
|
||||
if ( (cmd ~== "invprev") || (cmd ~== "invnext") ) return true;
|
||||
// skip the rest of this function
|
||||
return false;
|
||||
}
|
||||
// weapon selector is active
|
||||
int WeapSel = 0;
|
||||
if ( cmd ~== "weapnext" ) WeapSel = 1;
|
||||
else if ( cmd ~== "weapprev" ) WeapSel = -1;
|
||||
if ( wsel && (wsel.stage < 2) )
|
||||
{
|
||||
if ( WeapSel == 1 )
|
||||
{
|
||||
wsel.WeapNext();
|
||||
return true;
|
||||
}
|
||||
if ( WeapSel == -1 )
|
||||
{
|
||||
wsel.WeapPrev();
|
||||
return true;
|
||||
}
|
||||
if ( cmd ~== "+attack" )
|
||||
{
|
||||
wsel.WeapSel();
|
||||
return true;
|
||||
}
|
||||
if ( cmd ~== "+altattack" )
|
||||
{
|
||||
wsel.WeapCancel();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ( WeapSel && swwm_useweaponbar && !paused && (players[consoleplayer].playerstate == PST_LIVE) && players[consoleplayer].mo && (gamestate == GS_LEVEL) )
|
||||
{
|
||||
// only if player owns any selectable weapons
|
||||
if ( !wsel && SWWMWeaponSelect.PlayerHasWeapons(players[consoleplayer].mo) )
|
||||
{
|
||||
wsel = new("SWWMWeaponSelect").Init(players[consoleplayer].mo);
|
||||
StatusBar.AttachMessage(wsel,-2920);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// F
|
||||
if ( e.KeyChar == 0x66 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ extend Class SWWMHandler
|
|||
PPShader.SetEnabled("Glitch",false);
|
||||
PPShader.SetEnabled("Grain",false);
|
||||
PPShader.SetEnabled("WindBlur",false);
|
||||
PPShader.SetEnabled("BokehSel",false);
|
||||
}
|
||||
|
||||
private ui void RenderShaders( RenderEvent e )
|
||||
|
|
|
|||
|
|
@ -819,3 +819,269 @@ Class DSMapTitle : HUDMessageBase
|
|||
MySubDrawText(txtsub,xx-w2/2,yy+fheight_sub+12,ss,alpha);
|
||||
}
|
||||
}
|
||||
|
||||
// ez weapon selector
|
||||
Class SWWMWeaponSelect : HUDMessageBase
|
||||
{
|
||||
Actor mo;
|
||||
Array<Weapon> weaps;
|
||||
int cursel;
|
||||
double alph, olalph;
|
||||
double curY, smoothY, olsmoothY;
|
||||
int stage;
|
||||
|
||||
private int CmpWeapon( Weapon a, Weapon b )
|
||||
{
|
||||
let [dummya, slota] = mo.player.weapons.LocateWeapon(a.GetClass());
|
||||
if ( slota == 0 ) slota = 10;
|
||||
let [dummyb, slotb] = mo.player.weapons.LocateWeapon(b.GetClass());
|
||||
if ( slotb == 0 ) slotb = 10;
|
||||
if ( slota == slotb )
|
||||
return (a.SlotPriority <= b.SlotPriority);
|
||||
return slota > slotb;
|
||||
}
|
||||
|
||||
private int partition_weapons( int l, int h )
|
||||
{
|
||||
Weapon pv = weaps[h];
|
||||
int i = (l-1);
|
||||
for ( int j=l; j<=(h-1); j++ )
|
||||
{
|
||||
if ( CmpWeapon(pv,weaps[j]) )
|
||||
{
|
||||
i++;
|
||||
Weapon tmp = weaps[j];
|
||||
weaps[j] = weaps[i];
|
||||
weaps[i] = tmp;
|
||||
}
|
||||
}
|
||||
Weapon tmp = weaps[h];
|
||||
weaps[h] = weaps[i+1];
|
||||
weaps[i+1] = tmp;
|
||||
return i+1;
|
||||
}
|
||||
private void qsort_weapons( int l, int h )
|
||||
{
|
||||
if ( l >= h ) return;
|
||||
int p = partition_weapons(l,h);
|
||||
qsort_weapons(l,p-1);
|
||||
qsort_weapons(p+1,h);
|
||||
}
|
||||
|
||||
static clearscope bool PlayerHasWeapons( Actor mo )
|
||||
{
|
||||
for ( Inventory i=mo.inv; i; i=i.inv )
|
||||
{
|
||||
if ( !(i is 'Weapon') ) continue;
|
||||
let w = Weapon(i);
|
||||
if ( !mo.player.weapons.LocateWeapon(w.GetClass()) ) continue;
|
||||
if ( (w is 'SWWMWeapon') && SWWMWeapon(w).bHIDEINMENU ) continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private double CalcHeight()
|
||||
{
|
||||
double th = 0.;
|
||||
double cur = -1.;
|
||||
for ( int i=0; i<weaps.Size(); i++ )
|
||||
{
|
||||
if ( !weaps[i] ) continue;
|
||||
double h = 16.; // padding
|
||||
TextureID ico = weaps[i].Icon;
|
||||
if ( ico.IsValid() )
|
||||
{
|
||||
Vector2 sz = TexMan.GetScaledSize(ico);
|
||||
if ( weaps[i] is 'SWWMWeapon' ) // SWWM weapon icons are larger
|
||||
sz *= .125;
|
||||
h += sz.y;
|
||||
}
|
||||
if ( i == cursel ) cur = th+(h*.5);
|
||||
th += h;
|
||||
}
|
||||
return (cur<0.)?(th*.5):cur;
|
||||
}
|
||||
|
||||
SWWMWeaponSelect Init( Actor mo )
|
||||
{
|
||||
self.mo = mo;
|
||||
// enumerate all selectable weapons
|
||||
for ( Inventory i=mo.inv; i; i=i.inv )
|
||||
{
|
||||
if ( !(i is 'Weapon') ) continue;
|
||||
let w = Weapon(i);
|
||||
if ( !mo.player.weapons.LocateWeapon(w.GetClass()) ) continue;
|
||||
if ( (w is 'SWWMWeapon') && SWWMWeapon(w).bHIDEINMENU ) continue;
|
||||
if ( weaps.Find(w) < weaps.Size() ) continue;
|
||||
weaps.Push(w);
|
||||
}
|
||||
// sort weapons
|
||||
qsort_weapons(0,weaps.Size()-1);
|
||||
// find current selected
|
||||
for ( int i=0; i<weaps.Size(); i++ )
|
||||
{
|
||||
if ( (weaps[i] != mo.player.ReadyWeapon) && (weaps[i].SisterWeapon != mo.player.ReadyWeapon) )
|
||||
continue;
|
||||
cursel = i;
|
||||
break;
|
||||
}
|
||||
// initial state
|
||||
S_StartSound("menu/demotab",CHAN_AUTO,CHANF_UI);
|
||||
stage = 0;
|
||||
alph = 0.;
|
||||
olsmoothY = smoothY = curY = CalcHeight();
|
||||
return self;
|
||||
}
|
||||
|
||||
private void ShowNameTag()
|
||||
{
|
||||
let bar = SWWMStatusBar(StatusBar);
|
||||
if ( !bar ) return;
|
||||
let sw = SWWMWeapon(weaps[cursel]);
|
||||
if ( sw && sw.SisterWeapon && (sw.Amount > 1) && ((mo.player.ReadyWeapon == sw) || ((mo.player.ReadyWeapon != sw.SisterWeapon) && !swwm_singlefirst)) )
|
||||
bar.ntagstr = sw.SisterWeapon.GetTag();
|
||||
else bar.ntagstr = weaps[cursel].GetTag();
|
||||
bar.ntagtic = level.totaltime;
|
||||
bar.ntagcol = nametagcolor;
|
||||
}
|
||||
|
||||
void WeapPrev()
|
||||
{
|
||||
if ( (weaps.Size() <= 1) || (cursel <= 0) ) return;
|
||||
cursel--;
|
||||
curY = CalcHeight();
|
||||
S_StartSound("menu/demoscroll",CHAN_AUTO,CHANF_UI);
|
||||
if ( !weaps[cursel] || !(displaynametags&2) ) return;
|
||||
ShowNameTag();
|
||||
}
|
||||
|
||||
void WeapNext()
|
||||
{
|
||||
if ( (weaps.Size() <= 1) || (cursel >= weaps.Size()-1) ) return;
|
||||
cursel++;
|
||||
curY = CalcHeight();
|
||||
S_StartSound("menu/demoscroll",CHAN_AUTO,CHANF_UI);
|
||||
if ( !weaps[cursel] || !(displaynametags&2) ) return;
|
||||
ShowNameTag();
|
||||
}
|
||||
|
||||
void WeapSel()
|
||||
{
|
||||
stage = 2;
|
||||
if ( !weaps[cursel] ) return;
|
||||
EventHandler.SendNetworkEvent(String.Format("swwmselweapon.%s",weaps[cursel].GetClassName()),mo.PlayerNumber());
|
||||
}
|
||||
|
||||
void WeapCancel()
|
||||
{
|
||||
stage = 2;
|
||||
S_StartSound("menu/democlose",CHAN_AUTO,CHANF_UI|CHANF_OVERLAP);
|
||||
}
|
||||
|
||||
override bool Tick()
|
||||
{
|
||||
int oldsiz = weaps.Size();
|
||||
for ( int i=0; i<weaps.Size(); i++ )
|
||||
{
|
||||
if ( weaps[i] ) continue;
|
||||
weaps.Delete(i);
|
||||
if ( cursel >= i ) cursel--;
|
||||
i--;
|
||||
}
|
||||
for ( Inventory i=mo.inv; i; i=i.inv )
|
||||
{
|
||||
if ( !(i is 'Weapon') ) continue;
|
||||
let w = Weapon(i);
|
||||
if ( !mo.player.weapons.LocateWeapon(w.GetClass()) ) continue;
|
||||
if ( (w is 'SWWMWeapon') && SWWMWeapon(w).bHIDEINMENU ) continue;
|
||||
if ( weaps.Find(w) < weaps.Size() ) continue;
|
||||
weaps.Push(w);
|
||||
}
|
||||
if ( weaps.Size() <= 0 ) stage = 2; // force close if no weapons available
|
||||
else if ( weaps.Size() != oldsiz )
|
||||
{
|
||||
// re-sort and reposition
|
||||
let csel = weaps[cursel];
|
||||
qsort_weapons(0,weaps.Size()-1);
|
||||
cursel = weaps.Find(csel);
|
||||
curY = CalcHeight();
|
||||
}
|
||||
olalph = alph;
|
||||
switch ( stage )
|
||||
{
|
||||
case 0:
|
||||
// fade in
|
||||
alph += 4./GameTicRate;
|
||||
if ( alph >= 1. )
|
||||
{
|
||||
alph = 1.;
|
||||
stage = 1;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
// do nothing
|
||||
break;
|
||||
case 2:
|
||||
// fade out
|
||||
alph -= 6./GameTicRate;
|
||||
if ( alph <= 0. )
|
||||
{
|
||||
PPShader.SetEnabled("BokehSel",false); // clear the shader
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
// smooth scroll
|
||||
olsmoothY = smoothY;
|
||||
smoothY = smoothY*.6+curY*.4;
|
||||
return false;
|
||||
}
|
||||
|
||||
override void Draw( int bottom, int visibility )
|
||||
{
|
||||
double fractic = System.GetTimeFrac();
|
||||
double ssmoothY = SWWMUtility.Lerp(olsmoothY,smoothY,fractic);
|
||||
double salph = SWWMUtility.Lerp(olalph,alph,fractic);
|
||||
if ( swwm_shaders )
|
||||
{
|
||||
PPShader.SetEnabled("BokehSel",true);
|
||||
PPShader.SetUniform1f("BokehSel","strength",salph);
|
||||
}
|
||||
Screen.Dim("Black",.4*salph,0,0,Screen.GetWidth(),Screen.GetHeight());
|
||||
double hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.);
|
||||
Vector2 ss = (Screen.GetWidth(),Screen.GetHeight())/hs;
|
||||
Vector2 hss = ss*.5;
|
||||
double x = Screen.GetWidth()*.5;
|
||||
double y = hss.y-ssmoothY;
|
||||
for ( int i=0; i<weaps.Size(); i++ )
|
||||
{
|
||||
if ( !weaps[i] ) continue;
|
||||
let w = weaps[i];
|
||||
let sw = SWWMWeapon(weaps[i]);
|
||||
double scl = sw?.125:1.;
|
||||
y += 8.;
|
||||
TextureID ico = w.Icon;
|
||||
if ( ico.IsValid() )
|
||||
{
|
||||
Vector2 sz = TexMan.GetScaledSize(ico);
|
||||
y += sz.y*scl*.5;
|
||||
double fade = clamp(.75-abs(y-hss.y)/hss.y,0.,.75)/.75;
|
||||
bool bHasAmmo = false;
|
||||
if ( sw ) bHasAmmo = sw.ReportHUDAmmo();
|
||||
else if ( (!w.Ammo1 || (w.Ammo1.Amount > 0) || w.bAMMO_OPTIONAL) || (w.Ammo2 && ((w.Ammo2.Amount > 0) || w.bALT_AMMO_OPTIONAL)) )
|
||||
bHasAmmo = true;
|
||||
if ( sw && sw.SisterWeapon && (sw.Amount > 1) && ((mo.player.ReadyWeapon == sw) || ((mo.player.ReadyWeapon != sw.SisterWeapon) && !swwm_singlefirst)) )
|
||||
{
|
||||
// double draw
|
||||
Screen.DrawTexture(ico,false,x-(4.*hs),(y-4.)*hs,DTA_ScaleX,scl*hs,DTA_ScaleY,scl*hs,DTA_Alpha,salph*fade,DTA_CenterOffset,true,DTA_Color,bHasAmmo?0xFFFFFFFF:0xFF800000,DTA_ColorOverlay,(i==cursel)?0x00000000:0x40000000);
|
||||
Screen.DrawTexture(ico,false,x+(4.*hs),(y+4.)*hs,DTA_ScaleX,scl*hs,DTA_ScaleY,scl*hs,DTA_Alpha,salph*fade,DTA_CenterOffset,true,DTA_Color,bHasAmmo?0xFFFFFFFF:0xFF800000,DTA_ColorOverlay,(i==cursel)?0x00000000:0x40000000);
|
||||
}
|
||||
else Screen.DrawTexture(ico,false,x,y*hs,DTA_ScaleX,scl*hs,DTA_ScaleY,scl*hs,DTA_Alpha,salph*fade,DTA_CenterOffset,true,DTA_Color,bHasAmmo?0xFFFFFFFF:0xFF800000,DTA_ColorOverlay,(i==cursel)?0x00000000:0x40000000);
|
||||
y += sz.y*scl*.5;
|
||||
}
|
||||
y += 8.;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -330,6 +330,7 @@ Class Hellblazer : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_HELLBLAZER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Hellblazer.png";
|
||||
Inventory.PickupMessage "$I_HELLBLAZER";
|
||||
Obituary "$O_HELLBLAZER";
|
||||
SWWMWeapon.Tooltip "$TT_HELLBLAZER";
|
||||
|
|
|
|||
|
|
@ -462,6 +462,7 @@ Class Wallbuster : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_WALLBUSTER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Wallbuster.png";
|
||||
Inventory.PickupMessage "$I_WALLBUSTER";
|
||||
Obituary "$O_WALLBUSTER";
|
||||
SWWMWeapon.Tooltip "$TT_WALLBUSTER";
|
||||
|
|
|
|||
|
|
@ -251,6 +251,7 @@ Class Eviscerator : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_EVISCERATOR";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Eviscerator.png";
|
||||
Inventory.PickupMessage "$I_EVISCERATOR";
|
||||
Obituary "$O_EVISCERATOR";
|
||||
SWWMWeapon.Tooltip "$TT_EVISCERATOR";
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@ Class Ynykron : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_YNYKRON";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Ynykron.png";
|
||||
Inventory.PickupMessage "$T_YNYKRON";
|
||||
Inventory.PickupSound "misc/w_pkup_vip";
|
||||
Obituary "$O_YNYKRON";
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ Class DeepImpact : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_DEEPIMPACT";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_DeepImpact.png";
|
||||
Inventory.PickupMessage "$I_DEEPIMPACT";
|
||||
Obituary "$O_DEEPIMPACT_WEAK";
|
||||
SWWMWeapon.Tooltip "$TT_DEEPIMPACT";
|
||||
|
|
|
|||
|
|
@ -445,6 +445,7 @@ Class Spreadgun : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_SPREADGUN";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Spreadgun.png";
|
||||
Inventory.PickupMessage "$I_SPREADGUN";
|
||||
Obituary "$O_SPREADGUN";
|
||||
SWWMWeapon.Tooltip "$TT_SPREADGUN";
|
||||
|
|
|
|||
|
|
@ -211,6 +211,7 @@ Class Sparkster : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_SPARKSTER";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_Sparkster.png";
|
||||
Inventory.PickupMessage "$I_SPARKSTER";
|
||||
Obituary "$O_SPARKSTER";
|
||||
SWWMWeapon.Tooltip "$TT_SPARKSTER";
|
||||
|
|
|
|||
|
|
@ -205,8 +205,8 @@ Class ExplodiumGun : SWWMWeapon
|
|||
|
||||
override bool Use( bool pickup )
|
||||
{
|
||||
// switch to dual if already selected
|
||||
if ( Owner.player && (Owner.player.ReadyWeapon == self) && (Amount > 1) )
|
||||
// switch to dual if already selected or if first selecting (unless disabled)
|
||||
if ( Owner.player && (Amount > 1) && ((Owner.player.ReadyWeapon == self) || ((Owner.player.ReadyWeapon != SisterWeapon) && !swwm_singlefirst)) )
|
||||
{
|
||||
// if the player's current weapon is a gesture, set sister as the former weapon, to avoid breaking gesture sequences
|
||||
if ( Owner.player.ReadyWeapon is 'SWWMGesture' )
|
||||
|
|
@ -322,6 +322,7 @@ Class ExplodiumGun : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_EXPLODIUM";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_ExplodiumGun.png";
|
||||
Inventory.PickupMessage "$T_EXPLODIUM";
|
||||
Obituary "$O_EXPLODIUM";
|
||||
SWWMWeapon.Tooltip "$TT_EXPLODIUM";
|
||||
|
|
|
|||
|
|
@ -356,6 +356,7 @@ Class CandyGun : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_CANDYGUN";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_CandyGun.png";
|
||||
Inventory.PickupMessage "$I_CANDYGUN";
|
||||
Obituary "$O_CANDYGUN";
|
||||
SWWMWeapon.Tooltip "$TT_CANDYGUN";
|
||||
|
|
|
|||
|
|
@ -719,6 +719,7 @@ Class SilverBullet : SWWMWeapon
|
|||
Default
|
||||
{
|
||||
Tag "$T_SILVERBULLET";
|
||||
Inventory.Icon "graphics/HUD/Icons/W_SilverBullet.png";
|
||||
Inventory.PickupMessage "$T_SILVERBULLET";
|
||||
Obituary "$O_SILVERBULLET";
|
||||
SWWMWeapon.Tooltip "$TT_SILVERBULLET";
|
||||
|
|
|
|||