From: Holger Schemel Date: Thu, 15 Nov 2018 00:12:08 +0000 (+0100) Subject: fixed some bugs with (not) displaying virtual buttons X-Git-Tag: 4.1.2.0~100 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b165e8970f5f3d8f9972433960785f31b9a11723;p=rocksndiamonds.git fixed some bugs with (not) displaying virtual buttons 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. --- diff --git a/src/game.c b/src/game.c index fd774e84..71740a8f 100644 --- a/src/game.c +++ b/src/game.c @@ -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 ---------- diff --git a/src/tools.c b/src/tools.c index b2668d02..7e6424f8 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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();