project_files/HedgewarsMobile/Classes/MapConfigViewController.m
changeset 6869 a187c280dd3d
parent 6832 fae8fd118da9
child 6908 896ed2afcfb8
equal deleted inserted replaced
6868:f31b5213b163 6869:a187c280dd3d
    33 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    33 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    34     return rotationManager(interfaceOrientation);
    34     return rotationManager(interfaceOrientation);
    35 }
    35 }
    36 
    36 
    37 -(IBAction) mapButtonPressed:(id) sender {
    37 -(IBAction) mapButtonPressed:(id) sender {
    38     [AudioManagerController playClickSound];
    38     [[AudioManagerController mainManager] playClickSound];
    39     [self updatePreview];
    39     [self updatePreview];
    40 }
    40 }
    41 
    41 
    42 -(void) updatePreview {
    42 -(void) updatePreview {
    43     // don't generate a new preview while it's already generating one
    43     // don't generate a new preview while it's already generating one
   288     int num = (int) (self.slider.value * 100);
   288     int num = (int) (self.slider.value * 100);
   289     if (oldValue != num) {
   289     if (oldValue != num) {
   290         [self updatePreview];
   290         [self updatePreview];
   291         oldValue = num;
   291         oldValue = num;
   292     }
   292     }
   293     [AudioManagerController playClickSound];
   293     [[AudioManagerController mainManager] playClickSound];
   294 }
   294 }
   295 
   295 
   296 // perform actions based on the activated section, then call updatePreview to visually update the selection
   296 // perform actions based on the activated section, then call updatePreview to visually update the selection
   297 // and if necessary update the table with a slide animation
   297 // and if necessary update the table with a slide animation
   298 -(IBAction) segmentedControlChanged:(id) sender {
   298 -(IBAction) segmentedControlChanged:(id) sender {
   299     NSString *mapgen, *staticmap, *mission;
   299     NSString *mapgen, *staticmap, *mission;
   300     NSInteger newPage = self.segmentedControl.selectedSegmentIndex;
   300     NSInteger newPage = self.segmentedControl.selectedSegmentIndex;
   301 
   301 
   302     [AudioManagerController playSelectSound];
   302     [[AudioManagerController mainManager] playSelectSound];
   303     switch (newPage) {
   303     switch (newPage) {
   304         case 0: // Random
   304         case 0: // Random
   305             mapgen = @"e$mapgen 0";
   305             mapgen = @"e$mapgen 0";
   306             staticmap = @"";
   306             staticmap = @"";
   307             mission = @"";
   307             mission = @"";