project_files/HedgewarsMobile/Classes/TeamConfigViewController.m
author nemo
Sun, 04 Sep 2011 13:36:59 -0400
changeset 5771 e3a047e84e19
parent 5208 878e551f0b4a
child 5976 306cedbeb213
permissions -rw-r--r--
by request of shoppa player, remove land spray from shoppa wep set
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
     1
/*
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
4976
088d40d8aba2 Happy 2011 :)
koda
parents: 4920
diff changeset
     3
 * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
     4
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
     8
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    12
 * GNU General Public License for more details.
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    13
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    14
 * You should have received a copy of the GNU General Public License
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    15
 * along with this program; if not, write to the Free Software
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    17
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    18
 * File created on 20/04/2010.
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    19
 */
81db3c85784b headers ftw, also right project file
koda
parents: 3814
diff changeset
    20
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    21
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    22
#import "TeamConfigViewController.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    23
#import "CommodityFunctions.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    24
#import "SquareButtonView.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    25
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    26
@implementation TeamConfigViewController
3739
97cf933e5bd2 disable AI teleport
koda
parents: 3703
diff changeset
    27
@synthesize listOfTeams, listOfSelectedTeams, cachedContentsOfDir;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    28
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    29
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    30
#pragma mark View lifecycle
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    31
-(void) viewDidLoad {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    32
    [super viewDidLoad];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
    33
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    34
    CGSize screenSize = [[UIScreen mainScreen] bounds].size;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    35
    self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
4082
bfe14b38dad1 better support for wimpier i-devices
koda
parents: 3983
diff changeset
    36
4244
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    37
    if ([self.tableView respondsToSelector:@selector(setBackgroundView:)]) {
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    38
        if (IS_IPAD())
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    39
            [self.tableView setBackgroundView:nil];
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    40
        else {
4356
d1d26f8963a3 update some files for new graphics and new ios4.2
koda
parents: 4284
diff changeset
    41
            UIImage *backgroundImage = [[UIImage alloc] initWithContentsOfFile:@"background~iphone.png"];
4244
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    42
            UIImageView *background = [[UIImageView alloc] initWithImage:backgroundImage];
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    43
            [backgroundImage release];
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    44
            [self.tableView setBackgroundView:background];
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    45
            [background release];
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    46
        }
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    47
    } else
4244
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    48
        self.view.backgroundColor = [UIColor blackColor];
bf46b4bdf27d iphone interface
koda
parents: 4115
diff changeset
    49
3917
4c243b1eac97 playing a bit with colors
koda
parents: 3829
diff changeset
    50
    self.tableView.separatorColor = UICOLOR_HW_YELLOW_BODER;
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
    51
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    52
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    53
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    54
-(void) viewWillAppear:(BOOL)animated {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    55
    [super viewWillAppear:animated];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    56
3739
97cf933e5bd2 disable AI teleport
koda
parents: 3703
diff changeset
    57
    NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:TEAMS_DIRECTORY() error:NULL];
3551
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    58
    // avoid overwriting selected teams when returning on this view
3971
5c82ee165ed5 minor stuff
koda
parents: 3917
diff changeset
    59
    if ([self.cachedContentsOfDir isEqualToArray:contentsOfDir] == NO) {
3917
4c243b1eac97 playing a bit with colors
koda
parents: 3829
diff changeset
    60
        NSArray *colors = getAvailableColors();
3551
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    61
        NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[contentsOfDir count]];
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    62
        for (int i = 0; i < [contentsOfDir count]; i++) {
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    63
            NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    64
                                         [contentsOfDir objectAtIndex:i],@"team",
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    65
                                         [NSNumber numberWithInt:4],@"number",
3917
4c243b1eac97 playing a bit with colors
koda
parents: 3829
diff changeset
    66
                                         [colors objectAtIndex:i%[colors count]],@"color",nil];
3551
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    67
            [array addObject:dict];
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    68
            [dict release];
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    69
        }
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    70
        self.listOfTeams = array;
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    71
        [array release];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
    72
