author | koda |
Sun, 08 Apr 2012 23:31:02 +0200 | |
changeset 6865 | fe19af8278e6 |
parent 6832 | fae8fd118da9 |
permissions | -rw-r--r-- |
3829 | 1 |
/* |
2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
|
6700 | 3 |
* Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@gmail.com> |
3829 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
17 |
*/ |
|
18 |
||
3792 | 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 "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
|
21 |
|
3792 | 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 HelpPageInGameViewController |
4144 | 24 |
@synthesize scrollView; |
3792 | 25 |
|
26 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { |
|
27 |
return rotationManager(interfaceOrientation); |
|
28 |
} |
|
29 |
||
30 |
-(void) didReceiveMemoryWarning { |
|
31 |
[super didReceiveMemoryWarning]; |
|
4144 | 32 |
self.scrollView = nil; |
33 |
} |
|
34 |
||
35 |
// on iPhone the XIBs contain UIScrollView |
|
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) { |
4754 | 38 |
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
|
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 | 44 |
[super viewDidLoad]; |
45 |
} |
|
46 |
||
3792 | 47 |
-(void) viewDidUnload { |
48 |
[super viewDidUnload]; |
|
4144 | 49 |
self.scrollView = nil; |
3792 | 50 |
} |
51 |
||
52 |
-(void) dealloc { |
|
5208 | 53 |
releaseAndNil(scrollView); |
3792 | 54 |
[super dealloc]; |
55 |
} |
|
56 |
||
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 | 59 |
self.view.alpha = 0; |
60 |
[UIView commitAnimations]; |
|
61 |
[self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1]; |
|
62 |
} |
|
63 |
||
64 |
@end |