fixed some bugs with (not) displaying virtual buttons
authorHolger Schemel <info@artsoft.org>
Thu, 15 Nov 2018 00:12:08 +0000 (01:12 +0100)
committerHolger Schemel <info@artsoft.org>
Thu, 15 Nov 2018 00:18:21 +0000 (01:18 +0100)
This corrects the following situations regarding virtual buttons:

* Fixed displaying virtual buttons while tapes are played.
* Fixed displaying virtual buttons after all players were gone.
* Fixed *not* displaying virtual buttons when tape stopped playing and
  the user can continue playing the game.

src/game.c
src/tools.c

index fd774e84c30b33e2c80ad0ae00346e2dc8fdf101..71740a8f4931186bbcd5a08847518cef733528d5 100644 (file)
@@ -11364,6 +11364,15 @@ static void GameActionsExt(void)
 
   SetVideoFrameDelay(game_frame_delay_value);
 
 
   SetVideoFrameDelay(game_frame_delay_value);
 
+  // (de)activate virtual buttons depending on current game status
+  if (strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS))
+  {
+    if (game.all_players_gone) // if no players there to be controlled anymore
+      SetOverlayActive(FALSE);
+    else if (!tape.playing)    // if game continues after tape stopped playing
+      SetOverlayActive(TRUE);
+  }
+
 #if 0
 #if 0
   // ---------- main game synchronization point ----------
 #if 0
 #if 0
   // ---------- main game synchronization point ----------
index b2668d026ae34c8e02ce56f9d5785ac0fe3aaec1..7e6424f8e6bb9c2c6d4f0834e15160b10438f1b8 100644 (file)
@@ -1042,8 +1042,9 @@ void FadeIn(int fade_mask)
   FADE_SXSIZE = FULL_SXSIZE;
   FADE_SYSIZE = FULL_SYSIZE;
 
   FADE_SXSIZE = FULL_SXSIZE;
   FADE_SYSIZE = FULL_SYSIZE;
 
-  if (game_status == GAME_MODE_PLAYING &&
-      strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS))
+  // activate virtual buttons depending on upcoming game status
+  if (strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS) &&
+      game_status == GAME_MODE_PLAYING && !tape.playing)
     SetOverlayActive(TRUE);
 
   SetScreenStates_AfterFadingIn();
     SetOverlayActive(TRUE);
 
   SetScreenStates_AfterFadingIn();