3551
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    73
        NSMutableArray *emptyArray = [[NSMutableArray alloc] initWithObjects:nil];
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    74
        self.listOfSelectedTeams = emptyArray;
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    75
        [emptyArray release];
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    76
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    77
        selectedTeamsCount = [self.listOfSelectedTeams count];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    78
        allTeamsCount = [self.listOfTeams count];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    79
4920
bc3c077e15a2 cleaning up how chat is handled on idevices
koda
parents: 4811
diff changeset
    80
        NSArray *contents = [[NSArray alloc] initWithArray:contentsOfDir copyItems:YES];
bc3c077e15a2 cleaning up how chat is handled on idevices
koda
parents: 4811
diff changeset
    81
        self.cachedContentsOfDir = contents;
bc3c077e15a2 cleaning up how chat is handled on idevices
koda
parents: 4811
diff changeset
    82
        [contents release];
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    83
    }
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    84
    [self.tableView reloadData];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    85
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    86
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    87
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    88
    return rotationManager(interfaceOrientation);
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    89
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    90
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    91
-(NSInteger) filterNumberOfHogs:(NSInteger) hogs {
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    92
    NSInteger numberOfHogs;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    93
    if (hogs <= HW_getMaxNumberOfHogs() && hogs >= 1)
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    94
        numberOfHogs = hogs;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    95
    else {
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    96
        if (hogs > HW_getMaxNumberOfHogs())
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    97
            numberOfHogs = 1;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    98
        else
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
    99
            numberOfHogs = HW_getMaxNumberOfHogs();
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   100
    }
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   101
    return numberOfHogs;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   102
}
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   103
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   104
-(UIImage *)drawHogsRepeated:(NSInteger) manyTimes {
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   105
    UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:HEDGEHOG_FILE()];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   106
    CGFloat screenScale = getScreenScale();
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   107
    int w = hogSprite.size.width * screenScale;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   108
    int h = hogSprite.size.height * screenScale;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   109
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   110
    CGContextRef context = CGBitmapContextCreate(NULL, w * 3, h, 8, 4 * w * 3, colorSpace, kCGImageAlphaPremultipliedFirst);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   111
    
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   112
    // draw the two images in the current context
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   113
    for (int i = 0; i < manyTimes; i++)
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   114
        CGContextDrawImage(context, CGRectMake(i*8*screenScale, 0, w, h), [hogSprite CGImage]);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   115
    [hogSprite release];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   116
    
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   117
    // Create bitmap image info from pixel data in current context
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   118
    CGImageRef imageRef = CGBitmapContextCreateImage(context);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   119
    
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   120
    // Create a new UIImage object
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   121
    UIImage *resultImage;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   122
    if ([self respondsToSelector:@selector(imageWithCGImage:scale:orientation:)])
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   123
        resultImage = [UIImage imageWithCGImage:imageRef scale:screenScale orientation:UIImageOrientationUp];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   124
    else
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   125
        resultImage = [UIImage imageWithCGImage:imageRef];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   126
    
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   127
    // Release colorspace, context and bitmap information
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   128
    CGColorSpaceRelease(colorSpace);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   129
    CGContextRelease(context);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   130
    CFRelease(imageRef);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   131
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   132
    return resultImage;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   133
}
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   134
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   135
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   136
#pragma mark Table view data source
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   137
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   138
    return 2;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   139
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   140
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   141
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   142
    if (section == 0)
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   143
        return selectedTeamsCount;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   144
    else
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   145
        return allTeamsCount;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   146
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   147
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   148
// Customize the appearance of table view cells.
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   149
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   150
    static NSString *CellIdentifier0 = @"Cell0";
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   151
    static NSString *CellIdentifier1 = @"Cell1";
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   152
    NSInteger section = [indexPath section];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   153
    UITableViewCell *cell;
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   154
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   155
    if (section == 0) {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   156
        cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier0];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   157
        if (cell == nil) {
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   158
            cell = [[[HoldTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier0] autorelease];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   159
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   160
            SquareButtonView *squareButton = [[SquareButtonView alloc] initWithFrame:CGRectMake(0, 0, 36, 36)];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   161
            cell.accessoryView = squareButton;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   162
            [squareButton release];
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   163
        }
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   164
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   165
        NSMutableDictionary *selectedRow = [listOfSelectedTeams objectAtIndex:[indexPath row]];
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   166
        cell.textLabel.text = [[selectedRow objectForKey:@"team"] stringByDeletingPathExtension];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   167
        cell.textLabel.backgroundColor = [UIColor clearColor];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   168
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   169
        SquareButtonView *squareButton = (SquareButtonView *)cell.accessoryView;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   170
        [squareButton selectColor:[[selectedRow objectForKey:@"color"] intValue]];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   171
        NSNumber *hogNumber = [selectedRow objectForKey:@"number"];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   172
        [squareButton setTitle:[hogNumber stringValue] forState:UIControlStateNormal];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   173
        squareButton.ownerDictionary = selectedRow;
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   174
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   175
        cell.imageView.image = [self drawHogsRepeated:[hogNumber intValue]];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   176
        ((HoldTableViewCell *)cell).delegate = self;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   177
    } else {
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   178
        cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier1];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   179
        if (cell == nil)
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   180
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   181
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   182
        cell.textLabel.text = [[[listOfTeams objectAtIndex:[indexPath row]] objectForKey:@"team"] stringByDeletingPathExtension];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   183
        cell.textLabel.backgroundColor = [UIColor clearColor];
