hedgewars/uWorld.pas
changeset 13467 854caa3c9212
parent 13465 08a3851aaf67
child 13621 0c797469d16d
--- a/hedgewars/uWorld.pas	Tue Jul 10 16:25:58 2018 +0200
+++ b/hedgewars/uWorld.pas	Tue Jul 10 16:44:13 2018 +0200
@@ -31,6 +31,7 @@
 procedure DrawWorld(Lag: LongInt);
 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
+procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt; forceDisplay : boolean);
 procedure HideMission;
 procedure SetAmmoTexts(ammoType: TAmmoType; name: ansistring; caption: ansistring; description: ansistring; autoLabels: boolean);
 procedure ShakeCamera(amount: LongInt);
@@ -1606,6 +1607,8 @@
     if missionTex <> nil then
         DrawTextureCentered(0, Min((cScreenHeight shr 1) + 100, cScreenHeight - 48 - missionTex^.h), missionTex);
     end;
+if missionTimer = 0 then
+    isForceMission := false;
 
 // fps
 {$IFDEF USE_TOUCH_INTERFACE}
@@ -1941,6 +1944,11 @@
 end;
 
 procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt);
+begin
+    ShowMission(caption, subcaption, text, icon, time, false);
+end;
+
+procedure ShowMission(caption, subcaption, text: ansistring; icon, time : LongInt; forceDisplay : boolean);
 var r: TSDL_Rect;
 begin
 if cOnlyStats then exit;
@@ -1948,6 +1956,10 @@
 r.w:= 32;
 r.h:= 32;
 
+// If true, then mission panel cannot be hidden by releasing the mission panel key.
+// Is in effect until timer runs out, is hidden with HideMission or ShowMission is called with forceDisplay=false.
+isForceMission := forceDisplay;
+
 if time = 0 then
     time:= 5000;
 missionTimer:= time;
@@ -1970,6 +1982,7 @@
 procedure HideMission;
 begin
     missionTimer:= 0;
+    isForceMission:= false;
 end;
 
 procedure SetAmmoTexts(ammoType: TAmmoType; name: ansistring; caption: ansistring; description: ansistring; autoLabels: boolean);