# HG changeset patch # User koda # Date 1280783592 -7200 # Node ID e1959819a54274e4fc75334cc01826de5bb6bf64 # Parent 12d17c6e88555300eba430ff4be1ce0d2dca8ede completing the ifrontend interface... diff -r 12d17c6e8855 -r e1959819a542 project_files/HedgewarsMobile/Classes/GameConfigViewController.h --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.h Mon Aug 02 00:55:24 2010 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.h Mon Aug 02 23:13:12 2010 +0200 @@ -7,12 +7,12 @@ // #import +#import "MapConfigViewController.h" @class TeamConfigViewController; -@class MapConfigViewController; @class SchemeWeaponConfigViewController; -@interface GameConfigViewController : UIViewController { +@interface GameConfigViewController : UIViewController { UIViewController *activeController; MapConfigViewController *mapConfigViewController; TeamConfigViewController *teamConfigViewController; diff -r 12d17c6e8855 -r e1959819a542 project_files/HedgewarsMobile/Classes/GameConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Mon Aug 02 00:55:24 2010 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Mon Aug 02 23:13:12 2010 +0200 @@ -9,18 +9,10 @@ #import "GameConfigViewController.h" #import "SDL_uikitappdelegate.h" #import "CommodityFunctions.h" -#import "MapConfigViewController.h" #import "TeamConfigViewController.h" #import "SchemeWeaponConfigViewController.h" -// draw background image in uitoolbar -/*@implementation UIToolbar (CustomImage) --(void) drawRect:(CGRect)rect { - UIImage *image = [UIImage imageWithContentsOfFile:@"toolbarBackground.png"]; - [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; -} -@end -*/ + @implementation GameConfigViewController @@ -197,14 +189,15 @@ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { if (mapConfigViewController == nil) mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil]; + mapConfigViewController.delegate = self; if (teamConfigViewController == nil) teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped]; - teamConfigViewController.view.frame = CGRectMake(10, 225, 300, 470); + teamConfigViewController.view.frame = CGRectMake(10, 70, 300, 600); teamConfigViewController.view.backgroundColor = [UIColor clearColor]; [mapConfigViewController.view addSubview:teamConfigViewController.view]; if (schemeWeaponConfigViewController == nil) schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped]; - schemeWeaponConfigViewController.view.frame = CGRectMake(362, 230, 300, 470); + schemeWeaponConfigViewController.view.frame = CGRectMake(362, 200, 300, 480); [mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view]; for (UIView *oneView in self.view.subviews) { if ([oneView isMemberOfClass:[UIToolbar class]]) { diff -r 12d17c6e8855 -r e1959819a542 project_files/HedgewarsMobile/Classes/MapConfigViewController.h --- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.h Mon Aug 02 00:55:24 2010 +0200 +++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.h Mon Aug 02 23:13:12 2010 +0200 @@ -9,7 +9,16 @@ #import #import "SDL_net.h" +@protocol MapConfigDelegate + +-(void) buttonPressed:(id) sender; + +@end + + @interface MapConfigViewController : UIViewController { + id delegate; + TCPsocket sd, csd; NSInteger oldValue; //slider NSInteger oldPage; //segmented control @@ -38,6 +47,8 @@ NSArray *mapArray; } +@property (nonatomic,retain) id delegate; + @property (nonatomic) NSInteger maxHogs; @property (nonatomic) BOOL busy; @property (nonatomic,retain) NSString *seedCommand; @@ -58,10 +69,13 @@ @property (nonatomic,retain) NSArray *themeArray; @property (nonatomic,retain) NSArray *mapArray; +-(IBAction) buttonPressed:(id) sender; + -(IBAction) updatePreview; -(IBAction) sliderChanged:(id) sender; -(IBAction) sliderEndedChanging:(id) sender; -(IBAction) segmentedControlChanged:(id) sender; + -(void) turnOnWidgets; -(void) turnOffWidgets; -(void) setLabelText:(NSString *)str; diff -r 12d17c6e8855 -r e1959819a542 project_files/HedgewarsMobile/Classes/MapConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Mon Aug 02 00:55:24 2010 +0200 +++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Mon Aug 02 23:13:12 2010 +0200 @@ -17,7 +17,7 @@ @implementation MapConfigViewController @synthesize previewButton, maxHogs, seedCommand, templateFilterCommand, mapGenCommand, mazeSizeCommand, themeCommand, staticMapCommand, - tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, themeArray, mapArray, busy; + tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, themeArray, mapArray, busy, delegate; -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { @@ -457,7 +457,7 @@ // dummy value, everything is set by -updatePreview -> -didSelectRowAtIndexPath -> -updatePreviewWithMap staticmap = @"map Bamboo"; self.slider.enabled = NO; - self.sizeLabel.text = @"."; + self.sizeLabel.text = @""; [self restoreBackgroundImage]; break; @@ -562,12 +562,21 @@ } #pragma mark - -#pragma mark memory +#pragma mark delegate functions for iPad +-(IBAction) buttonPressed:(id) sender { + if (self.delegate != nil && [delegate respondsToSelector:@selector(buttonPressed:)]) + [self.delegate buttonPressed:(UIButton *)sender]; +} + +#pragma mark - -(void) didReceiveMemoryWarning { [super didReceiveMemoryWarning]; + //[previewButton setImage:nil forState:UIControlStateNormal]; } -(void) viewDidUnload { + self.delegate = nil; + self.previewButton = nil; self.seedCommand = nil; self.templateFilterCommand = nil; @@ -592,6 +601,8 @@ } -(void) dealloc { + self.delegate = nil; + [seedCommand release]; [templateFilterCommand release]; [mapGenCommand release]; diff -r 12d17c6e8855 -r e1959819a542 project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj --- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Mon Aug 02 00:55:24 2010 +0200 +++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Mon Aug 02 23:13:12 2010 +0200 @@ -36,6 +36,9 @@ 6129B9F711EFB04D0017E305 /* denied.png in Resources */ = {isa = PBXBuildFile; fileRef = 6129B9F611EFB04D0017E305 /* denied.png */; }; 61370653117B1D50004EE44A /* Entitlements-Distribution.plist in Resources */ = {isa = PBXBuildFile; fileRef = 61370652117B1D50004EE44A /* Entitlements-Distribution.plist */; }; 61536DF411CEAE7100D87A7E /* GameConfigViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924A11CA9CB400D6E256 /* GameConfigViewController.xib */; }; + 615AD96212073B4D00F2FF04 /* startGameButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 615AD96112073B4D00F2FF04 /* startGameButton.png */; }; + 615AD9E9120764CA00F2FF04 /* backButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 615AD9E8120764CA00F2FF04 /* backButton.png */; }; + 615AD9EB1207654E00F2FF04 /* helpButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 615AD9EA1207654E00F2FF04 /* helpButton.png */; }; 6163EE7E11CC2600001C0453 /* SingleWeaponViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */; }; 6165920D11CA9BA200D6E256 /* FlagsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E111CA9BA200D6E256 /* FlagsViewController.m */; }; 6165920E11CA9BA200D6E256 /* FortsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E311CA9BA200D6E256 /* FortsViewController.m */; }; @@ -699,6 +702,9 @@ 6129B9F611EFB04D0017E305 /* denied.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = denied.png; path = Resources/denied.png; sourceTree = ""; }; 61370652117B1D50004EE44A /* Entitlements-Distribution.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Entitlements-Distribution.plist"; sourceTree = ""; }; 614E333D11DE9A93009DBA4E /* VGSHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = VGSHandlers.inc; path = ../../hedgewars/VGSHandlers.inc; sourceTree = SOURCE_ROOT; }; + 615AD96112073B4D00F2FF04 /* startGameButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = startGameButton.png; path = "Resources/Frontend-iPad/startGameButton.png"; sourceTree = ""; }; + 615AD9E8120764CA00F2FF04 /* backButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = backButton.png; path = "Resources/Frontend-iPad/backButton.png"; sourceTree = ""; }; + 615AD9EA1207654E00F2FF04 /* helpButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpButton.png; path = "Resources/Frontend-iPad/helpButton.png"; sourceTree = ""; }; 6163EE7C11CC2600001C0453 /* SingleWeaponViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleWeaponViewController.h; sourceTree = ""; }; 6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SingleWeaponViewController.m; sourceTree = ""; }; 616591E011CA9BA200D6E256 /* FlagsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlagsViewController.h; sourceTree = ""; }; @@ -1277,10 +1283,13 @@ 61F903FA11DF58680068B24D /* Frontend-iPad */ = { isa = PBXGroup; children = ( + 615AD96112073B4D00F2FF04 /* startGameButton.png */, 61F2E7F812060FF6005734F7 /* SchemesLabel.png */, 61F2E80B12061713005734F7 /* AvailableTeamsLabel.png */, + 615AD9EA1207654E00F2FF04 /* helpButton.png */, 61F2E80C12061713005734F7 /* PlayingTeamsLabel.png */, 61F2E7F912060FF6005734F7 /* WeaponsLabel.png */, + 615AD9E8120764CA00F2FF04 /* backButton.png */, 61F9043911DF64E20068B24D /* bluebox.png */, 61EBA62711DFF2BC0048B68A /* bricks.png */, 61EBA62811DFF2BC0048B68A /* title.png */, @@ -1987,6 +1996,9 @@ 61F2E7FB12060FF6005734F7 /* WeaponsLabel.png in Resources */, 61F2E80D12061713005734F7 /* AvailableTeamsLabel.png in Resources */, 61F2E80E12061713005734F7 /* PlayingTeamsLabel.png in Resources */, + 615AD96212073B4D00F2FF04 /* startGameButton.png in Resources */, + 615AD9E9120764CA00F2FF04 /* backButton.png in Resources */, + 615AD9EB1207654E00F2FF04 /* helpButton.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff -r 12d17c6e8855 -r e1959819a542 project_files/HedgewarsMobile/Resources/Frontend-iPad/backButton.png Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/backButton.png has changed diff -r 12d17c6e8855 -r e1959819a542 project_files/HedgewarsMobile/Resources/Frontend-iPad/helpButton.png Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/helpButton.png has changed diff -r 12d17c6e8855 -r e1959819a542 project_files/HedgewarsMobile/Resources/Frontend-iPad/startGameButton.png Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/startGameButton.png has changed diff -r 12d17c6e8855 -r e1959819a542 project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib --- a/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Mon Aug 02 00:55:24 2010 +0200 +++ b/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Mon Aug 02 23:13:12 2010 +0200 @@ -57,7 +57,7 @@ 292 - {{0, 214}, {320, 490}} + {{0, 60}, {320, 618}} NO NO @@ -70,7 +70,7 @@ 292 - {{704, 214}, {320, 490}} + {{704, 214}, {320, 464}} NO NO @@ -80,17 +80,7 @@ 292 - {{342, 214}, {340, 490}} - - NO - NO - IBIPadFramework - - - - - 292 - {{25, 28}, {272, 162}} + {{342, 187}, {340, 502}} NO NO @@ -107,6 +97,51 @@ IBIPadFramework + + + 292 + {{106, 707}, {320, 41}} + + NO + NO + IBIPadFramework + + + + + 292 + {{594, 707}, {320, 41}} + + NO + NO + IBIPadFramework + + + + + 292 + {{610, 713}, {145, 29}} + + NO + YES + 7 + NO + IBIPadFramework + Max Hogs: + + Helvetica-Oblique + 18 + 16 + + + 2 + MC45MTM3MjU1NTQ5IDAuNzMzMzMzMzQ5MiAwLjAxMTc2NDcwNzA0AA + + + 1 + 10 + 2 + 289 @@ -155,7 +190,7 @@ 292 - {{75, 138}, {149, 23}} + {{263, 716}, {149, 23}} NO IBIPadFramework @@ -198,7 +233,7 @@ 292 - {{129, 41}, {42, 21}} + {{778, 717}, {42, 21}} NO YES @@ -206,6 +241,11 @@ NO IBIPadFramework ... + + Helvetica-Bold + 17 + 16 + 2 MC45MTc2NDcxMjMzIDAuNjc0NTA5ODIzMyAwAA @@ -218,7 +258,7 @@ 292 - {{77, 87}, {145, 29}} + {{112, 713}, {145, 29}} NO YES @@ -243,7 +283,7 @@ -2147483356 - {{10, 225}, {300, 470}} + {{10, 70}, {300, 600}} NO IBIPadFramework @@ -262,7 +302,7 @@ -2147483356 - {{362, 230}, {300, 470}} + {{362, 200}, {300, 480}} NO IBIPadFramework @@ -281,7 +321,7 @@ 292 - {{357, 57}, {309, 165}} + {{357, 30}, {309, 165}} NO NO @@ -294,7 +334,7 @@ 274 - {{714, 225}, {300, 507}} + {{714, 225}, {300, 485}} 3 @@ -310,6 +350,71 @@ YES 45 + + + 292 + {{441, 693}, {142, 64}} + + NO + 1 + IBIPadFramework + 0 + 0 + + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + startGameButton.png + + + + + 292 + {{10, 693}, {64, 64}} + + NO + IBIPadFramework + 0 + 0 + + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + backButton.png + + + + + 292 + {{950, 693}, {64, 64}} + + NO + 2 + IBIPadFramework + 0 + 0 + + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + helpButton.png + + {1024, 768} @@ -434,6 +539,33 @@ 69 + + + buttonPressed: + + + 7 + + 73 + + + + buttonPressed: + + + 7 + + 74 + + + + buttonPressed: + + + 7 + + 77 + @@ -451,19 +583,24 @@ YES - - - - - - + + + + + + + + + + + @@ -539,11 +676,6 @@ - 59 - - - - 61 @@ -553,6 +685,36 @@ + + 70 + + + + + 72 + + + + + 75 + + + + + 78 + + + + + 79 + + + + + 80 + + + @@ -572,18 +734,28 @@ 54.IBPluginDependency 55.IBPluginDependency 57.IBPluginDependency - 59.IBPluginDependency 61.IBPluginDependency 66.IBPluginDependency 7.IBPluginDependency + 70.IBPluginDependency + 72.IBPluginDependency + 75.IBPluginDependency + 78.IBPluginDependency + 79.IBPluginDependency 8.IBPluginDependency + 80.IBPluginDependency 9.IBPluginDependency YES MapConfigViewController UIResponder - {{227, 240}, {1024, 768}} + {{82, 256}, {1024, 768}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -618,7 +790,7 @@ - 69 + 80 @@ -630,6 +802,7 @@ YES YES + buttonPressed: segmentedControlChanged: sliderChanged: sliderEndedChanging: @@ -641,12 +814,14 @@ id id id + id YES YES + buttonPressed: segmentedControlChanged: sliderChanged: sliderEndedChanging: @@ -655,6 +830,10 @@ YES + buttonPressed: + id + + segmentedControlChanged: id @@ -676,6 +855,7 @@ YES YES + delegate maxLabel previewButton segmentedControl @@ -685,6 +865,7 @@ YES + id UILabel UIButton UISegmentedControl @@ -697,6 +878,7 @@ YES YES + delegate maxLabel previewButton segmentedControl @@ -707,6 +889,10 @@ YES + delegate + id + + maxLabel UILabel @@ -1000,14 +1186,20 @@ YES YES + backButton.png background.png bluebox.png + helpButton.png + startGameButton.png title.png YES + {64, 64} {1024, 768} {512, 512} + {64, 64} + {142, 64} {273, 151}