Adjust "scripted textures" for 4.6 compat.

This commit is contained in:
Marisa the Magician 2021-05-31 10:11:26 +02:00
commit a8e018d507
2 changed files with 24 additions and 50 deletions

View file

@ -1,4 +1,4 @@
version "4.3" version "4.6"
#include "zscript/dt_libeye/projector.txt" #include "zscript/dt_libeye/projector.txt"
#include "zscript/dt_libeye/projector gl.txt" #include "zscript/dt_libeye/projector gl.txt"

View file

@ -24,26 +24,14 @@ Class PulseGunLED : Actor
SetZ(floorz); SetZ(floorz);
roll = 180; roll = 180;
angle = 180; angle = 180;
double stretch = level.pixelstretch; double halfstretch = 1.+(level.pixelstretch-1.)/2.;
double halfstretch = (1.+level.pixelstretch)/2.; if ( !base ) base = Spawn("AmmoLEDScreen",(PULSELEDBASE,PULSELEDBASE-128.,floorz+64.*halfstretch));
if ( !base )
{
base = Spawn("AmmoLEDScreen",(PULSELEDBASE,PULSELEDBASE-128.,floorz+64./halfstretch));
base.scale.y /= level.pixelstretch;
}
for ( int i=0; i<3; i++ ) for ( int i=0; i<3; i++ )
{ {
if ( !digits[i] ) if ( !digits[i] )
{ digits[i] = Spawn("LEDFont",(PULSELEDBASE+1.,PULSELEDBASE-72.+48.*i,floorz+50.*halfstretch));
digits[i] = Spawn("LEDFont",(PULSELEDBASE+1.,PULSELEDBASE-72.+48.*i,floorz+50./halfstretch));
digits[i].scale.y /= level.pixelstretch;
}
}
if ( !bar )
{
bar = Spawn("AmmoCountBar",(PULSELEDBASE+1.,PULSELEDBASE-98.,floorz-26./halfstretch));
bar.scale.y /= level.pixelstretch;
} }
if ( !bar ) bar = Spawn("AmmoCountBar",(PULSELEDBASE+1.,PULSELEDBASE-98.,floorz-26.*halfstretch));
} }
override void Tick() override void Tick()
{ {
@ -91,20 +79,12 @@ Class FlakCannonLED : Actor
SetZ(floorz); SetZ(floorz);
roll = 180; roll = 180;
angle = 180; angle = 180;
double stretch = level.pixelstretch; double halfstretch = 1.+(level.pixelstretch-1.)/2.;
double halfstretch = (1.+level.pixelstretch)/2.; if ( !base ) base = Spawn("AmmoLEDScreen",(FLAKLEDBASE,FLAKLEDBASE-64.,floorz+32.*halfstretch));
if ( !base )
{
base = Spawn("AmmoLEDScreen",(FLAKLEDBASE,FLAKLEDBASE-64.,floorz+32./halfstretch));
base.scale.y /= level.pixelstretch;
}
for ( int i=0; i<3; i++ ) for ( int i=0; i<3; i++ )
{ {
if ( !digits[i] ) if ( !digits[i] )
{ digits[i] = Spawn("LEDFont",(FLAKLEDBASE+1.,FLAKLEDBASE-30.+20.*i,floorz+16.*halfstretch));
digits[i] = Spawn("LEDFont",(FLAKLEDBASE+1.,FLAKLEDBASE-30.+20.*i,floorz+16./halfstretch));
digits[i].scale.y /= level.pixelstretch;
}
} }
} }
override void Tick() override void Tick()
@ -142,20 +122,12 @@ Class MinigunLED : Actor
SetZ(floorz); SetZ(floorz);
roll = 180; roll = 180;
angle = 180; angle = 180;
double stretch = level.pixelstretch; double halfstretch = 1.+(level.pixelstretch-1.)/2.;
double halfstretch = (1.+level.pixelstretch)/2.; if ( !base ) base = Spawn("AmmoLEDScreen",(MINILEDBASE,MINILEDBASE-32.,floorz+32.*halfstretch));
if ( !base )
{
base = Spawn("AmmoLEDScreen",(MINILEDBASE,MINILEDBASE-32.,floorz+32./halfstretch));
base.scale.y /= level.pixelstretch;
}
for ( int i=0; i<3; i++ ) for ( int i=0; i<3; i++ )
{ {
if ( !digits[i] ) if ( !digits[i] )
{ digits[i] = Spawn("LEDFont",(MINILEDBASE+1.,MINILEDBASE-30.+20.*i,floorz+16.*halfstretch));
digits[i] = Spawn("LEDFont",(MINILEDBASE+1.,MINILEDBASE-30.+20.*i,floorz+16./halfstretch));
digits[i].scale.y /= level.pixelstretch;
}
} }
} }
override void Tick() override void Tick()
@ -177,26 +149,28 @@ Class UTRocketLauncherLED : Actor
Actor base, digits[3]; Actor base, digits[3];
transient UTRocketLauncher mygun; transient UTRocketLauncher mygun;
Default
{
+NOGRAVITY;
+NOBLOCKMAP;
+NOINTERACTION;
+DONTSPLASH;
Radius .1;
Height 0;
}
override void PostBeginPlay() override void PostBeginPlay()
{ {
SetOrigin((ROCKETLEDBASE+32,ROCKETLEDBASE,0),false); SetOrigin((ROCKETLEDBASE+32,ROCKETLEDBASE,0),false);
SetZ(floorz); SetZ(floorz);
roll = 180; roll = 180;
angle = 180; angle = 180;
double stretch = level.pixelstretch; double halfstretch = 1.+(level.pixelstretch-1.)/2.;
double halfstretch = (1.+level.pixelstretch)/2.; if ( !base ) base = Spawn("AmmoLEDScreen",(ROCKETLEDBASE,ROCKETLEDBASE-32.,floorz+32.*halfstretch));
if ( !base )
{
base = Spawn("AmmoLEDScreen",(ROCKETLEDBASE,ROCKETLEDBASE-32.,floorz+32./halfstretch));
base.scale.y /= level.pixelstretch;
}
for ( int i=0; i<3; i++ ) for ( int i=0; i<3; i++ )
{ {
if ( !digits[i] ) if ( !digits[i] )
{ digits[i] = Spawn("LEDFont",(ROCKETLEDBASE+1.,ROCKETLEDBASE-30.+20.*i,floorz+16.*halfstretch));
digits[i] = Spawn("LEDFont",(ROCKETLEDBASE+1.,ROCKETLEDBASE-30.+20.*i,floorz+16./halfstretch));
digits[i].scale.y /= level.pixelstretch;
}
} }
} }
override void Tick() override void Tick()