project_files/HedgewarsMobile/Classes/MapConfigViewController.h
author koda
Thu, 22 Sep 2011 15:30:40 +0200
changeset 5992 a311b8461ec9
parent 4976 088d40d8aba2
child 6107 0741c0f0203e
permissions -rw-r--r--
prevent screen locking while synching saves (can take some time)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     1
/*
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
4976
088d40d8aba2 Happy 2011 :)
koda
parents: 4362
diff changeset
     3
 * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     4
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
81db3c85784b headers ftw, also right project file
koda
parents: 3783
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: 3783
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     8
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    12
 * GNU General Public License for more details.
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    13
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    14
 * You should have received a copy of the GNU General Public License
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    15
 * along with this program; if not, write to the Free Software
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    17
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    18
 * File created on 22/04/2010.
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    19
 */
81db3c85784b headers ftw, also right project file
koda
parents: 3783
diff changeset
    20
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    21
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    22
#import <UIKit/UIKit.h>
3910
dd47efbdec46 move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents: 3829
diff changeset
    23
#import "MapPreviewButtonView.h"
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    24
4349
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    25
@class SchemeWeaponConfigViewController;
4362
8dae325dc625 added missing graphics and fixed some glitches/crashes/bugs
koda
parents: 4349
diff changeset
    26
@class GameConfigViewController;
4349
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    27
3910
dd47efbdec46 move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents: 3829
diff changeset
    28
@interface MapConfigViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, MapPreviewViewDelegate> {
4349
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    29
    NSInteger oldValue;     // for the slider
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    30
    NSInteger oldPage;      // for the segmented control
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    31
    BOOL busy;              // for the preview button
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3642
diff changeset
    32
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    33
    // objects read (mostly) by parent view
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    34
    NSInteger maxHogs;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    35
    NSString *seedCommand;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    36
    NSString *templateFilterCommand;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    37
    NSString *mapGenCommand;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    38
    NSString *mazeSizeCommand;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    39
    NSString *themeCommand;
3642
fb39fecca350 support for static map added to iFrontend
koda
parents: 3547
diff changeset
    40
    NSString *staticMapCommand;
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3910
diff changeset
    41
    NSString *missionCommand;
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3642
diff changeset
    42
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    43
    // various widgets in the view
3910
dd47efbdec46 move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents: 3829
diff changeset
    44
    MapPreviewButtonView *previewButton;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    45
    UITableView *tableView;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    46
    UILabel *maxLabel;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    47
    UILabel *sizeLabel;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    48
    UISegmentedControl *segmentedControl;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    49
    UISlider *slider;
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3642
diff changeset
    50
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    51
    // internal objects
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    52
    NSIndexPath *lastIndexPath;
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3910
diff changeset
    53
    NSArray *dataSourceArray;
4349
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    54
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    55
    // controller for mission state
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    56
    SchemeWeaponConfigViewController *externalController;
4362
8dae325dc625 added missing graphics and fixed some glitches/crashes/bugs
koda
parents: 4349
diff changeset
    57
    GameConfigViewController *parentController;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    58
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    59
3705
e1959819a542 completing the ifrontend interface...
koda
parents: 3703
diff changeset
    60
3910
dd47efbdec46 move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents: 3829
diff changeset
    61
@property (nonatomic,assign) NSInteger maxHogs;
dd47efbdec46 move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents: 3829
diff changeset
    62
@property (nonatomic,assign) BOOL busy;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    63
@property (nonatomic,retain) NSString *seedCommand;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    64
@property (nonatomic,retain) NSString *templateFilterCommand;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    65
@property (nonatomic,retain) NSString *mapGenCommand;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    66
@property (nonatomic,retain) NSString *mazeSizeCommand;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    67
@property (nonatomic,retain) NSString *themeCommand;
3642
fb39fecca350 support for static map added to iFrontend
koda
parents: 3547
diff changeset
    68
@property (nonatomic,retain) NSString *staticMapCommand;
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3910
diff changeset
    69
@property (nonatomic,retain) NSString *missionCommand;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    70
3910
dd47efbdec46 move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents: 3829
diff changeset
    71
@property (nonatomic,retain) IBOutlet MapPreviewButtonView *previewButton;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    72
@property (nonatomic,retain) IBOutlet UITableView *tableView;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    73
@property (nonatomic,retain) IBOutlet UILabel *maxLabel;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    74
@property (nonatomic,retain) IBOutlet UILabel *sizeLabel;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    75
@property (nonatomic,retain) IBOutlet UISegmentedControl *segmentedControl;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    76
@property (nonatomic,retain) IBOutlet UISlider *slider;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    77
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    78
@property (nonatomic,retain) NSIndexPath *lastIndexPath;
3911
46d7a5cf8ac6 further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents: 3910
diff changeset
    79
@property (nonatomic,retain) NSArray *dataSourceArray;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    80
4349
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    81
@property (nonatomic,assign) SchemeWeaponConfigViewController *externalController;
4362
8dae325dc625 added missing graphics and fixed some glitches/crashes/bugs
koda
parents: 4349
diff changeset
    82
@property (nonatomic,assign) GameConfigViewController *parentController;
4349
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    83
8efa91f98274 display an empty table for missions
koda
parents: 3930
diff changeset
    84
3705
e1959819a542 completing the ifrontend interface...
koda
parents: 3703
diff changeset
    85
-(IBAction) buttonPressed:(id) sender;
e1959819a542 completing the ifrontend interface...
koda
parents: 3703
diff changeset
    86
3783
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3705
diff changeset
    87
-(IBAction) mapButtonPressed;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    88
-(IBAction) sliderChanged:(id) sender;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    89
-(IBAction) sliderEndedChanging:(id) sender;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    90
-(IBAction) segmentedControlChanged:(id) sender;
3705
e1959819a542 completing the ifrontend interface...
koda
parents: 3703
diff changeset
    91
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    92
-(void) turnOnWidgets;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    93
-(void) turnOffWidgets;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    94
-(void) setLabelText:(NSString *)str;
3783
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3705
diff changeset
    95
-(void) updatePreview;
3926
668b71f31e51 use dynamic data from engine instead of using hardcoded values
koda
parents: 3911
diff changeset
    96
-(void) loadDataSourceArray;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    97
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    98
@end