18 * File created on 22/04/2010. |
18 * File created on 22/04/2010. |
19 */ |
19 */ |
20 |
20 |
21 |
21 |
22 #import <UIKit/UIKit.h> |
22 #import <UIKit/UIKit.h> |
23 #import "SDL_net.h" |
23 #import "MapPreviewButtonView.h" |
24 |
24 |
25 @protocol MapConfigDelegate <NSObject> |
25 @protocol MapConfigDelegate <NSObject> |
26 |
26 |
27 -(void) buttonPressed:(id) sender; |
27 -(void) buttonPressed:(id) sender; |
28 |
28 |
29 @end |
29 @end |
30 |
30 |
31 |
31 |
32 @interface MapConfigViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> { |
32 @interface MapConfigViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, MapPreviewViewDelegate> { |
33 id<MapConfigDelegate> delegate; |
33 id<MapConfigDelegate> delegate; |
34 |
34 |
35 TCPsocket sd, csd; |
|
36 NSInteger oldValue; //slider |
35 NSInteger oldValue; //slider |
37 NSInteger oldPage; //segmented control |
36 NSInteger oldPage; //segmented control |
38 BOOL busy; |
37 BOOL busy; |
39 |
38 |
40 // objects read (mostly) by parent view |
39 // objects read (mostly) by parent view |
45 NSString *mazeSizeCommand; |
44 NSString *mazeSizeCommand; |
46 NSString *themeCommand; |
45 NSString *themeCommand; |
47 NSString *staticMapCommand; |
46 NSString *staticMapCommand; |
48 |
47 |
49 // various widgets in the view |
48 // various widgets in the view |
50 UIButton *previewButton; |
49 MapPreviewButtonView *previewButton; |
51 UITableView *tableView; |
50 UITableView *tableView; |
52 UILabel *maxLabel; |
51 UILabel *maxLabel; |
53 UILabel *sizeLabel; |
52 UILabel *sizeLabel; |
54 UISegmentedControl *segmentedControl; |
53 UISegmentedControl *segmentedControl; |
55 UISlider *slider; |
54 UISlider *slider; |
60 NSArray *mapArray; |
59 NSArray *mapArray; |
61 } |
60 } |
62 |
61 |
63 @property (nonatomic,retain) id<MapConfigDelegate> delegate; |
62 @property (nonatomic,retain) id<MapConfigDelegate> delegate; |
64 |
63 |
65 @property (nonatomic) NSInteger maxHogs; |
64 @property (nonatomic,assign) NSInteger maxHogs; |
66 @property (nonatomic) BOOL busy; |
65 @property (nonatomic,assign) BOOL busy; |
67 @property (nonatomic,retain) NSString *seedCommand; |
66 @property (nonatomic,retain) NSString *seedCommand; |
68 @property (nonatomic,retain) NSString *templateFilterCommand; |
67 @property (nonatomic,retain) NSString *templateFilterCommand; |
69 @property (nonatomic,retain) NSString *mapGenCommand; |
68 @property (nonatomic,retain) NSString *mapGenCommand; |
70 @property (nonatomic,retain) NSString *mazeSizeCommand; |
69 @property (nonatomic,retain) NSString *mazeSizeCommand; |
71 @property (nonatomic,retain) NSString *themeCommand; |
70 @property (nonatomic,retain) NSString *themeCommand; |
72 @property (nonatomic,retain) NSString *staticMapCommand; |
71 @property (nonatomic,retain) NSString *staticMapCommand; |
73 |
72 |
74 @property (nonatomic,retain) IBOutlet UIButton *previewButton; |
73 @property (nonatomic,retain) IBOutlet MapPreviewButtonView *previewButton; |
75 @property (nonatomic,retain) IBOutlet UITableView *tableView; |
74 @property (nonatomic,retain) IBOutlet UITableView *tableView; |
76 @property (nonatomic,retain) IBOutlet UILabel *maxLabel; |
75 @property (nonatomic,retain) IBOutlet UILabel *maxLabel; |
77 @property (nonatomic,retain) IBOutlet UILabel *sizeLabel; |
76 @property (nonatomic,retain) IBOutlet UILabel *sizeLabel; |
78 @property (nonatomic,retain) IBOutlet UISegmentedControl *segmentedControl; |
77 @property (nonatomic,retain) IBOutlet UISegmentedControl *segmentedControl; |
79 @property (nonatomic,retain) IBOutlet UISlider *slider; |
78 @property (nonatomic,retain) IBOutlet UISlider *slider; |
90 -(IBAction) segmentedControlChanged:(id) sender; |
89 -(IBAction) segmentedControlChanged:(id) sender; |
91 |
90 |
92 -(void) turnOnWidgets; |
91 -(void) turnOnWidgets; |
93 -(void) turnOffWidgets; |
92 -(void) turnOffWidgets; |
94 -(void) setLabelText:(NSString *)str; |
93 -(void) setLabelText:(NSString *)str; |
95 -(void) setButtonImage:(UIImage *)img; |
|
96 -(void) updatePreview; |
94 -(void) updatePreview; |
97 -(void) updatePreviewWithMap:(NSInteger) index; |
|
98 |
|
99 -(const uint8_t *)engineProtocol:(NSInteger) port; |
|
100 |
95 |
101 @end |
96 @end |