Switch + Change hog tags now turns on and off all tags
authorWuzzy <Wuzzy2@mail.ru>
Wed, 14 Feb 2018 22:54:13 +0100
changeset 13004 46ba3285449a
parent 13003 22e032ab1cb7
child 13005 c5529aabdda9
Switch + Change hog tags now turns on and off all tags The previous state is remembered
ChangeLog.txt
README.md
hedgewars/uCommandHandlers.pas
hedgewars/uVariables.pas
--- a/ChangeLog.txt	Wed Feb 14 22:27:18 2018 +0100
+++ b/ChangeLog.txt	Wed Feb 14 22:54:13 2018 +0100
@@ -8,7 +8,8 @@
  + Show remaining ammo when using Birdy egg or RC Plane bomb
  + Add separate control for team chat (default: U)
  + Add separate control for changing hedgehog tags (default: Home)
- + Hedgehog tag translucency is now changed with Precise + Change hedgehog tags key
+ + Hedgehog tag translucency is now changed with [Precise] + [Change hedgehog tags]
+ + Toggle all hedgehog tags at once with [Switch] + [Change hedgehog tags]
  * Fix time box being usable in Sudden Death with 0 health decrease
  * Fix chat input key being sometimes registered twice
 
--- a/README.md	Wed Feb 14 22:27:18 2018 +0100
+++ b/README.md	Wed Feb 14 22:54:13 2018 +0100
@@ -75,7 +75,8 @@
 These are lesser-known controls of Hedgewars, they are based on your
 configured controls:
 
-* Precise + Toggle team bars: Toggle hedgehog tag translucency
+* Precise + Change hedgehog tags: Toggle hedgehog tag translucency
+* Switch + Change hedgehog tags: Turn all hedgehog tags on and off
 * Precise + Toggle team bars + Switch: Toggle HUD
 * Precise + Capture (screenshot key): Save current map + mask into Screenshot directory
 
--- a/hedgewars/uCommandHandlers.pas	Wed Feb 14 22:27:18 2018 +0100
+++ b/hedgewars/uCommandHandlers.pas	Wed Feb 14 22:54:13 2018 +0100
@@ -631,13 +631,25 @@
         cTagsMask:= cTagsMask or htTransparent
     else
         cTagsMask:= cTagsMask and (not htTransparent)
-// Just the rotate tags key: Rotate hog tags
+// Rotate Tags key + Switch: Toggle all tags on and off
+else if LocalMessage and gmSwitch = gmSwitch then
+    if ((cTagsMask and (htTeamName or htName or htHealth)) = 0) then
+        cTagsMask:= cPrevTagsMask
+    else
+        begin
+        cPrevTagsMask:= cTagsMask;
+        cTagsMask:= cTagsMask and (not (htTeamName or htName or htHealth))
+        end
+// Rotate Tags key only: Rotate hog tags
 else
+    begin
+    cPrevTagsMask:= cTagsMask;
     if ((GameFlags and gfInvulnerable) = 0) then
         cTagsMask:= cTagsMasks[cTagsMask]
     else
         cTagsMask:= cTagsMasksNoHealth[cTagsMask]
     end;
+end;
 
 procedure chSpeedup_p(var s: shortstring);
 begin
--- a/hedgewars/uVariables.pas	Wed Feb 14 22:27:18 2018 +0100
+++ b/hedgewars/uVariables.pas	Wed Feb 14 22:54:13 2018 +0100
@@ -123,6 +123,7 @@
     cSDCloudsNumber  : LongWord;
 
     cTagsMask        : byte;
+    cPrevTagsMask    : byte;
     zoom             : GLfloat;
     ZoomValue        : GLfloat;
 
@@ -2624,6 +2625,7 @@
 {$ENDIF}
 
     cTagsMask:= htTeamName or htName or htHealth;
+    cPrevTagsMask:= cTagsMask;
 end;
 
 procedure initScreenSpaceVars();