Add dedicated key to display mission panel: M
authorWuzzy <Wuzzy2@mail.ru>
Tue, 10 Jul 2018 16:07:11 +0200
changeset 13465 08a3851aaf67
parent 13464 32032120435c
child 13466 c6ecb87b3231
Add dedicated key to display mission panel: M
ChangeLog.txt
QTfrontend/binds.cpp
QTfrontend/binds.h
README.md
hedgewars/uCommandHandlers.pas
hedgewars/uInputHandler.pas
hedgewars/uVariables.pas
hedgewars/uWorld.pas
--- a/ChangeLog.txt	Tue Jul 10 15:20:19 2018 +0200
+++ b/ChangeLog.txt	Tue Jul 10 16:07:11 2018 +0200
@@ -2,6 +2,7 @@
 * bugfixes
 ====================== 0.9.25 ======================
 Game:
+ + Add new key to show mission panel (default: M)
  + Add chat command “/help”, displays help for chat commands
  * Fix extreme amounts of droplets when shooting with minigun into ocean world edge
  * Fix hog being unable to walk after using sniper rifle without firing both shots
--- a/QTfrontend/binds.cpp	Tue Jul 10 15:20:19 2018 +0200
+++ b/QTfrontend/binds.cpp	Tue Jul 10 16:07:11 2018 +0200
@@ -67,8 +67,9 @@
     {"fullscr",   "f12",        QT_TRANSLATE_NOOP("binds", "change mode"),     NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle fullscreen mode:")},
     {"capture",   "c",          QT_TRANSLATE_NOOP("binds", "capture"),         NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Take a screenshot:")},
     {"+speedup",  "s",          QT_TRANSLATE_NOOP("binds", "speed up replay"),         NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Demo replay:")},
+    {"+mission",  "m",          QT_TRANSLATE_NOOP("binds", "show mission information"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Heads-up display:")},
     //: 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:")},
+    {"rotmask",   "delete",     QT_TRANSLATE_NOOP("binds", "toggle team bars"), NULL, NULL},
     {"rottags",   "home",       QT_TRANSLATE_NOOP("binds", "toggle hedgehog tags"), NULL, NULL},
 #ifdef VIDEOREC
     {"record",    "r",          QT_TRANSLATE_NOOP("binds", "record"),          NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Record video:")}
--- a/QTfrontend/binds.h	Tue Jul 10 15:20:19 2018 +0200
+++ b/QTfrontend/binds.h	Tue Jul 10 16:07:11 2018 +0200
@@ -22,9 +22,9 @@
 #include <QString>
 
 #ifdef VIDEOREC
-#define BINDS_NUMBER 49
+#define BINDS_NUMBER 50
 #else
-#define BINDS_NUMBER 48
+#define BINDS_NUMBER 49
 #endif
 
 struct BindAction
--- a/README.md	Tue Jul 10 15:20:19 2018 +0200
+++ b/README.md	Tue Jul 10 16:07:11 2018 +0200
@@ -63,8 +63,9 @@
 * Tab: Switch hedgehog (after activating the utility)
 * 1-5: Set weapon timer
 * F1-F10: Weapon shortcuts
+* M: Mission panel / game mode information. Hold pressed to display, release to hide
 * P: Pause, when playing offline, toggle automatic turn skipping when online
-* Esc: Quit with prompt (also shows mission panel)
+* Esc: Quit with prompt
 * T: Chat
 * U: Team chat
 
--- a/hedgewars/uCommandHandlers.pas	Tue Jul 10 15:20:19 2018 +0200
+++ b/hedgewars/uCommandHandlers.pas	Tue Jul 10 16:07:11 2018 +0200
@@ -834,6 +834,19 @@
   cAdvancedMapGenMode:= true;
 end;
 
+procedure chShowMission_p(var s: shortstring);
+begin
+  s:= s; // avoid compiler hint
+  isShowMission:= true;
+end;
+
+procedure chShowMission_m(var s: shortstring);
+begin
+  s:= s; // avoid compiler hint
+  isShowMission:= false;
+  HideMission();
+end;
+
 procedure initModule;
 begin
 //////// Begin top sorted by freq analysis not including chatmsg
@@ -922,6 +935,8 @@
     RegisterVariable('record'  , @chRecord       , true );
     RegisterVariable('worldedge',@chWorldEdge    , false);
     RegisterVariable('advmapgen',@chAdvancedMapGenMode, false);
+    RegisterVariable('+mission', @chShowMission_p, true);
+    RegisterVariable('-mission', @chShowMission_m, true);
 end;
 
 procedure freeModule;
--- a/hedgewars/uInputHandler.pas	Tue Jul 10 15:20:19 2018 +0200
+++ b/hedgewars/uInputHandler.pas	Tue Jul 10 16:07:11 2018 +0200
@@ -357,6 +357,7 @@
     RegisterBind(DefaultBinds, _S'`', 'history');
     RegisterBind(DefaultBinds, 'delete', 'rotmask');
     RegisterBind(DefaultBinds, 'home', 'rottags');
+    RegisterBind(DefaultBinds, 'm', '+mission');
 
     //numpad
     //DefaultBinds[265]:= '+volup';
--- a/hedgewars/uVariables.pas	Tue Jul 10 15:20:19 2018 +0200
+++ b/hedgewars/uVariables.pas	Tue Jul 10 16:07:11 2018 +0200
@@ -78,6 +78,7 @@
     isInMultiShoot  : boolean;
     isSpeed         : boolean;
     isAFK           : boolean;
+    isShowMission   : boolean;
     SpeedStart      : LongWord;
 
     fastUntilLag    : boolean;
@@ -2843,6 +2844,7 @@
     isInMultiShoot  := false;
     isSpeed         := false;
     isAFK           := false;
+    isShowMission   := false;
     SpeedStart      := 0;
     fastUntilLag    := false;
     fastScrolling   := false;
--- a/hedgewars/uWorld.pas	Tue Jul 10 15:20:19 2018 +0200
+++ b/hedgewars/uWorld.pas	Tue Jul 10 16:07:11 2018 +0200
@@ -1597,7 +1597,7 @@
     DrawTextureCentered(0, (cScreenHeight shr 1), PauseTexture);
 if isAFK then
     DrawTextureCentered(0, (cScreenHeight shr 1), AFKTexture);
-if not isFirstFrame and (missionTimer <> 0) or isPaused or fastUntilLag or (GameState = gsConfirm) then
+if not isFirstFrame and (missionTimer <> 0) or isShowMission or isPaused or fastUntilLag or (GameState = gsConfirm) then
     begin
     if (ReadyTimeLeft = 0) and (missionTimer > 0) then
         dec(missionTimer, Lag);