11
11
#include " AdjustSync.h"
12
12
#include " ActorUtil.h"
13
13
14
+ static bool previousGameplayState;
15
+
14
16
static bool IsGameplay ()
15
17
{
16
18
return SCREENMAN && SCREENMAN->GetTopScreen () && SCREENMAN->GetTopScreen ()->GetScreenType () == gameplay;
@@ -21,19 +23,30 @@ REGISTER_SCREEN_CLASS( ScreenSyncOverlay );
21
23
void ScreenSyncOverlay::Init ()
22
24
{
23
25
Screen::Init ();
24
-
25
26
m_overlay.Load (THEME->GetPathB (m_sName, " overlay" ));
26
27
AddChild (m_overlay);
28
+
29
+ // When the screen is initialized we know it will not be gameplay
30
+ // but we want Update to start in the correct state to hide help.
31
+ previousGameplayState = true ;
27
32
28
33
Update ( 0 );
29
34
}
30
35
31
36
void ScreenSyncOverlay::Update ( float fDeltaTime )
32
37
{
33
- this ->SetVisible ( IsGameplay () );
34
- if ( !IsGameplay () )
38
+ bool isGameplay = IsGameplay ();
39
+
40
+ this ->SetVisible ( isGameplay );
41
+
42
+ if ( !isGameplay )
35
43
{
36
- HideHelp ();
44
+ if ( previousGameplayState )
45
+ {
46
+ previousGameplayState = isGameplay;
47
+ HideHelp ();
48
+ }
49
+
37
50
return ;
38
51
}
39
52
@@ -125,7 +138,9 @@ static LocalizedString CANT_SYNC_WHILE_PLAYING_A_COURSE ("ScreenSyncOverlay","Ca
125
138
static LocalizedString SYNC_CHANGES_REVERTED (" ScreenSyncOverlay" ," Sync changes reverted." );
126
139
bool ScreenSyncOverlay::Input ( const InputEventPlus &input )
127
140
{
128
- if ( !IsGameplay () )
141
+ bool isGameplay = IsGameplay ();
142
+
143
+ if ( !isGameplay )
129
144
return Screen::Input (input);
130
145
131
146
if ( input.DeviceI .device != DEVICE_KEYBOARD )
@@ -283,7 +298,12 @@ bool ScreenSyncOverlay::Input( const InputEventPlus &input )
283
298
FAIL_M (ssprintf (" Invalid sync action choice: %i" , a));
284
299
}
285
300
286
- ShowHelp ();
301
+ if ( !previousGameplayState )
302
+ {
303
+ previousGameplayState = isGameplay;
304
+ ShowHelp ();
305
+ }
306
+
287
307
UpdateText ();
288
308
return true ;
289
309
}
0 commit comments