Add separate control for changing hedgehog tags
authorWuzzy <Wuzzy2@mail.ru>
Wed, 14 Feb 2018 21:28:44 +0100
changeset 12997 f06660523198
parent 12996 2bafaeed5e2e
child 12998 22e032ab1cb7
Add separate control for changing hedgehog tags
ChangeLog.txt
QTfrontend/binds.cpp
QTfrontend/binds.h
README.md
hedgewars/uCommandHandlers.pas
hedgewars/uInputHandler.pas
--- a/ChangeLog.txt	Wed Feb 14 20:57:45 2018 +0100
+++ b/ChangeLog.txt	Wed Feb 14 21:28:44 2018 +0100
@@ -7,6 +7,7 @@
  + Add healing visual effect in Paramedics mode and a few scripts
  + 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)
  * Fix time box being usable in Sudden Death with 0 health decrease
  * Fix chat input key being sometimes registered twice
 
--- a/QTfrontend/binds.cpp	Wed Feb 14 20:57:45 2018 +0100
+++ b/QTfrontend/binds.cpp	Wed Feb 14 21:28:44 2018 +0100
@@ -69,6 +69,7 @@
     {"+speedup",  "s",          QT_TRANSLATE_NOOP("binds", "speed up replay"),         NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Demo replay:")},
     //: This refers to the team info bars (name/flag/health) of all teams. These are shown at the bottom center of the screen
     {"rotmask",   "delete",     QT_TRANSLATE_NOOP("binds", "toggle team bars"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Heads-up display:")},
+    {"rottags",   "home",       QT_TRANSLATE_NOOP("binds", "change hedgehog tags"), NULL, NULL},
 #ifdef VIDEOREC
     {"record",    "r",          QT_TRANSLATE_NOOP("binds", "record"),          NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Record video:")}
 #endif
--- a/QTfrontend/binds.h	Wed Feb 14 20:57:45 2018 +0100
+++ b/QTfrontend/binds.h	Wed Feb 14 21:28:44 2018 +0100
@@ -22,9 +22,9 @@
 #include <QString>
 
 #ifdef VIDEOREC
-#define BINDS_NUMBER 48
+#define BINDS_NUMBER 49
 #else
-#define BINDS_NUMBER 47
+#define BINDS_NUMBER 48
 #endif
 
 struct BindAction
--- a/README.md	Wed Feb 14 20:57:45 2018 +0100
+++ b/README.md	Wed Feb 14 21:28:44 2018 +0100
@@ -53,7 +53,9 @@
 * Left mouse button: Select target or weapon
 * Space bar: Shoot
 * Left shift: Precise (this is a modifier key)
-* Left shift + Up/Down: Precise aiming
+* Precise + Up/Down: Precise aiming
+* Precise + Left/Right: Turn around without walking
+* Hold down Precise: Prevent slipping on ice
 * Enter: Jump
 * Backspace: High jump
 * Backspace ×2: Backjump
@@ -73,9 +75,6 @@
 These are lesser-known controls of Hedgewars, they are based on your
 configured controls:
 
-* Hold down Precise: Prevent slipping on ice
-* Precise + Left/Right: Turn around without walking
-* Precise + Toggle team bars: Change hedgehog tags
 * 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 20:57:45 2018 +0100
+++ b/hedgewars/uCommandHandlers.pas	Wed Feb 14 21:28:44 2018 +0100
@@ -26,7 +26,7 @@
 procedure freeModule;
 
 implementation
-uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uWorld, uRandom, uCaptions
+uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uWorld, uRandom, uCaptions, uConsole
     , uVisualGearsList, uGearsHedgehog
      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF};
 
@@ -614,13 +614,6 @@
          UIDisplay:= uiNone
     else UIDisplay:= uiAll
     end
-else if LocalMessage and gmPrecise = gmPrecise then
-    begin
-    if ((GameFlags and gfInvulnerable) = 0) then
-        cTagsMask:= cTagsMasks[cTagsMask]
-    else
-        cTagsMask:= cTagsMasksNoHealth[cTagsMask]
-    end
 else
     begin
     if UIDisplay <> uiNoTeams then
@@ -629,6 +622,15 @@
     end
 end;
 
+procedure chRotateTags(var s: shortstring);
+begin
+s:= s; // avoid compiler hint
+if ((GameFlags and gfInvulnerable) = 0) then
+    cTagsMask:= cTagsMasks[cTagsMask]
+else
+    cTagsMask:= cTagsMasksNoHealth[cTagsMask]
+end;
+
 procedure chSpeedup_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
@@ -822,6 +824,7 @@
     RegisterVariable('spectate', @chFastUntilLag   , false);
     RegisterVariable('capture' , @chCapture      , true );
     RegisterVariable('rotmask' , @chRotateMask   , true );
+    RegisterVariable('rottags' , @chRotateTags   , true );
     RegisterVariable('rdriven' , @chTeamLocal    , false);
     RegisterVariable('map'     , @chSetMap       , false);
     RegisterVariable('theme'   , @chSetTheme     , false);
--- a/hedgewars/uInputHandler.pas	Wed Feb 14 20:57:45 2018 +0100
+++ b/hedgewars/uInputHandler.pas	Wed Feb 14 21:28:44 2018 +0100
@@ -281,6 +281,7 @@
     DefaultBinds[KeyNameToCode('escape')]:= 'quit';
     DefaultBinds[KeyNameToCode(_S'`')]:= 'history';
     DefaultBinds[KeyNameToCode('delete')]:= 'rotmask';
+    DefaultBinds[KeyNameToCode('home')]:= 'rottags';
 
     //numpad
     //DefaultBinds[265]:= '+volup';