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 fd774e8..71740a8 100644 (file)
@@ -11364,6 +11364,15 @@ static void GameActionsExt(void)
 
   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 ----------
index b2668d0..7e6424f 100644 (file)
@@ -1042,8 +1042,9 @@ void FadeIn(int fade_mask)
   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();