3814
7af568bc0710 discrimination between ai and humans
koda
parents: 3780
diff changeset
   184
        
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   185
        NSString *teamPath = [NSString stringWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),cell.textLabel.text];
3814
7af568bc0710 discrimination between ai and humans
koda
parents: 3780
diff changeset
   186
        NSDictionary *firstHog = [[[NSDictionary dictionaryWithContentsOfFile:teamPath] objectForKey:@"hedgehogs"] objectAtIndex:0];
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   187
        if ([[firstHog objectForKey:@"level"] intValue] != 0) {
4811
3edc0cdcfe03 add new robot badge to sources
koda
parents: 4538
diff changeset
   188
            NSString *filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Settings/Images/robotBadge.png"];
3edc0cdcfe03 add new robot badge to sources
koda
parents: 4538
diff changeset
   189
            UIImage *sprite = [[UIImage alloc] initWithContentsOfFile:filePath];
3814
7af568bc0710 discrimination between ai and humans
koda
parents: 3780
diff changeset
   190
            UIImageView *spriteView = [[UIImageView alloc] initWithImage:sprite];
7af568bc0710 discrimination between ai and humans
koda
parents: 3780
diff changeset
   191
            [sprite release];
7af568bc0710 discrimination between ai and humans
koda
parents: 3780
diff changeset
   192
            
7af568bc0710 discrimination between ai and humans
koda
parents: 3780
diff changeset
   193
            cell.accessoryView = spriteView;
7af568bc0710 discrimination between ai and humans
koda
parents: 3780
diff changeset
   194
            [spriteView release];
7af568bc0710 discrimination between ai and humans
koda
parents: 3780
diff changeset
   195
        } else
7af568bc0710 discrimination between ai and humans
koda
parents: 3780
diff changeset
   196
            cell.accessoryView = nil;
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   197
    }
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   198
3917
4c243b1eac97 playing a bit with colors
koda
parents: 3829
diff changeset
   199
    cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   200
    cell.backgroundColor = UICOLOR_HW_ALMOSTBLACK;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   201
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   202
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   203
    return cell;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   204
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   205
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
   206
