project_files/HedgewarsMobile/Classes/MapConfigViewController.m
changeset 6829 60b039d88dab
parent 6823 e54a68b9b844
child 6832 fae8fd118da9
equal deleted inserted replaced
6828:6a5d33bff0b0 6829:60b039d88dab
    19  */
    19  */
    20 
    20 
    21 
    21 
    22 #import "MapConfigViewController.h"
    22 #import "MapConfigViewController.h"
    23 #import <QuartzCore/QuartzCore.h>
    23 #import <QuartzCore/QuartzCore.h>
    24 #import "SchemeWeaponConfigViewController.h"
       
    25 
    24 
    26 #define scIndex         self.segmentedControl.selectedSegmentIndex
    25 #define scIndex         self.segmentedControl.selectedSegmentIndex
    27 #define isRandomness()  (segmentedControl.selectedSegmentIndex == 0 || segmentedControl.selectedSegmentIndex == 2)
    26 #define isRandomness()  (segmentedControl.selectedSegmentIndex == 0 || segmentedControl.selectedSegmentIndex == 2)
    28 
    27 
    29 @implementation MapConfigViewController
    28 @implementation MapConfigViewController
   307             mapgen = @"e$mapgen 0";
   306             mapgen = @"e$mapgen 0";
   308             staticmap = @"";
   307             staticmap = @"";
   309             mission = @"";
   308             mission = @"";
   310             [self sliderChanged:nil];
   309             [self sliderChanged:nil];
   311             self.slider.enabled = YES;
   310             self.slider.enabled = YES;
   312             [SchemeWeaponConfigViewController fillInstanceSections];
   311             [[NSNotificationCenter defaultCenter] postNotificationName:@"fillsections" object:nil];
   313             break;
   312             break;
   314 
   313 
   315         case 1: // Map
   314         case 1: // Map
   316             mapgen = @"e$mapgen 0";
   315             mapgen = @"e$mapgen 0";
   317             // dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap
   316             // dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap
   318             staticmap = @"map Bamboo";
   317             staticmap = @"map Bamboo";
   319             mission = @"";
   318             mission = @"";
   320             self.slider.enabled = NO;
   319             self.slider.enabled = NO;
   321             [SchemeWeaponConfigViewController fillInstanceSections];
   320             [[NSNotificationCenter defaultCenter] postNotificationName:@"fillsections" object:nil];
   322             break;
   321             break;
   323 
   322 
   324         case 2: // Maze
   323         case 2: // Maze
   325             mapgen = @"e$mapgen 1";
   324             mapgen = @"e$mapgen 1";
   326             staticmap = @"";
   325             staticmap = @"";
   327             mission = @"";
   326             mission = @"";
   328             [self sliderChanged:nil];
   327             [self sliderChanged:nil];
   329             self.slider.enabled = YES;
   328             self.slider.enabled = YES;
   330             [SchemeWeaponConfigViewController fillInstanceSections];
   329             [[NSNotificationCenter defaultCenter] postNotificationName:@"fillsections" object:nil];
   331             break;
   330             break;
   332 
   331 
   333         case 3: // Mission
   332         case 3: // Mission
   334             mapgen = @"e$mapgen 0";
   333             mapgen = @"e$mapgen 0";
   335             // dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap
   334             // dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap
   336             staticmap = @"map Bamboo";
   335             staticmap = @"map Bamboo";
   337             mission = @"";
   336             mission = @"";
   338             self.slider.enabled = NO;
   337             self.slider.enabled = NO;
   339             [SchemeWeaponConfigViewController emptyInstanceSections];
   338             [[NSNotificationCenter defaultCenter] postNotificationName:@"emptysections" object:nil];
   340             break;
   339             break;
   341 
   340 
   342         default:
   341         default:
   343             mapgen = nil;
   342             mapgen = nil;
   344             staticmap = nil;
   343             staticmap = nil;