diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-04-02 18:01:28 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-04-02 18:01:28 +0000 |
| commit | ebc8e55d33f011d9c44a5c76f463c99950f0e973 (patch) | |
| tree | 715e11e8bff5125725a1600efbf3a4912b958a82 /macosx/PcsxrMemCardController.m | |
| parent | 761714b617e99eaa5009ccf73e637367c41e3bb2 (diff) | |
| download | pcsxr-ebc8e55d33f011d9c44a5c76f463c99950f0e973.tar.gz | |
OS X:
Stop the memory card images from animating when the preferences window closes.
Other changes and improvements.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@89782 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrMemCardController.m')
| -rwxr-xr-x | macosx/PcsxrMemCardController.m | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m index 0620fbf4..7fb139ea 100755 --- a/macosx/PcsxrMemCardController.m +++ b/macosx/PcsxrMemCardController.m @@ -25,6 +25,20 @@ @synthesize memCard1Array; @synthesize memCard2Array; +- (void)stopMemoryAnimation +{ + [self.imageAnimateTimer invalidate]; + self.imageAnimateTimer = nil; +} + +- (void)beginMemoryAnimation +{ + if (!_imageAnimateTimer) { + self.imageAnimateTimer = [[NSTimer alloc] initWithFireDate:[NSDate date] interval:0.30 target:self selector:@selector(animateMemCards:) userInfo:nil repeats:YES]; + [[NSRunLoop mainRunLoop] addTimer:self.imageAnimateTimer forMode:NSRunLoopCommonModes]; + } +} + - (void)setupValues:(int)theCards { NSParameterAssert(theCards < 4 && theCards > 0); @@ -84,8 +98,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(memoryCardDidChangeNotification:) name:memChangeNotifier object:nil]; - self.imageAnimateTimer = [[NSTimer alloc] initWithFireDate:[NSDate date] interval:3.0/10.0 target:self selector:@selector(animateMemCards:) userInfo:nil repeats:YES]; - [[NSRunLoop mainRunLoop] addTimer:self.imageAnimateTimer forMode:NSRunLoopCommonModes]; + [self beginMemoryAnimation]; } - (void)animateMemCards:(NSTimer*)theTimer @@ -216,16 +229,6 @@ } } -- (IBAction)changeMemCard:(id)sender -{ - [ConfigurationController mcdChangeClicked:sender]; -} - -- (IBAction)newMemCard:(id)sender -{ - [ConfigurationController mcdNewClicked:sender]; -} - - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; |
