added disabling overlay touch buttons when showing envelope
[rocksndiamonds.git] / src / tools.c
index af239591b40067a32c8fdd39cb0a1ae5ac229f6c..79c2bae71a65c82449c89f881ea05b29bcf63856 100644 (file)
@@ -2820,9 +2820,13 @@ void ShowEnvelope(int envelope_nr)
   int anim_mode = graphic_info[graphic].anim_mode;
   int main_anim_mode = (anim_mode == ANIM_NONE ? ANIM_VERTICAL|ANIM_HORIZONTAL:
                        anim_mode == ANIM_DEFAULT ? ANIM_VERTICAL : anim_mode);
+  boolean overlay_enabled = GetOverlayEnabled();
 
   game.envelope_active = TRUE; // needed for RedrawPlayfield() events
 
+  SetOverlayEnabled(FALSE);
+  UnmapAllGadgets();
+
   PlayMenuSoundStereo(sound_opening, SOUND_MIDDLE);
 
   if (anim_mode == ANIM_DEFAULT)
@@ -2835,6 +2839,9 @@ void ShowEnvelope(int envelope_nr)
   else
     WaitForEventToContinue();
 
+  RemapAllGadgets();
+  SetOverlayEnabled(overlay_enabled);
+
   PlayMenuSoundStereo(sound_closing, SOUND_MIDDLE);
 
   if (anim_mode != ANIM_NONE)