equal
deleted
inserted
replaced
163 // remove completed games notification |
163 // remove completed games notification |
164 [userDefaults setObject:@"" forKey:@"savedGamePath"]; |
164 [userDefaults setObject:@"" forKey:@"savedGamePath"]; |
165 [userDefaults synchronize]; |
165 [userDefaults synchronize]; |
166 |
166 |
167 // now we can remove the cover with a transition |
167 // now we can remove the cover with a transition |
|
168 blackView.frame = theFrame; |
|
169 blackView.alpha = 1; |
168 [UIView beginAnimations:@"fade in" context:NULL]; |
170 [UIView beginAnimations:@"fade in" context:NULL]; |
169 [UIView setAnimationDuration:1]; |
171 [UIView setAnimationDuration:1]; |
170 blackView.alpha = 0; |
172 blackView.alpha = 0; |
171 [UIView commitAnimations]; |
173 [UIView commitAnimations]; |
172 [blackView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1]; |
174 [blackView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1]; |
208 [self.engineProtocol spawnThread:self.savePath]; |
210 [self.engineProtocol spawnThread:self.savePath]; |
209 [self prepareEngineLaunch]; |
211 [self prepareEngineLaunch]; |
210 } |
212 } |
211 |
213 |
212 -(void) gameHasEndedWithStats:(NSArray *)stats { |
214 -(void) gameHasEndedWithStats:(NSArray *)stats { |
213 // display stats page |
215 // wrap this around a retain/realse to prevent being deallocated too soon |
|
216 [self retain]; |
|
217 // display stats page if there is something to display |
214 if (stats != nil) { |
218 if (stats != nil) { |
215 StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
219 StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
216 statsPage.statsArray = stats; |
220 statsPage.statsArray = stats; |
217 statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical; |
221 statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical; |
218 if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)]) |
222 if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)]) |
223 } |
227 } |
224 |
228 |
225 // can remove the savefile if the replay has ended |
229 // can remove the savefile if the replay has ended |
226 if (self.gameType == gtSave) |
230 if (self.gameType == gtSave) |
227 [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil]; |
231 [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil]; |
|
232 [self release]; |
228 } |
233 } |
229 |
234 |
230 @end |
235 @end |