project_files/HedgewarsMobile/Classes/MapConfigViewController.m
changeset 4351 9d155da5b417
parent 4290 82f1f1d819c0
child 4356 d1d26f8963a3
equal deleted inserted replaced
4348:d4f659e96a4a 4351:9d155da5b417
    21 
    21 
    22 #import "MapConfigViewController.h"
    22 #import "MapConfigViewController.h"
    23 #import "PascalImports.h"
    23 #import "PascalImports.h"
    24 #import "CommodityFunctions.h"
    24 #import "CommodityFunctions.h"
    25 #import "UIImageExtra.h"
    25 #import "UIImageExtra.h"
       
    26 #import "SchemeWeaponConfigViewController.h"
    26 
    27 
    27 #define scIndex         self.segmentedControl.selectedSegmentIndex
    28 #define scIndex         self.segmentedControl.selectedSegmentIndex
    28 #define isRandomness()  (segmentedControl.selectedSegmentIndex == 0 || segmentedControl.selectedSegmentIndex == 2)
    29 #define isRandomness()  (segmentedControl.selectedSegmentIndex == 0 || segmentedControl.selectedSegmentIndex == 2)
    29 
    30 
    30 @implementation MapConfigViewController
    31 @implementation MapConfigViewController
    31 @synthesize previewButton, maxHogs, seedCommand, templateFilterCommand, mapGenCommand, mazeSizeCommand, themeCommand, staticMapCommand,
    32 @synthesize previewButton, maxHogs, seedCommand, templateFilterCommand, mapGenCommand, mazeSizeCommand, themeCommand, staticMapCommand,
    32             missionCommand, tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy;
    33             missionCommand, tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy, externalController;
    33 
    34 
    34 
    35 
    35 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    36 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    36     return rotationManager(interfaceOrientation);
    37     return rotationManager(interfaceOrientation);
    37 }
    38 }
   318             mapgen = @"e$mapgen 0";
   319             mapgen = @"e$mapgen 0";
   319             staticmap = @"";
   320             staticmap = @"";
   320             mission = @"";
   321             mission = @"";
   321             [self sliderChanged:nil];
   322             [self sliderChanged:nil];
   322             self.slider.enabled = YES;
   323             self.slider.enabled = YES;
       
   324             [externalController fillSections];
   323             break;
   325             break;
   324 
   326 
   325         case 1: // Map
   327         case 1: // Map
       
   328             mapgen = @"e$mapgen 0";
       
   329             // dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap
       
   330             staticmap = @"map Bamboo";
       
   331             mission = @"";
       
   332             self.slider.enabled = NO;
       
   333             self.sizeLabel.text = NSLocalizedString(@"No filter",@"");
       
   334             [externalController fillSections];
       
   335             break;
       
   336 
       
   337         case 2: // Maze
       
   338             mapgen = @"e$mapgen 1";
       
   339             staticmap = @"";
       
   340             mission = @"";
       
   341             [self sliderChanged:nil];
       
   342             self.slider.enabled = YES;
       
   343             [externalController fillSections];
       
   344             break;
       
   345 
   326         case 3: // Mission
   346         case 3: // Mission
   327             mapgen = @"e$mapgen 0";
   347             mapgen = @"e$mapgen 0";
   328             // dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap
   348             // dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap
   329             staticmap = @"map Bamboo";
   349             staticmap = @"map Bamboo";
   330             mission = @"";
   350             mission = @"";
   331             self.slider.enabled = NO;
   351             self.slider.enabled = NO;
   332             self.sizeLabel.text = NSLocalizedString(@"No filter",@"");
   352             self.sizeLabel.text = NSLocalizedString(@"No filter",@"");
   333             break;
   353             [externalController emptySections];
   334 
       
   335         case 2: // Maze
       
   336             mapgen = @"e$mapgen 1";
       
   337             staticmap = @"";
       
   338             mission = @"";
       
   339             [self sliderChanged:nil];
       
   340             self.slider.enabled = YES;
       
   341             break;
   354             break;
   342 
   355 
   343         default:
   356         default:
   344             mapgen = nil;
   357             mapgen = nil;
   345             staticmap = nil;
   358             staticmap = nil;