author | nemo |
Sun, 24 Jan 2010 16:33:57 +0000 | |
changeset 2709 | 4fa7c5bd067c |
parent 2694 | dcd248e04f3d |
child 2723 | eaa6ac1e95ea |
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 |
||
33 |
/* |
|
34 |
// Override to allow orientations other than the default portrait orientation. |
|
35 |
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
|
36 |
// Return YES for supported orientations |
|
37 |
return (interfaceOrientation == UIInterfaceOrientationPortrait); |
|
38 |
} |
|
39 |
*/ |
|
2694
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
40 |
/* |
2685 | 41 |
- (void)didReceiveMemoryWarning { |
42 |
// Releases the view if it doesn't have a superview. |
|
43 |
[super didReceiveMemoryWarning]; |
|
44 |
||
45 |
// Release any cached data, images, etc that aren't in use. |
|
46 |
} |
|
2694
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
47 |
*/ |
2685 | 48 |
|
49 |
- (void)viewDidUnload { |
|
50 |
// Release any retained subviews of the main view. |
|
51 |
self.passandplayButton = nil; |
|
52 |
self.netplayButton = nil; |
|
53 |
self.storeButton = nil; |
|
54 |
self.versionLabel = nil; |
|
55 |
} |
|
56 |
||
57 |
- (void)dealloc { |
|
58 |
[passandplayButton release]; |
|
59 |
[netplayButton release]; |
|
60 |
[storeButton release]; |
|
61 |
[versionLabel release]; |
|
62 |
[super dealloc]; |
|
63 |
} |
|
64 |
||
2694
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
65 |
// 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
|
66 |
-(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
|
67 |
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
|
68 |
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
|
69 |
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
|
70 |
[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
|
71 |
} |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
72 |
|
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
73 |
-(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
|
74 |
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
|
75 |
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
|
76 |
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
|
77 |
[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
|
78 |
} |
dcd248e04f3d
can use latest sdlimage, work on setting panel and option when launching the game, minor fixes
koda
parents:
2687
diff
changeset
|
79 |
|
2685 | 80 |
-(IBAction) startPlaying { |
81 |
[[SDLUIKitDelegate sharedAppDelegate] startSDLgame]; |
|
82 |
} |
|
2687
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
83 |
|
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
84 |
-(IBAction) notYetImplemented { |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
85 |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented" |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
86 |
message:@"Sorry, this feature is not yet implemented" |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
87 |
delegate:nil |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
88 |
cancelButtonTitle:@"Well, don't worry" |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
89 |
otherButtonTitles:nil]; |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
90 |
[alert show]; |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
91 |
[alert release]; |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
92 |
} |
28b8330b8af1
add stub files for other views and prevent useless crashes
koda
parents:
2685
diff
changeset
|
93 |
|
2685 | 94 |
@end |