--- a/cocoaTouch/MainMenuViewController.m Sat Feb 13 12:40:40 2010 +0000
+++ b/cocoaTouch/MainMenuViewController.m Sat Feb 13 16:04:04 2010 +0000
@@ -138,17 +138,17 @@
self.settingsViewController = controller;
[controller release];
}
- self.settingsViewController.view.frame = CGRectMake(0, -320, 480, 320);
+ self.settingsViewController.view.frame = CGRectMake(0, -257, 480, 278);
self.settingsViewController.parentView = self.mainView;
- [UIView beginAnimations:@"View Switch" context:NULL];
+ [UIView beginAnimations:@"Settings SwitchView" context:NULL];
[UIView setAnimationDuration:1];
- self.settingsViewController.view.frame = CGRectMake(0, 0, 480, 320);
- self.mainView.frame = CGRectMake(0, 320, 480, 320);
+ self.settingsViewController.view.frame = CGRectMake(0, 21, 480, 278);
+ self.mainView.frame = CGRectMake(0, 299, 480, 278);
[UIView commitAnimations];
- [self.view addSubview:settingsViewController.view];
+ [self.view insertSubview:settingsViewController.view atIndex:0];
}
}
--- a/cocoaTouch/MainMenuViewController.xib Sat Feb 13 12:40:40 2010 +0000
+++ b/cocoaTouch/MainMenuViewController.xib Sat Feb 13 16:04:04 2010 +0000
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="21"/>
+ <integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -48,22 +48,23 @@
<object class="IBUIImageView" id="249993817">
<reference key="NSNextResponder" ref="167221315"/>
<int key="NSvFlags">274</int>
- <string key="NSFrameSize">{480, 320}</string>
+ <string key="NSFrameSize">{480, 278}</string>
<reference key="NSSuperview" ref="167221315"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
+ <int key="IBUIContentMode">4</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
- <string key="NSResourceName">background.png</string>
+ <string key="NSResourceName">backgroundCenter.png</string>
</object>
</object>
<object class="IBUIImageView" id="171108356">
<reference key="NSNextResponder" ref="167221315"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 20}, {240, 94}}</string>
+ <string key="NSFrame">{{13, 12}, {240, 52}}</string>
<reference key="NSSuperview" ref="167221315"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
@@ -77,7 +78,7 @@
<object class="IBUIButton" id="124270424">
<reference key="NSNextResponder" ref="167221315"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{234, 140}, {220, 52}}</string>
+ <string key="NSFrame">{{233, 106}, {220, 52}}</string>
<reference key="NSSuperview" ref="167221315"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
@@ -112,7 +113,7 @@
<object class="IBUIButton" id="745970938">
<reference key="NSNextResponder" ref="167221315"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{234, 240}, {220, 52}}</string>
+ <string key="NSFrame">{{233, 210}, {220, 52}}</string>
<reference key="NSSuperview" ref="167221315"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
@@ -137,7 +138,7 @@
<object class="IBUIButton" id="836337039">
<reference key="NSNextResponder" ref="167221315"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{40, 195}, {220, 52}}</string>
+ <string key="NSFrame">{{33, 166}, {220, 52}}</string>
<reference key="NSSuperview" ref="167221315"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
@@ -162,7 +163,7 @@
<object class="IBUILabel" id="533529472">
<reference key="NSNextResponder" ref="167221315"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{67, 114}, {145, 21}}</string>
+ <string key="NSFrame">{{60, 81}, {145, 21}}</string>
<reference key="NSSuperview" ref="167221315"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -185,7 +186,7 @@
<object class="IBUIButton" id="753723574">
<reference key="NSNextResponder" ref="167221315"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{335, 66}, {59, 52}}</string>
+ <string key="NSFrame">{{314, 28}, {59, 52}}</string>
<reference key="NSSuperview" ref="167221315"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
@@ -204,7 +205,7 @@
</object>
</object>
</object>
- <string key="NSFrameSize">{480, 320}</string>
+ <string key="NSFrame">{{0, 21}, {480, 278}}</string>
<reference key="NSSuperview" ref="191373211"/>
<object class="NSColor" key="IBUIBackgroundColor" id="186611269">
<int key="NSColorSpace">1</int>
@@ -212,6 +213,34 @@
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
</object>
+ <object class="IBUIImageView" id="821240857">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{480, 21}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <int key="IBUIContentMode">4</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <object class="NSCustomResource" key="IBUIImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">borderTop.png</string>
+ </object>
+ </object>
+ <object class="IBUIImageView" id="936485487">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrame">{{0, 300}, {480, 20}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <int key="IBUIContentMode">4</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <object class="NSCustomResource" key="IBUIImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">borderBottom.png</string>
+ </object>
+ </object>
</object>
<string key="NSFrameSize">{480, 320}</string>
<reference key="NSSuperview"/>
@@ -296,6 +325,8 @@
<reference key="object" ref="191373211"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="936485487"/>
+ <reference ref="821240857"/>
<reference ref="167221315"/>
</object>
<reference key="parent" ref="0"/>
@@ -312,17 +343,27 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
+ <int key="objectID">35</int>
+ <reference key="object" ref="821240857"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">36</int>
+ <reference key="object" ref="936485487"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="167221315"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="249993817"/>
- <reference ref="745970938"/>
<reference ref="171108356"/>
+ <reference ref="533529472"/>
+ <reference ref="753723574"/>
+ <reference ref="124270424"/>
<reference ref="836337039"/>
- <reference ref="124270424"/>
- <reference ref="753723574"/>
- <reference ref="533529472"/>
+ <reference ref="745970938"/>
</object>
<reference key="parent" ref="191373211"/>
</object>
@@ -337,13 +378,18 @@
<reference key="parent" ref="167221315"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">24</int>
- <reference key="object" ref="124270424"/>
+ <int key="objectID">27</int>
+ <reference key="object" ref="533529472"/>
<reference key="parent" ref="167221315"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">25</int>
- <reference key="object" ref="745970938"/>
+ <int key="objectID">28</int>
+ <reference key="object" ref="753723574"/>
+ <reference key="parent" ref="167221315"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">24</int>
+ <reference key="object" ref="124270424"/>
<reference key="parent" ref="167221315"/>
</object>
<object class="IBObjectRecord">
@@ -352,13 +398,8 @@
<reference key="parent" ref="167221315"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">27</int>
- <reference key="object" ref="533529472"/>
- <reference key="parent" ref="167221315"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">28</int>
- <reference key="object" ref="753723574"/>
+ <int key="objectID">25</int>
+ <reference key="object" ref="745970938"/>
<reference key="parent" ref="167221315"/>
</object>
</object>
@@ -371,6 +412,7 @@
<string>-2.CustomClassName</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBPluginDependency</string>
+ <string>21.IBEditorWindowLastContentRect</string>
<string>21.IBPluginDependency</string>
<string>22.IBPluginDependency</string>
<string>23.IBPluginDependency</string>
@@ -379,6 +421,8 @@
<string>26.IBPluginDependency</string>
<string>27.IBPluginDependency</string>
<string>28.IBPluginDependency</string>
+ <string>35.IBPluginDependency</string>
+ <string>36.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -386,6 +430,9 @@
<string>UIResponder</string>
<string>{{619, 293}, {480, 320}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>{{671, 637}, {480, 278}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -412,7 +459,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">34</int>
+ <int key="maxID">36</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
--- a/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.h Sat Feb 13 12:40:40 2010 +0000
+++ b/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.h Sat Feb 13 16:04:04 2010 +0000
@@ -31,7 +31,6 @@
MainMenuViewController *viewController;
}
-// the outlets are set in MainWindow.xib
@property (readwrite, assign) SDL_Window *window;
@property (readwrite, retain) UIWindow *uiwindow;
@property (nonatomic, retain) MainMenuViewController *viewController;
--- a/cocoaTouch/SDLOverrides/SDL_uikitview.h Sat Feb 13 12:40:40 2010 +0000
+++ b/cocoaTouch/SDLOverrides/SDL_uikitview.h Sat Feb 13 16:04:04 2010 +0000
@@ -48,6 +48,7 @@
#endif
}
+
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
--- a/cocoaTouch/SDLOverrides/SDL_uikitview.m Sat Feb 13 12:40:40 2010 +0000
+++ b/cocoaTouch/SDLOverrides/SDL_uikitview.m Sat Feb 13 16:04:04 2010 +0000
@@ -34,15 +34,16 @@
@implementation SDL_uikitview
// they have to be global variables to allow showControls() to use them
-UIButton *attackButton, *menuButton;
-
+//UIButton *attackButton, *menuButton;
+UIView *menuView;
-(void) dealloc {
#if SDL_IPHONE_KEYBOARD
SDL_DelKeyboard(0);
[textField release];
#endif
- [menuButton release];
- [attackButton release];
+ if (menuView) [menuView release];
+ //[menuButton release];
+ //[attackButton release];
[super dealloc];
}
@@ -66,7 +67,9 @@
self.multipleTouchEnabled = YES;
self.exclusiveTouch = YES;
-/*
+
+
+ /*
// custom code
// the coordinate system is still like in Portrait even though everything is rotated
attackButton = [[UIButton alloc] initWithFrame:CGRectMake(30, 480, 260, 50)];
@@ -112,9 +115,47 @@
[self insertSubview:chatButton atIndex:0];
[chatButton release];
*/
+
+//(0,0) is the lower left corner
+//x:[0-320]
+//y:[0-480]
+ UIButton *menuButton = [[UIButton alloc] initWithFrame:CGRectMake(256, 416, 64, 64)];
+ [menuButton addTarget:[self superclass] action:@selector(showMenu) forControlEvents:UIControlEventTouchDown];
+ [menuButton setBackgroundImage:[UIImage imageNamed:@"Default.png"] forState:UIControlStateNormal];
+ [self insertSubview:menuButton atIndex:0];
+ [menuButton release];
+
+ menuView = [[UIView alloc] initWithFrame:CGRectMake(320, 480, 150, 100)];
+ menuView.backgroundColor = [UIColor lightGrayColor];
+ [self insertSubview:menuView atIndex:1];
+
return self;
}
++(void) showMenu {
+ HW_pause();
+
+ [UIView beginAnimations:@"show menu" context:NULL];
+ [UIView setAnimationDuration:1];
+
+ menuView.frame = CGRectMake(170, 380, 150, 100);
+
+ [UIView commitAnimations];
+}
+
++(void) hideMenu {
+ [UIView beginAnimations:@"hide menu" context:NULL];
+ [UIView setAnimationDuration:1];
+
+ menuView.frame = CGRectMake(480, -70, 150, 100);
+
+ [UIView commitAnimations];
+
+ HW_pause();
+}
+
+
+
#pragma mark -
#pragma mark Exported functions for FreePascal
const char* IPH_getDocumentsPath() {
@@ -164,6 +205,10 @@
//TODO: implement a UITextScroll and put received chat lines in there
}
++(void) pauseGame {
+ HW_pause();
+}
+
#pragma mark -
#pragma mark Custom SDL_UIView input handling
#define kMinimumPinchDelta 50
--- a/cocoaTouch/SettingsViewController.m Sat Feb 13 12:40:40 2010 +0000
+++ b/cocoaTouch/SettingsViewController.m Sat Feb 13 16:04:04 2010 +0000
@@ -142,8 +142,8 @@
[UIView beginAnimations:@"Get Back" context:NULL];
[UIView setAnimationDuration:1];
- self.view.frame = CGRectMake(0, -320, 480, 320);
- self.parentView.frame = CGRectMake(0, 0, 480, 320);
+ self.view.frame = CGRectMake(0, -257, 480, 278);
+ self.parentView.frame = CGRectMake(0, 21, 480, 278);
[UIView commitAnimations];
[self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
--- a/cocoaTouch/SettingsViewController.xib Sat Feb 13 12:40:40 2010 +0000
+++ b/cocoaTouch/SettingsViewController.xib Sat Feb 13 16:04:04 2010 +0000
@@ -97,20 +97,20 @@
<object class="IBUIImageView" id="411150667">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">274</int>
- <string key="NSFrameSize">{480, 320}</string>
+ <string key="NSFrameSize">{480, 278}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentMode">4</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
- <string key="NSResourceName">background.png</string>
+ <string key="NSResourceName">backgroundTop.png</string>
</object>
</object>
<object class="IBUITableView" id="179734732">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">274</int>
- <string key="NSFrame">{{0, 20}, {480, 280}}</string>
+ <string key="NSFrameSize">{480, 278}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -126,12 +126,13 @@
<float key="IBUISectionFooterHeight">10</float>
</object>
</object>
- <string key="NSFrameSize">{480, 320}</string>
+ <string key="NSFrameSize">{480, 278}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
</object>
+ <int key="IBUIContentMode">4</int>
</object>
<object class="IBUIView" id="399248671">
<reference key="NSNextResponder"/>
@@ -318,11 +319,6 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">30</int>
- <reference key="object" ref="179734732"/>
- <reference key="parent" ref="191373211"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="809344278"/>
<reference key="parent" ref="0"/>
@@ -341,6 +337,11 @@
<reference key="object" ref="227113826"/>
<reference key="parent" ref="399248671"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">30</int>
+ <reference key="object" ref="179734732"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -366,7 +367,7 @@
<string>SettingsViewController</string>
<string>UIResponder</string>
<string>UIControl</string>
- <string>{{476, 492}, {480, 320}}</string>
+ <string>{{476, 534}, {480, 278}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -408,7 +409,6 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>backgroundTap:</string>
<string>deleteData:</string>
- <string>sliderChanged:</string>
<string>textFieldDoneEditing:</string>
</object>
<object class="NSMutableArray" key="dict.values">
@@ -416,7 +416,6 @@
<string>id</string>
<string>id</string>
<string>id</string>
- <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
--- a/cocoaTouch/otherSrc/PascalImports.h Sat Feb 13 12:40:40 2010 +0000
+++ b/cocoaTouch/otherSrc/PascalImports.h Sat Feb 13 16:04:04 2010 +0000
@@ -39,6 +39,7 @@
void HW_chat(void);
void HW_tab(void);
+ void HW_pause(void);
#ifdef __cplusplus
}
Binary file cocoaTouch/resources/background.png has changed
Binary file cocoaTouch/resources/backgroundBottom.png has changed
Binary file cocoaTouch/resources/backgroundCenter.png has changed
Binary file cocoaTouch/resources/backgroundTop.png has changed
Binary file cocoaTouch/resources/borderBottom.png has changed
Binary file cocoaTouch/resources/borderTop.png has changed
--- a/hedgewars/PascalExports.pas Sat Feb 13 12:40:40 2010 +0000
+++ b/hedgewars/PascalExports.pas Sat Feb 13 16:04:04 2010 +0000
@@ -42,6 +42,7 @@
procedure HW_shoot; cdecl; export;
procedure HW_whereIsHog; cdecl; export;
procedure HW_chat; cdecl; export;
+procedure HW_pause; cdecl; export;
procedure HW_tab; cdecl; export;
{$ENDIF}
@@ -120,6 +121,11 @@
switchAction:= true;
end;
+procedure HW_pause; cdecl; export;
+begin
+ pauseAction:= true;
+end;
+
procedure HW_whereIsHog; cdecl; export;
//var Xcoord, Ycoord: LongInt;
begin
--- a/hedgewars/uKeys.pas Sat Feb 13 12:40:40 2010 +0000
+++ b/hedgewars/uKeys.pas Sat Feb 13 16:04:04 2010 +0000
@@ -76,6 +76,7 @@
tabKey: boolean;
chatAction: boolean;
+ pauseAction: boolean;
switchAction: boolean;
theJoystick: PSDL_Joystick;
@@ -336,6 +337,7 @@
DefaultBinds[25]:= '+left';
DefaultBinds[26]:= '+right';
DefaultBinds[44]:= 'chat';
+DefaultBinds[55]:= 'pause';
{$ELSE}
DefaultBinds[KeyNameToCode('up')]:= '+up';
DefaultBinds[KeyNameToCode('down')]:= '+down';
@@ -376,6 +378,7 @@
tkbdn[32]:= ord(spaceKey);
tkbdn[44]:= ord(chatAction);
+ tkbdn[55]:= ord(pauseAction);
//tkbdn[100]:= ord(switchAction);
leftClick:= false;
@@ -387,6 +390,7 @@
backspaceKey:= false;
chatAction:= false;
+ pauseAction:= false;
//switchAction:= false;
end;
{$ENDIF}
@@ -505,6 +509,7 @@
tabKey:= false;
chatAction:= false;
+ pauseAction:= false;
switchAction:= false;
{$ENDIF}
end;