project_files/HedgewarsMobile/Classes/MapConfigViewController.m
changeset 4244 bf46b4bdf27d
parent 4115 222b8016c773
child 4287 7dbdc862097c
equal deleted inserted replaced
4243:bbf7451f6b4e 4244:bf46b4bdf27d
   125 
   125 
   126     UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
   126     UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
   127     if (cell == nil)
   127     if (cell == nil)
   128         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
   128         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
   129 
   129 
   130     if (IS_IPAD())
       
   131         cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
       
   132 
       
   133     if (self.dataSourceArray == nil)
   130     if (self.dataSourceArray == nil)
   134         [self loadDataSourceArray];
   131         [self loadDataSourceArray];
   135     NSArray *source = [self.dataSourceArray objectAtIndex:scIndex];
   132     NSArray *source = [self.dataSourceArray objectAtIndex:scIndex];
   136 
   133 
   137     NSString *labelString = [source objectAtIndex:row];
   134     NSString *labelString = [source objectAtIndex:row];
   138     cell.textLabel.text = labelString;
   135     cell.textLabel.text = labelString;
   139     cell.textLabel.adjustsFontSizeToFitWidth = YES;
   136     cell.textLabel.adjustsFontSizeToFitWidth = YES;
   140     cell.textLabel.minimumFontSize = 7;
   137     cell.textLabel.minimumFontSize = 7;
       
   138     cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
   141 
   139 
   142     if (isRandomness()) {
   140     if (isRandomness()) {
   143         UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),labelString]];
   141         UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),labelString]];
   144         cell.imageView.image = image;
   142         cell.imageView.image = image;
   145         [image release];
   143         [image release];
   351     self.mapGenCommand = mapgen;
   349     self.mapGenCommand = mapgen;
   352     self.staticMapCommand = staticmap;
   350     self.staticMapCommand = staticmap;
   353     self.missionCommand = mission;
   351     self.missionCommand = mission;
   354 
   352 
   355     // nice animation for updating the table when appropriate (on iphone)
   353     // nice animation for updating the table when appropriate (on iphone)
       
   354     /*
   356     if (IS_IPAD() == NO)
   355     if (IS_IPAD() == NO)
   357         if (((oldPage == 0 || oldPage == 2) && (newPage == 1 || newPage == 3)) ||
   356         if (((oldPage == 0 || oldPage == 2) && (newPage == 1 || newPage == 3)) ||
   358             ((oldPage == 1 || oldPage == 3) && (newPage == 0 || newPage == 2)) ||
   357             ((oldPage == 1 || oldPage == 3) && (newPage == 0 || newPage == 2)) ||
   359             ((oldPage == 1 && newPage == 3) || (oldPage == 3 || newPage == 1))) {
   358             ((oldPage == 1 && newPage == 3) || (oldPage == 3 || newPage == 1))) {
   360             self.tableView.frame = CGRectMake(480, 0, 185, 276);
   359             self.tableView.frame = CGRectMake(480, 0, 185, 276);
   361             [UIView beginAnimations:@"moving in table" context:NULL];
   360             [UIView beginAnimations:@"moving in table" context:NULL];
   362             self.tableView.frame = CGRectMake(295, 0, 185, 276);
   361             self.tableView.frame = CGRectMake(295, 0, 185, 276);
   363             [UIView commitAnimations];
   362             [UIView commitAnimations];
   364         }
   363         }
       
   364     */
   365 
   365 
   366     [self.tableView reloadData];
   366     [self.tableView reloadData];
   367     [self updatePreview];
   367     [self updatePreview];
   368     oldPage = newPage;
   368     oldPage = newPage;
   369 }
   369 }
   422     self.mazeSizeCommand = @"e$maze_size 0";
   422     self.mazeSizeCommand = @"e$maze_size 0";
   423     self.mapGenCommand = @"e$mapgen 0";
   423     self.mapGenCommand = @"e$mapgen 0";
   424     self.staticMapCommand = @"";
   424     self.staticMapCommand = @"";
   425     self.missionCommand = @"";
   425     self.missionCommand = @"";
   426 
   426 
   427     if (IS_IPAD()) {
   427     if ([self.tableView respondsToSelector:@selector(setBackgroundView:)])
   428         if ([self.tableView respondsToSelector:@selector(setBackgroundView:)])
   428         [self.tableView setBackgroundView:nil];
   429             [self.tableView setBackgroundView:nil];
   429     self.view.backgroundColor = [UIColor clearColor];
   430         self.view.backgroundColor = [UIColor clearColor];
   430     self.tableView.separatorColor = UICOLOR_HW_YELLOW_BODER;
   431         self.tableView.separatorColor = UICOLOR_HW_YELLOW_BODER;
   431     self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
   432         self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
       
   433         self.tableView.rowHeight = 45;
       
   434     }
       
   435 }
   432 }
   436 
   433 
   437 -(void) viewWillAppear:(BOOL)animated {
   434 -(void) viewWillAppear:(BOOL)animated {
   438     if (self.dataSourceArray == nil)
   435     if (self.dataSourceArray == nil)
   439         [self loadDataSourceArray];
   436         [self loadDataSourceArray];