From f55abc40fb57749057d705c63d3daa5c2f0d3468 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Wed, 30 May 2018 19:24:47 +0200 Subject: [PATCH] Tweaked some drawing behaviors. Added note about HUD customization. --- readme.txt | 6 ++++++ textures.eightball | 4 ++-- zscript/eightball.zsc | 10 +++++----- zscript/enforcer.zsc | 4 ++-- zscript/pulsegun.zsc | 2 +- zscript/uthud.zsc | 14 ++++++++------ 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/readme.txt b/readme.txt index 89b2f37..a45d32c 100644 --- a/readme.txt +++ b/readme.txt @@ -46,8 +46,14 @@ In progress: - General polishing and bugfixing. - Trim out unused animations. +TODO: + + - Scaling/Customization options for the HUD. + Known bugs: - Sometimes the slave enforcer gets "lowered" while the main enforcer is reloading. No idea what causes this. - Sludge doesn't react to ceiling and wall movement. + - Pulse gun beams behave oddly when the player is on moving platforms. + This might just be a rendering interpolation glitch, as usual. \ No newline at end of file diff --git a/textures.eightball b/textures.eightball index 76fc810..99ec9b5 100644 --- a/textures.eightball +++ b/textures.eightball @@ -180,5 +180,5 @@ Sprite "EBLDH0",1,1{} Sprite "EBLDI0",1,1{} Sprite "EBLDJ0",1,1{} Sprite "EBLDK0",1,1{} -Graphic "XHAIRS99",16,16{} -Graphic "XHAIRB99",16,16{} +Graphic "XHAIRS99",1,1{} +Graphic "XHAIRB99",1,1{} diff --git a/zscript/eightball.zsc b/zscript/eightball.zsc index 973f008..1c1ec92 100644 --- a/zscript/eightball.zsc +++ b/zscript/eightball.zsc @@ -236,21 +236,21 @@ Class UTRocketLauncher : UTWeapon override void PostRender() { - if ( LockedTarget ) Screen.DrawTexture(lockontex,false,(Screen.GetWidth()-16)*0.5,(Screen.GetHeight()-16)*0.5); + if ( LockedTarget ) Screen.DrawTexture(lockontex,false,Screen.GetWidth()*0.5,Screen.GetHeight()*0.5); } override void Tick() { Super.Tick(); if ( !Owner ) return; - if ( LockedOn && (!LockedTarget || (LockedTarget.Health <= 0) || LockedTarget.bKilled || LockedTarget.bCorpse || !LockedTarget.bShootable) ) + if ( LockedOn && (!LockedTarget || (LockedTarget.Health <= 0) || !LockedTarget.bIsMonster || LockedTarget.bKilled || LockedTarget.bCorpse || !LockedTarget.bShootable) ) { LockedTarget = null; LockedOn = false; Owner.A_PlaySound("utrl/seeklost",CHAN_6); } - if ( LockedTarget ) A_SetCrosshair(99); - else A_SetCrosshair(0); + if ( LockedTarget ) crosshair = 99; + else crosshair = 0; } // consumes 1 ammo @@ -357,7 +357,7 @@ Class UTRocketLauncher : UTWeapon invoker.LockedTarget = null; while ( a = Actor(t.Next()) ) { - if ( !a.bSHOOTABLE || (a.Health <= 0) || a.bKilled || a.bCorpse || (a == self) || isTeammate(a) || !CheckSight(a) ) continue; + if ( !a.bSHOOTABLE || (a.Health <= 0) || a.bKilled || !a.bIsMonster || a.bCorpse || (a == self) || isTeammate(a) || !CheckSight(a) ) continue; Vector3 viewdir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch)); Vector3 reldir = level.Vec3Diff(Vec2OffsetZ(0,0,player.viewz),a.Vec2OffsetZ(0,0,a.pos.z+a.height*0.5)); double reldist = reldir.length(); diff --git a/zscript/enforcer.zsc b/zscript/enforcer.zsc index d9e1719..f6b3490 100644 --- a/zscript/enforcer.zsc +++ b/zscript/enforcer.zsc @@ -160,8 +160,8 @@ Class Enforcer : UTWeapon replaces Pistol override void PostRender() { if ( !CVar.GetCVar('flak_enforcerreload').GetBool() ) return; - if ( Amount > 1 ) Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,Screen.GetHeight()*0.88,String.Format("L Clip: % 2d / 20\nR Clip: % 2d / 20",slaveclipcount,clipcount)); - else Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,Screen.GetHeight()*0.88,String.Format("Clip: % 2d / 20",clipcount)); + if ( Amount > 1 ) Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,Screen.GetHeight()*0.9-confont.GetHeight()*2,String.Format("L Clip: %2d / 20\nR Clip: %2d / 20",slaveclipcount,clipcount)); + else Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,Screen.GetHeight()*0.9-confont.GetHeight(),String.Format("Clip: %2d / 20",clipcount)); } override bool HandlePickup( Inventory item ) diff --git a/zscript/pulsegun.zsc b/zscript/pulsegun.zsc index 73ee493..65609c0 100644 --- a/zscript/pulsegun.zsc +++ b/zscript/pulsegun.zsc @@ -416,7 +416,7 @@ Class PulseGun : UTWeapon override void PostRender() { if ( !CVar.GetCVar('flak_pulsereload').GetBool() ) return; - Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,Screen.GetHeight()*0.88,String.Format("Clip: % 2d / 50",clipcount)); + Screen.DrawText(confont,Font.CR_GREEN,Screen.GetWidth()*0.01,Screen.GetHeight()*0.9-confont.GetHeight(),String.Format("Clip: %2d / 50",clipcount)); } action void A_Reloading() diff --git a/zscript/uthud.zsc b/zscript/uthud.zsc index c2bc192..f2c51a3 100644 --- a/zscript/uthud.zsc +++ b/zscript/uthud.zsc @@ -192,6 +192,7 @@ Class UTHud : BaseStatusBar } // UT's implementation doesn't seem to translate well to this, so I improvised a bit and made something not so ugly + // This whole function might need to be rewritten in a prettier way someday private void UTDrawBigNum( int value, double sx = 1.0 ) { double step = 25*HScale*sx; @@ -200,6 +201,7 @@ Class UTHud : BaseStatusBar String digits = String.Format("%d",min(abs(value),9999)); double flen = 3*step; double len = digits.length()*step; + for ( int i=0; i