project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
changeset 6020 c792d4b3e080
parent 6018 3b86826f6665
child 6029 5073285b6599
child 6078 8c0cc07731e5
equal deleted inserted replaced
6019:8843ea756cfc 6020:c792d4b3e080
   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