Colorize switching arrows, pointing arrow and target cross in clan color
authorWuzzy <Wuzzy2@mail.ru>
Sun, 09 Dec 2018 21:13:38 +0100
changeset 14400 f39d34d78028
parent 14399 d670e4efe1ed
child 14401 694c96fb3a06
Colorize switching arrows, pointing arrow and target cross in clan color
ChangeLog.txt
hedgewars/uGearsRender.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Graphics/Finger.png
share/hedgewars/Data/Graphics/Switch.png
share/hedgewars/Data/Graphics/Targetp.png
share/hedgewars/Data/Graphics/Targetp@2x.png
--- a/ChangeLog.txt	Sun Dec 09 17:12:47 2018 +0100
+++ b/ChangeLog.txt	Sun Dec 09 21:13:38 2018 +0100
@@ -2,6 +2,7 @@
 * bugfixes
 =============== 1.0.0 (unreleased) =================
  + New chat command: “/help room” (shows room chat commands within the game)
+ + Colorize switching arrows, pointing arrow and target cross in clan color
 
 Lua API:
  + New call: SetTurnTimePaused(isPaused): Call with true to pause turn time, false to unpause
--- a/hedgewars/uGearsRender.pas	Sun Dec 09 17:12:47 2018 +0100
+++ b/hedgewars/uGearsRender.pas	Sun Dec 09 21:13:38 2018 +0100
@@ -1189,7 +1189,9 @@
 
                 dAngle := DxDy2Angle(int2hwfloat(ty - oy), int2hwfloat(tx - ox)) + 90;
 
+                Tint(Team^.Clan^.Color shl 8 or $FF);
                 DrawSpriteRotatedF(sprFinger, tx, ty, RealTicks div 32 mod 16, 1, dAngle);
+                untint;
                 end;
 
 
@@ -1264,7 +1266,13 @@
         //DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8, 1, 22, 22, (RealTicks shr 3) mod 360)
         DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1/(1+(RealTicks shr 8) mod 5), 0, 0, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8, 1, 22, 22, (RealTicks shr 3) mod 360)
     else
+        begin
+        if CurrentHedgehog <> nil then
+            Tint(CurrentHedgehog^.Team^.Clan^.Color shl 8 or $FF);
         DrawSpriteRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+        if CurrentHedgehog <> nil then
+            untint;
+        end;
 
     case Gear^.Kind of
           gtGrenade: DrawSpriteRotated(sprBomb, x, y, 0, Gear^.DirAngle);
@@ -1467,7 +1475,13 @@
                         DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0)
                         end
                     end;
-        gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (RealTicks shr 6) mod 12);
+        gtSwitcher: begin
+                    setTintAdd(true);
+                    Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
+                    DrawSprite(sprSwitch, x - 16, y - 56, (RealTicks shr 6) mod 12);
+                    untint;
+                    setTintAdd(false);
+                    end;
           gtTarget: begin
                     Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000));
                     DrawSprite(sprTarget, x - 16, y - 16, 0);
--- a/hedgewars/uWorld.pas	Sun Dec 09 17:12:47 2018 +0100
+++ b/hedgewars/uWorld.pas	Sun Dec 09 21:13:38 2018 +0100
@@ -1146,7 +1146,9 @@
             h:= -NameTagTex^.w - 24;
             if OwnerTex <> nil then
                 h:= h - OwnerTex^.w - 4;
+            Tint(TeamsArray[t]^.Clan^.Color shl 8 or $FF);
             DrawSpriteRotatedF(sprFinger, h, cScreenHeight + DrawHealthY + smallScreenOffset + 2 + SpritesData[sprFinger].Width div 4, 0, 1, -90);
+            untint;
             end;
         end;
       end;
@@ -1400,7 +1402,10 @@
         if CurAmmoType = amBee then
             spr:= sprTargetBee
         else
+            begin
             spr:= sprTargetP;
+            Tint(Team^.Clan^.Color shl 8 or $FF);
+            end;
         if replicateToLeft then
             begin
             ShiftWorld(-1);
@@ -1416,6 +1421,8 @@
             end;
 
         DrawSpriteRotatedF(spr, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+        if spr = sprTargetP then
+            untint;
         end;
     end;
 
Binary file share/hedgewars/Data/Graphics/Finger.png has changed
Binary file share/hedgewars/Data/Graphics/Switch.png has changed
Binary file share/hedgewars/Data/Graphics/Targetp.png has changed
Binary file share/hedgewars/Data/Graphics/Targetp@2x.png has changed