project_files/HedgewarsMobile/Classes/TeamConfigViewController.m
changeset 3780 7c704e69242e
parent 3739 97cf933e5bd2
child 3814 7af568bc0710
equal deleted inserted replaced
3779:3351a017d4ad 3780:7c704e69242e
     5 //  Created by Vittorio on 20/04/10.
     5 //  Created by Vittorio on 20/04/10.
     6 //  Copyright 2010 __MyCompanyName__. All rights reserved.
     6 //  Copyright 2010 __MyCompanyName__. All rights reserved.
     7 //
     7 //
     8 
     8 
     9 #import "TeamConfigViewController.h"
     9 #import "TeamConfigViewController.h"
       
    10 #import <QuartzCore/QuartzCore.h>
    10 #import "CommodityFunctions.h"
    11 #import "CommodityFunctions.h"
    11 #import "HogButtonView.h"
    12 #import "HogButtonView.h"
    12 #import "SquareButtonView.h"
    13 #import "SquareButtonView.h"
    13 
    14 
    14 @implementation TeamConfigViewController
    15 @implementation TeamConfigViewController
   144 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
   145 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
   145     return 40.0;
   146     return 40.0;
   146 }
   147 }
   147 
   148 
   148 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
   149 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
   149     NSString *fileToLoad;
   150     UILabel *theLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30)];
       
   151     theLabel.backgroundColor = [UIColor blueColor];
   150     if (section == 0) 
   152     if (section == 0) 
   151         fileToLoad = @"PlayingTeamsLabel.png";
   153         theLabel.text = NSLocalizedString(@"Playing Teams",@"");
   152     else
   154     else
   153         fileToLoad = @"AvailableTeamsLabel.png";
   155         theLabel.text = NSLocalizedString(@"Available Teams",@"");
       
   156     theLabel.center = CGPointMake(self.view.frame.size.width/2, 20);
       
   157     theLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
       
   158     theLabel.textAlignment = UITextAlignmentCenter;
       
   159     theLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]*80/100];
       
   160     theLabel.backgroundColor = UICOLOR_HW_DARKBLUE;
   154     
   161     
   155     UIImage *img = [[UIImage alloc] initWithContentsOfFile:fileToLoad];
   162     [theLabel.layer setBorderWidth:1.5f];
   156     UIImageView *imgView = [[[UIImageView alloc] initWithImage:img] autorelease];
   163     [theLabel.layer setBorderColor:[UICOLOR_HW_YELLOW_BODER CGColor]];
   157     [img release];
   164     [theLabel.layer setCornerRadius:8.0f];
   158 
   165     [theLabel.layer setMasksToBounds:YES];
   159     return imgView;
   166 
       
   167     UIView *theView = [[[UIView alloc] init] autorelease];
       
   168     [theView addSubview:theLabel];
       
   169     [theLabel release];
       
   170     return theView;
   160 }
   171 }
   161 
   172 
   162 /*
   173 /*
   163 -(NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section {
   174 -(NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section {
   164     if (section == 0)
   175     if (section == 0)