87 |
87 |
88 // the overlay is not needed any more and can be removed |
88 // the overlay is not needed any more and can be removed |
89 [[OverlayViewController mainOverlay] removeOverlay]; |
89 [[OverlayViewController mainOverlay] removeOverlay]; |
90 |
90 |
91 // engine thread *should* be done by now |
91 // engine thread *should* be done by now |
92 NSArray *stats = self.proto.statsArray; |
92 NSArray *stats = [[NSArray alloc] initWithArray:self.proto.statsArray copyItems:YES]; |
93 if (stats != nil) { |
93 if ([HWUtils gameStatus] == gsEnded && stats != nil) { |
94 StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
94 StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
95 statsPage.statsArray = stats; |
95 statsPage.statsArray = stats; |
96 statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical; |
96 statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical; |
97 if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)]) |
97 if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)]) |
98 statsPage.modalPresentationStyle = UIModalPresentationPageSheet; |
98 statsPage.modalPresentationStyle = UIModalPresentationPageSheet; |
99 |
99 |
100 [callingController presentModalViewController:statsPage animated:YES]; |
100 [callingController presentModalViewController:statsPage animated:YES]; |
101 [statsPage release]; |
101 [statsPage release]; |
102 } |
102 } |
103 [stats release]; // we retained the array before |
103 [stats release]; |
104 |
104 |
105 // can remove the savefile if the replay has ended |
105 // can remove the savefile if the replay has ended |
106 if ([HWUtils gameType] == gtSave) |
106 if ([HWUtils gameType] == gtSave) |
107 [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil]; |
107 [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil]; |
108 |
108 |