Turn timer digits green when it's still the ready timer
authorWuzzy <almikes@aol.com>
Sat, 30 Apr 2016 20:35:55 +0200
changeset 11917 d3a852554aa7
parent 11916 6145efcff302
child 11918 232b57a70aca
Turn timer digits green when it's still the ready timer
hedgewars/uTypes.pas
hedgewars/uVariables.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Graphics/BigDigitsGray.png
share/hedgewars/Data/Graphics/BigDigitsGreen.png
share/hedgewars/Data/Graphics/BigDigitsRed.png
--- a/hedgewars/uTypes.pas	Sat Nov 19 06:43:44 2016 +0100
+++ b/hedgewars/uTypes.pas	Sat Apr 30 20:35:55 2016 +0200
@@ -48,8 +48,8 @@
             ptSuddenDeath, ptButtons, ptShaders);
 
     // Available sprites for displaying stuff
-    TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprFrame,
-            sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee,
+    TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprBigDigitGray, sprBigDigitGreen,
+            sprBigDigitRed, sprFrame, sprLag, sprArrow, sprBazookaShell, sprTargetP, sprBee,
             sprSmokeTrace, sprRopeHook, sprExplosion50, sprMineOff,
             sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower,
             sprClusterBomb, sprClusterParticle, sprFlame,
--- a/hedgewars/uVariables.pas	Sat Nov 19 06:43:44 2016 +0100
+++ b/hedgewars/uVariables.pas	Sat Apr 30 20:35:55 2016 +0200
@@ -338,6 +338,12 @@
             Width:   8; Height:  8; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprBomb
             (FileName:  'BigDigits'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprBigDigit
+            (FileName: 'BigDigitsGray'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprBigDigitGray
+            (FileName: 'BigDigitsGreen'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprBigDigitGreen
+            (FileName: 'BigDigitsRed'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprBigDigitRed
             (FileName:      'Frame'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:   4; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprFrame
             (FileName:        'Lag'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
--- a/hedgewars/uWorld.pas	Sat Nov 19 06:43:44 2016 +0100
+++ b/hedgewars/uWorld.pas	Sat Apr 30 20:35:55 2016 +0200
@@ -1025,7 +1025,7 @@
 
 
 procedure RenderTeamsHealth;
-var t, i, h, smallScreenOffset, TeamHealthBarWidth : LongInt;
+var t, i,  h, smallScreenOffset, TeamHealthBarWidth : LongInt;
     r: TSDL_Rect;
     highlight: boolean;
     htex: PTexture;
@@ -1159,6 +1159,7 @@
 
 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
 var i, t: LongInt;
+    spr: TSprite;
     r: TSDL_Rect;
     tdx, tdy: Double;
     s: shortstring;
@@ -1441,7 +1442,11 @@
         while i > 0 do
             begin
             dec(t, 32);
-            DrawSprite(sprBigDigit, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, i mod 10);
+            if (ReadyTimeLeft <> 0) then
+                spr := sprBigDigitGreen
+            else
+                spr := sprBigDigit;
+            DrawSprite(spr, -(cScreenWidth shr 1) + t + offsetY, cScreenHeight - offsetX, i mod 10);
             i:= i div 10
             end;
         DrawSprite(sprFrame, -(cScreenWidth shr 1) + t - 4 + offsetY, cScreenHeight - offsetX, 0);
Binary file share/hedgewars/Data/Graphics/BigDigitsGray.png has changed
Binary file share/hedgewars/Data/Graphics/BigDigitsGreen.png has changed
Binary file share/hedgewars/Data/Graphics/BigDigitsRed.png has changed