Move canvas stuff to separate files/folders.

This commit is contained in:
Mari the Deer 2022-09-08 13:56:42 +02:00
commit 58b1a7ebba
16 changed files with 159 additions and 76 deletions

View file

@ -1,3 +1,5 @@
canvastexture LOGOFADE 4 4
canvastexture SHEENLED 128 128
canvastexture QUADRLED 64 64
canvastexture MORTLED1 256 128
canvastexture MORTLED2 64 16

View file

@ -100,3 +100,13 @@ HardwareShader Texture "models/MortalGrenade_Used.png"
Define "RIMFACT" = "1.2"
Define "RIMSTEP" = ".2"
}
HardwareShader Texture "models/MortalLED.png"
{
Shader "shaders/glsl/BrightCanvas.fp"
Texture "scrtex" "MORTLED1"
}
HardwareShader Texture "models/MortalLED2.png"
{
Shader "shaders/glsl/BrightCanvas.fp"
Texture "scrtex" "MORTLED2"
}

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r414 \cu(Thu 8 Sep 00:18:01 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r414 \cu(2022-09-08 00:18:01)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r415 \cu(Thu 8 Sep 13:56:42 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r415 \cu(2022-09-08 13:56:42)\c-";

BIN
models/canvas/MortalBG.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 625 B

After

Width:  |  Height:  |  Size: 625 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 121 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 83 B

After

Width:  |  Height:  |  Size: 83 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 478 B

Before After
Before After

View file

@ -123,6 +123,7 @@ version "4.9"
#include "zscript/weapons/swwm_deathlydeathcannon.zsc"
#include "zscript/weapons/swwm_deathlydeathcannon_fx.zsc"
#include "zscript/weapons/swwm_weapons_hud.zsc"
#include "zscript/weapons/swwm_weapons_canvas.zsc"
// monsters
#include "zscript/swwm_monsters.zsc"
// DLC1 - Weapon Set
@ -148,6 +149,7 @@ version "4.9"
#include "zscript/dlc1/swwm_ultimate.zsc"
#include "zscript/dlc1/swwm_ultimate_fx.zsc"
#include "zscript/dlc1/swwm_dlcweapons_hud.zsc"
#include "zscript/dlc1/swwm_dlcweapons_canvas.zsc"
// DLC2 - Game Set
#include "zscript/dlc2/swwm_demoland.zsc"
#include "zscript/dlc2/swwm_demoshmup.zsc"

View file

@ -0,0 +1,133 @@
// RenderTexture code for DLC weapons
// Plasma Blaster
extend Class PlasmaBlast
{
override void RenderTexture( RenderEvent e )
{
// ammo display
// dynamic glow
}
}
extend Class DualPlasmaBlast
{
override void RenderTexture( RenderEvent e )
{
// render right-hand weapon's scripted textures as well
SWWMWeapon(SisterWeapon).RenderTexture(e);
// ammo display
// dynamic glow
}
}
// Sheen HMG
extend Class HeavyMahSheenGun
{
transient ui Canvas AmmoLed;
ui TextureID AmmoLedBase, AmmoLedBar, AmmoLedSpeed, AmmoLedNums;
override void RenderTexture( RenderEvent e )
{
if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("SHEENLED");
if ( !AmmoLedBase ) AmmoLedBase = TexMan.CheckForTexture("models/canvas/SheenLEDBase.png",TexMan.Type_Any);
if ( !AmmoLedBar ) AmmoLedBar = TexMan.CheckForTexture("models/canvas/SheenLEDBar.png",TexMan.Type_Any);
if ( !AmmoLedSpeed ) AmmoLedSpeed = TexMan.CheckForTexture("models/canvas/SheenLEDSpeed.png",TexMan.Type_Any);
if ( !AmmoLedNums ) AmmoLedNums = TexMan.CheckForTexture("models/canvas/SheenLEDNums.png",TexMan.Type_Any);
int d1 = Ammo1.Amount%10;
int d2 = (Ammo1.Amount/10)%10;
int d3 = (Ammo1.Amount/100)%10;
AmmoLed.DrawTexture(AmmoLedBase,false,0,0,DTA_Color,0xFF00FF00);
AmmoLed.DrawTexture(AmmoLedSpeed,false,16,16,DTA_SrcHeight,16,DTA_DestHeight,16,DTA_Color,(firespeed==0)?0xFF80FF00:0xFF408000,DTA_LegacyRenderStyle,STYLE_Add);
AmmoLed.DrawTexture(AmmoLedSpeed,false,48,16,DTA_SrcY,16,DTA_SrcHeight,16,DTA_DestHeight,16,DTA_Color,(firespeed==1)?0xFFFFFF00:0xFF808000,DTA_LegacyRenderStyle,STYLE_Add);
AmmoLed.DrawTexture(AmmoLedSpeed,false,80,16,DTA_SrcY,32,DTA_SrcHeight,16,DTA_DestHeight,16,DTA_Color,(firespeed==2)?0xFFFF8000:0xFF804000,DTA_LegacyRenderStyle,STYLE_Add);
if ( incooldown )
AmmoLed.DrawTexture(AmmoLedNums,false,16,32,DTA_SrcX,64,DTA_SrcY,64,DTA_SrcWidth,96,DTA_SrcHeight,64,DTA_DestWidth,96,DTA_DestHeight,64,DTA_Color,((gametic%8)>=4)?0xFFFF0000:0xFF800000,DTA_LegacyRenderStyle,STYLE_Add);
else
{
Vector3 rgb = SWWMUtility.HSVtoRGB(((Ammo1.Amount/4.)/Ammo1.MaxAmount,1.,1.));
Color numcol = Color(255,int(rgb.x*255),int(rgb.y*255),int(rgb.z*255));
Color blkcol = Color(255,int(rgb.x*128),int(rgb.y*128),int(rgb.z*128));
AmmoLed.DrawTexture(AmmoLedNums,false,16,32,DTA_SrcX,(d3%8)*32,DTA_SrcY,(d3/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add);
AmmoLed.DrawTexture(AmmoLedNums,false,48,32,DTA_SrcX,(d2%8)*32,DTA_SrcY,(d2/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3&&!d2)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add);
AmmoLed.DrawTexture(AmmoLedNums,false,80,32,DTA_SrcX,(d1%8)*32,DTA_SrcY,(d1/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3&&!d2&&!d1)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add);
}
double ht = barrelheat*.96;
AmmoLed.DrawTexture(AmmoLedBar,false,16,100,DTA_SrcWidth,ht,DTA_DestWidthF,ht,DTA_Color,0xFFFF0000,DTA_LegacyRenderStyle,STYLE_Add);
}
}
// Quadravol
extend Class Quadravol
{
transient ui Canvas AmmoLed;
ui TextureID AmmoLedBase, AmmoLedRound, AmmoLedCharge;
override void RenderTexture( RenderEvent e )
{
if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("QUADRLED");
if ( !AmmoLedBase ) AmmoLedBase = TexMan.CheckForTexture("models/canvas/QuadLEDBase.png",TexMan.Type_Any);
if ( !AmmoLedRound ) AmmoLedRound = TexMan.CheckForTexture("models/canvas/QuadLEDRound.png",TexMan.Type_Any);
if ( !AmmoLedCharge ) AmmoLedCharge = TexMan.CheckForTexture("models/canvas/QuadLEDCharge.png",TexMan.Type_Any);
AmmoLed.Clear(0,0,64,64,0xFF101033);
AmmoLed.DrawTexture(AmmoLedBase,false,0,0,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,0xFF00FFFF);
Color col;
switch ( chargelevel )
{
default:
col = 0xFF00FF00;
break;
case 1:
case 9:
col = 0xFF0080FF;
break;
case 2:
case 8:
col = 0xFF0000FF;
break;
case 3:
case 7:
col = 0xFF8000FF;
break;
case 4:
case 6:
col = 0xFFFF0080;
break;
case 5:
col = 0xFFFF0000;
break;
}
AmmoLed.DrawTexture(AmmoLedCharge,false,12,4,DTA_SrcX,(chargelevel%4)*64,DTA_SrcY,(chargelevel/4)*64,DTA_SrcWidth,40,DTA_SrcHeight,40,DTA_DestWidth,40,DTA_DestHeight,40,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,col);
for ( int i=0; i<clipcount; i++ ) AmmoLed.DrawTexture(AmmoLedRound,false,36-8*i,52,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,0xFFFF8000);
if ( chambered ) AmmoLed.DrawTexture(AmmoLedRound,false,52,52,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,charged?0xFF404040:0xFFFF8000);
}
}
// Ray-Khom
extend Class RayKhom
{
override void RenderTexture( RenderEvent e )
{
// ammo display
}
}
// Mortal Rifle
extend Class MisterRifle
{
override void RenderTexture( RenderEvent e )
{
// Side touchscreen
// Holo sub-screen
}
}
// Rafan-Kos
extend Class RafanKos
{
override void RenderTexture( RenderEvent e )
{
// ammo display
// dynamic glow
}
}

View file

@ -14,38 +14,6 @@ Class HeavyMahSheenGun : SWWMWeapon
transient ui SmoothDynamicValueInterpolator HeatInter;
transient SpreadSlugTracer st;
transient ui Canvas AmmoLed;
ui TextureID AmmoLedBase, AmmoLedBar, AmmoLedSpeed, AmmoLedNums;
override void RenderTexture( RenderEvent e )
{
if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("SHEENLED");
if ( !AmmoLedBase ) AmmoLedBase = TexMan.CheckForTexture("models/SheenLEDBase.png",TexMan.Type_Any);
if ( !AmmoLedBar ) AmmoLedBar = TexMan.CheckForTexture("models/SheenLEDBar.png",TexMan.Type_Any);
if ( !AmmoLedSpeed ) AmmoLedSpeed = TexMan.CheckForTexture("models/SheenLEDSpeed.png",TexMan.Type_Any);
if ( !AmmoLedNums ) AmmoLedNums = TexMan.CheckForTexture("models/SheenLEDNums.png",TexMan.Type_Any);
int d1 = Ammo1.Amount%10;
int d2 = (Ammo1.Amount/10)%10;
int d3 = (Ammo1.Amount/100)%10;
AmmoLed.DrawTexture(AmmoLedBase,false,0,0,DTA_Color,0xFF00FF00);
AmmoLed.DrawTexture(AmmoLedSpeed,false,16,16,DTA_SrcHeight,16,DTA_DestHeight,16,DTA_Color,(firespeed==0)?0xFF80FF00:0xFF408000,DTA_LegacyRenderStyle,STYLE_Add);
AmmoLed.DrawTexture(AmmoLedSpeed,false,48,16,DTA_SrcY,16,DTA_SrcHeight,16,DTA_DestHeight,16,DTA_Color,(firespeed==1)?0xFFFFFF00:0xFF808000,DTA_LegacyRenderStyle,STYLE_Add);
AmmoLed.DrawTexture(AmmoLedSpeed,false,80,16,DTA_SrcY,32,DTA_SrcHeight,16,DTA_DestHeight,16,DTA_Color,(firespeed==2)?0xFFFF8000:0xFF804000,DTA_LegacyRenderStyle,STYLE_Add);
if ( incooldown )
AmmoLed.DrawTexture(AmmoLedNums,false,16,32,DTA_SrcX,64,DTA_SrcY,64,DTA_SrcWidth,96,DTA_SrcHeight,64,DTA_DestWidth,96,DTA_DestHeight,64,DTA_Color,((gametic%8)>=4)?0xFFFF0000:0xFF800000,DTA_LegacyRenderStyle,STYLE_Add);
else
{
Vector3 rgb = SWWMUtility.HSVtoRGB(((Ammo1.Amount/4.)/Ammo1.MaxAmount,1.,1.));
Color numcol = Color(255,int(rgb.x*255),int(rgb.y*255),int(rgb.z*255));
Color blkcol = Color(255,int(rgb.x*128),int(rgb.y*128),int(rgb.z*128));
AmmoLed.DrawTexture(AmmoLedNums,false,16,32,DTA_SrcX,(d3%8)*32,DTA_SrcY,(d3/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add);
AmmoLed.DrawTexture(AmmoLedNums,false,48,32,DTA_SrcX,(d2%8)*32,DTA_SrcY,(d2/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3&&!d2)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add);
AmmoLed.DrawTexture(AmmoLedNums,false,80,32,DTA_SrcX,(d1%8)*32,DTA_SrcY,(d1/8)*64,DTA_SrcWidth,32,DTA_SrcHeight,64,DTA_DestWidth,32,DTA_DestHeight,64,DTA_Color,(!d3&&!d2&&!d1)?blkcol:numcol,DTA_LegacyRenderStyle,STYLE_Add);
}
double ht = barrelheat*.96;
AmmoLed.DrawTexture(AmmoLedBar,false,16,100,DTA_SrcWidth,ht,DTA_DestWidthF,ht,DTA_Color,0xFFFF0000,DTA_LegacyRenderStyle,STYLE_Add);
}
override void HudTick()
{
Super.HudTick();

View file

@ -11,50 +11,8 @@ Class Quadravol : SWWMWeapon
Property ClipCount : clipcount;
transient ui Canvas AmmoLed;
ui TextureID AmmoLedBase, AmmoLedRound, AmmoLedCharge;
int wastecycle; // for easter egg
override void RenderTexture( RenderEvent e )
{
if ( !AmmoLed ) AmmoLed = TexMan.GetCanvas("QUADRLED");
if ( !AmmoLedBase ) AmmoLedBase = TexMan.CheckForTexture("models/QuadLEDBase.png",TexMan.Type_Any);
if ( !AmmoLedRound ) AmmoLedRound = TexMan.CheckForTexture("models/QuadLEDRound.png",TexMan.Type_Any);
if ( !AmmoLedCharge ) AmmoLedCharge = TexMan.CheckForTexture("models/QuadLEDCharge.png",TexMan.Type_Any);
AmmoLed.Clear(0,0,64,64,0xFF101033);
AmmoLed.DrawTexture(AmmoLedBase,false,0,0,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,0xFF00FFFF);
Color col;
switch ( chargelevel )
{
default:
col = 0xFF00FF00;
break;
case 1:
case 9:
col = 0xFF0080FF;
break;
case 2:
case 8:
col = 0xFF0000FF;
break;
case 3:
case 7:
col = 0xFF8000FF;
break;
case 4:
case 6:
col = 0xFFFF0080;
break;
case 5:
col = 0xFFFF0000;
break;
}
AmmoLed.DrawTexture(AmmoLedCharge,false,12,4,DTA_SrcX,(chargelevel%4)*64,DTA_SrcY,(chargelevel/4)*64,DTA_SrcWidth,40,DTA_SrcHeight,40,DTA_DestWidth,40,DTA_DestHeight,40,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,col);
for ( int i=0; i<clipcount; i++ ) AmmoLed.DrawTexture(AmmoLedRound,false,36-8*i,52,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,0xFFFF8000);
if ( chambered ) AmmoLed.DrawTexture(AmmoLedRound,false,52,52,DTA_LegacyRenderStyle,STYLE_Shaded,DTA_FillColor,charged?0xFF404040:0xFFFF8000);
}
override bool ReportHUDAmmo()
{
return (chargelevel>0)||(chambered&&!charged)||(clipcount>0)||(Ammo1.Amount > 0);

View file

@ -0,0 +1,10 @@
// RenderTexture code for all weapons
// Ynykron Artifact
extend Class Ynykron
{
// TODO for 1.4: re-add the glowing red indicators from SWWM Platinum
override void RenderTexture( RenderEvent e )
{
}
}