project_files/HedgewarsMobile/Classes/MapConfigViewController.m
changeset 6000 dbcebcd3d79f
parent 5483 fc755bb8096d
child 6078 8c0cc07731e5
equal deleted inserted replaced
5998:e8f44e9433f0 6000:dbcebcd3d79f
    38 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    38 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    39     return rotationManager(interfaceOrientation);
    39     return rotationManager(interfaceOrientation);
    40 }
    40 }
    41 
    41 
    42 -(IBAction) mapButtonPressed {
    42 -(IBAction) mapButtonPressed {
    43     playSound(@"clickSound");
    43     [AudioManagerController playClickSound];
    44     [self updatePreview];
    44     [self updatePreview];
    45 }
    45 }
    46 
    46 
    47 -(void) updatePreview {
    47 -(void) updatePreview {
    48     // don't generate a new preview while it's already generating one
    48     // don't generate a new preview while it's already generating one
   305     int num = (int) (self.slider.value * 100);
   305     int num = (int) (self.slider.value * 100);
   306     if (oldValue != num) {
   306     if (oldValue != num) {
   307         [self updatePreview];
   307         [self updatePreview];
   308         oldValue = num;
   308         oldValue = num;
   309     }
   309     }
   310     playSound(@"clickSound");
   310     [AudioManagerController playClickSound];
   311 }
   311 }
   312 
   312 
   313 // perform actions based on the activated section, then call updatePreview to visually update the selection
   313 // perform actions based on the activated section, then call updatePreview to visually update the selection
   314 // and if necessary update the table with a slide animation
   314 // and if necessary update the table with a slide animation
   315 -(IBAction) segmentedControlChanged:(id) sender {
   315 -(IBAction) segmentedControlChanged:(id) sender {
   316     NSString *mapgen, *staticmap, *mission;
   316     NSString *mapgen, *staticmap, *mission;
   317     NSInteger newPage = self.segmentedControl.selectedSegmentIndex;
   317     NSInteger newPage = self.segmentedControl.selectedSegmentIndex;
   318 
   318 
   319     playSound(@"selSound");
   319     [AudioManagerController playSelectSound];
   320     switch (newPage) {
   320     switch (newPage) {
   321         case 0: // Random
   321         case 0: // Random
   322             mapgen = @"e$mapgen 0";
   322             mapgen = @"e$mapgen 0";
   323             staticmap = @"";
   323             staticmap = @"";
   324             mission = @"";
   324             mission = @"";