project_files/HedgewarsMobile/Classes/SavedGamesViewController.m
changeset 4115 222b8016c773
parent 4082 bfe14b38dad1
child 4362 8dae325dc625
equal deleted inserted replaced
4114:b4c31cea013e 4115:222b8016c773
    38 
    38 
    39     [self.tableView reloadData];
    39     [self.tableView reloadData];
    40 }
    40 }
    41 
    41 
    42 -(void) viewDidLoad {
    42 -(void) viewDidLoad {
    43     if ([UITableView respondsToSelector:@selector(setBackgroundView:)])
    43     if ([self.tableView respondsToSelector:@selector(setBackgroundView:)])
    44         self.tableView.backgroundView = nil;
    44         self.tableView.backgroundView = nil;
    45 
    45 
    46     NSString *imgName;
    46     NSString *imgName;
    47     if (IS_IPAD())
    47     if (IS_IPAD())
    48         imgName = @"mediumBackground~ipad.png";
    48         imgName = @"mediumBackground~ipad.png";
   163 -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger) section {
   163 -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger) section {
   164     UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 50)];
   164     UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 50)];
   165     footer.backgroundColor = [UIColor clearColor];
   165     footer.backgroundColor = [UIColor clearColor];
   166     
   166     
   167     UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width*80/100, 100)];
   167     UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width*80/100, 100)];
   168     label.center = CGPointMake(self.tableView.frame.size.width/2,70);
   168     label.center = CGPointMake(self.tableView.frame.size.width/2, 70);
   169     label.textAlignment = UITextAlignmentCenter;
   169     label.textAlignment = UITextAlignmentCenter;
   170     label.font = [UIFont systemFontOfSize:16];
   170     label.font = [UIFont systemFontOfSize:16];
   171     label.textColor = [UIColor lightGrayColor];
   171     label.textColor = [UIColor lightGrayColor];
   172     label.numberOfLines = 5;
   172     label.numberOfLines = 5;
   173     label.text = NSLocalizedString(@"Games are automatically saved and can be resumed by selecting an entry above.\nYou can modify this list by pressing the 'Edit' button.\nNotice that completed games are deleted, so make backups.",@"");
   173     label.text = NSLocalizedString(@"Games are automatically saved and can be resumed by selecting an entry above.\nYou can modify this list by pressing the 'Edit' button.\nNotice that completed games are deleted, so make backups.",@"");
   174 
   174 
   175     label.backgroundColor = [UIColor clearColor];
   175     label.backgroundColor = [UIColor clearColor];
   176     [footer addSubview:label];
   176     [footer addSubview:label];
   177     [label release];
   177     [label release];
   178     return [footer autorelease];
   178     return [footer autorelease];
       
   179 }
       
   180 
       
   181 -(CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
       
   182     return 125;
   179 }
   183 }
   180 
   184 
   181 -(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
   185 -(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
   182     NSUInteger row = [indexPath row];
   186     NSUInteger row = [indexPath row];
   183     [(EditableCellView *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:0]] save:nil];
   187     [(EditableCellView *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:0]] save:nil];