project_files/HedgewarsMobile/Classes/HelpPageInGameViewController.m
author koda
Wed, 28 Mar 2012 01:19:36 +0200
changeset 6830 d2df090453aa
parent 6700 project_files/HedgewarsMobile/Classes/HelpPageViewController.m@e04da46ee43c
child 6832 fae8fd118da9
permissions -rw-r--r--
ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
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
6700
e04da46ee43c the most important commit of the year
koda
parents: 6078
diff changeset
     3
 * Copyright (c) 2009-2012 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
6830
d2df090453aa ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
koda
parents: 6700
diff changeset
    22
#import "HelpPageInGameViewController.h"
6078
8c0cc07731e5 headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents: 5208
diff changeset
    23
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    24
6830
d2df090453aa ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
koda
parents: 6700
diff changeset
    25
@implementation HelpPageInGameViewController
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 {
6830
d2df090453aa ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
koda
parents: 6700
diff changeset
    39
    if (IS_IPAD() == NO) {
4754
a0fd8211c00f moar code cleanup and initial saving of stats
koda
parents: 4362
diff changeset
    40
        scrollView.contentSize = CGSizeMake(480,470);
6830
d2df090453aa ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
koda
parents: 6700
diff changeset
    41
        scrollView.maximumZoomScale = 4.0;
d2df090453aa ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
koda
parents: 6700
diff changeset
    42
        scrollView.minimumZoomScale = 0.75;
d2df090453aa ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
koda
parents: 6700
diff changeset
    43
        scrollView.clipsToBounds = YES;
d2df090453aa ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
koda
parents: 6700
diff changeset
    44
        scrollView.delegate = self;
d2df090453aa ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
koda
parents: 6700
diff changeset
    45
    }
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    46
    [super viewDidLoad];
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    47
}
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    48
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    49
-(void) viewDidUnload {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    50
    [super viewDidUnload];
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    51
    self.scrollView = nil;
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    52
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    53
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    54
-(void) dealloc {
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 4976
diff changeset
    55
    releaseAndNil(scrollView);
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    56
    [super dealloc];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    57
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    58
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    59
-(IBAction) dismiss {
6830
d2df090453aa ios: prevent an horrible hack for the in-game help pages; they would actually need a serious refactoring to allow localisation and rotation support
koda
parents: 6700
diff changeset
    60
    [UIView beginAnimations:@"dismiss help" context:NULL];
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    61
    self.view.alpha = 0;
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    62
    [UIView commitAnimations];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    63
    [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    64
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    65
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    66
@end