From 67ef1465efbc3151174ed378ffb203848bff2251 Mon Sep 17 00:00:00 2001 From: exterlulz Date: Sun, 22 Aug 2010 11:59:30 +0200 Subject: [PATCH] fix IBActions in GameController --- English.lproj/MainMenu.xib | 30 ++++++++++-------------------- src/GameController.h | 12 ++++++------ src/GameController.m | 26 +++++++++++++++++++------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index c19e72b..f516266 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -11,8 +11,8 @@ 788 - + com.apple.InterfaceBuilder.CocoaPlugin @@ -828,14 +828,6 @@ 213 - - abortGame: - - - - 215 - - abortGameButton @@ -1155,6 +1147,14 @@ 307 + + + abortGame: + + + + 308 + @@ -1790,7 +1790,7 @@ - 307 + 308 @@ -1810,8 +1810,6 @@ id id id - id - id id id id @@ -1836,14 +1834,6 @@ prefsCustomBackgroundCheckboxAction: id - - prefsGraphicDropAction: - id - - - prefsSelectFolderButtonAction: - id - receiveHiScoreName: id diff --git a/src/GameController.h b/src/GameController.h index 4ae285a..9257361 100644 --- a/src/GameController.h +++ b/src/GameController.h @@ -109,14 +109,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - (BOOL)validateMenuItem: (NSMenuItem*) aMenuItem; - (IBAction)startNewGame:(id)sender; -- (IBAction)abortGame; -- (IBAction)receiveHiScoreName; +- (IBAction)abortGame:(id)sender; +- (IBAction)receiveHiScoreName:(id)sender; - (IBAction)togglePauseMode:(id)sender; - (IBAction)toggleMute:(id)sender; -- (IBAction)orderFrontAboutPanel; -- (IBAction)orderFrontPreferencesPanel; -- (IBAction)showHighScores; -- (IBAction)resetHighScores; +- (IBAction)orderFrontAboutPanel:(id)sender; +- (IBAction)orderFrontPreferencesPanel:(id)sender; +- (IBAction)showHighScores:(id)sender; +- (IBAction)resetHighScores:(id)sender; - (NSArray *)makeBlankHiScoresWith:(NSArray *)oldScores; diff --git a/src/GameController.m b/src/GameController.m index 0910f09..60ea866 100644 --- a/src/GameController.m +++ b/src/GameController.m @@ -321,8 +321,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. [self startAnimation:@selector(waitForFirstClick)]; } -- (IBAction)abortGame +- (IBAction)abortGame:(id)sender { + #pragma unused (sender) + [abortGameButton setEnabled:NO]; if (_paused) { [self togglePauseMode:self]; @@ -332,8 +334,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. [self waitForFirstClick]; } -- (IBAction)receiveHiScoreName +- (IBAction)receiveHiScoreName:(id)sender { + #pragma unused (sender) + int score = [hiScorePanelScoreTextField intValue]; NSString *name = [hiScorePanelNameTextField stringValue]; @@ -422,8 +426,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } -- (IBAction)orderFrontAboutPanel +- (IBAction)orderFrontAboutPanel:(id)sender { + #pragma unused (sender) + //NSLog(@"GameController showAboutPanel called"); if (!aboutPanel) { [NSBundle loadNibNamed:@"About" owner:self]; @@ -432,8 +438,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. [aboutPanel makeKeyAndOrderFront:self]; } -- (IBAction)orderFrontPreferencesPanel +- (IBAction)orderFrontPreferencesPanel:(id)sender { + #pragma unused (sender) + if (!prefsPanel) { [NSBundle loadNibNamed:@"Preferences" owner:self]; } @@ -467,8 +475,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. [prefsPanel makeKeyAndOrderFront:self]; } -- (IBAction)showHighScores +- (IBAction)showHighScores:(id)sender { + #pragma unused (sender) + // rotate which scores to show // gameNames = [hiScores objectAtIndex:gameLevel*2]; @@ -495,8 +505,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. [gameView setLastMoveDate]; //reset timer so scores show for 20s } -- (IBAction)resetHighScores +// TODO: remove (id)sender when not used? but only in header +- (IBAction)resetHighScores:(id)sender { + #pragma unused (sender) // don't rotate which scores to show // // blank the hi scores @@ -505,7 +517,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. hiScores = [[self makeBlankHiScoresWith:nil] retain]; [[NSUserDefaults standardUserDefaults] setObject:hiScores forKey:@"hiScores"]; - [self showHighScores]; //call the show scores routine + [self showHighScores:self]; //call the show scores routine } - (NSArray *)makeBlankHiScoresWith:(NSArray *)oldScores -- 2.11.4.GIT