-(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
   207
    return 40.0;
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
   208
}
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
   209
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
   210
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
3983
aa24192417a8 use labels instead of images, should save ram and space
koda
parents: 3971
diff changeset
   211
    CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
aa24192417a8 use labels instead of images, should save ram and space
koda
parents: 3971
diff changeset
   212
    NSString *text;
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   213
    if (section == 0)
3983
aa24192417a8 use labels instead of images, should save ram and space
koda
parents: 3971
diff changeset
   214
        text = NSLocalizedString(@"Playing Teams",@"");
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
   215
    else
3983
aa24192417a8 use labels instead of images, should save ram and space
koda
parents: 3971
diff changeset
   216
        text = NSLocalizedString(@"Available Teams",@"");
aa24192417a8 use labels instead of images, should save ram and space
koda
parents: 3971
diff changeset
   217
    UILabel *theLabel = createBlueLabel(text, frame);
3780
7c704e69242e fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents: 3739
diff changeset
   218
    theLabel.center = CGPointMake(self.view.frame.size.width/2, 20);
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
   219
3780
7c704e69242e fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents: 3739
diff changeset
   220
    UIView *theView = [[[UIView alloc] init] autorelease];
7c704e69242e fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents: 3739
diff changeset
   221
    [theView addSubview:theLabel];
7c704e69242e fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents: 3739
diff changeset
   222
    [theLabel release];
7c704e69242e fade in when returning from game, labels rewritten so that they are drawn at runtime (more flexibility with i18n and iphone support)
koda
parents: 3739
diff changeset
   223
    return theView;
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
   224
}
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3697
diff changeset
   225
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   226
-(CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
4538
4c2dc9d75742 add more space for this help message on ipad
koda
parents: 4504
diff changeset
   227
    return IS_IPAD() ? 40 : 20;
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   228
}
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   229
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   230
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger) section {
4538
4c2dc9d75742 add more space for this help message on ipad
koda
parents: 4504
diff changeset
   231
    NSInteger height = IS_IPAD() ? 40 : 20;
4c2dc9d75742 add more space for this help message on ipad
koda
parents: 4504
diff changeset
   232
    UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, height)];
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   233
    footer.backgroundColor = [UIColor clearColor];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   234
4538
4c2dc9d75742 add more space for this help message on ipad
koda
parents: 4504
diff changeset
   235
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width*80/100, height)];
4c2dc9d75742 add more space for this help message on ipad
koda
parents: 4504
diff changeset
   236
    label.center = CGPointMake(self.tableView.frame.size.width/2, height/2);
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   237
    label.textAlignment = UITextAlignmentCenter;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   238
    label.font = [UIFont italicSystemFontOfSize:12];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   239
    label.textColor = [UIColor whiteColor];
4538
4c2dc9d75742 add more space for this help message on ipad
koda
parents: 4504
diff changeset
   240
    label.numberOfLines = 2;
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   241
    if (section == 0)
4538
4c2dc9d75742 add more space for this help message on ipad
koda
parents: 4504
diff changeset
   242
        label.text = NSLocalizedString(@"Tap to add hogs or change color, touch and hold to remove a team.",@"");
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   243
    else
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   244
        label.text = NSLocalizedString(@"The robot badge indicates an AI-controlled team.",@"");
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   245
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   246
    label.backgroundColor = [UIColor clearColor];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   247
    [footer addSubview:label];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   248
    [label release];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   249
    return [footer autorelease];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   250
}
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   251
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   252
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   253
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   254
#pragma mark Table view delegate
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   255
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   256
    NSInteger row = [indexPath row];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   257
    NSInteger section = [indexPath section];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   258
