From 3a5e9ff79a2c4e85ae34b079fa6a277e8ffa5cda Mon Sep 17 00:00:00 2001 From: meancoot Date: Tue, 31 Dec 2013 12:52:24 -0500 Subject: [PATCH] (iOS) Make cocoa menu button image show up more constantly. --- apple/common/RAGameView.m | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/apple/common/RAGameView.m b/apple/common/RAGameView.m index 409e6d2111..28aae118ed 100644 --- a/apple/common/RAGameView.m +++ b/apple/common/RAGameView.m @@ -166,10 +166,24 @@ static bool g_is_syncing = true; [g_view addSubview:g_pause_indicator_view]; self.view = g_view; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showPauseIndicator) name:UIApplicationWillEnterForegroundNotification object:nil]; return self; } // Pause Menus +- (void)viewDidAppear:(BOOL)animated +{ + [self showPauseIndicator]; +} + +- (void)showPauseIndicator +{ + g_pause_indicator_view.alpha = 1.0f; + [NSObject cancelPreviousPerformRequestsWithTarget:g_instance]; + [g_instance performSelector:@selector(hidePauseButton) withObject:g_instance afterDelay:3.0f]; +} + - (void)viewWillLayoutSubviews { UIInterfaceOrientation orientation = self.interfaceOrientation; @@ -419,16 +433,8 @@ static RAScreen* get_chosen_screen() bool apple_gfx_ctx_init(void) { // Make sure the view was created - [RAGameView get]; - -#ifdef IOS // Show pause button for a few seconds, so people know it's there - g_pause_indicator_view.alpha = 1.0f; - [NSObject cancelPreviousPerformRequestsWithTarget:g_instance]; - [g_instance performSelector:@selector(hidePauseButton) withObject:g_instance afterDelay:3.0f]; -#endif - + [RAGameView get]; g_initialized = true; - return true; }