--- a/hedgewars/CCHandlers.inc Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/CCHandlers.inc Sat Oct 09 18:01:47 2010 +0200
@@ -458,9 +458,7 @@
{$IFDEF DEBUGFILE}
AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks));
{$ENDIF}
-{$IFDEF IPHONEOS}
- clearView();
-{$ENDIF}
+ perfExt_NewTurnBeginning();
end;
procedure chSay(var s: shortstring);
--- a/hedgewars/CMakeLists.txt Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/CMakeLists.txt Sat Oct 09 18:01:47 2010 +0200
@@ -59,6 +59,7 @@
uLandTexture.pas
uLocale.pas
uMisc.pas
+ uMobile.pas
uRandom.pas
uScript.pas
adler32.pas
--- a/hedgewars/PascalExports.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/PascalExports.pas Sat Oct 09 18:01:47 2010 +0200
@@ -13,7 +13,8 @@
unit PascalExports;
interface
-uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, uGears, uSound, hwengine;
+uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat,
+ uGears, uSound, hwengine, uAmmos, uLocale; // don't change the order!
{$INCLUDE "config.inc"}
@@ -258,6 +259,66 @@
else PlaySound(sndPiano8);
end;
end;
+
+function HW_getWeaponNameByIndex(whichone: LongInt): PChar; cdecl; export;
+begin
+ exit (str2pchar(trammo[Ammoz[TAmmoType(whichone+1)].NameId]));
+end;
+
+function HW_getNumberOfWeapons:LongInt; cdecl; export;
+begin
+ exit(ord(high(TAmmoType)));
+end;
+
+procedure HW_setWeapon(whichone: LongInt); cdecl; export;
+begin
+ if (not CurrentTeam^.ExtDriven) and (CurrentTeam^.Hedgehogs[0].BotLevel = 0) then
+ SetWeapon(TAmmoType(whichone+1));
+end;
+
+function HW_getAmmoCounts: PByte; cdecl; export;
+var counts : PByte;
+ a : PHHAmmo;
+ slot, index: LongInt;
+begin
+ if (CurrentTeam^.ExtDriven) or (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then
+ exit(nil);
+ a:= CurrentHedgehog^.Ammo;
+ GetMem(counts,ord(High(TAmmoType)));
+ FillChar(counts^,ord(High(TAmmoType)),0);
+ for slot:= 0 to cMaxSlotIndex do
+ for index:= 0 to cMaxSlotAmmoIndex do
+ counts[ord(a^[slot,index].AmmoType)-1]:= byte(a^[slot,index].Count);
+ exit(counts);
+ // leak?
+end;
+
+function HW_getAmmoDelays: PByte; cdecl; export;
+var skipTurns : PByte;
+ a : TAmmoType;
+begin
+ GetMem(skipTurns,ord(High(TAmmoType)));
+ FillChar(skipTurns^,ord(High(TAmmoType)),0);
+ for a:= Low(TAmmoType) to High(TAmmoType) do
+ skipTurns[ord(a)-1]:= byte(Ammoz[a].SkipTurns);
+ exit(skipTurns);
+ // leak?
+end;
+
+function HW_getTurnsForCurrentTeam:LongInt; cdecl; export;
+begin
+ exit(CurrentTeam^.Clan^.TurnNumber);
+end;
+
+function HW_getMaxNumberOfHogs: LongInt; cdecl; export;
+begin
+ exit(cMaxHHIndex+1);
+end;
+
+function HW_getMaxNumberOfTeams: LongInt; cdecl; export;
+begin
+ exit(cMaxTeams);
+end;
{$ENDIF}
end.
--- a/hedgewars/SDLh.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/SDLh.pas Sat Oct 09 18:01:47 2010 +0200
@@ -842,15 +842,6 @@
function SDLNet_Read16(buf: pointer): Word;
function SDLNet_Read32(buf: pointer): LongWord;
-{$IFDEF IPHONEOS}
-(* iPhone related calls *)
-procedure clearView; cdecl; external;
-procedure startSpinning; cdecl; external;
-procedure stopSpinning; cdecl; external;
-function isPhone: Boolean; cdecl; external;
-procedure replayBegan; cdecl; external;
-procedure replayFinished; cdecl; external;
-{$ENDIF}
implementation
function SDL_MustLock(Surface: PSDL_Surface): Boolean;
--- a/hedgewars/hwengine.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/hwengine.pas Sat Oct 09 18:01:47 2010 +0200
@@ -30,7 +30,7 @@
{$ENDIF}
uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uKeys, uSound,
- uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uRandom, uLandTexture, uCollisions, sysutils;
+ uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uRandom, uLandTexture, uCollisions, uMobile, sysutils;
var isTerminated: boolean = false;
alsoShutdownFrontend: boolean = false;
@@ -285,9 +285,7 @@
else
begin
LoadRecordFromFile(recordFileName);
-{$IFDEF IPHONEOS}
- replayBegan();
-{$ENDIF}
+ perfExt_SaveBeganSynching();
end;
ScriptOnGameInit;
--- a/hedgewars/uAIAmmoTests.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/uAIAmmoTests.pas Sat Oct 09 18:01:47 2010 +0200
@@ -106,7 +106,7 @@
const BadTurn = Low(LongInt) div 4;
implementation
-uses uMisc, uAIMisc, uLand, uTeams;
+uses uMisc, uAIMisc, uLand;
function Metric(x1, y1, x2, y2: LongInt): LongInt;
begin
--- a/hedgewars/uAmmos.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/uAmmos.pas Sat Oct 09 18:01:47 2010 +0200
@@ -47,7 +47,7 @@
var shoppa: boolean;
implementation
-uses uMisc, uGears, uWorld, uLocale, uConsole;
+uses uMisc, uGears, uWorld, uLocale, uConsole, uMobile;
type TAmmoCounts = array[TAmmoType] of Longword;
var StoresList: array[0..Pred(cMaxHHs)] of PHHAmmo;
@@ -247,7 +247,8 @@
CurAmmoType:= amNothing
end
end
- end
+ end;
+perfExt_NewTurnBeginning;
end;
function HHHasAmmo(var Hedgehog: THedgehog; Ammo: TAmmoType): boolean;
@@ -355,7 +356,8 @@
else
ShowCrosshair:= (Propz and ammoprop_NoCrosshair) = 0;
end
- end
+ end;
+perfExt_NewTurnBeginning;
end;
procedure SwitchNotHeldAmmo(var Hedgehog: THedgehog);
--- a/hedgewars/uConsole.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/uConsole.pas Sat Oct 09 18:01:47 2010 +0200
@@ -37,7 +37,7 @@
procedure doPut(putX, putY: LongInt; fromAI: boolean);
implementation
-uses uMisc, uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uWorld,
+uses uMisc, uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uWorld, uMobile,
uRandom, uAmmos, uStats, uChat, SDLh, uSound, uVisualGears, uScript;
const cLineWidth: LongInt = 0;
--- a/hedgewars/uGame.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/uGame.pas Sat Oct 09 18:01:47 2010 +0200
@@ -26,7 +26,7 @@
////////////////////
implementation
////////////////////
-uses uMisc, uConsts, uKeys, uTeams, uIO, uAI, uGears, uScript, uSound, SDLh;
+uses uMisc, uConsts, uKeys, uTeams, uIO, uAI, uGears, uScript, uSound, uMobile;
procedure DoGameTick(Lag: LongInt);
var i: LongInt;
@@ -68,9 +68,7 @@
if isSoundEnabled then playMusic;
GameType:= gmtLocal;
InitIPC;
-{$IFDEF IPHONEOS}
- replayFinished();
-{$ENDIF}
+ perfExt_SaveFinishedSynching();
end;
end
else ProcessGears
--- a/hedgewars/uLocale.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/uLocale.pas Sat Oct 09 18:01:47 2010 +0200
@@ -46,17 +46,16 @@
gidDamageModifier);
const MAX_EVENT_STRINGS = 100;
-var trammo: array[TAmmoStrId] of ansistring;
- trammoc: array[TAmmoStrId] of ansistring;
- trammod: array[TAmmoStrId] of ansistring;
- trmsg: array[TMsgStrId] of ansistring;
- trgoal: array[TGoalStrId] of ansistring;
+var trammo: array[TAmmoStrId] of ansistring; // name of the weapon
+ trammoc: array[TAmmoStrId] of ansistring; // caption of the weapon
+ trammod: array[TAmmoStrId] of ansistring; // description of the weapon
+ trmsg: array[TMsgStrId] of ansistring; // message of the event
+ trgoal: array[TGoalStrId] of ansistring; // message of the goal
procedure LoadLocale(FileName: shortstring);
-function Format(fmt: shortstring; var arg: shortstring): shortstring;
-function Format(fmt: ansistring; var arg: ansistring): ansistring;
-
-function GetEventString(e: TEventId): ansistring;
+function Format(fmt: shortstring; var arg: shortstring): shortstring;
+function Format(fmt: ansistring; var arg: ansistring): ansistring;
+function GetEventString(e: TEventId): ansistring;
implementation
uses uMisc, uRandom;
@@ -144,4 +143,9 @@
else Format:= copy(fmt, 1, i - 1) + arg + Format(copy(fmt, i + 2, Length(fmt) - i - 1), arg)
end;
+procedure LoadLocaleWrapper(str: pchar); cdecl; export;
+begin
+ LoadLocale(Strpas(str));
+end;
+
end.
--- a/hedgewars/uMisc.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/uMisc.pas Sat Oct 09 18:01:47 2010 +0200
@@ -197,7 +197,7 @@
procedure MakeScreenshot(filename: shortstring);
implementation
-uses uConsole, uStore, uIO, uSound, typinfo, sysutils;
+uses uConsole, uStore, uIO, uSound, typinfo, sysutils, uMobile;
var KBnum: Longword;
{$IFDEF DEBUGFILE}
@@ -796,21 +796,20 @@
ScreenFade := sfNone;
+{$IFDEF SDL13}
+ SDLwindow := nil;
+{$ENDIF}
+
// those values still aren't perfect
cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH);
cScreenSpace:= cRightScreenBorder - cLeftScreenBorder;
-{$IFDEF IPHONEOS}
if isPhone() then
cMaxCaptions:= 3
else
-{$ENDIF}
cMaxCaptions:= 4;
-{$IFDEF SDL13}
- SDLwindow := nil;
-{$ENDIF}
{$IFDEF DEBUGFILE}
{$I-}
{$IFDEF IPHONEOS}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uMobile.pas Sat Oct 09 18:01:47 2010 +0200
@@ -0,0 +1,102 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2008 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *)
+
+{$INCLUDE "options.inc"}
+
+unit uMobile;
+interface
+
+{$IFDEF IPHONEOS}
+(* iOS calls written in C/Objc *)
+procedure clearView; cdecl; external;
+procedure startSpinning; cdecl; external;
+procedure stopSpinning; cdecl; external;
+procedure replayBegan; cdecl; external;
+procedure replayFinished; cdecl; external;
+procedure updateVisualsNewTurn; cdecl; external;
+function isApplePhone: Boolean; cdecl; external;
+{$ENDIF}
+function isPhone: Boolean;
+procedure doRumble;
+procedure perfExt_AddProgress;
+procedure perfExt_FinishProgress;
+procedure perfExt_AmmoUpdate;
+procedure perfExt_NewTurnBeginning;
+procedure perfExt_SaveBeganSynching;
+procedure perfExt_SaveFinishedSynching;
+
+implementation
+
+function isPhone: Boolean;
+begin
+{$IFDEF IPHONEOS}
+ exit(isApplePhone());
+{$ENDIF}
+ exit(false);
+end;
+
+procedure doRumble;
+begin
+ // fill me!
+end;
+
+procedure perfExt_AddProgress;
+begin
+{$IFDEF IPHONEOS}
+ startSpinning();
+{$ENDIF}
+end;
+
+procedure perfExt_FinishProgress;
+begin
+{$IFDEF IPHONEOS}
+ stopSpinning();
+{$ENDIF}
+end;
+
+procedure perfExt_AmmoUpdate;
+begin
+{$IFDEF IPHONEOS}
+ updateVisualsNewTurn();
+{$ENDIF}
+end;
+
+procedure perfExt_NewTurnBeginning;
+begin
+{$IFDEF IPHONEOS}
+ clearView();
+ updateVisualsNewTurn();
+{$ENDIF}
+end;
+
+procedure perfExt_SaveBeganSynching;
+begin
+{$IFDEF IPHONEOS}
+ replayBegan();
+{$ENDIF}
+end;
+
+procedure perfExt_SaveFinishedSynching;
+begin
+{$IFDEF IPHONEOS}
+ replayFinished();
+{$ENDIF}
+end;
+
+
+end.
--- a/hedgewars/uStore.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/uStore.pas Sat Oct 09 18:01:47 2010 +0200
@@ -80,7 +80,7 @@
procedure Tint(c: Longword); inline;
implementation
-uses uMisc, uConsole, uLocale;
+uses uMisc, uConsole, uLocale, uMobile;
type TGPUVendor = (gvUnknown, gvNVIDIA, gvATI, gvIntel, gvApple);
@@ -1138,10 +1138,12 @@
end;
procedure SetupOpenGL;
+{$IFNDEF IPHONEOS}
var vendor: shortstring;
{$IFDEF DARWIN}
one: LongInt;
{$ENDIF}
+{$ENDIF}
begin
{$IFDEF IPHONEOS}
@@ -1149,6 +1151,7 @@
SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1);
{$ELSE}
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+ vendor:= LowerCase(shortstring(pchar(glGetString(GL_VENDOR))));
{$IFNDEF SDL13}
// this attribute is default in 1.3 and must be enabled in MacOSX
if (cReducedQuality and rqDesyncVBlank) <> 0 then
@@ -1172,7 +1175,6 @@
glGetIntegerv(GL_MAX_TEXTURE_SIZE, @MaxTextureSize);
- vendor:= LowerCase(shortstring(pchar(glGetString(GL_VENDOR))));
{$IFDEF DEBUGFILE}
AddFileLog('OpenGL-- Renderer: ' + shortstring(pchar(glGetString(GL_RENDERER))));
AddFileLog(' |----- Vendor: ' + shortstring(pchar(glGetString(GL_VENDOR))));
@@ -1268,9 +1270,8 @@
squaresize:= texsurf^.w shr 1;
numsquares:= texsurf^.h div squaresize;
SDL_FreeSurface(texsurf);
-{$IFDEF IPHONEOS}
- startSpinning();
-{$ENDIF}
+
+ perfExt_AddProgress();
end;
TryDo(ProgrTex <> nil, 'Error - Progress Texure is nil!', true);
@@ -1297,9 +1298,7 @@
begin
WriteLnToConsole('Freeing progress surface... ');
FreeTexture(ProgrTex);
-{$IFDEF IPHONEOS}
- stopSpinning();
-{$ENDIF}
+ perfExt_FinishProgress();
end;
procedure flipSurface(Surface: PSDL_Surface; Vertical: Boolean);
--- a/hedgewars/uTeams.pas Fri Oct 08 22:46:05 2010 +0400
+++ b/hedgewars/uTeams.pas Sat Oct 09 18:01:47 2010 +0200
@@ -114,10 +114,10 @@
function CheckForWin: boolean;
procedure TeamGone(s: shortstring);
procedure TeamGoneEffect(var Team: TTeam);
-function GetTeamStatString(p: PTeam): shortstring;
+function GetTeamStatString(p: PTeam): shortstring;
implementation
-uses uMisc, uWorld, uLocale, uAmmos, uChat;
+uses uMisc, uWorld, uLocale, uAmmos, uChat, uMobile;
const MaxTeamHealth: LongInt = 0;
function CheckForWin: boolean;
@@ -224,7 +224,8 @@
end
until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil);
-CurrentHedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog])
+CurrentHedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
+perfExt_AmmoUpdate
end;
procedure AfterSwitchHedgehog;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.h Sat Oct 09 18:01:47 2010 +0200
@@ -0,0 +1,43 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * File created on 03/10/2010.
+ */
+
+
+#import <UIKit/UIKit.h>
+
+
+@interface AmmoMenuViewController : UIViewController {
+ UIImage *weaponsImage;
+ NSArray *buttonsArray;
+
+ unsigned char *delay;
+ CGPoint startingPoint;
+ BOOL isVisible;
+}
+
+@property (nonatomic,retain) UIImage *weaponsImage;
+@property (nonatomic,retain) NSArray *buttonsArray;
+@property (assign) BOOL isVisible;
+
+-(void) buttonPressed:(id)sender;
+-(void) updateAmmoVisuals;
+-(void) appearInView:(UIView *)container;
+-(void) disappear;
+
+@end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m Sat Oct 09 18:01:47 2010 +0200
@@ -0,0 +1,267 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * File created on 03/10/2010.
+ */
+
+
+#import "AmmoMenuViewController.h"
+#import <QuartzCore/QuartzCore.h>
+#import "CommodityFunctions.h"
+#import "UIImageExtra.h"
+#import "PascalImports.h"
+
+@implementation AmmoMenuViewController
+@synthesize weaponsImage, buttonsArray, isVisible;
+
+
+-(void) viewDidLoad {
+ [super viewDidLoad];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(updateAmmoVisuals)
+ name:@"updateAmmoVisuals"
+ object:nil];
+
+ self.view.frame = CGRectMake(0, 0, 480, 320);
+ self.view.backgroundColor = [UIColor blackColor];
+ self.view.layer.borderColor = [[UIColor whiteColor] CGColor];
+ self.view.layer.borderWidth = 1.3f;
+ [self.view.layer setCornerRadius:10];
+ [self.view.layer setMasksToBounds:YES];
+
+ self.isVisible = NO;
+ delay = HW_getAmmoDelays();
+
+ UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
+ spinner.hidesWhenStopped = YES;
+ spinner.center = self.view.center;
+ [spinner startAnimating];
+ [self.view addSubview:spinner];
+ if (self.buttonsArray == nil)
+ [NSThread detachNewThreadSelector:@selector(loadAmmoStuff:) toTarget:self withObject:spinner];
+ [spinner release];
+}
+
+-(void) viewWillAppear:(BOOL)animated {
+ if (self.buttonsArray != nil)
+ [self updateAmmoVisuals];
+ [super viewWillAppear:animated];
+}
+
+-(void) appearInView:(UIView *)container {
+ [self viewWillAppear:YES];
+ [container addSubview:self.view];
+ self.view.center = CGPointMake(container.center.y, container.center.x);
+ self.isVisible = YES;
+ [self viewDidAppear:YES];
+}
+
+-(void) disappear {
+
+ [self.view removeFromSuperview];
+ self.isVisible = NO;
+}
+
+-(void) loadAmmoStuff:(id) object {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ UIActivityIndicatorView *spinner = (UIActivityIndicatorView *)object;
+
+ NSString *str = [NSString stringWithFormat:@"%@/AmmoMenu/Ammos.png",GRAPHICS_DIRECTORY()];
+ UIImage *ammoStoreImage = [[UIImage alloc] initWithContentsOfFile:str];
+
+ NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:HW_getNumberOfWeapons()];
+ for (int i = 0; i < HW_getNumberOfWeapons(); i++) {
+ int x_src = ((i*32)/(int)ammoStoreImage.size.height)*32;
+ int y_src = (i*32)%(int)ammoStoreImage.size.height;
+ int x_dst = 10+(i%10)*44;
+ int y_dst = 10+(i/10)*44;
+
+ if (i / 10 % 2 != 0)
+ x_dst += 20;
+ UIImage *img = [ammoStoreImage cutAt:CGRectMake(x_src, y_src, 32, 32)];
+ UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
+ button.frame = CGRectMake(x_dst, y_dst, 40, 40);
+ button.tag = i;
+ button.layer.borderWidth = 1;
+ button.layer.borderColor = [UICOLOR_HW_YELLOW_TEXT CGColor];
+ [button.layer setCornerRadius:6];
+ [button.layer setMasksToBounds:YES];
+ [button setBackgroundImage:img forState:UIControlStateNormal];
+ [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
+ [button setTitleColor:UICOLOR_HW_YELLOW_TEXT forState:UIControlStateNormal];
+ button.titleLabel.backgroundColor = [UIColor blackColor];
+ button.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont smallSystemFontSize]];
+ [button.titleLabel.layer setCornerRadius:3];
+ [button.titleLabel.layer setMasksToBounds:YES];
+ button.titleLabel.layer.borderColor = [[UIColor whiteColor] CGColor];
+ button.titleLabel.layer.borderWidth = 1;
+ [self.view addSubview:button];
+ [array addObject:button];
+ }
+ NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:array,@"array",ammoStoreImage,@"image",spinner,@"spinner",nil];
+ [array release];
+ [ammoStoreImage release];
+
+ [self performSelectorOnMainThread:@selector(ready:) withObject:dict waitUntilDone:NO];
+
+ [pool drain];
+}
+
+-(void) ready:(id) object {
+ NSDictionary *dict = (NSDictionary *)object;
+ [[dict objectForKey:@"spinner"] stopAnimating];
+ self.weaponsImage = [dict objectForKey:@"image"];
+ self.buttonsArray = [dict objectForKey:@"array"];
+ [self updateAmmoVisuals];
+}
+
+-(void) updateAmmoVisuals {
+ unsigned char *loadout = HW_getAmmoCounts();
+ int turns = HW_getTurnsForCurrentTeam();
+
+ if (self.buttonsArray == nil) {
+ UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
+ spinner.hidesWhenStopped = YES;
+ spinner.center = self.view.center;
+ [spinner startAnimating];
+ [self.view addSubview:spinner];
+ [NSThread detachNewThreadSelector:@selector(loadAmmoStuff:) toTarget:self withObject:spinner];
+ [spinner release];
+ }
+
+ if (loadout == NULL) {
+ self.view.userInteractionEnabled = NO;
+ return;
+ } else
+ self.view.userInteractionEnabled = YES;
+
+ for (int i = 0; i < HW_getNumberOfWeapons(); i++) {
+ UIButton *button = [self.buttonsArray objectAtIndex:i];
+ if (loadout[i] > 0) {
+ if (button.enabled == NO) {
+ int x_src = ((i*32)/(int)self.weaponsImage.size.height)*32;
+ int y_src = (i*32)%(int)self.weaponsImage.size.height;
+ UIImage *img = [self.weaponsImage cutAt:CGRectMake(x_src, y_src, 32, 32)];
+ [button setBackgroundImage:img forState:UIControlStateNormal];
+ }
+ button.enabled = YES;
+ button.layer.borderColor = [UICOLOR_HW_YELLOW_TEXT CGColor];
+ } else {
+ if (button.enabled == YES)
+ [button setBackgroundImage:nil forState:UIControlStateNormal];
+ button.enabled = NO;
+ button.layer.borderColor = [[UIColor darkGrayColor] CGColor];
+ }
+
+ if (button.enabled == YES) {
+ if (delay[i]-turns >= 0) {
+ button.layer.borderColor = [[UIColor lightGrayColor] CGColor];
+ [button setTitle:[NSString stringWithFormat:@" %d ",delay[i]-turns+1] forState:UIControlStateNormal];
+ if (button.enabled == YES) {
+ int x_src = ((i*32)/(int)self.weaponsImage.size.height)*32;
+ int y_src = (i*32)%(int)self.weaponsImage.size.height;
+ UIImage *img = [self.weaponsImage cutAt:CGRectMake(x_src, y_src, 32, 32)];
+ [button setBackgroundImage:[img convertToGrayScale] forState:UIControlStateNormal];
+ }
+ } else {
+ button.layer.borderColor = [UICOLOR_HW_YELLOW_TEXT CGColor];
+ [button setTitle:@"" forState:UIControlStateNormal];
+ if (button.enabled == YES) {
+ int x_src = ((i*32)/(int)self.weaponsImage.size.height)*32;
+ int y_src = (i*32)%(int)self.weaponsImage.size.height;
+ UIImage *img = [self.weaponsImage cutAt:CGRectMake(x_src, y_src, 32, 32)];
+ [button setBackgroundImage:img forState:UIControlStateNormal];
+ }
+ }
+ }
+ }
+}
+
+#pragma mark -
+#pragma mark user interaction
+-(void) buttonPressed:(id) sender {
+ UIButton *theButton = (UIButton *)sender;
+ HW_setWeapon(theButton.tag);
+ playSound(@"clickSound");
+ [self disappear];
+}
+
+-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ /*
+ NSSet *allTouches = [event allTouches];
+
+ if ([touches count] == 1) {
+ self.view.layer.borderWidth = 3.5;
+ startingPoint = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
+ }
+ */
+}
+
+-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+ //self.view.layer.borderWidth = 1.3;
+}
+
+-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
+ /*
+ NSSet *allTouches = [event allTouches];
+
+ if ([touches count] == 1) {
+ CGPoint touchedPoint = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
+ CGFloat deltaX = touchedPoint.x - startingPoint.x;
+ CGFloat deltaY = touchedPoint.y - startingPoint.y;
+
+ //startingPoint = touchedPoint;
+ self.view.frame = CGRectMake(self.view.frame.origin.x + deltaX, self.view.frame.origin.y + deltaY,
+ self.view.frame.size.width, self.view.frame.size.height);
+ }
+ */
+}
+
+-(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
+ //[self touchesEnded:touches withEvent:event];
+}
+
+#pragma mark -
+#pragma mark memory
+-(void) didReceiveMemoryWarning {
+ self.weaponsImage = nil;
+ self.buttonsArray = nil;
+ MSG_MEMCLEAN();
+ [super didReceiveMemoryWarning];
+}
+
+-(void) viewDidUnload {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ self.weaponsImage = nil;
+ self.buttonsArray = nil;
+ delay = NULL;
+ MSG_DIDUNLOAD();
+ [super viewDidUnload];
+}
+
+-(void) dealloc {
+ [weaponsImage release];
+ [buttonsArray release];
+ [super dealloc];
+}
+
+@end
+
+void updateVisualsNewTurn (void) {
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"updateAmmoVisuals" object:nil];
+}
--- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Sat Oct 09 18:01:47 2010 +0200
@@ -21,9 +21,6 @@
#import <Foundation/Foundation.h>
-#define MAX_HOGS 8
-#define CURRENT_AMMOSIZE 48 // also add a line in SingleWeaponViewController array
-
#define DOCUMENTS_FOLDER() [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
#define SETTINGS_FILE() [DOCUMENTS_FOLDER() stringByAppendingString:@"/settings.plist"]
@@ -45,6 +42,7 @@
#define THEMES_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Themes/"]
#define MAPS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Maps/"]
#define MISSIONS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Missions/Maps/"]
+#define LOCALE_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Locale/"]
#define MSG_MEMCLEAN() DLog(@"has cleaned up some memory");
#define MSG_DIDUNLOAD() DLog(@"unloaded");
@@ -60,7 +58,7 @@
void playSound (NSString *snd);
void popError (const char *title, const char *message);
BOOL rotationManager (UIInterfaceOrientation interfaceOrientation);
-BOOL isPhone ();
+BOOL isApplePhone ();
NSInteger randomPort ();
NSString *modelType ();
NSArray *getAvailableColors(void);
--- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.m Sat Oct 09 18:01:47 2010 +0200
@@ -25,6 +25,7 @@
#import <mach/mach.h>
#import <mach/mach_host.h>
#import "AudioToolbox/AudioToolbox.h"
+#import "PascalImports.h"
void createTeamNamed (NSString *nameWithoutExt) {
NSString *teamsDirectory = TEAMS_DIRECTORY();
@@ -36,9 +37,9 @@
error:NULL];
}
- NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity: MAX_HOGS];
+ NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity: HW_getMaxNumberOfHogs()];
- for (int i = 0; i < MAX_HOGS; i++) {
+ for (int i = 0; i < HW_getMaxNumberOfHogs(); i++) {
NSString *hogName = [[NSString alloc] initWithFormat:@"hedgehog %d",i];
NSDictionary *hog = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:0],@"level",
hogName,@"hogname", @"NoHat",@"hat", nil];
@@ -73,7 +74,6 @@
switch (type) {
case 0: //default
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:CURRENT_AMMOSIZE],@"version",
@"939192942219912103223511100120100000021111010101",@"ammostore_initialqt",
@"040504054160065554655446477657666666615551010111",@"ammostore_probability",
@"000000000000020550000004000700400000000020000000",@"ammostore_delay",
@@ -81,7 +81,6 @@
break;
case 1: //crazy
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:CURRENT_AMMOSIZE],@"version",
@"999999999999999999299999999999999929999999990999",@"ammostore_initialqt",
@"111111011111111111111111111111111111111111110111",@"ammostore_probability",
@"000000000000000000000000000000000000000000000000",@"ammostore_delay",
@@ -89,7 +88,6 @@
break;
case 2: //pro mode
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:CURRENT_AMMOSIZE],@"version",
@"909000900000000000000900000000000000000000000000",@"ammostore_initialqt",
@"000000000000000000000000000000000000000000000000",@"ammostore_probability",
@"000000000000020550000004000700400000000020000000",@"ammostore_delay",
@@ -97,7 +95,6 @@
break;
case 3: //shoppa
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:CURRENT_AMMOSIZE],@"version",
@"000000990000000000000000000000000000000000000000",@"ammostore_initialqt",
@"444441004424440221011212122242200000000200040001",@"ammostore_probability",
@"000000000000000000000000000000000000000000000000",@"ammostore_delay",
@@ -105,7 +102,6 @@
break;
case 4: //basketball
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:CURRENT_AMMOSIZE],@"version",
@"939192942219912103223511100120100000021111010100",@"ammostore_initialqt",
@"000000000000000000000000000000000000000000000000",@"ammostore_probability",
@"000000000000000550000004000700400000000020000000",@"ammostore_delay",
@@ -113,7 +109,6 @@
break;
case 5: //minefield
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:CURRENT_AMMOSIZE],@"version",
@"000000990009000000030000000000000000000000000000",@"ammostore_initialqt",
@"000000000000000000000000000000000000000000000000",@"ammostore_probability",
@"000000000000020550000004000700400000000020000000",@"ammostore_delay",
@@ -230,7 +225,7 @@
DLog(@"used: %u free: %u total: %u", mem_used, mem_free, mem_total);
}
-BOOL isPhone () {
+BOOL inline isApplePhone () {
return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
}
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.h Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.h Sat Oct 09 18:01:47 2010 +0200
@@ -20,13 +20,13 @@
#import <UIKit/UIKit.h>
-#import "MapConfigViewController.h"
+@class HelpPageViewController;
+@class MapConfigViewController;
@class TeamConfigViewController;
@class SchemeWeaponConfigViewController;
-@class HelpPageViewController;
-@interface GameConfigViewController : UIViewController <MapConfigDelegate> {
+@interface GameConfigViewController : UIViewController {
UIImage *hedgehogImage;
UIView *imgContainer;
HelpPageViewController *helpPage;
@@ -39,6 +39,9 @@
@property (nonatomic,retain) UIImage *hedgehogImage;
@property (nonatomic,retain) UIView *imgContainer;
@property (nonatomic,retain) HelpPageViewController *helpPage;
+@property (nonatomic,retain) MapConfigViewController *mapConfigViewController;
+@property (nonatomic,retain) TeamConfigViewController *teamConfigViewController;
+@property (nonatomic,retain) SchemeWeaponConfigViewController *schemeWeaponConfigViewController;
-(IBAction) buttonPressed:(id) sender;
-(IBAction) segmentPressed:(id) sender;
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Sat Oct 09 18:01:47 2010 +0200
@@ -21,22 +21,30 @@
#import "GameConfigViewController.h"
#import "SDL_uikitappdelegate.h"
+#import "MapConfigViewController.h"
#import "TeamConfigViewController.h"
#import "SchemeWeaponConfigViewController.h"
#import "HelpPageViewController.h"
#import "CommodityFunctions.h"
#import "UIImageExtra.h"
+#import "PascalImports.h"
@implementation GameConfigViewController
-@synthesize hedgehogImage, imgContainer, helpPage;
+@synthesize hedgehogImage, imgContainer, helpPage, mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController;
+
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return rotationManager(interfaceOrientation);
}
--(IBAction) buttonPressed:(id) sender {
+-(IBAction) buttonPressed:(id) sender {
// works even if it's not actually a button
- UIButton *theButton = (UIButton *)sender;
+ UIButton *theButton;
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+ theButton = [[(NSNotification *)sender userInfo] objectForKey:@"sender"];
+ else
+ theButton = (UIButton *)sender;
+
switch (theButton.tag) {
case 0:
playSound(@"backSound");
@@ -152,7 +160,7 @@
return NO;
}
- if ([teamConfigViewController.listOfSelectedTeams count] > 6) {
+ if ([teamConfigViewController.listOfSelectedTeams count] > HW_getMaxNumberOfTeams()) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Too many teams",@"")
message:NSLocalizedString(@"Max six teams are allowed in the same game",@"")
delegate:nil
@@ -179,7 +187,7 @@
-(void) startGame:(UIButton *)button {
button.enabled = YES;
-
+
if ([self isEverythingSet] == NO)
return;
@@ -241,25 +249,30 @@
self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(buttonPressed:)
+ name:@"buttonPressed"
+ object:nil];
srandom(time(NULL));
self.hedgehogImage = nil;
// load other controllers
- if (mapConfigViewController == nil)
- mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
- mapConfigViewController.delegate = self;
- mapConfigViewController.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
- if (teamConfigViewController == nil)
- teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
- teamConfigViewController.view.frame = CGRectMake(362, 200, 328, 480);
- [mapConfigViewController.view addSubview:teamConfigViewController.view];
- if (schemeWeaponConfigViewController == nil)
- schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
- schemeWeaponConfigViewController.view.frame = CGRectMake(10, 70, 300, 550);
- [mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view];
+ if (self.mapConfigViewController == nil)
+ self.mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
+ if (self.teamConfigViewController == nil)
+ self.teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
+ [self.mapConfigViewController.view addSubview:self.teamConfigViewController.view];
+ if (self.schemeWeaponConfigViewController == nil)
+ self.schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
+ [self.mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view];
+ self.mapConfigViewController.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
+ self.teamConfigViewController.view.frame = CGRectMake(348, 200, 328, 480);
+ self.schemeWeaponConfigViewController.view.frame = CGRectMake(10, 70, 300, 600);
+
} else {
// this is the visible controller
- mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
+ if (mapConfigViewController == nil)
+ mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
// this must be loaded & added to auto set default scheme and ammo
schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
[self.view addSubview:schemeWeaponConfigViewController.view];
@@ -343,6 +356,8 @@
teamConfigViewController = nil;
if (schemeWeaponConfigViewController.view.superview == nil)
schemeWeaponConfigViewController = nil;
+ if (helpPage.view.superview == nil)
+ helpPage = nil;
// Release any cached data, images, etc that aren't in use.
self.imgContainer = nil;
@@ -352,11 +367,13 @@
}
-(void) viewDidUnload {
+ [[NSNotificationCenter defaultCenter] removeObserver:self forKeyPath:@"buttonPressed"];
self.hedgehogImage = nil;
self.imgContainer = nil;
- mapConfigViewController = nil;
- teamConfigViewController = nil;
- schemeWeaponConfigViewController = nil;
+ self.mapConfigViewController = nil;
+ self.teamConfigViewController = nil;
+ self.schemeWeaponConfigViewController = nil;
+ self.helpPage = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
@@ -367,6 +384,7 @@
[mapConfigViewController release];
[teamConfigViewController release];
[schemeWeaponConfigViewController release];
+ [helpPage release];
[super dealloc];
}
--- a/project_files/HedgewarsMobile/Classes/GameSetup.h Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.h Sat Oct 09 18:01:47 2010 +0200
@@ -31,11 +31,13 @@
NSString *savePath;
BOOL isNetGame;
+ BOOL menuStyle;
}
@property (nonatomic, retain) NSDictionary *systemSettings;
@property (nonatomic, retain) NSDictionary *gameConfig;
@property (nonatomic, retain) NSString *savePath;
+@property (assign) BOOL menuStyle;
-(id) initWithDictionary:(NSDictionary *)gameDictionary;
-(void) engineProtocol;
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m Sat Oct 09 18:01:47 2010 +0200
@@ -29,7 +29,7 @@
#define BUFFER_SIZE 255 // like in original frontend
@implementation GameSetup
-@synthesize systemSettings, gameConfig, savePath;
+@synthesize systemSettings, gameConfig, savePath, menuStyle;
-(id) initWithDictionary:(NSDictionary *)gameDictionary {
if (self = [super init]) {
@@ -38,6 +38,7 @@
// should check they exist and throw and exection if not
NSDictionary *dictSett = [[NSDictionary alloc] initWithContentsOfFile:SETTINGS_FILE()];
self.systemSettings = dictSett;
+ self.menuStyle = [[dictSett objectForKey:@"menu"] boolValue];
[dictSett release];
self.gameConfig = [gameDictionary objectForKey:@"game_dictionary"];
@@ -120,12 +121,12 @@
NSString *weaponPath = [[NSString alloc] initWithFormat:@"%@/%@",WEAPONS_DIRECTORY(),ammostoreName];
NSDictionary *ammoData = [[NSDictionary alloc] initWithContentsOfFile:weaponPath];
[weaponPath release];
- NSString *update = @"";
// if we're loading an older version of ammos fill the engine message with 0s
- int diff = CURRENT_AMMOSIZE - [[ammoData objectForKey:@"version"] intValue];
- if (diff != 0)
- update = [NSString stringWithCharacters:(const unichar*)"0000000000000000000000000000000000" length:diff];
+ int diff = HW_getNumberOfWeapons() - [[ammoData objectForKey:@"ammostore_initialqt"] length];
+ NSString *update = @"";
+ while ([update length] < diff)
+ update = [update stringByAppendingString:@"0"];
NSString *ammloadt = [[NSString alloc] initWithFormat:@"eammloadt %@%@", [ammoData objectForKey:@"ammostore_initialqt"], update];
[self sendToEngine: ammloadt];
@@ -143,7 +144,7 @@
[self sendToEngine: ammreinf];
[ammreinf release];
- // sent twice so it applies to both teams
+ // send this for each team so it applies the same ammostore to all teams
NSString *ammstore = [[NSString alloc] initWithString:@"eammstore"];
for (int i = 0; i < numberOfTeams; i++)
[self sendToEngine: ammstore];
@@ -410,9 +411,10 @@
case 'q':
// game ended, can remove the savefile
[[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
- // so update the relative viewcontroler
+ // so update the relative viewcontroler and the overlay
[[NSNotificationCenter defaultCenter] postNotificationName:@"removedSave" object:nil];
- // and disable the overlay
+ // and remove + disable the overlay
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"remove overlay" object:nil];
setGameRunning(NO);
break;
default:
--- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Sat Oct 09 18:01:47 2010 +0200
@@ -77,7 +77,7 @@
[self.settingsDictionary setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"alternate"];
break;
case 60: //getReady
- [self.settingsDictionary setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"ready"];
+ [self.settingsDictionary setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"menu"];
break;
default:
DLog(@"Wrong tag");
@@ -107,9 +107,10 @@
return 2;
break;
case 2: // other stuff
- return 1;
+ return 2;
break;
default:
+ DLog(@"Nope");
break;
}
return 0;
@@ -210,12 +211,10 @@
switchContent.on = [[self.settingsDictionary objectForKey:@"alternate"] boolValue];
switchContent.tag = 30;
} else {
- /*
- cell.textLabel.text = NSLocalizedString(@"Get Ready Dialogue", @"");
- cell.detailTextLabel.text = NSLocalizedString(@"Pause for 5 seconds between turns",@"");
- switchContent.on = [[self.settingsDictionary objectForKey:@"ready"] boolValue];
+ cell.textLabel.text = NSLocalizedString(@"Classic Ammo Menu", @"");
+ cell.detailTextLabel.text = NSLocalizedString(@"Select which style of ammo menu you prefer",@"");
+ switchContent.on = [[self.settingsDictionary objectForKey:@"menu"] boolValue];
switchContent.tag = 60;
- */
}
break;
default:
--- a/project_files/HedgewarsMobile/Classes/HogButtonView.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/HogButtonView.m Sat Oct 09 18:01:47 2010 +0200
@@ -22,6 +22,7 @@
#import "HogButtonView.h"
#import "CommodityFunctions.h"
#import "UIImageExtra.h"
+#import "PascalImports.h"
@implementation HogButtonView
@synthesize singleHog, numberOfHogs, ownerDictionary;
@@ -51,13 +52,13 @@
-(void) drawManyHogs:(NSInteger) hogs {
if (numberOfHogs != hogs) {
- if (hogs <= MAX_HOGS && hogs >= 1)
+ if (hogs <= HW_getMaxNumberOfHogs() && hogs >= 1)
numberOfHogs = hogs;
else {
- if (hogs > MAX_HOGS)
+ if (hogs > HW_getMaxNumberOfHogs())
numberOfHogs = 1;
else
- numberOfHogs = MAX_HOGS;
+ numberOfHogs = HW_getMaxNumberOfHogs();
}
[ownerDictionary setObject:[NSNumber numberWithInt:numberOfHogs] forKey:@"number"];
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m Sat Oct 09 18:01:47 2010 +0200
@@ -49,15 +49,30 @@
[array release];
// save the sdl window (!= uikit window) for future reference
- SDL_VideoDevice *_this = SDL_GetVideoDevice();
- SDL_VideoDisplay *display = &_this->displays[0];
- sdlwindow = display->windows;
+ SDL_VideoDevice *videoDevice = SDL_GetVideoDevice();
+ if (videoDevice) {
+ SDL_VideoDisplay *display = &videoDevice->displays[0];
+ if (display)
+ sdlwindow = display->windows;
+ }
+ [super viewDidLoad];
+}
- [super viewDidLoad];
+-(void) viewWillAppear:(BOOL)animated {
+ if (sdlwindow == NULL) {
+ SDL_VideoDevice *_this = SDL_GetVideoDevice();
+ if (_this) {
+ SDL_VideoDisplay *display = &_this->displays[0];
+ if (display)
+ sdlwindow = display->windows;
+ }
+ }
+ [super viewWillAppear:animated];
}
-(void) viewDidUnload {
self.menuList = nil;
+ sdlwindow = NULL;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
@@ -178,10 +193,8 @@
[UIView commitAnimations];
}
- if ([actionSheet cancelButtonIndex] != buttonIndex) {
+ if ([actionSheet cancelButtonIndex] != buttonIndex)
[[NSNotificationCenter defaultCenter] postNotificationName:@"remove overlay" object:nil];
- HW_terminate(NO);
- }
}
@end
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.h Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.h Sat Oct 09 18:01:47 2010 +0200
@@ -22,16 +22,7 @@
#import <UIKit/UIKit.h>
#import "MapPreviewButtonView.h"
-@protocol MapConfigDelegate <NSObject>
-
--(void) buttonPressed:(id) sender;
-
-@end
-
-
@interface MapConfigViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, MapPreviewViewDelegate> {
- id<MapConfigDelegate> delegate;
-
NSInteger oldValue; //slider
NSInteger oldPage; //segmented control
BOOL busy;
@@ -59,7 +50,6 @@
NSArray *dataSourceArray;
}
-@property (nonatomic,retain) id<MapConfigDelegate> delegate;
@property (nonatomic,assign) NSInteger maxHogs;
@property (nonatomic,assign) BOOL busy;
@@ -92,5 +82,6 @@
-(void) turnOffWidgets;
-(void) setLabelText:(NSString *)str;
-(void) updatePreview;
+-(void) loadDataSourceArray;
@end
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Sat Oct 09 18:01:47 2010 +0200
@@ -29,7 +29,7 @@
@implementation MapConfigViewController
@synthesize previewButton, maxHogs, seedCommand, templateFilterCommand, mapGenCommand, mazeSizeCommand, themeCommand, staticMapCommand,
- missionCommand, tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy, delegate;
+ missionCommand, tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
@@ -54,6 +54,8 @@
self.seedCommand = seedCmd;
[seedCmd release];
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex];
NSIndexPath *theIndex;
if (isRandomness()) {
@@ -111,6 +113,8 @@
}
-(NSInteger) tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger) section {
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
return [[self.dataSourceArray objectAtIndex:scIndex] count];
}
@@ -125,6 +129,8 @@
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex];
NSString *labelString = [source objectAtIndex:row];
@@ -150,6 +156,8 @@
// this set details for a static map (called by didSelectRowAtIndexPath)
-(void) setDetailsForStaticMap:(NSInteger) index {
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex];
NSString *fileCfg = [[NSString alloc] initWithFormat:@"%@/%@/map.cfg",
@@ -185,6 +193,8 @@
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
if (newRow != oldRow) {
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex];
if (isRandomness()) {
// just change the theme, don't update preview
@@ -356,10 +366,9 @@
}
#pragma mark -
-#pragma mark delegate functions for iPad
+#pragma mark calls the parent's function that checks the parameters and starts the game
-(IBAction) buttonPressed:(id) sender {
- if (self.delegate != nil && [delegate respondsToSelector:@selector(buttonPressed:)])
- [self.delegate buttonPressed:(UIButton *)sender];
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"buttonPressed" object:nil userInfo:[NSDictionary dictionaryWithObject:sender forKey:@"sender"]];
}
-(void) loadDataSourceArray {
@@ -433,8 +442,6 @@
}
-(void) viewDidUnload {
- self.delegate = nil;
-
self.previewButton = nil;
self.seedCommand = nil;
self.templateFilterCommand = nil;
@@ -461,13 +468,12 @@
-(void) didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
self.dataSourceArray = nil;
+ self.lastIndexPath = nil;
// maybe we can save some more
MSG_MEMCLEAN();
}
-(void) dealloc {
- self.delegate = nil;
-
[seedCommand release];
[templateFilterCommand release];
[mapGenCommand release];
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.h Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.h Sat Oct 09 18:01:47 2010 +0200
@@ -24,6 +24,7 @@
@class InGameMenuViewController;
@class HelpPageViewController;
+@class AmmoMenuViewController;
@interface OverlayViewController : UIViewController {
// the timer that dims the overlay
@@ -37,16 +38,26 @@
// the help menu
HelpPageViewController *helpPage;
+ // the objc ammomenu
+ AmmoMenuViewController *amvc;
+
// ths touch section
CGFloat initialDistanceForPinching;
CGPoint startingPoint;
BOOL isSegmentVisible;
BOOL isAttacking;
+
+ // stuff initialized externally
+ BOOL isNetGame;
+ BOOL useClassicMenu;
}
@property (nonatomic,retain) id popoverController;
@property (nonatomic,retain) InGameMenuViewController *popupMenu;
@property (nonatomic,retain) HelpPageViewController *helpPage;
+@property (nonatomic,retain) AmmoMenuViewController *amvc;
+@property (assign) BOOL isNetGame;
+@property (assign) BOOL useClassicMenu;
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Sat Oct 09 18:01:47 2010 +0200
@@ -23,6 +23,7 @@
#import "SDL_uikitappdelegate.h"
#import "InGameMenuViewController.h"
#import "HelpPageViewController.h"
+#import "AmmoMenuViewController.h"
#import "PascalImports.h"
#import "CommodityFunctions.h"
#import "CGPointUtils.h"
@@ -42,7 +43,7 @@
#define removeConfirmationInput() [[self.view viewWithTag:CONFIRMATION_TAG] removeFromSuperview];
@implementation OverlayViewController
-@synthesize popoverController, popupMenu, helpPage;
+@synthesize popoverController, popupMenu, helpPage, amvc, isNetGame, useClassicMenu;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
return rotationManager(interfaceOrientation);
@@ -180,6 +181,10 @@
self.popupMenu = nil;
if (self.helpPage.view.superview == nil)
self.helpPage = nil;
+ if (((UIPopoverController *)self.popoverController).contentViewController.view.superview == nil)
+ self.popoverController = nil;
+ if (self.amvc.view.superview == nil)
+ self.amvc = nil;
MSG_MEMCLEAN();
}
@@ -187,6 +192,10 @@
// only objects initialized in viewDidLoad should be here
[[NSNotificationCenter defaultCenter] removeObserver:self];
dimTimer = nil;
+ self.helpPage = nil;
+ [self dismissPopover];
+ self.popoverController = nil;
+ self.amvc = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
@@ -195,12 +204,14 @@
[popupMenu release];
[helpPage release];
[popoverController release];
+ [amvc release];
// dimTimer is autoreleased
[super dealloc];
}
-(void) cleanup {
[self dismissPopover];
+ HW_terminate(NO);
[self.view removeFromSuperview];
}
@@ -296,13 +307,32 @@
case 10:
playSound(@"clickSound");
HW_pause();
+ if (self.amvc.isVisible) {
+ doDim();
+ [self.amvc disappear];
+ }
removeConfirmationInput();
[self showPopover];
break;
case 11:
playSound(@"clickSound");
removeConfirmationInput();
- HW_ammoMenu();
+
+ if (self.useClassicMenu)
+ HW_ammoMenu();
+ else {
+ // TODO: removal and multimonitor experience
+ if (self.amvc == nil)
+ self.amvc = [[AmmoMenuViewController alloc] init];
+
+ if (self.amvc.isVisible) {
+ doDim();
+ [self.amvc disappear];
+ } else {
+ doNotDim();
+ [self.amvc appearInView:self.view];
+ }
+ }
break;
default:
DLog(@"Nope");
@@ -317,7 +347,7 @@
// present a further check before closing game
-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
if ([actionSheet cancelButtonIndex] != buttonIndex)
- HW_terminate(NO);
+ [self cleanup];
else
HW_pause();
}
@@ -329,26 +359,26 @@
isPopoverVisible = YES;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- if (popupMenu == nil)
- popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStylePlain];
- if (popoverController == nil) {
- popoverController = [[UIPopoverController alloc] initWithContentViewController:popupMenu];
- [popoverController setPopoverContentSize:CGSizeMake(220, 170) animated:YES];
- [popoverController setPassthroughViews:[NSArray arrayWithObject:self.view]];
+ if (self.popupMenu == nil)
+ self.popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStylePlain];
+ if (self.popoverController == nil) {
+ self.popoverController = [[UIPopoverController alloc] initWithContentViewController:self.popupMenu];
+ [self.popoverController setPopoverContentSize:CGSizeMake(220, 170) animated:YES];
+ [self.popoverController setPassthroughViews:[NSArray arrayWithObject:self.view]];
}
- [popoverController presentPopoverFromRect:CGRectMake(screen.size.height / 2, screen.size.width / 2, 1, 1)
+ [self.popoverController presentPopoverFromRect:CGRectMake(screen.size.height / 2, screen.size.width / 2, 1, 1)
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
} else {
- if (popupMenu == nil)
- popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStyleGrouped];
+ if (self.popupMenu == nil)
+ self.popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStyleGrouped];
[self.view addSubview:popupMenu.view];
- [popupMenu present];
+ [self.popupMenu present];
}
- popupMenu.tableView.scrollEnabled = NO;
+ self.popupMenu.tableView.scrollEnabled = NO;
}
// on ipad just dismiss it, on iphone transtion to the right
@@ -359,10 +389,10 @@
HW_pause();
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- [(InGameMenuViewController *)popoverController.contentViewController removeChat];
- [popoverController dismissPopoverAnimated:YES];
+ [(InGameMenuViewController *)[[self popoverController] contentViewController] removeChat];
+ [self.popoverController dismissPopoverAnimated:YES];
} else {
- [popupMenu dismiss];
+ [self.popupMenu dismiss];
}
[self buttonReleased:nil];
}
@@ -381,6 +411,10 @@
if (isPopoverVisible)
[self dismissPopover];
+ if (amvc.isVisible) {
+ doDim();
+ [self.amvc disappear];
+ }
// reset default dimming
doDim();
@@ -582,10 +616,15 @@
UIWindow *theWindow = [[UIApplication sharedApplication] keyWindow];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
indicator.tag = ACTIVITYINDICATOR_TAG;
+ int offset;
+ if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft)
+ offset = -120;
+ else
+ offset = 120;
if ([[UIScreen screens] count] > 1)
- indicator.center = CGPointMake(theWindow.frame.size.width/2, theWindow.frame.size.height/2 + 118);
+ indicator.center = CGPointMake(theWindow.frame.size.width/2, theWindow.frame.size.height/2 + offset);
else
- indicator.center = CGPointMake(theWindow.frame.size.width/2 + 118, theWindow.frame.size.height/2);
+ indicator.center = CGPointMake(theWindow.frame.size.width/2 + offset, theWindow.frame.size.height/2);
indicator.hidesWhenStopped = YES;
[indicator startAnimating];
[theWindow addSubview:indicator];
--- a/project_files/HedgewarsMobile/Classes/PascalImports.h Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/PascalImports.h Sat Oct 09 18:01:47 2010 +0200
@@ -32,7 +32,7 @@
void Game(const char *args[]);
void GenLandPreview(void);
-
+ void LoadLocaleWrapper(const char *filename);
void HW_versionInfo(short int *netProto, char **versionStr);
@@ -44,7 +44,7 @@
void HW_zoomOut(void);
void HW_zoomReset(void);
float HW_zoomFactor(void);
- int HW_zoomLevel(void);
+ int HW_zoomLevel(void);
void HW_walkingKeysUp(void);
void HW_otherKeysUp(void);
@@ -80,7 +80,16 @@
void HW_setGrenadeTime(int time);
void HW_setPianoSound(int snd);
-
+
+ void HW_setWeapon(int whichone);
+ unsigned char *HW_getAmmoDelays(void);
+ unsigned char *HW_getAmmoCounts(void);
+ int HW_getTurnsForCurrentTeam(void);
+ int HW_getNumberOfWeapons(void);
+ char *HW_getWeaponNameByIndex(int whichone);
+ int HW_getMaxNumberOfHogs(void);
+ int HW_getMaxNumberOfTeams(void);
+
#ifdef __cplusplus
}
#endif
--- a/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.h Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.h Sat Oct 09 18:01:47 2010 +0200
@@ -37,7 +37,7 @@
+(SDLUIKitDelegate *)sharedAppDelegate;
-(void) startSDLgame:(NSDictionary *)gameDictionary;
--(void) displayOverlayLater:(NSNumber *)isNetGame ;
+-(void) displayOverlayLater:(id) object;
@end
--- a/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m Sat Oct 09 18:01:47 2010 +0200
@@ -118,10 +118,12 @@
if ([isNetGameNum boolValue] == NO)
[setup startThread:@"engineProtocol"];
const char **gameArgs = [setup getSettings:[gameDictionary objectForKey:@"savefile"]];
+ NSNumber *menuStyle = [NSNumber numberWithBool:setup.menuStyle];
[setup release];
// since the sdlwindow is not yet created, we add the overlayController with a delay
- [self performSelector:@selector(displayOverlayLater:) withObject:isNetGameNum afterDelay:0.1];
+ NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:isNetGameNum,@"net",menuStyle,@"menu",nil];
+ [self performSelector:@selector(displayOverlayLater:) withObject:dict afterDelay:0.1];
// this is the pascal fuction that starts the game (wrapped around isInGame)
isInGame = YES;
@@ -129,7 +131,8 @@
isInGame = NO;
free(gameArgs);
- [uiwindow makeKeyAndVisible];
+ [self.uiwindow makeKeyAndVisible];
+ [self.uiwindow bringSubviewToFront:self.mainViewController.view];
UIView *refBlackView = [gameWindow viewWithTag:BLACKVIEW_TAG];
UIView *refSecondBlackView = [self.uiwindow viewWithTag:SECONDBLACKVIEW_TAG];
@@ -143,9 +146,12 @@
}
// overlay with controls, become visible later, with a transparency effect
--(void) displayOverlayLater:(NSNumber *)isNetGame {
+-(void) displayOverlayLater:(id) object {
+ NSDictionary *dict = (NSDictionary *)object;
OverlayViewController *overlayController = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:nil];
-
+ overlayController.isNetGame = [[dict objectForKey:@"net"] boolValue];
+ overlayController.useClassicMenu = [[dict objectForKey:@"menu"] boolValue];
+
UIWindow *gameWindow;
if ([[UIScreen screens] count] > 1)
gameWindow = self.uiwindow;
@@ -171,31 +177,22 @@
self.uiwindow.backgroundColor = [UIColor blackColor];
[self.uiwindow makeKeyAndVisible];
- if ([[UIScreen screens]count] > 1) {
- /*
- CGSize maxSize = CGSizeZero;
- UIScreenMode *screenMode = nil;
- for (UIScreenMode *mode in [[[UIScreen screens] objectAtIndex:1] availableModes]) {
- if (mode.size.width > maxSize.width) {
- maxSize = mode.size;
- screenMode = mode;
- }
- }
- */
+ // set working directory to resource path
+ [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]];
+
+ // check for dual monitor support
+ if ([[UIScreen screens] count] > 1) {
DLog(@"dual head mode ftw");
self.secondWindow = [[UIWindow alloc] initWithFrame:[[[UIScreen screens] objectAtIndex:1] bounds]];
self.secondWindow.backgroundColor = [UIColor blackColor];
self.secondWindow.screen = [[UIScreen screens] objectAtIndex:1];
- UIImage *titleImage = [UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"title.png"]];
+ UIImage *titleImage = [UIImage imageWithContentsOfFile:@"title.png"];
UIImageView *titleView = [[UIImageView alloc] initWithImage:titleImage];
titleView.center = self.secondWindow.center;
[self.secondWindow addSubview:titleView];
[titleView release];
[self.secondWindow makeKeyAndVisible];
}
-
- // set working directory to resource path
- [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]];
}
-(void) applicationWillTerminate:(UIApplication *)application {
--- a/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m Sat Oct 09 18:01:47 2010 +0200
@@ -28,6 +28,7 @@
#import "LevelViewController.h"
#import "CommodityFunctions.h"
#import "UIImageExtra.h"
+#import "PascalImports.h"
#define TEAMNAME_TAG 78789
@@ -148,7 +149,7 @@
rows = 1;
break;
case 1: // team members
- rows = MAX_HOGS;
+ rows = HW_getMaxNumberOfHogs();
break;
case 2: // team details
rows = [self.secondaryItems count];
@@ -288,45 +289,48 @@
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSInteger row = [indexPath row];
NSInteger section = [indexPath section];
- UITableViewController *nextController = nil;
if (2 == section) {
switch (row) {
case 0: // grave
if (nil == gravesViewController)
gravesViewController = [[GravesViewController alloc] initWithStyle:UITableViewStyleGrouped];
-
- nextController = gravesViewController;
+
+ [gravesViewController setTeamDictionary:teamDictionary];
+ [self.navigationController pushViewController:gravesViewController animated:YES];
break;
case 1: // voice
if (nil == voicesViewController)
voicesViewController = [[VoicesViewController alloc] initWithStyle:UITableViewStyleGrouped];
-
- nextController = voicesViewController;
+
+ [voicesViewController setTeamDictionary:teamDictionary];
+ [self.navigationController pushViewController:voicesViewController animated:YES];
break;
case 2: // fort
if (nil == fortsViewController)
fortsViewController = [[FortsViewController alloc] initWithStyle:UITableViewStyleGrouped];
-
- nextController = fortsViewController;
+
+ [fortsViewController setTeamDictionary:teamDictionary];
+ [self.navigationController pushViewController:fortsViewController animated:YES];
break;
case 3: // flag
if (nil == flagsViewController)
flagsViewController = [[FlagsViewController alloc] initWithStyle:UITableViewStyleGrouped];
-
- nextController = flagsViewController;
+
+ [flagsViewController setTeamDictionary:teamDictionary];
+ [self.navigationController pushViewController:flagsViewController animated:YES];
break;
case 4: // level
if (nil == levelViewController)
levelViewController = [[LevelViewController alloc] initWithStyle:UITableViewStyleGrouped];
-
- nextController = levelViewController;
+
+ [levelViewController setTeamDictionary:teamDictionary];
+ [self.navigationController pushViewController:levelViewController animated:YES];
+ break;
+ default:
+ DLog(@"Nope");
break;
}
-
- if ([nextController respondsToSelector:@selector(setTeamDictionary:)])
- [nextController setTeamDictionary:teamDictionary];
- [self.navigationController pushViewController:nextController animated:YES];
} else {
EditableCellView *cell = (EditableCellView *)[aTableView cellForRowAtIndexPath:indexPath];
[cell replyKeyboard];
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.h Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.h Sat Oct 09 18:01:47 2010 +0200
@@ -28,7 +28,6 @@
NSString *description;
UIImage *ammoStoreImage;
- NSArray *ammoNames;
char *quantity;
char *probability;
@@ -39,7 +38,6 @@
@property (nonatomic,retain) NSString *weaponName;
@property (nonatomic,retain) NSString *description;
@property (nonatomic,retain) UIImage *ammoStoreImage;
-@property (nonatomic,retain) NSArray *ammoNames;
-(void) saveAmmos;
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m Sat Oct 09 18:01:47 2010 +0200
@@ -20,12 +20,12 @@
#import "SingleWeaponViewController.h"
-#import "WeaponCellView.h"
#import "CommodityFunctions.h"
#import "UIImageExtra.h"
+#import "PascalImports.h"
@implementation SingleWeaponViewController
-@synthesize weaponName, description, ammoStoreImage, ammoNames;
+@synthesize weaponName, description, ammoStoreImage;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
return rotationManager(interfaceOrientation);
@@ -36,64 +36,14 @@
-(void) viewDidLoad {
[super viewDidLoad];
- // also increment CURRENT_AMMOSIZE in CommodityFunctions.h
- NSArray *array = [[NSArray alloc] initWithObjects:
- NSLocalizedString(@"Grenade",@""),
- NSLocalizedString(@"Cluster Bomb",@""),
- NSLocalizedString(@"Bazooka",@""),
- NSLocalizedString(@"Homing Bee",@""),
- NSLocalizedString(@"Shotgun",@""),
- NSLocalizedString(@"Pick Hammer",@""),
- NSLocalizedString(@"Skip",@""),
- NSLocalizedString(@"Rope",@""),
- NSLocalizedString(@"Mine",@""),
- NSLocalizedString(@"Deagle",@""),
- NSLocalizedString(@"Dynamite",@""),
- NSLocalizedString(@"Fire Punch",@""),
- NSLocalizedString(@"Slash",@""),
- NSLocalizedString(@"Baseball bat",@""),
- NSLocalizedString(@"Parachute",@""),
- NSLocalizedString(@"Air Attack",@""),
- NSLocalizedString(@"Mines Attack",@""),
- NSLocalizedString(@"Blow Torch",@""),
- NSLocalizedString(@"Construction",@""),
- NSLocalizedString(@"Teleport",@""),
- NSLocalizedString(@"Switch Hedgehog",@""),
- NSLocalizedString(@"Mortar",@""),
- NSLocalizedString(@"Kamikaze",@""),
- NSLocalizedString(@"Cake",@""),
- NSLocalizedString(@"Seduction",@""),
- NSLocalizedString(@"Watermelon Bomb",@""),
- NSLocalizedString(@"Hellish Hand Grenade",@""),
- NSLocalizedString(@"Napalm Attack",@""),
- NSLocalizedString(@"Drill Rocket",@""),
- NSLocalizedString(@"Ballgun",@""),
- NSLocalizedString(@"RC Plane",@""),
- NSLocalizedString(@"Low Gravity",@""),
- NSLocalizedString(@"Extra Damage",@""),
- NSLocalizedString(@"Invulnerable",@""),
- NSLocalizedString(@"Extra Time",@""),
- NSLocalizedString(@"Laser Sight",@""),
- NSLocalizedString(@"Vampirism",@""),
- NSLocalizedString(@"Sniper Rifle",@""),
- NSLocalizedString(@"Flying Saucer",@""),
- NSLocalizedString(@"Molotov Cocktail",@""),
- NSLocalizedString(@"Birdy",@""),
- NSLocalizedString(@"Portable Portal Device",@""),
- NSLocalizedString(@"Piano Attack",@""),
- NSLocalizedString(@"Old Limburger",@""),
- NSLocalizedString(@"Sine Gun",@""),
- NSLocalizedString(@"Flamethrower",@""),
- NSLocalizedString(@"Sticky Mine",@""),
- NSLocalizedString(@"Hammer",@""),
- nil];
- self.ammoNames = array;
- [array release];
+ NSString *trFilePath = [NSString stringWithFormat:@"%@/en.txt",LOCALE_DIRECTORY()];
+ // fill the data structure that we are going to read
+ LoadLocaleWrapper([trFilePath UTF8String]);
- quantity = (char *)malloc(sizeof(char)*(CURRENT_AMMOSIZE+1));
- probability = (char *)malloc(sizeof(char)*(CURRENT_AMMOSIZE+1));
- delay = (char *)malloc(sizeof(char)*(CURRENT_AMMOSIZE+1));
- crateness = (char *)malloc(sizeof(char)*(CURRENT_AMMOSIZE+1));
+ quantity = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
+ probability = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
+ delay = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
+ crateness = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
NSString *str = [NSString stringWithFormat:@"%@/AmmoMenu/Ammos.png",GRAPHICS_DIRECTORY()];
UIImage *img = [[UIImage alloc] initWithContentsOfFile:str];
@@ -126,7 +76,7 @@
delay[i] = tmp3[i];
crateness[i] = tmp4[i];
}
- for (int i = oldlen; i < CURRENT_AMMOSIZE; i++) {
+ for (int i = oldlen; i < HW_getNumberOfWeapons(); i++) {
quantity[i] = '0';
probability[i] = '0';
delay[i] = '0';
@@ -142,10 +92,10 @@
}
-(void) saveAmmos {
- quantity[CURRENT_AMMOSIZE] = '\0';
- probability[CURRENT_AMMOSIZE] = '\0';
- delay[CURRENT_AMMOSIZE] = '\0';
- crateness[CURRENT_AMMOSIZE] = '\0';
+ quantity[HW_getNumberOfWeapons()] = '\0';
+ probability[HW_getNumberOfWeapons()] = '\0';
+ delay[HW_getNumberOfWeapons()] = '\0';
+ crateness[HW_getNumberOfWeapons()] = '\0';
NSString *quantityStr = [NSString stringWithUTF8String:quantity];
NSString *probabilityStr = [NSString stringWithUTF8String:probability];
@@ -153,7 +103,6 @@
NSString *cratenessStr = [NSString stringWithUTF8String:crateness];
NSDictionary *weapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:CURRENT_AMMOSIZE],@"version",
quantityStr,@"ammostore_initialqt",
probabilityStr,@"ammostore_probability",
delayStr,@"ammostore_delay",
@@ -177,7 +126,7 @@
if (section == 0)
return 2;
else
- return CURRENT_AMMOSIZE;
+ return HW_getNumberOfWeapons();
}
// Customize the appearance of table view cells.
@@ -215,12 +164,12 @@
weaponCell.delegate = self;
}
- int x = ((row*32)/1024)*32;
- int y = (row*32)%1024;
+ int x = ((row*32)/(int)self.ammoStoreImage.size.height)*32;
+ int y = (row*32)%(int)self.ammoStoreImage.size.height;
UIImage *img = [[self.ammoStoreImage cutAt:CGRectMake(x, y, 32, 32)] makeRoundCornersOfSize:CGSizeMake(7, 7)];
weaponCell.weaponIcon.image = img;
- weaponCell.weaponName.text = [ammoNames objectAtIndex:row];
+ weaponCell.weaponName.text = [NSString stringWithUTF8String:HW_getWeaponNameByIndex(row)];
weaponCell.tag = row;
[weaponCell.initialSli setValue:[[NSString stringWithFormat:@"%c",quantity[row]] intValue] animated:NO];
@@ -306,7 +255,6 @@
self.description = nil;
self.weaponName = nil;
self.ammoStoreImage = nil;
- self.ammoNames = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
@@ -316,7 +264,6 @@
[weaponName release];
[description release];
[ammoStoreImage release];
- [ammoNames release];
[super dealloc];
}
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Sat Oct 09 18:01:47 2010 +0200
@@ -49,6 +49,7 @@
61272339117DF778005B90CF /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61272338117DF778005B90CF /* MobileCoreServices.framework */; };
6129B9F711EFB04D0017E305 /* denied.png in Resources */ = {isa = PBXBuildFile; fileRef = 6129B9F611EFB04D0017E305 /* denied.png */; };
61370653117B1D50004EE44A /* Entitlements-Distribution.plist in Resources */ = {isa = PBXBuildFile; fileRef = 61370652117B1D50004EE44A /* Entitlements-Distribution.plist */; };
+ 61399013125D19C0003C2DC0 /* uMobile.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61399012125D19C0003C2DC0 /* uMobile.pas */; };
6147DAD31253DCDE0010357E /* savesButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 6147DAD21253DCDE0010357E /* savesButton.png */; };
61536DF411CEAE7100D87A7E /* GameConfigViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924A11CA9CB400D6E256 /* GameConfigViewController.xib */; };
615AD96212073B4D00F2FF04 /* startGameButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 615AD96112073B4D00F2FF04 /* startGameButton.png */; };
@@ -83,9 +84,7 @@
6165923111CA9BD500D6E256 /* SquareButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6165922B11CA9BD500D6E256 /* SquareButtonView.m */; };
6165923211CA9BD500D6E256 /* UIImageExtra.m in Sources */ = {isa = PBXBuildFile; fileRef = 6165922D11CA9BD500D6E256 /* UIImageExtra.m */; };
6165925311CA9CB400D6E256 /* MainMenuViewController-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924B11CA9CB400D6E256 /* MainMenuViewController-iPad.xib */; };
- 6165925411CA9CB400D6E256 /* MainMenuViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924C11CA9CB400D6E256 /* MainMenuViewController-iPhone.xib */; };
6165925511CA9CB400D6E256 /* MapConfigViewController-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924D11CA9CB400D6E256 /* MapConfigViewController-iPad.xib */; };
- 6165925611CA9CB400D6E256 /* MapConfigViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924E11CA9CB400D6E256 /* MapConfigViewController-iPhone.xib */; };
6165925811CA9CB400D6E256 /* OverlayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165925011CA9CB400D6E256 /* OverlayViewController.xib */; };
6165929E11CA9E2F00D6E256 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6165929D11CA9E2F00D6E256 /* SDL_uikitappdelegate.m */; };
61798816114AA34C00BA94A9 /* hwengine.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987E7114AA34C00BA94A9 /* hwengine.pas */; };
@@ -142,6 +141,7 @@
61A118D311683CD100359010 /* HedgewarsTitle.png in Resources */ = {isa = PBXBuildFile; fileRef = 611FD9CB1155A28C00C2203D /* HedgewarsTitle.png */; };
61B3D71C11EA6F2700EC7420 /* uKeys.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987FE114AA34C00BA94A9 /* uKeys.pas */; };
61C079E411F35A300072BF46 /* EditableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C079E311F35A300072BF46 /* EditableCellView.m */; };
+ 61DE8F221257EB1100B80214 /* AmmoMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61DE8F211257EB1100B80214 /* AmmoMenuViewController.m */; };
61E1F4F811D004240016A5AA /* adler32.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E1F4F711D004240016A5AA /* adler32.pas */; };
61EBA62A11DFF2BC0048B68A /* title.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62811DFF2BC0048B68A /* title.png */; };
61EBA62D11DFF3310048B68A /* backgroundAndTitle.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62C11DFF3310048B68A /* backgroundAndTitle.png */; };
@@ -744,6 +744,7 @@
61272338117DF778005B90CF /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
6129B9F611EFB04D0017E305 /* denied.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = denied.png; path = Resources/denied.png; sourceTree = "<group>"; };
61370652117B1D50004EE44A /* Entitlements-Distribution.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Entitlements-Distribution.plist"; sourceTree = "<group>"; };
+ 61399012125D19C0003C2DC0 /* uMobile.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uMobile.pas; path = ../../hedgewars/uMobile.pas; sourceTree = SOURCE_ROOT; };
6147DAD21253DCDE0010357E /* savesButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = savesButton.png; path = Resources/savesButton.png; sourceTree = "<group>"; };
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 = "<group>"; };
@@ -879,6 +880,8 @@
61A117FE1168322700359010 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
61C079E211F35A300072BF46 /* EditableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditableCellView.h; sourceTree = "<group>"; };
61C079E311F35A300072BF46 /* EditableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditableCellView.m; sourceTree = "<group>"; };
+ 61DE8F201257EB1100B80214 /* AmmoMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AmmoMenuViewController.h; sourceTree = "<group>"; };
+ 61DE8F211257EB1100B80214 /* AmmoMenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AmmoMenuViewController.m; sourceTree = "<group>"; };
61E1F4F711D004240016A5AA /* adler32.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = adler32.pas; path = ../../hedgewars/adler32.pas; sourceTree = SOURCE_ROOT; };
61EBA62811DFF2BC0048B68A /* title.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = title.png; path = "Resources/Frontend-iPad/title.png"; sourceTree = "<group>"; };
61EBA62C11DFF3310048B68A /* backgroundAndTitle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = backgroundAndTitle.png; path = "Resources/Frontend-iPad/backgroundAndTitle.png"; sourceTree = "<group>"; };
@@ -995,22 +998,17 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
+ 61DE91561258B76800B80214 /* Custom Buttons */,
32CA4F630368D1EE00C91783 /* Hedgewars_Prefix.pch */,
6165922911CA9BD500D6E256 /* PascalImports.h */,
+ 6165922411CA9BD500D6E256 /* CGPointUtils.h */,
+ 6165922311CA9BD500D6E256 /* CGPointUtils.c */,
6165929C11CA9E2F00D6E256 /* SDL_uikitappdelegate.h */,
6165929D11CA9E2F00D6E256 /* SDL_uikitappdelegate.m */,
- 6165922411CA9BD500D6E256 /* CGPointUtils.h */,
- 6165922311CA9BD500D6E256 /* CGPointUtils.c */,
6165922511CA9BD500D6E256 /* CommodityFunctions.h */,
6165922611CA9BD500D6E256 /* CommodityFunctions.m */,
- 6165922711CA9BD500D6E256 /* HogButtonView.h */,
- 6165922811CA9BD500D6E256 /* HogButtonView.m */,
- 6165922A11CA9BD500D6E256 /* SquareButtonView.h */,
- 6165922B11CA9BD500D6E256 /* SquareButtonView.m */,
6165922C11CA9BD500D6E256 /* UIImageExtra.h */,
6165922D11CA9BD500D6E256 /* UIImageExtra.m */,
- 619C5BA0124FA59000D041AE /* MapPreviewButtonView.h */,
- 619C5BA1124FA59000D041AE /* MapPreviewButtonView.m */,
);
name = "Other Sources";
sourceTree = "<group>";
@@ -1266,6 +1264,8 @@
611EEAEC122B2A4D00DF6938 /* HelpPageViewController.m */,
611EEAED122B2A4D00DF6938 /* HelpPageLobbyViewController.xib */,
61842B23122B619D0096E335 /* HelpPageInGameViewController.xib */,
+ 61DE8F201257EB1100B80214 /* AmmoMenuViewController.h */,
+ 61DE8F211257EB1100B80214 /* AmmoMenuViewController.m */,
);
name = Overlay;
sourceTree = "<group>";
@@ -1347,6 +1347,19 @@
name = Products;
sourceTree = "<group>";
};
+ 61DE91561258B76800B80214 /* Custom Buttons */ = {
+ isa = PBXGroup;
+ children = (
+ 6165922711CA9BD500D6E256 /* HogButtonView.h */,
+ 6165922811CA9BD500D6E256 /* HogButtonView.m */,
+ 6165922A11CA9BD500D6E256 /* SquareButtonView.h */,
+ 6165922B11CA9BD500D6E256 /* SquareButtonView.m */,
+ 619C5BA0124FA59000D041AE /* MapPreviewButtonView.h */,
+ 619C5BA1124FA59000D041AE /* MapPreviewButtonView.m */,
+ );
+ name = "Custom Buttons";
+ sourceTree = "<group>";
+ };
61F7A42811E2905C0040BA66 /* Icons */ = {
isa = PBXGroup;
children = (
@@ -1401,6 +1414,7 @@
9283015C0F10E48900CC5A3C /* Pascal Sources */ = {
isa = PBXGroup;
children = (
+ 61399012125D19C0003C2DC0 /* uMobile.pas */,
619C5AF3124F7E3100D041AE /* LuaPas.pas */,
61798892114AA56300BA94A9 /* inc */,
61E1F4F711D004240016A5AA /* adler32.pas */,
@@ -2067,9 +2081,7 @@
61370653117B1D50004EE44A /* Entitlements-Distribution.plist in Resources */,
611E12FF117BBBDA0044B62F /* Entitlements-Development.plist in Resources */,
6165925311CA9CB400D6E256 /* MainMenuViewController-iPad.xib in Resources */,
- 6165925411CA9CB400D6E256 /* MainMenuViewController-iPhone.xib in Resources */,
6165925511CA9CB400D6E256 /* MapConfigViewController-iPad.xib in Resources */,
- 6165925611CA9CB400D6E256 /* MapConfigViewController-iPhone.xib in Resources */,
6165925811CA9CB400D6E256 /* OverlayViewController.xib in Resources */,
61EF920E11DF57AC003441C4 /* arrowDown.png in Resources */,
61EF920F11DF57AC003441C4 /* arrowLeft.png in Resources */,
@@ -2247,6 +2259,8 @@
611D9BFB12497E9800008271 /* SavedGamesViewController.m in Sources */,
619C5AF4124F7E3100D041AE /* LuaPas.pas in Sources */,
619C5BA2124FA59000D041AE /* MapPreviewButtonView.m in Sources */,
+ 61DE8F221257EB1100B80214 /* AmmoMenuViewController.m in Sources */,
+ 61399013125D19C0003C2DC0 /* uMobile.pas in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
--- a/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Sat Oct 09 18:01:47 2010 +0200
@@ -763,7 +763,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>MapConfigViewController</string>
<string>UIResponder</string>
- <string>{{205, 295}, {1024, 768}}</string>
+ <string>{{489, 236}, {1024, 768}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -804,7 +804,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">115</int>
+ <int key="maxID">119</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
--- a/project_files/HedgewarsMobile/Resources/Settings/settings.plist Fri Oct 08 22:46:05 2010 +0400
+++ b/project_files/HedgewarsMobile/Resources/Settings/settings.plist Sat Oct 09 18:01:47 2010 +0200
@@ -12,5 +12,7 @@
<true/>
<key>username</key>
<string></string>
+ <key>menu</key>
+ <false/>
</dict>
</plist>