From e3ada323868a0acc5bed82d1d3abd7cf99735d97 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Mon, 21 Aug 2023 14:21:19 +0200 Subject: [PATCH] Make PAUSED text cycle colors when bouncing. --- language.version | 4 ++-- zscript/hud/swwm_hud.zsc | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/language.version b/language.version index 819250913..d9e2cf5d0 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r937 \cu(Mon 21 Aug 11:38:08 CEST 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r937 \cu(2023-08-21 11:38:08)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r938 \cu(Mon 21 Aug 14:21:19 CEST 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r938 \cu(2023-08-21 14:21:19)\c-"; diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index 27b539b66..ab33eeaa7 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -108,7 +108,7 @@ Class SWWMStatusBar : BaseStatusBar double FrameTime; double PrevFrame; int chatopen; - int pausetime; + int pausetime, pausecol; Vector2 pausepos, pausedir; // constants @@ -453,6 +453,10 @@ Class SWWMStatusBar : BaseStatusBar override bool DrawPaused( int player ) { + static const int pausepal[] = + { + MCR_RED, MCR_ORANGE, MCR_YELLOW, MCR_GRASS, MCR_GREEN, MCR_MINT, MCR_CYAN, MCR_AQUA, MCR_BLUE, MCR_PURPLE, MCR_MAGENTA, MCR_PINK + }; let fnt = mSmallFontOutline?mSmallFontOutline:NewSmallFont; let fnt2 = mSmallFont?mSmallFont:NewConsoleFont; if ( swwm_fuzz ) @@ -469,19 +473,32 @@ Class SWWMStatusBar : BaseStatusBar pausepos.x = Screen.GetWidth()/2; pausepos.y = Screen.GetHeight()/2; pausedir = (1,1); + pausecol = 8; } else { pausepos.x += pausedir.x*CleanXFac; pausepos.y += pausedir.y*CleanYFac; if ( pausepos.x >= Screen.GetWidth()-((fnt.StringWidth(str)*3+8)*CleanXFac/2) ) + { pausedir.x = -1; + pausecol = (pausecol+1)%12; + } if ( pausepos.x < ((fnt.StringWidth(str)*3+8)*CleanXFac/2) ) + { pausedir.x = 1; + pausecol = (pausecol+1)%12; + } if ( pausepos.y >= Screen.GetHeight()-((fnt.GetHeight()*3+8)*CleanYFac/2) ) + { pausedir.y = -1; + pausecol = (pausecol+1)%12; + } if ( pausepos.y < ((fnt.GetHeight()*3+8)*CleanYFac/2) ) + { pausedir.y = 1; + pausecol = (pausecol+1)%12; + } } double xx = pausepos.x-(fnt.StringWidth(str)*3*CleanXFac)/2; double yy = pausepos.y-(fnt.GetHeight()*3*CleanYFac)/2; @@ -490,7 +507,7 @@ Class SWWMStatusBar : BaseStatusBar { int ch; [ch, pos] = str.GetNextCodePoint(pos); - Screen.DrawChar(fnt,Font.CR_BLUE,xx,yy+4*sin(32*i+8*gametic)*CleanYFac,ch,DTA_ScaleX,CleanXFac*3,DTA_ScaleY,CleanYFac*3); + Screen.DrawChar(fnt,mhudfontcol[pausepal[pausecol]],xx,yy+4*sin(32*i+8*gametic)*CleanYFac,ch,DTA_ScaleX,CleanXFac*3,DTA_ScaleY,CleanYFac*3); xx += (fnt.GetCharWidth(ch)+fnt.GetDefaultKerning())*3*CleanXFac; } yy += fnt.GetHeight()*3*CleanYFac;