project_files/HedgewarsMobile/Classes/HelpPageViewController.m
author Xeli
Thu, 04 Aug 2011 17:36:13 +0200
branchhedgeroid
changeset 5473 a68f900c4e8c
parent 5208 878e551f0b4a
child 6078 8c0cc07731e5
permissions -rw-r--r--
Utility functions which are context wide, mostly SD methods right now
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     1
/*
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
4976
088d40d8aba2 Happy 2011 :)
koda
parents: 4754
diff changeset
     3
 * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     4
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
81db3c85784b headers ftw, also right project file
koda
parents: 3792
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: 3792
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     8
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    12
 * GNU General Public License for more details.
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    13
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    14
 * You should have received a copy of the GNU General Public License
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    15
 * along with this program; if not, write to the Free Software
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    17
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    18
 * File created on 30/08/2010.
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    19
 */
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    20
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    21
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    22
#import "HelpPageViewController.h"
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    23
#import "CommodityFunctions.h"
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    24
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    25
@implementation HelpPageViewController
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    26
@synthesize scrollView;
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    27
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    28
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    29
    return rotationManager(interfaceOrientation);
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    30
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    31
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    32
-(void) didReceiveMemoryWarning {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    33
    [super didReceiveMemoryWarning];
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    34
    self.scrollView = nil;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    35
}
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    36
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    37
// on iPhone the XIBs contain UIScrollView
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    38
-(void) viewDidLoad {
4754
a0fd8211c00f moar code cleanup and initial saving of stats
koda
parents: 4362
diff changeset
    39
    if (scrollView.tag == 0)    // ipad
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    40
        scrollView.contentSize = CGSizeMake(480,650);
4754
a0fd8211c00f moar code cleanup and initial saving of stats
koda
parents: 4362
diff changeset
    41
    else                        // iphone
a0fd8211c00f moar code cleanup and initial saving of stats
koda
parents: 4362
diff changeset
    42
        scrollView.contentSize = CGSizeMake(480,470);
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    43
    scrollView.maximumZoomScale = 4.0;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    44
    scrollView.minimumZoomScale = 0.75;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    45
    scrollView.clipsToBounds = YES;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    46
    scrollView.delegate = self;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    47
    [super viewDidLoad];
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    48
}
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    49
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    50
-(void) viewDidUnload {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    51
    [super viewDidUnload];
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    52
    self.scrollView = nil;
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    53
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    54
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    55
-(void) dealloc {
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 4976
diff changeset
    56
    releaseAndNil(scrollView);
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    57
    [super dealloc];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    58
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    59
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    60
-(IBAction) dismiss {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    61
    [UIView beginAnimations:@"helpingame" context:NULL];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    62
    self.view.alpha = 0;
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    63
    [UIView commitAnimations];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    64
    [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    65
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    66
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    67
@end