# HG changeset patch # User antonc27 # Date 1445543825 -7200 # Node ID e1bbd85a53b79f5e94aef6cf02903bc33f0c6abf # Parent 0dd98551e3f82f6677b8f6e2b97a70fefc71912e - Toolbar elements are localizable now in GameConfig for iPhone diff -r 0dd98551e3f8 -r e1bbd85a53b7 project_files/HedgewarsMobile/Classes/GameConfigViewController-iPhone.xib --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPhone.xib Thu Oct 22 03:02:43 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController-iPhone.xib Thu Oct 22 21:57:05 2015 +0200 @@ -1,438 +1,105 @@ - - - - 1792 - 14E46 - 7706 - 1348.17 - 758.70 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 7703 - - - IBProxyObject - IBUIBarButtonItem - IBUISegmentedControl - IBUIToolbar - IBUIView - IBUIViewController - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 266 - - - - 292 - {{105, 8}, {270, 30}} - - NO - 12345 - IBCocoaTouchFramework - 2 - 4 - 0 - - Map - Teams - Details - Help - - - - - - - - - - - - - - - {0, 0} - {0, 0} - {0, 0} - {0, 0} - - - - - - - - - 1 - MC42IDAuNiAwLjYAA - - - - {{0, 276}, {480, 44}} - - - NO - NO - IBCocoaTouchFramework - 1 - - - Back - IBCocoaTouchFramework - 1 - - - - IBCocoaTouchFramework - - 5 - - - IBCocoaTouchFramework - - - - - IBCocoaTouchFramework - - 5 - - - 1 - Start - IBCocoaTouchFramework - 68 - 2 - - - - - - - 274 - {480, 276} - - - - 3 - MQA - - 2 - - - YES - IBCocoaTouchFramework - - - - 274 - {480, 276} - - - - 3 - MQA - - - YES - IBCocoaTouchFramework - - - {480, 320} - - - 3 - MQA - - NO - - 3 - 3 - - - IBUISimulatedFreeformSizeMetricsSentinel - Freeform - - IBCocoaTouchFramework - - - MapConfigViewController-iPhone - - - 3 - 3 - - - IBUIScreenMetrics - IBCocoaTouchFramework - iPhone 4-inch - - YES - - - - - - {320, 568} - {568, 320} - - - 2 - - IBCocoaTouchFramework - YES - - - - 1 - - - - IBCocoaTouchFramework - YES - - - - - - IBCocoaTouchFramework - YES - - - - - - - view - - - - 3 - - - - mapConfigViewController - - - - 33 - - - - teamConfigViewController - - - - 34 - - - - schemeWeaponConfigViewController - - - - 35 - - - - buttonPressed: - - - - 17 - - - - buttonPressed: - - - - 23 - - - - segmentPressed: - - - 13 - - 29 - - - - view - - - - 42 - - - - view - - - - 43 - - - - - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - - - - - - - - 15 - - - - - - - - - - - - 16 - - - - - 18 - - - - - 19 - - - - - 21 - - - - - - - - 20 - - - - - 22 - - - - - 30 - - - - - 31 - - - - - 32 - - - - - 40 - - - TeamConfigViewController View - - - 41 - - - SchemeWeaponConfigViewController View - - - - - GameConfigViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - MapConfigViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - TeamConfigViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - SchemeWeaponConfigViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 45 - - - 0 - IBCocoaTouchFramework - NO - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 0dd98551e3f8 -r e1bbd85a53b7 project_files/HedgewarsMobile/Classes/GameConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Thu Oct 22 03:02:43 2015 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Thu Oct 22 21:57:05 2015 +0200 @@ -24,6 +24,13 @@ #import "GameInterfaceBridge.h" #import "HelpPageLobbyViewController.h" +@interface GameConfigViewController () +@property (nonatomic, retain) IBOutlet UISegmentedControl *tabsSegmentedControl; //iPhone only + +@property (nonatomic, retain) IBOutlet UIBarButtonItem *backButton; //iPhone only +@property (nonatomic, retain) IBOutlet UIBarButtonItem *startButton; //iPhone only +@end + @implementation GameConfigViewController @synthesize imgContainer, titleImage, sliderBackground, helpPage, mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController; @@ -32,6 +39,8 @@ return rotationManager(interfaceOrientation); } +#pragma mark - Buttons + -(IBAction) buttonPressed:(id) sender { UIButton *theButton = (UIButton *)sender; @@ -76,6 +85,17 @@ } } +#pragma mark - Tabs Segmented Control + +- (void)localizeTabsSegmentedControl +{ + for (NSUInteger i = 0; i < self.tabsSegmentedControl.numberOfSegments; i++) + { + NSString *oldTitle = [self.tabsSegmentedControl titleForSegmentAtIndex:i]; + [self.tabsSegmentedControl setTitle:NSLocalizedString(oldTitle, nil) forSegmentAtIndex:i]; + } +} + -(IBAction) segmentPressed:(id) sender { UISegmentedControl *theSegment = (UISegmentedControl *)sender; @@ -116,6 +136,8 @@ } +#pragma mark - + -(BOOL) isEverythingSet { // don't start playing if the preview is in progress if ([self.mapConfigViewController busy]) { @@ -302,13 +324,17 @@ self.imgContainer = nil; } --(void) viewDidLoad { +-(void) viewDidLoad +{ + [super viewDidLoad]; + self.view.backgroundColor = [UIColor blackColor]; CGRect screenRect = [[UIScreen mainScreen] safeBounds]; self.view.frame = screenRect; - if (IS_IPAD()) { + if (IS_IPAD()) + { // the label for the filter slider UILabel *backLabel = [[UILabel alloc] initWithFrame:CGRectMake(116, 714, 310, 40) andTitle:nil @@ -327,13 +353,19 @@ [self.view addSubview:maxLabel]; self.mapConfigViewController.maxLabel = maxLabel; [maxLabel release]; - } else { + } + else + { + [self localizeTabsSegmentedControl]; + + [self.backButton setTitle:NSLocalizedString(@"Back", nil)]; + [self.startButton setTitle:NSLocalizedString(@"Start", nil)]; + self.mapConfigViewController.view.frame = CGRectMake(0, 0, screenRect.size.width, screenRect.size.height-44); } + [self.view addSubview:self.mapConfigViewController.view]; [self.view bringSubviewToFront:self.mapConfigViewController.slider]; - - [super viewDidLoad]; } -(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval) duration { @@ -436,6 +468,9 @@ } -(void) dealloc { + releaseAndNil(_tabsSegmentedControl); + releaseAndNil(_backButton); + releaseAndNil(_startButton); releaseAndNil(imgContainer); releaseAndNil(titleImage); releaseAndNil(sliderBackground); diff -r 0dd98551e3f8 -r e1bbd85a53b7 project_files/HedgewarsMobile/Locale/English.lproj/Localizable.strings Binary file project_files/HedgewarsMobile/Locale/English.lproj/Localizable.strings has changed