fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
--- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Wed Oct 26 00:30:35 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Wed Oct 26 01:17:44 2011 +0200
@@ -64,8 +64,9 @@
theOtherSwitch = (UISwitch *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]].accessoryView;
[theOtherSwitch setOn:NO animated:YES];
- if (theOtherSwitch.on)
- [AudioManagerController pauseBackgroundMusic];
+ // since switching sound on won't turn music on anyways, we can always turn off music
+ [AudioManagerController pauseBackgroundMusic];
+ [settings setObject:[NSNumber numberWithBool:NO] forKey:@"music"];
break;
case 20: //musicSwitch
// if switch above (sound) is off, never turn on
@@ -80,7 +81,6 @@
[AudioManagerController playBackgroundMusic];
else
[AudioManagerController pauseBackgroundMusic];
-
break;
case 30: //alternateSwitch
[settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"alternate"];
--- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m Wed Oct 26 00:30:35 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m Wed Oct 26 01:17:44 2011 +0200
@@ -43,16 +43,18 @@
self.previewImage.layer.borderWidth = 3.8f;
self.previewImage.layer.cornerRadius = 14;
- UIView *backView = [[UIView alloc] initWithFrame:self.tableView.frame];
- backView.backgroundColor = IS_IPAD() ? [UIColor darkBlueColorTransparent] : [UIColor blackColorTransparent];
- [self.tableView setBackgroundView:backView];
- [backView release];
- self.tableView.backgroundColor = [UIColor clearColor];
- self.tableView.layer.borderColor = IS_IPAD() ? [[UIColor darkYellowColor] CGColor] : [[UIColor whiteColor] CGColor];
+ if (IS_IPAD()) {
+ [self.tableView setBackgroundColorForAnyTable:[UIColor darkBlueColorTransparent]];
+ self.tableView.layer.borderColor = [[UIColor darkYellowColor] CGColor];
+ self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+ } else {
+ [self.tableView setBackgroundColorForAnyTable:[UIColor blackColorTransparent]];
+ self.tableView.layer.borderColor = [[UIColor whiteColor] CGColor];
+ self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
+ }
self.tableView.layer.borderWidth = 2.4f;
self.tableView.layer.cornerRadius = 8;
self.tableView.separatorColor = [UIColor whiteColor];
- self.tableView.separatorStyle = IS_IPAD() ? UITableViewCellSeparatorStyleNone : UITableViewCellSeparatorStyleSingleLine;
self.descriptionLabel.textColor = [UIColor lightYellowColor];
[super viewDidLoad];
--- a/project_files/HedgewarsMobile/ExtraCategories.m Wed Oct 26 00:30:35 2011 +0200
+++ b/project_files/HedgewarsMobile/ExtraCategories.m Wed Oct 26 01:17:44 2011 +0200
@@ -44,8 +44,9 @@
backView.backgroundColor = color;
self.backgroundView = backView;
[backView release];
- }
- self.backgroundColor = [UIColor clearColor];
+ self.backgroundColor = [UIColor clearColor];
+ } else
+ self.backgroundColor = color;
}
@end