4486
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   259
    if (section == 1 && [self.listOfTeams count] > row) {
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   260
        [self.listOfSelectedTeams addObject:[self.listOfTeams objectAtIndex:row]];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   261
        [self.listOfTeams removeObjectAtIndex:row];
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   262
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   263
        NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:selectedTeamsCount inSection:0];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   264
        allTeamsCount--;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   265
        selectedTeamsCount++;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   266
        [aTableView beginUpdates];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   267
        [aTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationRight];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   268
        [aTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   269
        [aTableView endUpdates];
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   270
    }
4486
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   271
    if (section == 0 && [self.listOfSelectedTeams count] > row) {
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   272
        NSMutableDictionary *selectedRow = [self.listOfSelectedTeams objectAtIndex:row];
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   273
        UITableViewCell *cell = [aTableView cellForRowAtIndexPath:indexPath];
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   274
        SquareButtonView *squareButton = (SquareButtonView *)cell.accessoryView;
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   275
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   276
        NSInteger increaseNumber = [[selectedRow objectForKey:@"number"] intValue] + 1;
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   277
        NSNumber *newNumber = [NSNumber numberWithInt:[self filterNumberOfHogs:increaseNumber]];
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   278
        [squareButton setTitle:[newNumber stringValue] forState:UIControlStateNormal];
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   279
        [selectedRow setObject:newNumber forKey:@"number"];
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   280
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   281
        cell.imageView.image = [self drawHogsRepeated:[newNumber intValue]];
2c8e4d859d37 fix crasher (somehow, might be glitchy)
koda
parents: 4476
diff changeset
   282
    }
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   283
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   284
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   285
-(void) holdAction:(NSString *)content {
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   286
    NSInteger row;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   287
    for (row = 0; row < [self.listOfSelectedTeams count]; row++) {
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   288
        NSDictionary *dict = [self.listOfSelectedTeams objectAtIndex:row];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   289
        if ([content isEqualToString:[[dict objectForKey:@"team"] stringByDeletingPathExtension]])
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   290
            break;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   291
    }
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   292
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   293
    [self.listOfTeams addObject:[self.listOfSelectedTeams objectAtIndex:row]];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   294
    [self.listOfSelectedTeams removeObjectAtIndex:row];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   295
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   296
    [self.tableView beginUpdates];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   297
    [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationLeft];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   298
    [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:allTeamsCount inSection:1]] withRowAnimation:UITableViewRowAnimationLeft];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   299
    allTeamsCount++;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   300
    selectedTeamsCount--;
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   301
    [self.tableView endUpdates];
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 4356
diff changeset
   302
}
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   303
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   304
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   305
#pragma mark Memory management
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   306
-(void) didReceiveMemoryWarning {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   307
    // Relinquish ownership any cached data, images, etc that aren't in use.
3739
97cf933e5bd2 disable AI teleport
koda
parents: 3703
diff changeset
   308
    self.cachedContentsOfDir = nil;
3971
5c82ee165ed5 minor stuff
koda
parents: 3917
diff changeset
   309
    MSG_MEMCLEAN();
5c82ee165ed5 minor stuff
koda
parents: 3917
diff changeset
   310
    [super didReceiveMemoryWarning];
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   311
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   312
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   313
-(void) viewDidUnload {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   314
    self.listOfTeams = nil;
3739
97cf933e5bd2 disable AI teleport
koda
parents: 3703
diff changeset
   315
    self.listOfSelectedTeams = nil;
97cf933e5bd2 disable AI teleport
koda
parents: 3703
diff changeset
   316
    self.cachedContentsOfDir = nil;
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3659
diff changeset
   317
    MSG_DIDUNLOAD();
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   318
    [super viewDidUnload];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   319
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   320
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   321
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   322
-(void) dealloc {
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 4976
diff changeset
   323
    releaseAndNil(listOfTeams);
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 4976
diff changeset
   324
    releaseAndNil(listOfSelectedTeams);
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 4976
diff changeset
   325
    releaseAndNil(cachedContentsOfDir);
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   326
    [super dealloc];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   327
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   328
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   329
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   330
@end
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   331