author | smxx |
Mon, 01 Feb 2010 22:01:35 +0000 | |
changeset 2739 | f860f27028cc |
parent 2738 | bfccb2ec4334 |
child 2740 | 03df0573a9fd |
permissions | -rw-r--r-- |
2685 | 1 |
// |
2 |
// MainMenuViewController.m |
|
3 |
// hwengine |
|
4 |
// |
|
5 |
// Created by Vittorio on 08/01/10. |
|
6 |
// Copyright 2010 __MyCompanyName__. All rights reserved. |
|
7 |
// |
|
8 |
||
9 |
#import "MainMenuViewController.h" |
|
10 |
#import "SDL_uikitappdelegate.h" |
|
11 |
||
12 |
@implementation MainMenuViewController |
|
13 |
||
14 |
@synthesize passandplayButton, netplayButton, storeButton, versionLabel; |
|
15 |
||
16 |
/* |
|
17 |
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. |
|
18 |
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { |
|
19 |
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { |
|
20 |
// Custom initialization |
|
21 |
} |
|
22 |
return self; |
|
23 |
} |
|
24 |
*/ |
|
25 |
||
26 |
||
27 |
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. |
|
2687
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
28 |
-(void) viewDidLoad { |
2694
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
29 |
self.versionLabel.text = @"Hedgewars version 0.9.13-dev"; |
2685 | 30 |
[super viewDidLoad]; |
31 |
} |
|
32 |
||
2738
bfccb2ec4334
new graphics from Tiy and frontend is loaded in landscape mode
koda
parents:
2723
diff
changeset
|
33 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { |
bfccb2ec4334
new graphics from Tiy and frontend is loaded in landscape mode
koda
parents:
2723
diff
changeset
|
34 |
if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) return YES; |
bfccb2ec4334
new graphics from Tiy and frontend is loaded in landscape mode
koda
parents:
2723
diff
changeset
|
35 |
else return NO; |
2685 | 36 |
} |
2723 | 37 |
|
2694
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
38 |
/* |
2685 | 39 |
- (void)didReceiveMemoryWarning { |
40 |
// Releases the view if it doesn't have a superview. |
|
41 |
[super didReceiveMemoryWarning]; |
|
42 |
||
43 |
// Release any cached data, images, etc that aren't in use. |
|
44 |
} |
|
2694
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
45 |
*/ |
2685 | 46 |
|
47 |
- (void)viewDidUnload { |
|
48 |
// Release any retained subviews of the main view. |
|
49 |
self.passandplayButton = nil; |
|
50 |
self.netplayButton = nil; |
|
51 |
self.storeButton = nil; |
|
52 |
self.versionLabel = nil; |
|
53 |
} |
|
54 |
||
55 |
- (void)dealloc { |
|
56 |
[passandplayButton release]; |
|
57 |
[netplayButton release]; |
|
58 |
[storeButton release]; |
|
59 |
[versionLabel release]; |
|
60 |
[super dealloc]; |
|
61 |
} |
|
62 |
||
2694
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
63 |
// disable the buttons when to prevent launching twice the game |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
64 |
-(void) viewWillDisappear:(BOOL)animated { |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
65 |
passandplayButton.enabled = NO; |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
66 |
netplayButton.enabled = NO; |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
67 |
storeButton.enabled = NO; |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
68 |
[super viewWillDisappear:animated]; |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
69 |
} |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
70 |
|
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
71 |
-(void) viewWillAppear:(BOOL)animated { |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
72 |
passandplayButton.enabled = YES; |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
73 |
netplayButton.enabled = YES; |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
74 |
storeButton.enabled = YES; |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
75 |
[super viewWillAppear:animated]; |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
76 |
} |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
77 |
|
2685 | 78 |
-(IBAction) startPlaying { |
79 |
[[SDLUIKitDelegate sharedAppDelegate] startSDLgame]; |
|
80 |
} |
|
2687
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
81 |
|
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
82 |
-(IBAction) notYetImplemented { |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
83 |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented" |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
84 |
message:@"Sorry, this feature is not yet implemented" |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
85 |
delegate:nil |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
86 |
cancelButtonTitle:@"Well, don't worry" |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
87 |
otherButtonTitles:nil]; |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
88 |
[alert show]; |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
89 |
[alert release]; |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
90 |
} |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
91 |
|
2685 | 92 |
@end |