project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.m
author unc0rr
Mon, 09 Apr 2012 22:01:13 +0400
changeset 6872 0f6eef4a07c8
parent 6832 fae8fd118da9
permissions -rw-r--r--
Better support for strings
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
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    19
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
    20
#import "HelpPageLobbyViewController.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
    21
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    22
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
    23
@implementation HelpPageLobbyViewController
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    24
@synthesize scrollView;
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    25
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    26
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    27
    return rotationManager(interfaceOrientation);
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    28
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    29
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    30
-(void) didReceiveMemoryWarning {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    31
    [super didReceiveMemoryWarning];
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    32
    self.scrollView = nil;
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    33
}
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    34
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    35
// on iPhone the XIBs contain UIScrollView
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    36
-(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
    37
    if (IS_IPAD() == NO){
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    38
        scrollView.contentSize = CGSizeMake(480,650);
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
        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
    40
        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
    41
        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
    42
        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
    43
    }
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    44
    [super viewDidLoad];
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    45
}
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    46
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    47
-(void) viewDidUnload {
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    48
    [super viewDidUnload];
4144
cda2685feeb4 help pages for iphone
koda
parents: 3829
diff changeset
    49
    self.scrollView = nil;
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    50
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    51
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    52
-(void) dealloc {
5208
878e551f0b4a all together now! releaseAndNil ftw
koda
parents: 4976
diff changeset
    53
    releaseAndNil(scrollView);
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    54
    [super dealloc];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    55
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    56
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    57
-(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
    58
    [UIView beginAnimations:@"dismiss help" context:NULL];
3792
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    59
    self.view.alpha = 0;
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    60
    [UIView commitAnimations];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    61
    [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    62
}
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    63
dd9345e74b66 help page for lobby
koda
parents:
diff changeset
    64
@end