l.p->sizelineinfo; i++)
setbvalue(luaH_setnum(L, t, lineinfo[i]), 1);
- sethvalue(L, L->top, t);
+ sethvalue(L, L->top, t);
}
incr_top(L);
}
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/ldo.c
--- a/misc/liblua/ldo.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/ldo.c Wed Oct 27 14:02:20 2010 +0200
@@ -365,7 +365,7 @@
** The arguments are on the stack, right after the function.
** When returns, all the results are on the stack, starting at the original
** function position.
-*/
+*/
void luaD_call (lua_State *L, StkId func, int nResults) {
if (++L->nCcalls >= LUAI_MAXCCALLS) {
if (L->nCcalls == LUAI_MAXCCALLS)
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/lgc.c
--- a/misc/liblua/lgc.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/lgc.c Wed Oct 27 14:02:20 2010 +0200
@@ -310,7 +310,7 @@
traverseproto(g, p);
return sizeof(Proto) + sizeof(Instruction) * p->sizecode +
sizeof(Proto *) * p->sizep +
- sizeof(TValue) * p->sizek +
+ sizeof(TValue) * p->sizek +
sizeof(int) * p->sizelineinfo +
sizeof(LocVar) * p->sizelocvars +
sizeof(TString *) * p->sizeupvalues;
@@ -697,7 +697,7 @@
GCObject *o = obj2gco(uv);
o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */
g->rootgc = o;
- if (isgray(o)) {
+ if (isgray(o)) {
if (g->gcstate == GCSpropagate) {
gray2black(o); /* closed upvalues need barrier */
luaC_barrier(L, uv, uv->v);
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/llimits.h
--- a/misc/liblua/llimits.h Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/llimits.h Wed Oct 27 14:02:20 2010 +0200
@@ -107,7 +107,7 @@
#ifndef lua_lock
-#define lua_lock(L) ((void) 0)
+#define lua_lock(L) ((void) 0)
#define lua_unlock(L) ((void) 0)
#endif
@@ -118,7 +118,7 @@
/*
** macro to control inclusion of some hard tests on stack reallocation
-*/
+*/
#ifndef HARDSTACKTESTS
#define condhardstacktests(x) ((void)0)
#else
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/loadlib.c
--- a/misc/liblua/loadlib.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/loadlib.c Wed Oct 27 14:02:20 2010 +0200
@@ -502,7 +502,7 @@
** 'module' function
** =======================================================
*/
-
+
static void setfenv (lua_State *L) {
lua_Debug ar;
@@ -632,7 +632,7 @@
lua_setfield(L, -2, "__gc");
/* create `package' table */
luaL_register(L, LUA_LOADLIBNAME, pk_funcs);
-#if defined(LUA_COMPAT_LOADLIB)
+#if defined(LUA_COMPAT_LOADLIB)
lua_getfield(L, -1, "loadlib");
lua_setfield(L, LUA_GLOBALSINDEX, "loadlib");
#endif
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/lobject.h
--- a/misc/liblua/lobject.h Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/lobject.h Wed Oct 27 14:02:20 2010 +0200
@@ -337,7 +337,7 @@
typedef struct Table {
CommonHeader;
- lu_byte flags; /* 1< C) then pc++ */
-OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
+OP_TEST,/* A C if not (R(A) <=> C) then pc++ */
+OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */
@@ -197,8 +197,8 @@
if R(A) = R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */
-OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
- if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */
+OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
+ if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */
OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */
OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/
@@ -240,7 +240,7 @@
** bits 4-5: B arg mode
** bit 6: instruction set register A
** bit 7: operator is a test
-*/
+*/
enum OpArgMask {
OpArgN, /* argument is not used */
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/lstate.c
--- a/misc/liblua/lstate.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/lstate.c Wed Oct 27 14:02:20 2010 +0200
@@ -36,7 +36,7 @@
lua_State l;
global_State g;
} LG;
-
+
static void stack_init (lua_State *L1, lua_State *L) {
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/lstrlib.c
--- a/misc/liblua/lstrlib.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/lstrlib.c Wed Oct 27 14:02:20 2010 +0200
@@ -636,7 +636,7 @@
lua_pushlstring(L, s, e - s); /* keep original text */
}
else if (!lua_isstring(L, -1))
- luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
+ luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
luaL_addvalue(b); /* add result to accumulator */
}
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/ltable.c
--- a/misc/liblua/ltable.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/ltable.c Wed Oct 27 14:02:20 2010 +0200
@@ -48,7 +48,7 @@
#define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t))))
-
+
#define hashstr(t,str) hashpow2(t, (str)->tsv.hash)
#define hashboolean(t,p) hashpow2(t, p)
@@ -302,7 +302,7 @@
if (nasize > oldasize) /* array part must grow? */
setarrayvector(L, t, nasize);
/* create new hash part with appropriate size */
- setnodevector(L, t, nhsize);
+ setnodevector(L, t, nhsize);
if (nasize < oldasize) { /* array part must shrink? */
t->sizearray = nasize;
/* re-insert elements from vanishing slice */
@@ -390,11 +390,11 @@
/*
-** inserts a new key into a hash table; first, check whether key's main
-** position is free. If not, check whether colliding node is in its main
-** position or not: if it is not, move colliding node to an empty place and
-** put new key in its main position; otherwise (colliding node is in its main
-** position), new key goes to an empty position.
+** inserts a new key into a hash table; first, check whether key's main
+** position is free. If not, check whether colliding node is in its main
+** position or not: if it is not, move colliding node to an empty place and
+** put new key in its main position; otherwise (colliding node is in its main
+** position), new key goes to an empty position.
*/
static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
Node *mp = mainposition(t, key);
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/lua.h
--- a/misc/liblua/lua.h Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/lua.h Wed Oct 27 14:02:20 2010 +0200
@@ -245,7 +245,7 @@
-/*
+/*
** ===============================================================
** some useful macros
** ===============================================================
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/lualib.h
--- a/misc/liblua/lualib.h Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/lualib.h Wed Oct 27 14:02:20 2010 +0200
@@ -41,7 +41,7 @@
/* open all previous libraries */
-LUALIB_API void (luaL_openlibs) (lua_State *L);
+LUALIB_API void (luaL_openlibs) (lua_State *L);
diff -r 793386610068 -r b1c2c2f6fc5e misc/liblua/lvm.c
--- a/misc/liblua/lvm.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/liblua/lvm.c Wed Oct 27 14:02:20 2010 +0200
@@ -125,7 +125,7 @@
callTMres(L, val, tm, t, key);
return;
}
- t = tm; /* else repeat with `tm' */
+ t = tm; /* else repeat with `tm' */
}
luaG_runerror(L, "loop in gettable");
}
@@ -152,7 +152,7 @@
callTM(L, tm, t, key, val);
return;
}
- t = tm; /* else repeat with `tm' */
+ t = tm; /* else repeat with `tm' */
}
luaG_runerror(L, "loop in settable");
}
diff -r 793386610068 -r b1c2c2f6fc5e misc/libopenalbridge/commands.c
--- a/misc/libopenalbridge/commands.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/libopenalbridge/commands.c Wed Oct 27 14:02:20 2010 +0200
@@ -34,26 +34,26 @@
ALfloat SourceVelocity[] = { 0.0, 0.0, 0.0 };
ALint state;
int i, j;
-
+
if (openal_ready() == AL_TRUE && index < cache_size) {
// check if sound has already a source
if (the_sounds[index].source_index != -1) {
// it has a source, check it's not playing
alGetSourcei(Sources[the_sounds[index].source_index], AL_SOURCE_STATE, &state);
- if (state != AL_PLAYING && state != AL_PAUSED) {
+ if (state != AL_PLAYING && state != AL_PAUSED) {
// it is not being played, so we can use it safely
- needsSource = AL_FALSE;
+ needsSource = AL_FALSE;
}
// else it is being played, so we have to allocate a new source for this buffer
}
-
+
if (needsSource) {
#ifdef DEBUG
fprintf(stderr,"(Bridge Debug) - looking for a source for sound %d\n", index);
#endif
for (i = 0; i < sources_number; i++) {
// let's iterate on Sources until we find a source that is not playing
- alGetSourcei(Sources[i], AL_SOURCE_STATE, &state);
+ alGetSourcei(Sources[i], AL_SOURCE_STATE, &state);
if (state != AL_PLAYING && state != AL_PAUSED) {
// let's iterate on the_sounds until we find the sound using that source
for (j = 0; j < cache_size; j++) {
@@ -66,11 +66,11 @@
break;
}
}
-
+
if (i == sources_number) {
// this means all sources are busy
}
-
+
// set source properties that it will use when it's in playback
alSourcei (Sources[i], AL_BUFFER, the_sounds[index].buffer);
alSourcef (Sources[i], AL_PITCH, 1.0f);
@@ -78,16 +78,16 @@
alSourcefv(Sources[i], AL_POSITION, SourcePosition);
alSourcefv(Sources[i], AL_VELOCITY, SourceVelocity);
alSourcei (Sources[i], AL_LOOPING, 0);
-
+
if (AL_NO_ERROR != alGetError()) {
fprintf(stderr,"(Bridge ERROR) - failed to set Source properties\n");
return;
}
the_sounds[index].source_index = i;
}
-
+
alSourcePlay(Sources[the_sounds[index].source_index]);
-
+
if (AL_NO_ERROR != alGetError()) {
fprintf(stderr,"(Bridge Warning) - failed to play sound %d\n", index);
return;
diff -r 793386610068 -r b1c2c2f6fc5e misc/libopenalbridge/commands.h
--- a/misc/libopenalbridge/commands.h Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/libopenalbridge/commands.h Wed Oct 27 14:02:20 2010 +0200
@@ -22,34 +22,34 @@
#ifdef __CPLUSPLUS
extern "C" {
#endif
-
+
// play, pause, stop a single sound source
void openal_pausesound (unsigned int index);
void openal_stopsound (unsigned int index);
-
+
// play a sound and set whether it should loop or not (0/1)
void openal_playsound (unsigned int index);
-
+
void openal_freesound (unsigned int index);
-
+
// set or unset the looping property for a sound source
void openal_toggleloop (unsigned int index);
-
+
// set position and volume of a sound source
void openal_setposition (unsigned int index, float x, float y, float z);
void openal_setvolume (unsigned int index, float gain);
-
+
// set volume for all sounds (gain interval is [0-1])
void openal_setglobalvolume (float gain);
-
+
// mute or unmute all sounds
void openal_togglemute (void);
-
+
// fade effect,
void openal_fade (unsigned int index, unsigned short int quantity, al_fade_t direction);
-
+
#ifdef __CPLUSPLUS
}
#endif
-#endif /*_OALB_COMMANDS_H*/
\ No newline at end of file
+#endif /*_OALB_COMMANDS_H*/
diff -r 793386610068 -r b1c2c2f6fc5e misc/libopenalbridge/openalbridge.c
--- a/misc/libopenalbridge/openalbridge.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/libopenalbridge/openalbridge.c Wed Oct 27 14:02:20 2010 +0200
@@ -38,20 +38,20 @@
ALCcontext *context;
ALCdevice *device;
int i;
-
- // reuse old context and resize the existing
+
+ // reuse old context and resize the existing
if (openal_ready() == AL_TRUE) {
fprintf(stderr,"(Bridge Info) - already initialized\n");
instances_number++;
return AL_TRUE;
}
-
+
cache_pointer = 0;
instances_number++;
-
+
// initial memory size
cache_size = 50;
-
+
// open hardware device if present
device = alcOpenDevice(NULL);
sources_number = 16;
@@ -81,7 +81,7 @@
Sources = (ALuint *)Malloc (sizeof(ALuint) * sources_number);
alGenSources(sources_number, Sources);
-
+
// set the listener gain, position (on xyz axes), velocity (one value for each axe) and orientation
// Position, Velocity and Orientation of the listener
ALfloat ListenerPos[] = {0.0, 0.0, 0.0};
@@ -112,7 +112,7 @@
ALCcontext *context;
ALCdevice *device;
int i;
-
+
if (instances_number == 0) {
fprintf(stderr,"(Bridge Warning) - OpenAL not initialized\n");
return;
@@ -123,7 +123,7 @@
// release memory only when last session ends
return;
}
-
+
for (i = 0; i < cache_size; i++) {
openal_unloadfile(i);
}
@@ -148,7 +148,7 @@
ALboolean openal_ready (void) {
- if (instances_number >= 1)
+ if (instances_number >= 1)
return AL_TRUE;
else
return AL_FALSE;
@@ -164,12 +164,12 @@
int len, i, index = -1;
char *data;
FILE *fp;
-
+
if (openal_ready() == AL_FALSE) {
fprintf(stderr,"(Bridge Warning) - not initialized\n");
return -1;
}
-
+
// if this sound is already loaded return the index from the_sounds
len = strlen(filename);
for (i = 0; i < cache_size; i++) {
@@ -182,19 +182,19 @@
// if we don't have memory available search for a free element
if (cache_pointer >= cache_size)
if (the_sounds[i].is_used == AL_FALSE)
- index = i;
+ index = i;
}
if (index == -1 && cache_pointer >= cache_size) {
fprintf(stderr,"(Bridge Info) - No free spots found; doubling cache size\n", filename);
cache_size *= 2;
the_sounds = (al_sound_t *)Realloc (the_sounds, sizeof(al_sound_t) * cache_size);
- for (i = cache_size - 50; i < cache_size; i++)
+ for (i = cache_size - 50; i < cache_size; i++)
the_sounds[i] = new_sound_el();
- } else
+ } else
index = ++cache_pointer;
-
-
+
+
// detect the file format, as written in the first 4 bytes of the header
fp = Fopen (filename, "rb");
if (fp == NULL) {
@@ -231,13 +231,13 @@
// alGenBuffers happens here
sound_data = init_sound_el(filename);
-
+
if (AL_NO_ERROR != alGetError()) {
fprintf(stderr,"(Bridge ERROR) - Failed to allocate memory for buffer %d\n", index);
free(data);
return -5;
}
-
+
// copy pcm data in one buffer and free it
alBufferData(sound_data.buffer, format, data, bitsize, freq);
free(data);
@@ -246,7 +246,7 @@
fprintf(stderr,"(Bridge ERROR) - Failed to write data to buffer %d\n", index);
return -8;
}
-
+
// clear any AL errors beforehand
alGetError();
@@ -265,9 +265,9 @@
alGetSourcei (Sources[the_sounds[index].source_index], AL_SOURCE_STATE, &state);
if (state == AL_PLAYING || state == AL_PAUSED)
openal_stopsound(index);
-
- // free memory and
+
+ // free memory and
alDeleteBuffers (1, &the_sounds[index].buffer);
the_sounds[index] = new_sound_el();
}
-}
\ No newline at end of file
+}
diff -r 793386610068 -r b1c2c2f6fc5e misc/libopenalbridge/openalbridge.h
--- a/misc/libopenalbridge/openalbridge.h Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/libopenalbridge/openalbridge.h Wed Oct 27 14:02:20 2010 +0200
@@ -40,9 +40,9 @@
// unloads data from memory and marks a free spot
void openal_unloadfile (unsigned int index);
-
+
/******* other functions continue in commands.h *******/
-
+
#ifdef __CPLUSPLUS
}
#endif
diff -r 793386610068 -r b1c2c2f6fc5e misc/libopenalbridge/openalbridge_t.h
diff -r 793386610068 -r b1c2c2f6fc5e misc/libopenalbridge/tester.c
--- a/misc/libopenalbridge/tester.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/libopenalbridge/tester.c Wed Oct 27 14:02:20 2010 +0200
@@ -2,10 +2,10 @@
#include "openalbridge.h"
int main (int argc, int **argv) {
-
+
openal_init();
-
+
openal_close();
-
+
return 0;
-}
\ No newline at end of file
+}
diff -r 793386610068 -r b1c2c2f6fc5e misc/libopenalbridge/wrappers.c
--- a/misc/libopenalbridge/wrappers.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/libopenalbridge/wrappers.c Wed Oct 27 14:02:20 2010 +0200
@@ -57,7 +57,7 @@
al_sound_t new_sound_el (void) {
al_sound_t sound;
-
+
sound.filename = NULL;
sound.buffer = -1;
sound.source_index = -1;
@@ -68,7 +68,7 @@
al_sound_t init_sound_el (const char *str) {
al_sound_t sound;
-
+
sound.filename = str;
sound.source_index = -1;
sound.is_used = AL_TRUE;
diff -r 793386610068 -r b1c2c2f6fc5e misc/uSHA.pas
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/uSHA.pas Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,166 @@
+(*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2010 Andrey Korotaev
+ *
+ * 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 uSHA;
+interface
+uses SDLh;
+
+type TSHA1Context = packed record
+ H: array[0..4] of LongWord;
+ Length, CurrLength: Int64;
+ Buf: array[0..63] of byte;
+ end;
+ TSHA1Digest = array[0..4] of LongWord;
+
+procedure SHA1Init(var Context: TSHA1Context);
+procedure SHA1Update(var Context: TSHA1Context; Buf: PByteArray; Length: LongWord);
+procedure SHA1UpdateLongwords(var Context: TSHA1Context; Buf: PLongwordArray; Length: LongWord);
+function SHA1Final(Context: TSHA1Context): TSHA1Digest;
+
+implementation
+
+function rol(x: LongWord; y: Byte): LongWord;
+begin
+ rol:= (X shl y) or (X shr (32 - y))
+end;
+
+function Ft(t, b, c, d: LongWord): LongWord;
+begin
+case t of
+ 0..19: Ft := (b and c) or ((not b) and d);
+ 20..39: Ft := b xor c xor d;
+ 40..59: Ft := (b and c) or (b and d) or (c and d);
+ else Ft := b xor c xor d;
+ end;
+end;
+
+function Kt(t: Byte): LongWord;
+begin
+ case t of
+ 0..19: Kt := $5A827999;
+ 20..39: Kt := $6ED9EBA1;
+ 40..59: Kt := $8F1BBCDC;
+ else
+ Kt := $CA62C1D6
+ end;
+end;
+
+
+procedure SHA1Hash(var Context: TSHA1Context);
+var S: array[0..4 ] of LongWord;
+ W: array[0..79] of LongWord;
+ i, t: LongWord;
+begin
+{$HINTS OFF}
+move(Context.H, S, sizeof(S));
+{$HINTS ON}
+for i:= 0 to 15 do
+ SDLNet_Write32(PLongWordArray(@Context.Buf)^[i], @W[i]);
+
+for i := 16 to 79 do
+ W[i] := rol(W[i - 3] xor W[i - 8] xor W[i - 14] xor W[i - 16], 1);
+
+for i := 0 to 79 do
+ begin
+ t:= rol(S[0], 5) + Ft(i, S[1], S[2], S[3]) + S[4] + W[i] + Kt(i);
+ S[4]:= S[3];
+ S[3]:= S[2];
+ S[2]:= rol(S[1], 30);
+ S[1]:= S[0];
+ S[0]:= t
+ end;
+
+for i := 0 to 4 do
+ Context.H[i]:= Context.H[i] + S[i]
+end;
+
+procedure SHA1Init(var Context: TSHA1Context);
+begin
+ with Context do
+ begin
+ Length := 0;
+ CurrLength:= 0;
+ H[0]:= $67452301;
+ H[1]:= $EFCDAB89;
+ H[2]:= $98BADCFE;
+ H[3]:= $10325476;
+ H[4]:= $C3D2E1F0
+ end
+end;
+
+procedure SHA1Update(var Context: TSHA1Context; Buf: PByteArray; Length: LongWord);
+var i: Longword;
+begin
+for i:= 0 to Pred(Length) do
+ begin
+ Context.Buf[Context.CurrLength]:= Buf^[i];
+ inc(Context.CurrLength);
+ if Context.CurrLength = 64 then
+ begin
+ SHA1Hash(Context);
+ inc(Context.Length, 512);
+ Context.CurrLength:= 0
+ end
+ end
+end;
+
+procedure SHA1UpdateLongwords(var Context: TSHA1Context; Buf: PLongwordArray; Length: LongWord);
+var i: Longword;
+begin
+ for i:= 0 to Pred(Length div 4) do
+ begin
+ SDLNet_Write32(Buf^[i], @Context.Buf[Context.CurrLength]);
+ inc(Context.CurrLength, 4);
+ if Context.CurrLength = 64 then
+ begin
+ SHA1Hash(Context);
+ inc(Context.Length, 512);
+ Context.CurrLength:= 0
+ end
+ end
+end;
+
+function SHA1Final(Context: TSHA1Context): TSHA1Digest;
+var i: LongWord;
+begin
+ Context.Length:= Context.Length + Context.CurrLength shl 3;
+ Context.Buf[Context.CurrLength]:= $80;
+ inc(Context.CurrLength);
+
+ if Context.CurrLength > 56 then
+ begin
+ FillChar(Context.Buf[Context.CurrLength], 64 - Context.CurrLength, 0);
+ Context.CurrLength:= 64;
+ SHA1Hash(Context);
+ Context.CurrLength:=0
+ end;
+
+ FillChar(Context.Buf[Context.CurrLength], 56 - Context.CurrLength, 0);
+
+ for i:= 56 to 63 do
+ Context.Buf[i] := (Context.Length shr ((63 - i) * 8)) and $FF;
+ SHA1Hash(Context);
+ for i:= 0 to 4 do
+ SHA1Final[i]:= Context.H[i];
+
+ FillChar(Context, sizeof(Context), 0)
+end;
+
+end.
diff -r 793386610068 -r b1c2c2f6fc5e misc/wrapper.c
--- a/misc/wrapper.c Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/wrapper.c Wed Oct 27 14:02:20 2010 +0200
@@ -12,9 +12,9 @@
extern void Game (const char **);
int SDL_main (int argc, const char **argv) {
-
+
const char **gameArgs = (const char**) malloc(sizeof(char *) * 9);
-
+
gameArgs[0] = "wrapper"; //UserNick
gameArgs[1] = "0"; //ipcPort
gameArgs[2] = "0"; //isSoundEnabled
@@ -24,9 +24,9 @@
gameArgs[6] = "768"; //cScreenHeight
gameArgs[7] = "1024"; //cScreenHeight
gameArgs[8] = "Save.hws"; //recordFileName
-
+
Game(gameArgs);
free(gameArgs);
-
+
return 0;
}
diff -r 793386610068 -r b1c2c2f6fc5e misc/xfire/xfiregameclient.cpp
--- a/misc/xfire/xfiregameclient.cpp Thu Aug 26 23:59:18 2010 +0200
+++ b/misc/xfire/xfiregameclient.cpp Wed Oct 27 14:02:20 2010 +0200
@@ -29,7 +29,7 @@
#ifdef Module32Next
#undef Module32Next
-#endif
+#endif
int XfireIsLoaded()
@@ -99,7 +99,7 @@
if (snapshot_handle != INVALID_HANDLE_VALUE)
{
MODULEENTRY32 module_entry;
- module_entry.dwSize = sizeof(MODULEENTRY32);
+ module_entry.dwSize = sizeof(MODULEENTRY32);
BOOL result = Module32First(snapshot_handle, &module_entry);
char module_name[] = "xfire_toucan";
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Art.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Art.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Brick.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Brick.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Castle.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Castle.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/City.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/City.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Compost.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Compost.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Desert.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Desert.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/EarthRise.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/EarthRise.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Freeway.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Freeway.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Halloween.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Halloween.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Nature.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Nature.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Olympics.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Olympics.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Rock.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Rock.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/Sheep.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/Sheep.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/bath.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/bath.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/hell.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/hell.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/main theme.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/main theme.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/oriental.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/oriental.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/pirate.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/pirate.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/snow.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/snow.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Music/underwater.ogg
Binary file project_files/HedgewarsMobile/Audio/Music/underwater.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/1C.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/1C.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/2D.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/2D.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/3E.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/3E.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/4F.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/4F.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/5G.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/5G.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/6A.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/6A.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/7B.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/7B.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/8C.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/8C.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/9D.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/9D.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/BirdyLay.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/BirdyLay.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/CollectCrate.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/CollectCrate.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/Droplet1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/Droplet1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/Droplet2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/Droplet2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/Droplet3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/Droplet3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/Hellish.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/Hellish.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/Whistle.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/Whistle.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/Yoohoo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/Yoohoo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/baseballbat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/baseballbat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/bee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/bee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/beewater.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/beewater.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/cake2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/cake2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/denied.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/denied.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/drillgun.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/drillgun.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/egg.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/egg.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/explosion.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/explosion.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/graveimpact.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/graveimpact.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/grenadeimpact.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/grenadeimpact.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/gun.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/gun.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/hell_growl.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/hell_growl.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/hell_ooff.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/hell_ooff.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/hell_ow.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/hell_ow.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/hell_ugh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/hell_ugh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/homerun.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/homerun.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/lowgravity.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/lowgravity.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/melonimpact.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/melonimpact.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/minetick.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/minetick.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/molotov.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/molotov.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/mortar.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/mortar.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/pickhammer.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/pickhammer.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/placed.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/placed.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/rcplane.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/rcplane.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/ride_of_the_valkyries.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/ride_of_the_valkyries.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/ropeattach.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/ropeattach.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/roperelease.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/roperelease.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/ropeshot.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/ropeshot.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/shotgunfire.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/shotgunfire.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/shotgunreload.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/shotgunreload.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/shutterclick.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/shutterclick.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/skip.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/skip.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/sniperreload.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/sniperreload.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/splash.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/splash.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/steam.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/steam.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/steps.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/steps.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/suddendeath.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/suddendeath.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/switchhog.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/switchhog.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/throwpowerup.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/throwpowerup.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/throwrelease.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/throwrelease.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/ufo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/ufo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Amazing.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Amazing.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Boring.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Boring.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Brilliant.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Brilliant.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Bugger.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Bugger.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Bungee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Bungee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Byebye.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Byebye.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Comeonthen.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Comeonthen.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Coward.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Coward.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Cutitout.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Cutitout.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Drat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Drat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Enemydown.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Enemydown.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Excellent.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Excellent.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Fire.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Fire.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Firepunch1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Firepunch1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Firstblood.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Firstblood.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Flawless.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Flawless.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Gonnagetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Gonnagetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Grenade.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Grenade.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Hello.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Hello.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Hmm.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Hmm.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Hurry.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Hurry.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Illgetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Illgetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Incoming.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Incoming.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Jump1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Jump1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Jump2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Jump2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Jump3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Jump3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Justyouwait.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Justyouwait.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Kamikaze.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Kamikaze.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Laugh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Laugh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Leavemealone.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Leavemealone.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Melon.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Melon.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Missed.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Missed.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Nooo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Nooo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Nutter.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Nutter.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ohdear.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ohdear.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ooff1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ooff1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ooff2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ooff2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ooff3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ooff3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Oops.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Oops.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ouch.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ouch.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Ow4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Perfect.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Perfect.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Reinforcements.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Reinforcements.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Revenge.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Revenge.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Runaway.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Runaway.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Sameteam.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Sameteam.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Solong.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Solong.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Stupid.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Stupid.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Takecover.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Takecover.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Thisoneismine.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Thisoneismine.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Traitor.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Traitor.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Uh-oh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Uh-oh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Victory.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Victory.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Watchit.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Watchit.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Watchthis.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Watchthis.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Whatthe.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Whatthe.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Whoopsee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Whoopsee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Yessir.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Yessir.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/British/Youllregretthat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/British/Youllregretthat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Amazing.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Amazing.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Boring.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Boring.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Brilliant.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Brilliant.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Bugger.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Bugger.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Bungee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Bungee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Byebye.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Byebye.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Comeonthen.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Comeonthen.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Coward.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Coward.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Cutitout.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Cutitout.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Drat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Drat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Enemydown.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Enemydown.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Excellent.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Excellent.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Fire.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Fire.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch5.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch5.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch6.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firepunch6.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firstblood.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Firstblood.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Flawless.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Flawless.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Gonnagetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Gonnagetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Grenade.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Grenade.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Hello.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Hello.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Hmm.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Hmm.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Hurry.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Hurry.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Illgetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Illgetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Incoming.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Incoming.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Jump1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Jump1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Jump2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Jump2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Jump3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Jump3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Justyouwait.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Justyouwait.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Kamikaze.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Kamikaze.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Laugh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Laugh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Leavemealone.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Leavemealone.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Melon.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Melon.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Missed.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Missed.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Nooo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Nooo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Nutter.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Nutter.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ohdear.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ohdear.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ooff1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ooff1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ooff2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ooff2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ooff3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ooff3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Oops.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Oops.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ouch.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ouch.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Ow4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Perfect.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Perfect.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/PoisonCough.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/PoisonCough.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/PoisonMoan.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/PoisonMoan.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Reinforcements.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Reinforcements.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Revenge.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Revenge.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Runaway.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Runaway.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Sameteam.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Sameteam.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Solong.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Solong.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Stupid.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Stupid.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Takecover.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Takecover.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Thisoneismine.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Thisoneismine.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Traitor.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Traitor.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Uh-oh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Uh-oh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Victory.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Victory.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Watchit.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Watchit.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Watchthis.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Watchthis.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Whatthe.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Whatthe.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Whoopsee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Whoopsee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Yessir.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Yessir.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Youllregretthat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Default/Youllregretthat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Amazing.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Amazing.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Boring.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Boring.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Brilliant.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Brilliant.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Bugger.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Bugger.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Bungee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Bungee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Byebye.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Byebye.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Comeonthen.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Comeonthen.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Coward.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Coward.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Cutitout.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Cutitout.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Drat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Drat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Enemydown.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Enemydown.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Excellent.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Excellent.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Fire.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Fire.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Firepunch1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Firepunch1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Firstblood.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Firstblood.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Flawless.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Flawless.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Gonnagetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Gonnagetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Grenade.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Grenade.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Hello.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Hello.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Hmm.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Hmm.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Hurry.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Hurry.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Illgetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Illgetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Incoming.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Incoming.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Jump1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Jump1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Jump2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Jump2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Jump3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Jump3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Justyouwait.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Justyouwait.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Kamikaze.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Kamikaze.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Laugh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Laugh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Leavemealone.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Leavemealone.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Melon.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Melon.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Missed.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Missed.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Nooo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Nooo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Nutter.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Nutter.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ohdear.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ohdear.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ooff1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ooff1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ooff2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ooff2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ooff3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ooff3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Oops.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Oops.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ouch.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ouch.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Ow4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Perfect.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Perfect.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Reinforcements.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Reinforcements.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Revenge.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Revenge.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Runaway.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Runaway.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Sameteam.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Sameteam.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Solong.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Solong.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Stupid.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Stupid.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Takecover.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Takecover.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Thisoneismine.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Thisoneismine.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Traitor.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Traitor.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Uh-oh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Uh-oh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Victory.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Victory.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Watchit.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Watchit.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Watchthis.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Watchthis.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Whatthe.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Whatthe.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Whoopsee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Whoopsee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Yessir.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Yessir.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Youllregretthat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Mobster/Youllregretthat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Amazing.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Amazing.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Boring.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Boring.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Brilliant.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Brilliant.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Bugger.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Bugger.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Bungee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Bungee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Byebye.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Byebye.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Comeonthen.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Comeonthen.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Coward.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Coward.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Cutitout.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Cutitout.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Drat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Drat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Enemydown.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Enemydown.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Excellent.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Excellent.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Fire.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Fire.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch5.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch5.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch6.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firepunch6.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firstblood.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Firstblood.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Flawless.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Flawless.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Gonnagetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Gonnagetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Grenade.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Grenade.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Hello.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Hello.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Hmm.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Hmm.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Hurry.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Hurry.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Illgetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Illgetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Incoming.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Incoming.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Jump1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Jump1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Jump2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Jump2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Jump3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Jump3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Justyouwait.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Justyouwait.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Kamikaze.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Kamikaze.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Laugh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Laugh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Leavemealone.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Leavemealone.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Melon.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Melon.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Missed.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Missed.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Nooo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Nooo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Nutter.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Nutter.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ohdear.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ohdear.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ooff1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ooff1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ooff2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ooff2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ooff3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ooff3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Oops.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Oops.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ouch.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ouch.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Ow4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Perfect.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Perfect.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Reinforcements.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Reinforcements.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Revenge.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Revenge.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Runaway.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Runaway.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Sameteam.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Sameteam.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Solong.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Solong.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Stupid.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Stupid.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Takecover.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Takecover.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Thisoneismine.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Thisoneismine.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Traitor.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Traitor.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Uh-oh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Uh-oh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Victory.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Victory.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Watchit.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Watchit.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Watchthis.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Watchthis.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Whatthe.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Whatthe.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Whoopsee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Whoopsee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Yessir.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Yessir.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Youllregretthat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Pirate/Youllregretthat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Amazing.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Amazing.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Boring.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Boring.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Brilliant.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Brilliant.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Bugger.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Bugger.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Bungee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Bungee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Byebye.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Byebye.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Comeonthen.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Comeonthen.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Coward.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Coward.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Cutitout.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Cutitout.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Drat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Drat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Enemydown.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Enemydown.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Excellent.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Excellent.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Fire.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Fire.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch5.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch5.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch6.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firepunch6.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firstblood.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Firstblood.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Flawless.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Flawless.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Gonnagetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Gonnagetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Grenade.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Grenade.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Hello.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Hello.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Hmm.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Hmm.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Hurry.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Hurry.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Illgetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Illgetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Incoming.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Incoming.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Jump1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Jump1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Jump2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Jump2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Jump3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Jump3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Justyouwait.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Justyouwait.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Kamikaze.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Kamikaze.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Laugh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Laugh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Leavemealone.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Leavemealone.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Melon.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Melon.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Missed.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Missed.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Nooo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Nooo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Nutter.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Nutter.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ohdear.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ohdear.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ooff1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ooff1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ooff2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ooff2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ooff3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ooff3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Oops.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Oops.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ouch.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ouch.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Ow4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Perfect.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Perfect.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Reinforcements.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Reinforcements.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Revenge.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Revenge.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Runaway.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Runaway.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Sameteam.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Sameteam.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Solong.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Solong.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Stupid.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Stupid.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Takecover.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Takecover.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Thisoneismine.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Thisoneismine.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Traitor.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Traitor.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Uh-oh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Uh-oh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Victory.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Victory.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Watchit.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Watchit.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Watchthis.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Watchthis.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Whatthe.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Whatthe.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Whoopsee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Whoopsee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Yessir.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Yessir.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Youllregretthat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Robot/Youllregretthat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Amazing.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Amazing.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Boring.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Boring.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Brilliant.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Brilliant.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Bugger.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Bugger.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Bungee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Bungee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Byebye.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Byebye.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Comeonthen.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Comeonthen.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Coward.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Coward.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Cutitout.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Cutitout.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Drat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Drat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Enemydown.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Enemydown.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Excellent.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Excellent.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Fire.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Fire.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Firepunch1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Firepunch1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Firstblood.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Firstblood.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Flawless.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Flawless.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Gonnagetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Gonnagetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Grenade.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Grenade.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Hello.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Hello.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Hmm.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Hmm.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Hurry.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Hurry.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Illgetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Illgetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Incoming.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Incoming.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Jump1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Jump1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Jump2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Jump2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Jump3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Jump3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Justyouwait.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Justyouwait.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Kamikaze.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Kamikaze.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Laugh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Laugh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Leavemealone.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Leavemealone.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Melon.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Melon.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Missed.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Missed.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Nooo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Nooo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Nutter.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Nutter.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ohdear.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ohdear.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ooff1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ooff1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ooff2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ooff2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ooff3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ooff3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Oops.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Oops.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ouch.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ouch.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Ow4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Perfect.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Perfect.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Reinforcements.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Reinforcements.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Revenge.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Revenge.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Runaway.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Runaway.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Sameteam.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Sameteam.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Solong.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Solong.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Stupid.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Stupid.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Takecover.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Takecover.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Thisoneismine.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Thisoneismine.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Traitor.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Traitor.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Uh-oh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Uh-oh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Victory.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Victory.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Watchit.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Watchit.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Watchthis.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Watchthis.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Whatthe.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Whatthe.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Whoopsee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Whoopsee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Yessir.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Yessir.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Youllregretthat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Russian/Youllregretthat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Amazing.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Amazing.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Boring.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Boring.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Brilliant.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Brilliant.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Bugger.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Bugger.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Bungee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Bungee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Byebye.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Byebye.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Comeonthen.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Comeonthen.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Coward.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Coward.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Cutitout.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Cutitout.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Drat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Drat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Enemydown.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Enemydown.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Excellent.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Excellent.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Fire.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Fire.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch5.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch5.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch6.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firepunch6.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firstblood.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Firstblood.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Flawless.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Flawless.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/FlawlessPossibility.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/FlawlessPossibility.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Gonnagetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Gonnagetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Grenade.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Grenade.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Hello.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Hello.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Hmm.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Hmm.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Hurry.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Hurry.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Illgetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Illgetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Incoming.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Incoming.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Jump1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Jump1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Jump2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Jump2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Jump3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Jump3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Justyouwait.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Justyouwait.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Kamikaze.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Kamikaze.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Laugh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Laugh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Leavemealone.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Leavemealone.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Melon.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Melon.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Missed.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Missed.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Nooo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Nooo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Nutter.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Nutter.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ohdear.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ohdear.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ooff1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ooff1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ooff2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ooff2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ooff3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ooff3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Oops.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Oops.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ouch.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ouch.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Ow4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Perfect.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Perfect.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Reinforcements.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Reinforcements.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Revenge.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Revenge.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Runaway.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Runaway.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Sameteam.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Sameteam.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Solong.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Solong.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Stupid.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Stupid.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Takecover.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Takecover.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Thisoneismine.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Thisoneismine.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Traitor.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Traitor.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Uh-oh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Uh-oh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Victory.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Victory.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/VictoryPossibility.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/VictoryPossibility.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Watchit.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Watchit.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Watchthis.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Watchthis.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Whatthe.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Whatthe.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Whoopsee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Whoopsee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Yessir.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Yessir.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Youllregretthat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Singer/Youllregretthat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Amazing.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Amazing.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Boring.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Boring.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Brilliant.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Brilliant.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Bugger.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Bugger.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Bungee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Bungee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Byebye.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Byebye.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Comeonthen.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Comeonthen.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Coward.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Coward.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Cutitout.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Cutitout.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Drat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Drat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Enemydown.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Enemydown.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Excellent.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Excellent.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Fire.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Fire.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch5.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch5.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch6.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firepunch6.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firstblood.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Firstblood.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Flawless.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Flawless.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Gonnagetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Gonnagetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Grenade.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Grenade.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Hello.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Hello.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Hmm.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Hmm.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Hurry.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Hurry.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Illgetyou.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Illgetyou.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Incoming.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Incoming.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Jump1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Jump1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Jump2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Jump2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Jump3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Jump3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Justyouwait.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Justyouwait.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Kamikaze.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Kamikaze.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Laugh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Laugh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Leavemealone.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Leavemealone.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Melon.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Melon.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Missed.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Missed.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Nooo.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Nooo.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Nutter.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Nutter.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ohdear.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ohdear.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ooff1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ooff1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ooff2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ooff2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ooff3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ooff3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Oops.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Oops.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ouch.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ouch.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow1.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow1.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow2.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow2.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow3.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow3.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow4.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Ow4.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Perfect.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Perfect.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Reinforcements.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Reinforcements.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Revenge.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Revenge.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Runaway.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Runaway.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Sameteam.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Sameteam.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Solong.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Solong.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Stupid.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Stupid.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Takecover.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Takecover.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Thisoneismine.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Thisoneismine.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Traitor.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Traitor.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Uh-oh.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Uh-oh.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Victory.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Victory.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Watchit.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Watchit.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Watchthis.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Watchthis.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Whatthe.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Whatthe.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Whoopsee.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Whoopsee.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Yessir.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Yessir.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Youllregretthat.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/voices/Surfer/Youllregretthat.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/warp.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/warp.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Audio/Sounds/whipcrack.ogg
Binary file project_files/HedgewarsMobile/Audio/Sounds/whipcrack.ogg has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/AboutViewController.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/AboutViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,38 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 01/08/2010.
+ */
+
+
+#import
+
+
+@interface AboutViewController : UIViewController {
+ UITableView *tableView;
+ UISegmentedControl *segmentedControl;
+ NSArray *people;
+}
+
+@property (nonatomic,retain) IBOutlet UITableView *tableView;
+@property (nonatomic,retain) IBOutlet UISegmentedControl *segmentedControl;
+@property (nonatomic,retain) NSArray *people;
+
+-(IBAction) buttonPressed:(id) sender;
+-(IBAction) segmentedControlChanged:(id) sender;
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/AboutViewController.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/AboutViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,106 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 01/08/2010.
+ */
+
+
+#import "AboutViewController.h"
+#import "CommodityFunctions.h"
+
+@implementation AboutViewController
+@synthesize tableView, segmentedControl, people;
+
+-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
+ return rotationManager(interfaceOrientation);
+}
+
+-(void) viewDidLoad {
+ self.tableView.backgroundView = nil;
+ self.tableView.allowsSelection = NO;
+
+ NSString *strPath = [NSString stringWithFormat:@"%@/credits.plist",IFRONTEND_DIRECTORY()];
+ NSArray *array = [[NSArray alloc] initWithContentsOfFile:strPath];
+ self.people = array;
+ [array release];
+
+ [super viewDidLoad];
+}
+
+-(IBAction) buttonPressed:(id) sender {
+ playSound(@"backSound");
+ [[self parentViewController] dismissModalViewControllerAnimated:YES];
+}
+
+-(IBAction) segmentedControlChanged:(id) sender {
+ playSound(@"clickSound");
+ [self.tableView setContentOffset:CGPointMake(0, 0) animated:NO];
+ [self.tableView reloadData];
+}
+
+#pragma mark -
+#pragma mark Table view data source
+-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+ return 1;
+}
+
+-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ return [[self.people objectAtIndex:self.segmentedControl.selectedSegmentIndex] count];
+}
+
+-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ static NSString *CellIdentifier = @"Cell";
+
+ UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
+ if (cell == nil)
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
+
+ // first all the names, then the title (which is offset 5)
+ cell.textLabel.text = [[self.people objectAtIndex:self.segmentedControl.selectedSegmentIndex] objectAtIndex:[indexPath row]];
+ cell.detailTextLabel.text = [[self.people objectAtIndex:(self.segmentedControl.selectedSegmentIndex + 5)] objectAtIndex:[indexPath row]];
+
+ return cell;
+}
+
+#pragma mark -
+#pragma mark Table view delegate
+-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+ // do nothing
+}
+
+#pragma mark -
+#pragma mark Memory Management
+-(void) didReceiveMemoryWarning {
+ self.people = nil;
+ [super didReceiveMemoryWarning];
+}
+
+-(void) viewDidUnload {
+ self.tableView = nil;
+ self.segmentedControl = nil;
+ self.people = nil;
+ [super viewDidUnload];
+}
+
+-(void) dealloc {
+ [tableView release];
+ [segmentedControl release];
+ [people release];
+ [super dealloc];
+}
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/AboutViewController.xib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/AboutViewController.xib Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,696 @@
+
+
+
+ 1024
+ 10F569
+ 788
+ 1038.29
+ 461.00
+
+
+
+
+
+ YES
+
+ IBFilesOwner
+ IBIPadFramework
+
+
+ IBFirstResponder
+ IBIPadFramework
+
+
+
+ 292
+
+ YES
+
+
+ 290
+
+ YES
+
+
+ 292
+ {{127, 7}, {289, 30}}
+
+
+ NO
+ IBIPadFramework
+ 2
+ 5
+ 0
+
+ YES
+ Code
+ Art
+ Sound
+ Locale
+ Special
+
+
+ YES
+
+
+
+
+
+
+
+ YES
+
+
+
+
+
+
+
+ YES
+ {0, 0}
+ {0, 0}
+ {0, 0}
+ {0, 0}
+ {0, 0}
+
+
+ YES
+
+
+
+
+
+
+
+
+ {543, 44}
+
+
+ IBIPadFramework
+
+ YES
+
+
+
+ IBIPadFramework
+ 1
+
+ 0
+
+
+ IBIPadFramework
+
+
+
+
+
+ 274
+ {{0, 44}, {543, 577}}
+
+
+ NO
+ IBIPadFramework
+
+ NSImage
+ background_small.png
+
+
+
+
+ 274
+ {{0, 44}, {543, 577}}
+
+
+
+ 1
+ MCAwIDAgMAA
+
+ YES
+ IBIPadFramework
+ YES
+ 1
+ 2
+ 0
+ YES
+ 44
+ 10
+ 10
+
+
+ {543, 621}
+
+
+
+ 3
+ MQA
+
+ NO
+ NO
+
+ 3
+
+ IBIPadFramework
+
+
+
+
+ YES
+
+
+ view
+
+
+
+ 3
+
+
+
+ buttonPressed:
+
+
+
+ 8
+
+
+
+ dataSource
+
+
+
+ 12
+
+
+
+ delegate
+
+
+
+ 13
+
+
+
+ tableView
+
+
+
+ 14
+
+
+
+ segmentedControlChanged:
+
+
+ 13
+
+ 15
+
+
+
+ segmentedControl
+
+
+
+ 16
+
+
+
+
+ YES
+
+ 0
+
+
+
+
+
+ -1
+
+
+ File's Owner
+
+
+ -2
+
+
+
+
+ 2
+
+
+ YES
+
+
+
+
+
+
+
+ 5
+
+
+ YES
+
+
+
+
+
+ 6
+
+
+ YES
+
+
+
+
+
+
+ 7
+
+
+
+
+ 9
+
+
+
+
+ 10
+
+
+
+
+ 11
+
+
+
+
+
+
+ YES
+
+ YES
+ -1.CustomClassName
+ -2.CustomClassName
+ 10.IBPluginDependency
+ 11.IBPluginDependency
+ 2.IBEditorWindowLastContentRect
+ 2.IBPluginDependency
+ 5.IBPluginDependency
+ 6.IBPluginDependency
+ 7.IBPluginDependency
+ 9.IBPluginDependency
+
+
+ YES
+ AboutViewController
+ UIResponder
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ {{376, 170}, {543, 621}}
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+
+
+ YES
+
+
+ YES
+
+
+
+
+ YES
+
+
+ YES
+
+
+
+ 16
+
+
+
+ YES
+
+ AboutViewController
+ UIViewController
+
+ YES
+
+ YES
+ buttonPressed:
+ segmentedControlChanged:
+
+
+ YES
+ id
+ id
+
+
+
+ YES
+
+ YES
+ buttonPressed:
+ segmentedControlChanged:
+
+
+ YES
+
+ buttonPressed:
+ id
+
+
+ segmentedControlChanged:
+ id
+
+
+
+
+ YES
+
+ YES
+ segmentedControl
+ tableView
+
+
+ YES
+ UISegmentedControl
+ UITableView
+
+
+
+ YES
+
+ YES
+ segmentedControl
+ tableView
+
+
+ YES
+
+ segmentedControl
+ UISegmentedControl
+
+
+ tableView
+ UITableView
+
+
+
+
+ IBProjectSource
+ Classes/AboutViewController.h
+
+
+
+
+ YES
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSError.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSFileManager.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueCoding.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueObserving.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyedArchiver.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSObject.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSRunLoop.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSThread.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURL.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURLConnection.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CAAnimation.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CALayer.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIAccessibility.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINibLoading.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIResponder.h
+
+
+
+ UIBarButtonItem
+ UIBarItem
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIBarButtonItem.h
+
+
+
+ UIBarItem
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIBarItem.h
+
+
+
+ UIControl
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIControl.h
+
+
+
+ UIImageView
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIImageView.h
+
+
+
+ UINavigationBar
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINavigationBar.h
+
+
+
+ UINavigationItem
+ NSObject
+
+
+
+ UIResponder
+ NSObject
+
+
+
+ UIScrollView
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIScrollView.h
+
+
+
+ UISearchBar
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchBar.h
+
+
+
+ UISearchDisplayController
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchDisplayController.h
+
+
+
+ UISegmentedControl
+ UIControl
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISegmentedControl.h
+
+
+
+ UITableView
+ UIScrollView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITableView.h
+
+
+
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITextField.h
+
+
+
+ UIView
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIView.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINavigationController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIPopoverController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISplitViewController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITabBarController.h
+
+
+
+ UIViewController
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIViewController.h
+
+
+
+
+ 0
+ IBIPadFramework
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS
+
+
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3
+
+
+ YES
+ ../Hedgewars.xcodeproj
+ 3
+
+ background_small.png
+ {539, 639}
+
+ 117
+
+
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/AmmoMenuViewController.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,55 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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
+
+
+@interface AmmoMenuViewController : UIViewController {
+ NSArray *buttonsArray;
+ NSArray *imagesArray;
+
+ UILabel *nameLabel;
+ UILabel *extraLabel;
+ UILabel *captionLabel;
+
+ uint8_t *delay;
+ BOOL *shouldUpdateImage;
+ CGPoint startingPoint;
+ BOOL isVisible;
+}
+
+@property (retain) NSArray *buttonsArray;
+@property (retain) NSArray *imagesArray;
+@property (nonatomic,retain) UILabel *nameLabel;
+@property (nonatomic,retain) UILabel *extraLabel;
+@property (nonatomic,retain) UILabel *captionLabel;
+@property (assign) BOOL isVisible;
+
+-(void) buttonPressed:(id) sender;
+-(void) buttonReleased:(id) sender;
+-(void) buttonCancelled:(id) sender;
+-(void) appearInView:(UIView *)container;
+-(void) disappear;
+-(void) updateAmmoVisuals;
+-(void) loadLabels;
+-(void) loadAmmoStuff:(id) object;
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,368 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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
+#import "CommodityFunctions.h"
+#import "UIImageExtra.h"
+#import "PascalImports.h"
+
+#define BTNS_PER_ROW 9
+#define DEFAULT_DESCRIPTION NSLocalizedString(@"Hold your finger on a weapon to see what it does",@"")
+
+@implementation AmmoMenuViewController
+@synthesize imagesArray, buttonsArray, nameLabel, extraLabel, captionLabel, isVisible;
+
+-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
+ return rotationManager(interfaceOrientation);
+}
+
+#pragma mark -
+#pragma mark view handling
+-(void) 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.view.autoresizingMask = UIViewAutoresizingNone;
+
+ self.isVisible = NO;
+ delay = (uint8_t *)calloc(HW_getNumberOfWeapons(), sizeof(uint8_t));
+ HW_getAmmoDelays(delay);
+
+ shouldUpdateImage = (BOOL *)calloc(HW_getNumberOfWeapons(), sizeof(BOOL));
+
+ [super viewDidLoad];
+}
+
+-(void) viewWillAppear:(BOOL)animated {
+ [self updateAmmoVisuals];
+ [super viewWillAppear:animated];
+}
+
+-(void) appearInView:(UIView *)container {
+ [self viewWillAppear:YES];
+ [container addSubview:self.view];
+ if (IS_DUALHEAD() == NO)
+ self.view.center = CGPointMake(container.center.y, container.center.x);
+ else {
+ UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
+ if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight)
+ self.view.center = CGPointMake(container.center.y, container.center.x);
+ else
+ self.view.center = CGPointMake(container.center.x, container.center.y);
+ }
+ self.isVisible = YES;
+}
+
+-(void) disappear {
+ if (self.isVisible)
+ [self.view removeFromSuperview];
+ self.isVisible = NO;
+}
+
+#pragma mark -
+#pragma mark drawing
+-(void) loadLabels {
+ int x = 12;
+ int y = (HW_getNumberOfWeapons()/BTNS_PER_ROW)*44 + 18;
+ UILabel *name = [[UILabel alloc] initWithFrame:CGRectMake(x, y, 200, 20)];
+ name.backgroundColor = [UIColor clearColor];
+ name.textColor = UICOLOR_HW_YELLOW_BODER;
+ name.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
+ self.nameLabel = name;
+ [self.view addSubview:self.nameLabel];
+ [name release];
+
+ UILabel *caption = [[UILabel alloc] initWithFrame:CGRectMake(x+200, y, 220, 20)];
+ caption.backgroundColor = [UIColor clearColor];
+ caption.textColor = [UIColor whiteColor];
+ caption.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]];
+ caption.adjustsFontSizeToFitWidth = YES;
+ caption.minimumFontSize = 8;
+ self.captionLabel = caption;
+ [self.view addSubview:self.captionLabel];
+ [caption release];
+
+ UILabel *description = [[UILabel alloc] initWithFrame:CGRectMake(x+2, y+20, 410, 53)];
+ description.backgroundColor = [UIColor clearColor];
+ description.textColor = [UIColor whiteColor];
+ description.text = DEFAULT_DESCRIPTION;
+ description.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]];
+ description.adjustsFontSizeToFitWidth = YES;
+ description.minimumFontSize = 8;
+ description.numberOfLines = 0;
+ self.extraLabel = description;
+ [self.view addSubview:self.extraLabel];
+ [description release];
+}
+
+-(void) loadAmmoStuff:(id) object {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSString *str = [NSString stringWithFormat:@"%@/AmmoMenu/Ammos.png",GRAPHICS_DIRECTORY()];
+ UIImage *ammoStoreImage = [[UIImage alloc] initWithContentsOfFile:str];
+
+ NSMutableArray *imgs = [[NSMutableArray alloc] initWithCapacity:HW_getNumberOfWeapons()];
+ NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:HW_getNumberOfWeapons()];
+ int i, j, e;
+ for (i = 0, j = 0, e = 0; i < HW_getNumberOfWeapons(); i++) {
+ int x, y;
+ float w, radius;
+
+ // move utilities aside and make 'em rounded
+ if (HW_isWeaponAnEffect(i)) {
+ x = 432;
+ y = 20 + 48*e++;
+ w = 1.5;
+ radius = 22;
+ } else {
+ x = 10+(j%BTNS_PER_ROW)*44;
+ y = 10+(j/BTNS_PER_ROW)*44;
+ if (j / BTNS_PER_ROW % 2 != 0)
+ x += 20;
+ w = 1;
+ radius = 6;
+ j++;
+ }
+
+ UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
+ button.frame = CGRectMake(x, y, 40, 40);
+ button.tag = i;
+ button.layer.borderColor = [UICOLOR_HW_YELLOW_TEXT CGColor];
+ button.layer.borderWidth = w;
+ [button.layer setCornerRadius:radius];
+ [button.layer setMasksToBounds:YES];
+ [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchDown];
+ [button addTarget:self action:@selector(buttonReleased:) forControlEvents:UIControlEventTouchUpInside];
+ [button addTarget:self action:@selector(buttonCancelled:) forControlEvents:UIControlEventTouchUpOutside|UIControlEventTouchCancel];
+ [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];
+
+ int x_src = ((i*32)/(int)ammoStoreImage.size.height)*32;
+ int y_src = (i*32)%(int)ammoStoreImage.size.height;
+ UIImage *img = [ammoStoreImage cutAt:CGRectMake(x_src, y_src, 32, 32)];
+ [imgs addObject:img];
+ }
+ [self performSelectorOnMainThread:@selector(setButtonsArray:) withObject:array waitUntilDone:NO];
+ [array release];
+
+ [self performSelectorOnMainThread:@selector(setImagesArray:) withObject:imgs waitUntilDone:NO];
+ [imgs release];
+ [ammoStoreImage release];
+
+ [self performSelectorOnMainThread:@selector(loadLabels) withObject:nil waitUntilDone:NO];
+
+ [self performSelectorOnMainThread:@selector(updateAmmoVisuals) withObject:nil waitUntilDone:YES];
+ UIActivityIndicatorView *spinner = (UIActivityIndicatorView *)object;
+ [spinner stopAnimating];
+ [pool drain];
+}
+
+-(void) updateAmmoVisuals {
+ if (self.buttonsArray == nil || self.imagesArray == 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];
+ return;
+ }
+
+ int *loadout = (int *)calloc(HW_getNumberOfWeapons(), sizeof(int));
+ int res = HW_getAmmoCounts(loadout);
+ int turns = HW_getTurnsForCurrentTeam();
+
+ if (res == 0) {
+ self.view.userInteractionEnabled = YES;
+
+ for (int i = 0; i < HW_getNumberOfWeapons(); i++) {
+ UIButton *button = [self.buttonsArray objectAtIndex:i];
+ if (loadout[i] > 0) {
+ if (delay[i]-turns >= 0) {
+ button.layer.borderColor = [[UIColor lightGrayColor] CGColor];
+ [button setTitle:[NSString stringWithFormat:@" %d ",delay[i]-turns+1] forState:UIControlStateNormal];
+ if (button.currentBackgroundImage == nil || shouldUpdateImage[i] == NO) {
+ UIImage *img = [self.imagesArray objectAtIndex:i];
+ [button setBackgroundImage:[img convertToGrayScale] forState:UIControlStateNormal];
+ shouldUpdateImage[i] = YES;
+ }
+ } else {
+ button.layer.borderColor = [UICOLOR_HW_YELLOW_TEXT CGColor];
+ [button setTitle:nil forState:UIControlStateNormal];
+ if (button.currentBackgroundImage == nil || shouldUpdateImage[i] == YES) {
+ UIImage *img = [self.imagesArray objectAtIndex:i];
+ [button setBackgroundImage:img forState:UIControlStateNormal];
+ shouldUpdateImage[i] = NO;
+ }
+ }
+ button.enabled = YES;
+ } else {
+ if (button.enabled == YES)
+ [button setBackgroundImage:nil forState:UIControlStateNormal];
+ button.layer.borderColor = [[UIColor darkGrayColor] CGColor];
+ button.enabled = NO;
+ shouldUpdateImage[i] = NO;
+ }
+ }
+ } else {
+ self.view.userInteractionEnabled = NO;
+ }
+
+ free(loadout);
+ loadout = NULL;
+}
+
+#pragma mark -
+#pragma mark user interaction
+-(void) buttonPressed:(id) sender {
+ UIButton *theButton = (UIButton *)sender;
+ if (self.nameLabel == nil || self.extraLabel == nil)
+ [self loadLabels];
+
+ self.nameLabel.text = [NSString stringWithUTF8String:HW_getWeaponNameByIndex(theButton.tag)];
+ // description contains a lot of unnecessary stuff, we clean it by removing .|, !| and ?|
+ NSString *description = [NSString stringWithUTF8String:HW_getWeaponDescriptionByIndex(theButton.tag)];
+ NSArray *elements = [description componentsSeparatedByString:@".|"];
+ NSArray *purgedElements = [[elements objectAtIndex:0] componentsSeparatedByString:@"!|"];
+ NSArray *morePurgedElements = [[purgedElements objectAtIndex:0] componentsSeparatedByString:@"?|"];
+ self.extraLabel.text = [[[morePurgedElements objectAtIndex:0] stringByReplacingOccurrencesOfString:@"|" withString:@" "] stringByAppendingString:@"."];
+ if (theButton.currentTitle != nil)
+ self.captionLabel.text = NSLocalizedString(@"This weapon is locked",@"");
+ else
+ self.captionLabel.text = [NSString stringWithUTF8String:HW_getWeaponCaptionByIndex(theButton.tag)];
+}
+
+-(void) buttonCancelled:(id) sender {
+ self.nameLabel.text = nil;
+ self.extraLabel.text = DEFAULT_DESCRIPTION;
+ self.captionLabel.text = nil;
+}
+
+-(void) buttonReleased:(id) sender {
+ UIButton *theButton = (UIButton *)sender;
+ if (self.nameLabel == nil || self.extraLabel == nil)
+ [self loadLabels];
+
+ self.nameLabel.text = nil;
+ self.extraLabel.text = DEFAULT_DESCRIPTION;
+ self.captionLabel.text = nil;
+ if (theButton.currentTitle == nil) {
+ HW_setWeapon(theButton.tag);
+ playSound(@"clickSound");
+ if (IS_DUALHEAD() == NO)
+ [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];
+ }
+ */
+ if (IS_IPAD() == NO)
+ [self disappear];
+}
+
+-(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.imagesArray = nil;
+ self.buttonsArray = nil;
+ self.nameLabel = nil;
+ self.extraLabel = nil;
+ self.captionLabel = nil;
+ MSG_MEMCLEAN();
+ [super didReceiveMemoryWarning];
+}
+
+-(void) viewDidUnload {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ self.imagesArray = nil;
+ self.buttonsArray = nil;
+ self.nameLabel = nil;
+ self.extraLabel = nil;
+ self.captionLabel = nil;
+ free(delay);
+ delay = NULL;
+ free(shouldUpdateImage);
+ shouldUpdateImage = NULL;
+ MSG_DIDUNLOAD();
+ [super viewDidUnload];
+}
+
+-(void) dealloc {
+ [nameLabel release];
+ [extraLabel release];
+ [captionLabel release];
+ [imagesArray release];
+ [buttonsArray release];
+ [super dealloc];
+}
+
+@end
+
+void updateVisualsNewTurn (void) {
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"updateAmmoVisuals" object:nil];
+}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/CGPointUtils.c
--- a/project_files/HedgewarsMobile/Classes/CGPointUtils.c Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/CGPointUtils.c Wed Oct 27 14:02:20 2010 +0200
@@ -8,7 +8,7 @@
*/
#include "CGPointUtils.h"
-#include
+#include "math.h"
CGFloat distanceBetweenPoints (CGPoint first, CGPoint second) {
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/CGPointUtils.h
--- a/project_files/HedgewarsMobile/Classes/CGPointUtils.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/CGPointUtils.h Wed Oct 27 14:02:20 2010 +0200
@@ -9,12 +9,15 @@
#import
-#define degreesToRadian(x) (M_PI * x / 180.0)
-#define radiansToDegrees(x) (180.0 * x / M_PI)
+#define degreesToRadians(x) ( M_PI * x / 180.0)
+#define radiansToDegrees(x) (180.0 * x / M_PI )
-#define HWX(x) (int)(x-screen.size.height/2)
-#define HWY(x) (int)(screen.size.width-x)
+#define HWX(x) (int)(x-screen.size.height/2)/HW_zoomFactor()
+#define HWY(x) (int)(screen.size.width-x)/HW_zoomFactor() + (IS_IPAD()?40:17.5)*HW_zoomLevel()/HW_zoomFactor()
+
+#define HWXZ(x) (int)(x-screen.size.height/2)
+#define HWYZ(x) (int)(screen.size.width-x)
CGFloat distanceBetweenPoints (CGPoint first, CGPoint second);
CGFloat angleBetweenPoints(CGPoint first, CGPoint second);
-CGFloat angleBetweenLines(CGPoint line1Start, CGPoint line1End, CGPoint line2Start, CGPoint lin2End);
+CGFloat angleBetweenLines(CGPoint line1Start, CGPoint line1End, CGPoint line2Start, CGPoint line2End);
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/CommodityFunctions.h
--- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,50 +1,74 @@
-//
-// CommodityFunctions.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 08/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/04/2010.
+ */
+
#import
-#define MAX_HOGS 8
+#define DOCUMENTS_FOLDER() [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
+#define SETTINGS_FILE() [DOCUMENTS_FOLDER() stringByAppendingString:@"/settings.plist"]
+#define DEBUG_FILE() [DOCUMENTS_FOLDER() stringByAppendingString:@"/hw-game.log"]
-#define SETTINGS_FILE() [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
- objectAtIndex:0] stringByAppendingString:@"/settings.plist"]
-#define DEBUG_FILE() [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
- objectAtIndex:0] stringByAppendingString:@"/debug.txt"]
-
-#define TEAMS_DIRECTORY() [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
- objectAtIndex:0] stringByAppendingString:@"/Teams/"]
-#define WEAPONS_DIRECTORY() [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
- objectAtIndex:0] stringByAppendingString:@"/Weapons/"]
-#define SCHEMES_DIRECTORY() [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) \
- objectAtIndex:0] stringByAppendingString:@"/Schemes/"]
+#define TEAMS_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Teams/"]
+#define WEAPONS_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Weapons/"]
+#define SCHEMES_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Schemes/"]
+#define SAVES_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Saves/"]
#define GRAPHICS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/"]
#define HATS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Hats/"]
#define GRAVES_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Graves/"]
-#define BOTLEVELS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Hedgehog/botlevels"]
-#define BTN_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Btn"]
+#define BOTLEVELS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Hedgehog/botlevels/"]
+#define BTN_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Btn/"]
#define FLAGS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Graphics/Flags/"]
#define FORTS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Forts/"]
+#define VOICES_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Sounds/voices/"]
#define THEMES_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Themes/"]
#define MAPS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Maps/"]
-#define VOICES_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Sounds/voices/"]
+#define MISSIONS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Missions/Maps/"]
+#define LOCALE_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Locale/"]
+#define IFRONTEND_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Settings/iFrontend/"]
#define MSG_MEMCLEAN() DLog(@"has cleaned up some memory");
#define MSG_DIDUNLOAD() DLog(@"unloaded");
-#define CURRENT_AMMOSIZE 46
+#define UICOLOR_HW_YELLOW_BODER [UIColor colorWithRed:(CGFloat)0xFE/255 green:(CGFloat)0xC0/255 blue:0 alpha:1]
+#define UICOLOR_HW_YELLOW_TEXT [UIColor colorWithRed:(CGFloat)0xF0/255 green:(CGFloat)0xD0/255 blue:0 alpha:1]
+#define UICOLOR_HW_DARKBLUE [UIColor colorWithRed:(CGFloat)0x0F/255 green:0 blue:(CGFloat)0x42/255 alpha:1]
+#define UICOLOR_HW_ALPHABLUE [UIColor colorWithRed:(CGFloat)0x0F/255 green:0 blue:(CGFloat)0x42/255 alpha:0.58f]
+
+#define IS_DUALHEAD() ([[UIScreen screens] count] > 1)
+#define IS_IPAD() (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+
+#define DEFAULT_NETGAME_PORT 46631
+
void createTeamNamed (NSString *nameWithoutExt);
-void createWeaponNamed (NSString *nameWithoutExt);
+void createWeaponNamed (NSString *nameWithoutExt, int type);
void createSchemeNamed (NSString *nameWithoutExt);
+void print_free_memory (void);
+void playSound (NSString *snd);
+void popError (const char *title, const char *message);
BOOL rotationManager (UIInterfaceOrientation interfaceOrientation);
-NSInteger randomPort ();
-void popError (const char *title, const char *message);
-void print_free_memory ();
-BOOL isPhone ();
-NSString *modelType ();
+BOOL isApplePhone (void);
+NSInteger randomPort (void);
+NSString *modelType (void);
+NSArray *getAvailableColors (void);
+UILabel *createBlueLabel (NSString *title, CGRect frame);
+UILabel *createLabelWithParams (NSString *title, CGRect frame, CGFloat borderWidth, UIColor *borderColor, UIColor *backgroundColor);
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/CommodityFunctions.m
--- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,30 +1,46 @@
-//
-// CommodityFunctions.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 08/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/04/2010.
+ */
+
#import "CommodityFunctions.h"
#import
#import
#import
#import
+#import
+#import "AudioToolbox/AudioToolbox.h"
+#import "PascalImports.h"
void createTeamNamed (NSString *nameWithoutExt) {
NSString *teamsDirectory = TEAMS_DIRECTORY();
-
+
if (![[NSFileManager defaultManager] fileExistsAtPath: teamsDirectory]) {
- [[NSFileManager defaultManager] createDirectoryAtPath:teamsDirectory
- withIntermediateDirectories:NO
- attributes:nil
+ [[NSFileManager defaultManager] createDirectoryAtPath:teamsDirectory
+ withIntermediateDirectories:NO
+ attributes:nil
error:NULL];
}
-
- NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity: MAX_HOGS];
-
- for (int i = 0; i < MAX_HOGS; i++) {
+
+ NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity: HW_getMaxNumberOfHogs()];
+
+ 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];
@@ -32,12 +48,12 @@
[hedgehogs addObject:hog];
[hog release];
}
-
+
NSDictionary *theTeam = [[NSDictionary alloc] initWithObjectsAndKeys:@"0",@"hash",
@"Statue",@"grave", @"Plane",@"fort", @"Default",@"voicepack",
@"hedgewars",@"flag", hedgehogs,@"hedgehogs", nil];
[hedgehogs release];
-
+
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", teamsDirectory, nameWithoutExt];
[theTeam writeToFile:teamFile atomically:YES];
@@ -45,25 +61,67 @@
[theTeam release];
}
-void createWeaponNamed (NSString *nameWithoutExt) {
+void createWeaponNamed (NSString *nameWithoutExt, int type) {
NSString *weaponsDirectory = WEAPONS_DIRECTORY();
if (![[NSFileManager defaultManager] fileExistsAtPath: weaponsDirectory]) {
- [[NSFileManager defaultManager] createDirectoryAtPath:weaponsDirectory
- withIntermediateDirectories:NO
- attributes:nil
+ [[NSFileManager defaultManager] createDirectoryAtPath:weaponsDirectory
+ withIntermediateDirectories:NO
+ attributes:nil
error:NULL];
}
+
+ NSDictionary *theWeapon = nil;
+ switch (type) {
+ case 0: //default
+ theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
+ @"9391929422199121032235111001201000000211110101010",@"ammostore_initialqt",
+ @"0405040541600655546554464776576666666155510101110",@"ammostore_probability",
+ @"0000000000000205500000040007004000000000200000000",@"ammostore_delay",
+ @"1311110312111111123114111111111111111211111101110",@"ammostore_crate", nil];
+ break;
+ case 1: //crazy
+ theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
+ @"9999999999999999992999999999999999299999999909990",@"ammostore_initialqt",
+ @"1111110111111111111111111111111111111111111101110",@"ammostore_probability",
+ @"0000000000000000000000000000000000000000000000000",@"ammostore_delay",
+ @"1311110312111111123114111111111111111211110101110",@"ammostore_crate", nil];
+ break;
+ case 2: //pro mode
+ theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
+ @"9090009000000000000009000000000000000000000000000",@"ammostore_initialqt",
+ @"0000000000000000000000000000000000000000000000000",@"ammostore_probability",
+ @"0000000000000205500000040007004000000000200000000",@"ammostore_delay",
+ @"1111111111111111111111111111111111111111100101110",@"ammostore_crate", nil];
+ break;
+ case 3: //shoppa
+ theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
+ @"0000009900000000000000000000000000000000000000000",@"ammostore_initialqt",
+ @"4444410044244402210112121222422000000002000400010",@"ammostore_probability",
+ @"0000000000000000000000000000000000000000000000000",@"ammostore_delay",
+ @"1111111111111111111111111111111111111111101101110",@"ammostore_crate", nil];
+ break;
+ case 4: //basketball
+ theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
+ @"9391929422199121032235111001201000000211110101000",@"ammostore_initialqt",
+ @"0000000000000000000000000000000000000000000000000",@"ammostore_probability",
+ @"0000000000000005500000040007004000000000200000000",@"ammostore_delay",
+ @"1111111111111111111111111111111111111111111101110",@"ammostore_crate", nil];
+ break;
+ case 5: //minefield
+ theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
+ @"0000009900090000000300000000000000000000000000000",@"ammostore_initialqt",
+ @"0000000000000000000000000000000000000000000000000",@"ammostore_probability",
+ @"0000000000000205500000040007004000000000200000000",@"ammostore_delay",
+ @"1111111111111111111111111111111111111111111101110",@"ammostore_crate", nil];
+ break;
+ default:
+ NSLog(@"Nope");
+ break;
+ }
- NSDictionary *theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:CURRENT_AMMOSIZE],@"version",
- @"9391929422199121032235111001201000000211110111",@"ammostore_initialqt",
- @"0405040541600655546554464776576666666155510111",@"ammostore_probability",
- @"0000000000000205500000040007004000000000200000",@"ammostore_delay",
- @"1311110312111111123114111111111111111211111111",@"ammostore_crate", nil];
-
NSString *weaponFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", weaponsDirectory, nameWithoutExt];
-
+
[theWeapon writeToFile:weaponFile atomically:YES];
[weaponFile release];
[theWeapon release];
@@ -71,58 +129,70 @@
void createSchemeNamed (NSString *nameWithoutExt) {
NSString *schemesDirectory = SCHEMES_DIRECTORY();
-
+
if (![[NSFileManager defaultManager] fileExistsAtPath: schemesDirectory]) {
- [[NSFileManager defaultManager] createDirectoryAtPath:schemesDirectory
- withIntermediateDirectories:NO
- attributes:nil
+ [[NSFileManager defaultManager] createDirectoryAtPath:schemesDirectory
+ withIntermediateDirectories:NO
+ attributes:nil
error:NULL];
}
- NSArray *theScheme = [[NSArray alloc] initWithObjects:
- [NSNumber numberWithBool:NO], //fortmode
- [NSNumber numberWithBool:NO], //divideteam
- [NSNumber numberWithBool:NO], //solidland
- [NSNumber numberWithBool:NO], //addborder
- [NSNumber numberWithBool:NO], //lowgravity
- [NSNumber numberWithBool:NO], //lasersight
- [NSNumber numberWithBool:NO], //invulnerable
- [NSNumber numberWithBool:YES], //addmines
- [NSNumber numberWithBool:NO], //vampirism
- [NSNumber numberWithBool:NO], //karma
- [NSNumber numberWithBool:NO], //artillery
- [NSNumber numberWithBool:YES], //randomorder
- [NSNumber numberWithBool:NO], //king
- [NSNumber numberWithBool:NO], //placehedgehogs
- [NSNumber numberWithBool:NO], //clansharesammo
- [NSNumber numberWithBool:NO], //disablegirders
- [NSNumber numberWithBool:NO], //disablelandobjects
- [NSNumber numberWithInt:100], //damagemodifier
- [NSNumber numberWithInt:45], //turntime
- [NSNumber numberWithInt:100], //initialhealth
- [NSNumber numberWithInt:15], //suddendeathtimeout
- [NSNumber numberWithInt:5], //cratedrops
- [NSNumber numberWithInt:3], //minestime
- [NSNumber numberWithInt:4], //mines
- [NSNumber numberWithInt:0], //dudmines
- [NSNumber numberWithInt:2], //explosives
- nil];
+ NSMutableArray *basicArray = [[NSMutableArray alloc] initWithObjects:
+ [NSNumber numberWithInt:100], //damagemodifier
+ [NSNumber numberWithInt:45], //turntime
+ [NSNumber numberWithInt:100], //initialhealth
+ [NSNumber numberWithInt:15], //suddendeathtimeout
+ [NSNumber numberWithInt:5], //cratedrops
+ [NSNumber numberWithInt:3], //minestime
+ [NSNumber numberWithInt:4], //mines
+ [NSNumber numberWithInt:0], //dudmines
+ [NSNumber numberWithInt:2], //explosives
+ nil];
+
+ NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithObjects:
+ [NSNumber numberWithBool:NO], //fortmode
+ [NSNumber numberWithBool:NO], //divideteam
+ [NSNumber numberWithBool:NO], //solidland
+ [NSNumber numberWithBool:NO], //addborder
+ [NSNumber numberWithBool:NO], //lowgravity
+ [NSNumber numberWithBool:NO], //lasersight
+ [NSNumber numberWithBool:NO], //invulnerable
+ [NSNumber numberWithBool:YES], //addmines
+ [NSNumber numberWithBool:NO], //vampirism
+ [NSNumber numberWithBool:NO], //karma
+ [NSNumber numberWithBool:NO], //artillery
+ [NSNumber numberWithBool:YES], //randomorder
+ [NSNumber numberWithBool:NO], //king
+ [NSNumber numberWithBool:NO], //placehedgehogs
+ [NSNumber numberWithBool:NO], //clansharesammo
+ [NSNumber numberWithBool:NO], //disablegirders
+ [NSNumber numberWithBool:NO], //disablelandobjects
+ [NSNumber numberWithBool:NO], //aisurvival
+ nil];
+
+ NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
+ basicArray,@"basic",
+ gamemodArray,@"gamemod",
+ nil];
+ [gamemodArray release];
+ [basicArray release];
NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", schemesDirectory, nameWithoutExt];
-
+
[theScheme writeToFile:schemeFile atomically:YES];
[schemeFile release];
[theScheme release];
}
-BOOL rotationManager (UIInterfaceOrientation interfaceOrientation) {
+BOOL inline rotationManager (UIInterfaceOrientation interfaceOrientation) {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight) ||
- (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
+ (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
-NSInteger randomPort () {
+NSInteger inline randomPort () {
srandom(time(NULL));
- return (random() % 64511) + 1024;
+ NSInteger res = (random() % 64511) + 1024;
+ return (res == DEFAULT_NETGAME_PORT) ? randomPort() : res;
}
void popError (const char *title, const char *message) {
@@ -140,36 +210,88 @@
mach_port_t host_port;
mach_msg_type_number_t host_size;
vm_size_t pagesize;
-
+
host_port = mach_host_self();
host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t);
- host_page_size(host_port, &pagesize);
-
+ host_page_size(host_port, &pagesize);
+
vm_statistics_data_t vm_stat;
-
+
if (host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size) != KERN_SUCCESS)
DLog(@"Failed to fetch vm statistics");
-
- /* Stats in bytes */
+
+ /* Stats in bytes */
natural_t mem_used = (vm_stat.active_count + vm_stat.inactive_count + vm_stat.wire_count) * pagesize;
natural_t mem_free = vm_stat.free_count * pagesize;
natural_t mem_total = mem_used + mem_free;
DLog(@"used: %u free: %u total: %u", mem_used, mem_free, mem_total);
}
-BOOL isPhone () {
- return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
+BOOL inline isApplePhone () {
+ return (IS_IPAD() == NO);
}
NSString *modelType () {
size_t size;
// set 'oldp' parameter to NULL to get the size of the data returned so we can allocate appropriate amount of space
- sysctlbyname("hw.machine", NULL, &size, NULL, 0);
+ sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *name = (char *)malloc(sizeof(char) * size);
// get the platform name
sysctlbyname("hw.machine", name, &size, NULL, 0);
NSString *modelId = [NSString stringWithUTF8String:name];
free(name);
-
+
return modelId;
-}
\ No newline at end of file
+}
+
+void playSound (NSString *snd) {
+ //Get the filename of the sound file:
+ NSString *path = [NSString stringWithFormat:@"%@/%@.wav",[[NSBundle mainBundle] resourcePath],snd];
+
+ //declare a system sound id
+ SystemSoundID soundID;
+
+ //Get a URL for the sound file
+ NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
+
+ //Use audio sevices to create the sound
+ AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
+
+ //Use audio services to play the sound
+ AudioServicesPlaySystemSound(soundID);
+}
+
+NSArray inline *getAvailableColors (void) {
+ return [NSArray arrayWithObjects:[NSNumber numberWithUnsignedInt:0x4376e9], // bluette
+ [NSNumber numberWithUnsignedInt:0x3e9321], // greeeen
+ [NSNumber numberWithUnsignedInt:0xa23dbb], // violett
+ [NSNumber numberWithUnsignedInt:0xff9329], // oranngy
+ [NSNumber numberWithUnsignedInt:0xdd0000], // reddish
+ [NSNumber numberWithUnsignedInt:0x737373], // graaaay
+ [NSNumber numberWithUnsignedInt:0xbba23d], // gold$$$
+ [NSNumber numberWithUnsignedInt:0x3da2bb], // cyannnn
+ nil];
+}
+
+UILabel *createBlueLabel (NSString *title, CGRect frame) {
+ return createLabelWithParams(title, frame, 1.5f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_DARKBLUE);
+}
+
+UILabel *createLabelWithParams (NSString *title, CGRect frame, CGFloat borderWidth, UIColor *borderColor, UIColor *backgroundColor) {
+ UILabel *theLabel = [[UILabel alloc] initWithFrame:frame];
+ theLabel.backgroundColor = backgroundColor;
+
+ if (title != nil) {
+ theLabel.text = title;
+ theLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
+ theLabel.textAlignment = UITextAlignmentCenter;
+ theLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]*80/100];
+ }
+
+ [theLabel.layer setBorderWidth:borderWidth];
+ [theLabel.layer setBorderColor:borderColor.CGColor];
+ [theLabel.layer setCornerRadius:8.0f];
+ [theLabel.layer setMasksToBounds:YES];
+
+ return theLabel;
+}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/DetailViewController.h
--- a/project_files/HedgewarsMobile/Classes/DetailViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-//
-// DetailViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 27/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
-
-#import
-
-@class GeneralSettingsViewController;
-@class TeamSettingsViewController;
-@class WeaponSettingsViewController;
-@class SchemeSettingsViewController;
-
-@interface DetailViewController : UITableViewController {
- NSArray *controllerNames;
-
- GeneralSettingsViewController *generalSettingsViewController;
- TeamSettingsViewController *teamSettingsViewController;
- WeaponSettingsViewController *weaponSettingsViewController;
- SchemeSettingsViewController *schemeSettingsViewController;
- UIPopoverController *popoverController;
-}
-
-// used in iphone version
--(IBAction) dismissSplitView;
-
-@property (nonatomic, retain) NSArray *controllerNames;
-@property (nonatomic,retain) UIPopoverController *popoverController;
-
-@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/DetailViewController.m
--- a/project_files/HedgewarsMobile/Classes/DetailViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,206 +0,0 @@
- //
-// DetailViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 27/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
-
-#import "DetailViewController.h"
-#import "SDL_uikitappdelegate.h"
-#import "GeneralSettingsViewController.h"
-#import "TeamSettingsViewController.h"
-#import "WeaponSettingsViewController.h"
-#import "SchemeSettingsViewController.h"
-#import "CommodityFunctions.h"
-
-@implementation DetailViewController
-@synthesize controllerNames,popoverController;
-
-
--(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
- return rotationManager(interfaceOrientation);
-}
-
--(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
- self.view.frame = CGRectMake(0, 0, 1024, 1024);
-}
-
--(void) viewDidLoad {
- self.title = NSLocalizedString(@"Settings",@"");
-
- // allocate controllers and store them into the array
- NSArray *array= [[NSArray alloc] initWithObjects:NSLocalizedString(@"General",@""),
- NSLocalizedString(@"Teams",@""),
- NSLocalizedString(@"Weapons",@""),
- NSLocalizedString(@"Schemes",@""),
- nil];
- self.controllerNames = array;
- [array release];
-
- // on ipad make the general setting the first view, on iphone add the "Done" button on top left
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
-
- UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(112, 112, 480, 320)];
- label.text = @"Press the buttons on the left";
- label.font = [UIFont systemFontOfSize:20];
- label.textAlignment = UITextAlignmentCenter;
- [self.view addSubview:label];
- [label release];
-
- //[self.navigationController pushViewController:nextController animated:NO];
- } else {
- self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
- target:self
- action:@selector(dismissSplitView)];
- }
-
- [super viewDidLoad];
-}
-
-
-#pragma mark -
-#pragma mark Table view data source
--(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
- // don't display
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
- return 0;
- else
- return 1;
-}
-
--(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return [controllerNames count];
-}
-
--(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *CellIdentifier = @"Cell";
-
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
- reuseIdentifier:CellIdentifier] autorelease];
- }
-
- NSInteger row = [indexPath row];
-
- cell.textLabel.text = [controllerNames objectAtIndex:row];
- cell.imageView.image = [UIImage imageNamed:@"Icon.png"];
- cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
-
- return cell;
-}
-
-#pragma mark -
-#pragma mark Table view delegate
--(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- NSInteger row = [indexPath row];
- UIViewController *nextController = nil;
-
- switch (row) {
- case 0:
- if (nil == generalSettingsViewController)
- generalSettingsViewController = [[GeneralSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
- nextController = generalSettingsViewController;
- break;
- case 1:
- if (nil == teamSettingsViewController)
- teamSettingsViewController = [[TeamSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
- nextController = teamSettingsViewController;
- break;
- case 2:
- if (nil == weaponSettingsViewController)
- weaponSettingsViewController = [[WeaponSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
- nextController = weaponSettingsViewController;
- break;
- case 3:
- if (nil == schemeSettingsViewController)
- schemeSettingsViewController = [[SchemeSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
- nextController = schemeSettingsViewController;
- break;
- }
-
- nextController.title = [controllerNames objectAtIndex:row];
- [self.navigationController pushViewController:nextController animated:YES];
-}
-
--(IBAction) dismissSplitView {
- [[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil];
-}
-
-#pragma mark -
-#pragma mark splitview support
--(void) splitViewController:(UISplitViewController *)svc popoverController:(UIPopoverController *)pc willPresentViewController:(UIViewController *)aViewController {
- if (popoverController != nil) {
- [popoverController dismissPopoverAnimated:YES];
- }
-}
-
-// Called when the master view controller is about to be hidden
--(void) splitViewController: (UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController
- withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc {
-
- /* barButtonItem.title = @"Master View";
- UIToolbar *toolbar = self.parentViewController.navigationController.toolbar;
- NSMutableArray *items = [[toolbar items] mutableCopy];
- [items insertObject:barButtonItem atIndex:0];
- [toolbar setItems:items animated:YES];
-
- [items release];
-
- self.popoverController = pc;*/
- barButtonItem.title = aViewController.title;
- self.navigationItem.rightBarButtonItem = barButtonItem;
-}
-
-// Called when the master view controller is about to appear
--(void) splitViewController: (UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController
- invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem {
- /*UIToolbar *toolbar = self.parentViewController.navigationController.toolbar;
-
- NSMutableArray *items = [[toolbar items] mutableCopy];
- [items removeObjectAtIndex:0];
-
- [toolbar setItems:items animated:YES];
-
- [items release];
-
- self.popoverController = nil;*/
- self.navigationItem.rightBarButtonItem = nil;
-
-}
-
--(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren't in use.
- if (generalSettingsViewController.view.superview == nil)
- generalSettingsViewController = nil;
- if (teamSettingsViewController.view.superview == nil)
- teamSettingsViewController = nil;
- if (weaponSettingsViewController.view.superview == nil)
- weaponSettingsViewController = nil;
- if (schemeSettingsViewController.view.superview == nil)
- schemeSettingsViewController = nil;
- MSG_MEMCLEAN();
-}
-
--(void) viewDidUnload {
- self.controllerNames = nil;
- generalSettingsViewController = nil;
- teamSettingsViewController = nil;
- weaponSettingsViewController = nil;
- schemeSettingsViewController = nil;
- MSG_DIDUNLOAD();
- [super viewDidUnload];
-}
-
--(void) dealloc {
- [controllerNames release];
- [generalSettingsViewController release];
- [teamSettingsViewController release];
- [weaponSettingsViewController release];
- [schemeSettingsViewController release];
- [super dealloc];
-}
-@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/EditableCellView.h
--- a/project_files/HedgewarsMobile/Classes/EditableCellView.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/EditableCellView.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// WeaponCellView.h
-// Hedgewars
-//
-// Created by Vittorio on 03/07/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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/07/2010.
+ */
+
#import
@@ -20,7 +33,8 @@
UILabel *titleLabel;
NSInteger minimumCharacters;
NSInteger maximumCharacters;
-
+ BOOL respectEditing;
+
@private
NSString *oldValue;
}
@@ -30,6 +44,7 @@
@property (nonatomic,retain,readonly) UILabel *titleLabel;
@property (nonatomic,assign) NSInteger minimumCharacters;
@property (nonatomic,assign) NSInteger maximumCharacters;
+@property (nonatomic,assign) BOOL respectEditing;
@property (nonatomic,retain) NSString *oldValue;
-(void) replyKeyboard;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/EditableCellView.m
--- a/project_files/HedgewarsMobile/Classes/EditableCellView.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/EditableCellView.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,21 +1,34 @@
-//
-// WeaponCellView.m
-// Hedgewars
-//
-// Created by Vittorio on 03/07/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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/07/2010.
+ */
+
#import "EditableCellView.h"
#import "CommodityFunctions.h"
@implementation EditableCellView
-@synthesize delegate, textField, titleLabel, minimumCharacters, maximumCharacters, oldValue;
+@synthesize delegate, textField, titleLabel, minimumCharacters, maximumCharacters, respectEditing, oldValue;
-(id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
delegate = nil;
-
+
textField = [[UITextField alloc] initWithFrame:CGRectZero];
textField.backgroundColor = [UIColor clearColor];
textField.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
@@ -24,20 +37,22 @@
textField.clearsOnBeginEditing = NO;
textField.returnKeyType = UIReturnKeyDone;
textField.adjustsFontSizeToFitWidth = YES;
+ textField.userInteractionEnabled = YES;
[textField addTarget:self action:@selector(save:) forControlEvents:UIControlEventEditingDidEndOnExit];
-
+
[self.contentView addSubview:textField];
//[textField release];
-
+
titleLabel = [[UILabel alloc] init];
titleLabel.textAlignment = UITextAlignmentLeft;
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
[self.contentView addSubview:titleLabel];
//[titleLabel release];
-
+
minimumCharacters = 1;
maximumCharacters = 64;
+ respectEditing = NO;
oldValue = nil;
}
return self;
@@ -48,12 +63,12 @@
CGRect contentRect = self.contentView.bounds;
CGFloat boundsX = contentRect.origin.x;
-
+
int offset = 0;
int skew = 0;
if (self.imageView != nil)
offset += self.imageView.frame.size.width;
-
+
if ([self.titleLabel.text length] == 0)
titleLabel.frame = CGRectZero;
else {
@@ -62,7 +77,7 @@
skew +=2;
}
- textField.frame = CGRectMake(boundsX+offset+10, skew+10, 250, [UIFont labelFontSize] + 4);
+ textField.frame = CGRectMake(boundsX+offset+10, skew+10, 300, [UIFont labelFontSize] + 4);
}
-(void) setSelected:(BOOL)selected animated:(BOOL)animated {
@@ -85,25 +100,27 @@
return !([aTextField.text length] > self.maximumCharacters && [string length] > range.length);
}
-// allow editing only if delegate is set and conformant to protocol
+// allow editing only if delegate is set and conformant to protocol, and if editableOnlyWhileEditing
-(BOOL) textFieldShouldBeginEditing:(UITextField *)aTextField {
- return (delegate != nil) && [delegate respondsToSelector:@selector(saveTextFieldValue:withTag:)];
+ return (delegate != nil) &&
+ [delegate respondsToSelector:@selector(saveTextFieldValue:withTag:)] &&
+ (respectEditing) ? ((UITableView*)[self superview]).editing : YES;
}
// the textfield is being modified, update the navigation controller
-(void) textFieldDidBeginEditing:(UITextField *)aTextField{
// don't interact with table below
((UITableView*)[self superview]).scrollEnabled = NO;
-
+
self.oldValue = self.textField.text;
-
+
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel",@"")
style:UIBarButtonItemStylePlain
target:self
action:@selector(cancel:)];
[(UITableViewController *)delegate navigationItem].leftBarButtonItem = cancelButton;
[cancelButton release];
-
+
UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Save",@"")
style:UIBarButtonItemStyleDone
target:self
@@ -116,18 +133,22 @@
use method below instead that allows some more interaction
// don't accept 0-length strings
-(BOOL) textFieldShouldEndEditing:(UITextField *)aTextField {
- return ([aTextField.text length] > 0);
+ return ([aTextField.text length] > 0);
}
*/
-(BOOL) textFieldShouldReturn:(UITextField *)aTextField {
- return ([aTextField.text length] >= self.minimumCharacters);
+ return ([aTextField.text length] >= self.minimumCharacters);
}
// the textfield has been modified, tell the delegate to do something
--(void) textFieldDidEndEditing:(UITextField *)aTextField{
+-(void) textFieldDidEndEditing:(UITextField *)aTextField {
+ // this forces a save when user selects a new field
+ if ([self.textField.text isEqualToString:self.oldValue] == NO)
+ [self save:aTextField];
+
+ // restores default behaviour on caller
((UITableView*)[self superview]).scrollEnabled = YES;
-
[(UITableViewController *)delegate navigationItem].rightBarButtonItem = [(UITableViewController *)delegate navigationItem].backBarButtonItem;
[(UITableViewController *)delegate navigationItem].leftBarButtonItem = nil;
}
@@ -141,22 +162,31 @@
// the user pressed cancel so hide keyboard
-(void) cancel:(id) sender {
+ // reverts any changes and performs a fake save for removing the keyboard
self.textField.text = self.oldValue;
[self save:sender];
}
-// send the value to the delegate
+// send the value to the delegate (called before textFieldDidEndEditing)
-(void) save:(id) sender {
- if (delegate == nil || ![delegate respondsToSelector:@selector(saveTextFieldValue:withTag:)])
+ if (delegate == nil || [delegate respondsToSelector:@selector(saveTextFieldValue:withTag:)] == NO)
return;
-
+
// don't save if the textfield is invalid
- if (![self textFieldShouldReturn:textField])
+ if ([self textFieldShouldReturn:textField] == NO)
return;
-
+
[delegate saveTextFieldValue:self.textField.text withTag:self.tag];
[self.textField resignFirstResponder];
self.oldValue = nil;
}
+// when field is editable only when the tableview is editable, resign responder when exiting editing mode
+-(void) willTransitionToState:(UITableViewCellStateMask)state {
+ if (respectEditing && state == UITableViewCellStateDefaultMask)
+ [self save:nil];
+
+ [super willTransitionToState:state];
+}
+
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/FlagsViewController.h
--- a/project_files/HedgewarsMobile/Classes/FlagsViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/FlagsViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// FlagsViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 08/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/04/2010.
+ */
+
#import
@@ -12,12 +25,14 @@
@interface FlagsViewController : UITableViewController {
NSDictionary *teamDictionary;
- NSArray *flagArray;
+ NSArray *flagArray;
+ NSArray *communityArray;
NSIndexPath *lastIndexPath;
}
@property (nonatomic,retain) NSDictionary * teamDictionary;
@property (nonatomic,retain) NSArray *flagArray;
+@property (nonatomic,retain) NSArray *communityArray;
@property (nonatomic,retain) NSIndexPath *lastIndexPath;
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/FlagsViewController.m
--- a/project_files/HedgewarsMobile/Classes/FlagsViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/FlagsViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,16 +1,29 @@
-//
-// FlagsViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 08/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/04/2010.
+ */
+
#import "FlagsViewController.h"
#import "CommodityFunctions.h"
@implementation FlagsViewController
-@synthesize teamDictionary, flagArray, lastIndexPath;
+@synthesize teamDictionary, flagArray, communityArray, lastIndexPath;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
@@ -23,67 +36,116 @@
-(void) viewDidLoad {
[super viewDidLoad];
- self.flagArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FLAGS_DIRECTORY() error:NULL];
+ NSMutableArray *array_na = [[NSMutableArray alloc] init];
+ NSMutableArray *array_cm = [[NSMutableArray alloc] init];
+ for (NSString *name in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FLAGS_DIRECTORY() error:NULL]) {
+ if ([name hasPrefix:@"cm_"]) {
+ NSString *processed = [name substringFromIndex:3];
+ [array_cm addObject:processed];
+ } else
+ [array_na addObject:name];
+ }
+
+ self.flagArray = array_na;
+ [array_na release];
+ self.communityArray = array_cm;
+ [array_cm release];
+
self.title = NSLocalizedString(@"Set team flag",@"");
}
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
+ // reloadData needed because team might change
[self.tableView reloadData];
- [self.tableView setContentOffset:CGPointMake(0,0) animated:NO];
+ //[self.tableView setContentOffset:CGPointMake(0,0) animated:NO];
}
#pragma mark -
#pragma mark Table view data source
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
- return 1;
+ return 2;
}
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return [flagArray count];
+ if (section == 0)
+ return [self.flagArray count];
+ else
+ return [self.communityArray count];
}
// Customize the appearance of table view cells.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-
static NSString *CellIdentifier = @"Cell";
-
+ NSInteger row = [indexPath row];
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
-
- NSString *flag = [flagArray objectAtIndex:[indexPath row]];
-
- NSString *flagFile = [[NSString alloc] initWithFormat:@"%@/%@", FLAGS_DIRECTORY(), flag];
+
+ NSString *flagName = nil;
+ NSArray *source = nil;
+ if ([indexPath section] == 0) {
+ source = self.flagArray;
+ flagName = [source objectAtIndex:row];
+ } else {
+ source = self.communityArray;
+ flagName = [NSString stringWithFormat:@"cm_%@",[source objectAtIndex:row]];
+ }
+ NSString *flagFile = [[NSString alloc] initWithFormat:@"%@/%@", FLAGS_DIRECTORY(), flagName];
UIImage *flagSprite = [[UIImage alloc] initWithContentsOfFile:flagFile];
[flagFile release];
cell.imageView.image = flagSprite;
[flagSprite release];
-
- cell.textLabel.text = [flag stringByDeletingPathExtension];
- if ([cell.textLabel.text isEqualToString:[self.teamDictionary objectForKey:@"flag"]]) {
+
+ cell.textLabel.text = [[source objectAtIndex:row] stringByDeletingPathExtension];
+ if ([[flagName stringByDeletingPathExtension] isEqualToString:[self.teamDictionary objectForKey:@"flag"]]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
self.lastIndexPath = indexPath;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
-
+
return cell;
}
+-(NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section {
+ NSString *sectionTitle = nil;
+ switch (section) {
+ case 0:
+ sectionTitle = NSLocalizedString(@"Worldwide", @"");
+ break;
+ case 1:
+ sectionTitle = NSLocalizedString(@"Community", @"");
+ break;
+ default:
+ DLog(@"nope");
+ break;
+ }
+ return sectionTitle;
+}
+
#pragma mark -
#pragma mark Table view delegate
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int newRow = [indexPath row];
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
+ int newSection = [indexPath section];
+ int oldSection = (lastIndexPath != nil) ? [lastIndexPath section] : -1;
- if (newRow != oldRow) {
+ if (newRow != oldRow || newSection != oldSection) {
+ NSString *flag = nil;
+ if ([indexPath section] == 0)
+ flag = [self.flagArray objectAtIndex:newRow];
+ else
+ flag = [NSString stringWithFormat:@"cm_%@",[self.communityArray objectAtIndex:newRow]];
+
// if the two selected rows differ update data on the hog dictionary and reload table content
- [self.teamDictionary setValue:[[flagArray objectAtIndex:newRow] stringByDeletingPathExtension] forKey:@"flag"];
+ [self.teamDictionary setValue:[flag stringByDeletingPathExtension] forKey:@"flag"];
// tell our boss to write this new stuff on disk
[[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
@@ -103,15 +165,16 @@
#pragma mark -
#pragma mark Memory management
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+ self.lastIndexPath = nil;
+ MSG_MEMCLEAN();
[super didReceiveMemoryWarning];
- // Relinquish ownership any cached data, images, etc that aren't in use.
}
-(void) viewDidUnload {
self.teamDictionary = nil;
self.lastIndexPath = nil;
self.flagArray = nil;
+ self.communityArray = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
@@ -120,6 +183,7 @@
[teamDictionary release];
[lastIndexPath release];
[flagArray release];
+ [communityArray release];
[super dealloc];
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/FortsViewController.h
--- a/project_files/HedgewarsMobile/Classes/FortsViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/FortsViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// FortsViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 08/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/04/2010.
+ */
+
#import
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/FortsViewController.m
--- a/project_files/HedgewarsMobile/Classes/FortsViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/FortsViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// FortsViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 08/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/04/2010.
+ */
+
#import "FortsViewController.h"
#import "CommodityFunctions.h"
@@ -25,35 +38,21 @@
[super viewDidLoad];
NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FORTS_DIRECTORY() error:NULL];
- NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / 2)];
+ NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / 3)];
// we need to remove the double entries and the L.png suffix
for (int i = 0; i < [directoryContents count]; i++) {
- if (i % 2) {
+ if (i % 3 == 1) {
NSString *currentName = [directoryContents objectAtIndex:i];
NSString *correctName = [currentName substringToIndex:([currentName length] - 5)];
[filteredContents addObject:correctName];
- }
+ }
}
self.fortArray = filteredContents;
[filteredContents release];
-
- /*
- // this creates a scaled down version of the image
- NSMutableArray *spriteArray = [[NSMutableArray alloc] initWithCapacity:[fortArray count]];
- for (NSString *fortName in fortArray) {
- NSString *fortFile = [[NSString alloc] initWithFormat:@"%@/%@L.png", fortsDirectory, fortName];
- UIImage *fortSprite = [[UIImage alloc] initWithContentsOfFile:fortFile];
- [fortFile release];
- [spriteArray addObject:[fortSprite scaleToSize:CGSizeMake(196,196)]];
- [fortSprite release];
- }
- self.fortSprites = spriteArray;
- [spriteArray release];
- */
-
+
// statically set row height instead of using delegate method for performance reasons
self.tableView.rowHeight = 200;
-
+
self.title = NSLocalizedString(@"Choose team fort",@"");
}
@@ -78,32 +77,30 @@
// Customize the appearance of table view cells.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
-
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier] autorelease];
}
-
+
NSString *fortName = [fortArray objectAtIndex:[indexPath row]];
cell.textLabel.text = fortName;
-
- // this creates a scaled down version of the image
- // TODO: create preview files, scaling is way too slow!
- NSString *fortFile = [[NSString alloc] initWithFormat:@"%@/%@L.png", FORTS_DIRECTORY(), fortName];
+
+ NSString *fortFile = [[NSString alloc] initWithFormat:@"%@/%@-preview.png", FORTS_DIRECTORY(), fortName];
UIImage *fortSprite = [[UIImage alloc] initWithContentsOfFile:fortFile];
[fortFile release];
- cell.imageView.image = [fortSprite scaleToSize:CGSizeMake(196,196)];
+ cell.imageView.image = fortSprite;
[fortSprite release];
-
- cell.detailTextLabel.text = @"Insert funny description here";
+
+ //cell.detailTextLabel.text = @"Insert funny description here";
if ([cell.textLabel.text isEqualToString:[self.teamDictionary objectForKey:@"fort"]]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
self.lastIndexPath = indexPath;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
-
+
return cell;
}
@@ -113,14 +110,14 @@
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int newRow = [indexPath row];
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
-
+
if (newRow != oldRow) {
// if the two selected rows differ update data on the hog dictionary and reload table content
[self.teamDictionary setValue:[fortArray objectAtIndex:newRow] forKey:@"fort"];
// tell our boss to write this new stuff on disk
[[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
-
+
UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath];
newCell.accessoryType = UITableViewCellAccessoryCheckmark;
UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:lastIndexPath];
@@ -136,9 +133,9 @@
#pragma mark -
#pragma mark Memory management
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+ self.lastIndexPath = nil;
+ MSG_MEMCLEAN();
[super didReceiveMemoryWarning];
- // Relinquish ownership any cached data, images, etc that aren't in use.
}
-(void) viewDidUnload {
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/GameConfigViewController.h
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,24 +1,46 @@
-//
-// GameConfigViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 18/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 18/04/2010.
+ */
+
#import
+@class HelpPageViewController;
+@class MapConfigViewController;
@class TeamConfigViewController;
-@class MapConfigViewController;
@class SchemeWeaponConfigViewController;
-@interface GameConfigViewController : UIViewController {
- UIViewController *activeController;
+@interface GameConfigViewController : UIViewController {
+ UIView *imgContainer;
+ HelpPageViewController *helpPage;
+
MapConfigViewController *mapConfigViewController;
TeamConfigViewController *teamConfigViewController;
SchemeWeaponConfigViewController *schemeWeaponConfigViewController;
}
+@property (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;
-(void) startGame:(UIButton *)button;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/GameConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,27 +1,36 @@
- //
-// GameConfigViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 18/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 18/04/2010.
+ */
+
#import "GameConfigViewController.h"
#import "SDL_uikitappdelegate.h"
-#import "CommodityFunctions.h"
#import "MapConfigViewController.h"
#import "TeamConfigViewController.h"
#import "SchemeWeaponConfigViewController.h"
+#import "HelpPageViewController.h"
+#import "CommodityFunctions.h"
+#import "UIImageExtra.h"
+#import "PascalImports.h"
-// draw background image in uitoolbar
-/*@implementation UIToolbar (CustomImage)
--(void) drawRect:(CGRect)rect {
- UIImage *image = [UIImage imageWithContentsOfFile:@"toolbarBackground.png"];
- [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
-}
-@end
-*/
@implementation GameConfigViewController
+@synthesize imgContainer, helpPage, mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
@@ -30,10 +39,16 @@
-(IBAction) buttonPressed:(id) sender {
// works even if it's not actually a button
- UIButton *theButton = (UIButton *)sender;
+ UIButton *theButton;
+ if (IS_IPAD())
+ theButton = [[(NSNotification *)sender userInfo] objectForKey:@"sender"];
+ else
+ theButton = (UIButton *)sender;
+
switch (theButton.tag) {
case 0:
- if ([mapConfigViewController busy]) {
+ playSound(@"backSound");
+ if ([self.mapConfigViewController busy]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Wait for the Preview",@"")
message:NSLocalizedString(@"Before returning the preview needs to be generated",@"")
delegate:nil
@@ -41,19 +56,26 @@
otherButtonTitles:nil];
[alert show];
[alert release];
- } else {
+ } else
[[self parentViewController] dismissModalViewControllerAnimated:YES];
-
- }
break;
case 1:
+ playSound(@"clickSound");
theButton.enabled = NO;
[self startGame:theButton];
-// [self performSelector:@selector(startGame:)
-// withObject:theButton
-// afterDelay:0.25];
+ break;
+ case 2:
+ playSound(@"clickSound");
+ if (self.helpPage == nil)
+ self.helpPage = [[HelpPageViewController alloc] initWithNibName:@"HelpPageLobbyViewController" bundle:nil];
+ self.helpPage.view.alpha = 0;
+ [self.view addSubview:helpPage.view];
+ [UIView beginAnimations:@"helplobby" context:NULL];
+ self.helpPage.view.alpha = 1;
+ [UIView commitAnimations];
break;
default:
+ DLog(@"Nope");
break;
}
}
@@ -61,39 +83,45 @@
-(IBAction) segmentPressed:(id) sender {
UISegmentedControl *theSegment = (UISegmentedControl *)sender;
+ playSound(@"selSound");
switch (theSegment.selectedSegmentIndex) {
case 0:
// this init here is just aestetic as this controller was already set up in viewDidLoad
if (mapConfigViewController == nil) {
mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
+ [self.view addSubview:mapConfigViewController.view];
}
- activeController = mapConfigViewController;
+ // this message is compulsory otherwise the table won't be loaded at all
+ [mapConfigViewController viewWillAppear:NO];
+ [self.view bringSubviewToFront:mapConfigViewController.view];
break;
case 1:
if (teamConfigViewController == nil) {
teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
- // this message is compulsory otherwise the table won't be loaded at all
+ [self.view addSubview:teamConfigViewController.view];
}
- activeController = teamConfigViewController;
+ // this message is compulsory otherwise the table won't be loaded at all
+ [teamConfigViewController viewWillAppear:NO];
+ [self.view bringSubviewToFront:teamConfigViewController.view];
break;
case 2:
if (schemeWeaponConfigViewController == nil) {
schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
+ [self.view addSubview:schemeWeaponConfigViewController.view];
}
- activeController = schemeWeaponConfigViewController;
+ // this message is compulsory otherwise the table won't be loaded at all
+ [schemeWeaponConfigViewController viewWillAppear:NO];
+ [self.view bringSubviewToFront:schemeWeaponConfigViewController.view];
+ break;
+ default:
+ DLog(@"Nope");
break;
}
-
- // this message is compulsory otherwise the table won't be loaded at all
- [activeController viewWillAppear:NO];
- [self.view addSubview:activeController.view];
}
--(void) startGame:(UIButton *)button {
- button.enabled = YES;
-
+-(BOOL) isEverythingSet {
// don't start playing if the preview is in progress
- if ([mapConfigViewController busy]) {
+ if ([self.mapConfigViewController busy]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Wait for the Preview",@"")
message:NSLocalizedString(@"Before playing the preview needs to be generated",@"")
delegate:nil
@@ -101,11 +129,11 @@
otherButtonTitles:nil];
[alert show];
[alert release];
- return;
+ return NO;
}
// play only if there is more than one team
- if ([teamConfigViewController.listOfSelectedTeams count] < 2) {
+ if ([self.teamConfigViewController.listOfSelectedTeams count] < 2) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Too few teams playing",@"")
message:NSLocalizedString(@"Select at least two teams to play a game",@"")
delegate:nil
@@ -113,15 +141,15 @@
otherButtonTitles:nil];
[alert show];
[alert release];
- return;
+ return NO;
}
// play if there's room for enough hogs in the selected map
int hogs = 0;
for (NSDictionary *teamData in teamConfigViewController.listOfSelectedTeams)
hogs += [[teamData objectForKey:@"number"] intValue];
-
- if (hogs > mapConfigViewController.maxHogs) {
+
+ if (hogs > self.mapConfigViewController.maxHogs) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Too many hogs",@"")
message:NSLocalizedString(@"The map is too small for that many hogs",@"")
delegate:nil
@@ -129,10 +157,21 @@
otherButtonTitles:nil];
[alert show];
[alert release];
- return;
+ return NO;
}
- if ([schemeWeaponConfigViewController.selectedScheme length] == 0 || [schemeWeaponConfigViewController.selectedWeapon length] == 0 ) {
+ if ([self.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
+ cancelButtonTitle:NSLocalizedString(@"Ok, got it",@"")
+ otherButtonTitles:nil];
+ [alert show];
+ [alert release];
+ return NO;
+ }
+
+ if ([self.schemeWeaponConfigViewController.selectedScheme length] == 0 || [self.schemeWeaponConfigViewController.selectedWeapon length] == 0 ) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Missing detail",@"")
message:NSLocalizedString(@"Select one Scheme and one Weapon for this game",@"")
delegate:nil
@@ -140,43 +179,61 @@
otherButtonTitles:nil];
[alert show];
[alert release];
- return;
+ return NO;
}
+
+ return YES;
+}
+
+-(void) startGame:(UIButton *)button {
+ button.enabled = YES;
+ if ([self isEverythingSet] == NO)
+ return;
+
// create the configuration file that is going to be sent to engine
- NSDictionary *gameDictionary = [NSDictionary dictionaryWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command",
- mapConfigViewController.templateFilterCommand,@"templatefilter_command",
- mapConfigViewController.mapGenCommand,@"mapgen_command",
- mapConfigViewController.mazeSizeCommand,@"mazesize_command",
- mapConfigViewController.themeCommand,@"theme_command",
- mapConfigViewController.staticMapCommand,@"staticmap_command",
- teamConfigViewController.listOfSelectedTeams,@"teams_list",
- schemeWeaponConfigViewController.selectedScheme,@"scheme",
- schemeWeaponConfigViewController.selectedWeapon,@"weapon",
- nil];
-
+ NSDictionary *gameDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
+ self.mapConfigViewController.seedCommand,@"seed_command",
+ self.mapConfigViewController.templateFilterCommand,@"templatefilter_command",
+ self.mapConfigViewController.mapGenCommand,@"mapgen_command",
+ self.mapConfigViewController.mazeSizeCommand,@"mazesize_command",
+ self.mapConfigViewController.themeCommand,@"theme_command",
+ self.mapConfigViewController.staticMapCommand,@"staticmap_command",
+ self.mapConfigViewController.missionCommand,@"mission_command",
+ self.teamConfigViewController.listOfSelectedTeams,@"teams_list",
+ self.schemeWeaponConfigViewController.selectedScheme,@"scheme",
+ self.schemeWeaponConfigViewController.selectedWeapon,@"weapon",
+ [NSNumber numberWithInt:self.interfaceOrientation],@"orientation",
+ nil];
+
// finally launch game and remove this controller
DLog(@"sending config %@", gameDictionary);
-
- if ([[gameDictionary allKeys] count] == 9) {
- [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
+
+ if ([[gameDictionary allKeys] count] == 11) {
+ NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys:gameDictionary,@"game_dictionary", @"",@"savefile",
+ [NSNumber numberWithBool:NO],@"netgame", nil];
+ // let's hide all the views while the game is on
+ UIViewController *dummy = [[UIViewController alloc] init];
+ [self presentModalViewController:dummy animated:NO];
+ [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
+ [self dismissModalViewControllerAnimated:NO];
+ [dummy release];
} else {
- DLog(@"gameconfig data not complete!!\nmapConfigViewController = %@\nteamConfigViewController = %@\nschemeWeaponConfigViewController = %@\n",
- mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController);
+ DLog(@"gameconfig data not complete!!");
[self.parentViewController dismissModalViewControllerAnimated:YES];
-
+
// present an alert to the user, with an image on the ipad (too big for the iphone)
NSString *msg = NSLocalizedString(@"Something went wrong with your configuration. Please try again.",@"");
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+ if (IS_IPAD())
msg = [msg stringByAppendingString:@"\n\n\n\n\n\n\n\n"]; // this makes space for the image
-
+
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Whoops"
message:msg
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
-
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+
+ if (IS_IPAD()) {
UIImageView *deniedImg = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"denied.png"]];
deniedImg.frame = CGRectMake(25, 80, 240, 160);
[alert addSubview:deniedImg];
@@ -188,88 +245,171 @@
}
+-(void) loadNiceHogs {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSString *filePath = [NSString stringWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()];
+ UIImage *sprite = [[UIImage alloc] initWithContentsOfFile:filePath andCutAt:CGRectMake(96, 0, 32, 32)];
+
+ NSArray *hatArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:HATS_DIRECTORY() error:NULL];
+ int numberOfHats = [hatArray count];
+
+ if (self.imgContainer != nil)
+ [self.imgContainer removeFromSuperview];
+
+ self.imgContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 40)];
+ for (int i = 0; i < 1 + random()%20; i++) {
+ NSString *hat = [hatArray objectAtIndex:random()%numberOfHats];
+
+ NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@", HATS_DIRECTORY(), hat];
+ UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)];
+ [hatFile release];
+ UIImage *hogWithHat = [sprite mergeWith:hatSprite atPoint:CGPointMake(0, 5)];
+ [hatSprite release];
+
+ UIImageView *hog = [[UIImageView alloc] initWithImage:hogWithHat];
+ int x = 15*(i+1)+random()%40;
+ if (x + 32 > 300)
+ x = i*10;
+ hog.frame = CGRectMake(x, 30, 32, 32);
+ [self.imgContainer addSubview:hog];
+ [hog release];
+ }
+ [self.view addSubview:self.imgContainer];
+ [sprite release];
+ [pool drain];
+}
+
-(void) viewDidLoad {
self.view.backgroundColor = [UIColor blackColor];
-
+
CGRect screen = [[UIScreen mainScreen] bounds];
self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- if (mapConfigViewController == nil)
- mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
- if (teamConfigViewController == nil)
- teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStylePlain];
- teamConfigViewController.view.frame = CGRectMake(3, 224, 300, 472);
- teamConfigViewController.view.backgroundColor = [UIColor clearColor];
- [mapConfigViewController.view addSubview:teamConfigViewController.view];
- if (schemeWeaponConfigViewController == nil)
- schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
- schemeWeaponConfigViewController.view.frame = CGRectMake(362, 224, 300, 472);
- [mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view];
- for (UIView *oneView in self.view.subviews) {
- if ([oneView isMemberOfClass:[UIToolbar class]]) {
- [[oneView viewWithTag:12345] setHidden:YES];
- break;
- }
- }
+ if (IS_IPAD()) {
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(buttonPressed:)
+ name:@"buttonPressed"
+ object:nil];
+ srandom(time(NULL));
+
+ // load other controllers
+ if (self.mapConfigViewController == nil)
+ self.mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
+
+ UILabel *leftBackground = createLabelWithParams(nil, CGRectMake(0, 60, 320, 620), 2.7f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
+ [self.mapConfigViewController.view addSubview:leftBackground];
+ [leftBackground release];
+ UILabel *middleBackground = createLabelWithParams(nil, CGRectMake(337, 187, 350, 505), 2.7f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
+ [self.mapConfigViewController.view addSubview:middleBackground];
+ [middleBackground release];
+ UILabel *rightBackground = createLabelWithParams(nil, CGRectMake(704, 214, 320, 464), 2.7f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
+ [self.mapConfigViewController.view addSubview:rightBackground];
+ [rightBackground release];
+ UILabel *topBackground = createLabelWithParams(nil, CGRectMake(714, 14, 300, 190), 2.3f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
+ [self.mapConfigViewController.view addSubview:topBackground];
+ [topBackground release];
+ UILabel *bottomLeftBackground = createLabelWithParams(nil, CGRectMake(106, 714, 320, 40), 2.0f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
+ [self.mapConfigViewController.view addSubview:bottomLeftBackground];
+ [bottomLeftBackground release];
+ UILabel *bottomRightBackground = createLabelWithParams(NSLocalizedString(@"Max Hogs: ",@""), CGRectMake(594, 714, 320, 40), 2.0f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
+ bottomRightBackground.font = [UIFont italicSystemFontOfSize:[UIFont labelFontSize]];
+ [self.mapConfigViewController.view addSubview:bottomRightBackground];
+ [bottomRightBackground release];
+ [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.maxLabel];
+ [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.sizeLabel];
+ [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.segmentedControl];
+ [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.previewButton];
+ [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.slider];
+ [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.tableView];
+
+ 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];
- // this must be loaded & added to auto set default scheme and ammo
- schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
- [self.view addSubview:schemeWeaponConfigViewController.view];
+ if (self.mapConfigViewController == nil)
+ self.mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
+ // this must be loaded & added in order to auto set default scheme and ammo
+ self.schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
+ [self.view addSubview:self.schemeWeaponConfigViewController.view];
}
- activeController = mapConfigViewController;
-
- [self.view addSubview:mapConfigViewController.view];
-
+ [self.view addSubview:self.mapConfigViewController.view];
+
[super viewDidLoad];
}
-(void) viewWillAppear:(BOOL)animated {
- [mapConfigViewController viewWillAppear:animated];
- [teamConfigViewController viewWillAppear:animated];
- [schemeWeaponConfigViewController viewWillAppear:animated];
- // ADD other controllers here
-
+ if (IS_IPAD())
+ [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
+
+ [self.mapConfigViewController viewWillAppear:animated];
+ [self.teamConfigViewController viewWillAppear:animated];
+ [self.schemeWeaponConfigViewController viewWillAppear:animated];
+ // add other controllers here and below
+
[super viewWillAppear:animated];
}
-(void) viewDidAppear:(BOOL)animated {
- [mapConfigViewController viewDidAppear:animated];
- [teamConfigViewController viewDidAppear:animated];
- [schemeWeaponConfigViewController viewDidAppear:animated];
+ [self.mapConfigViewController viewDidAppear:animated];
+ [self.teamConfigViewController viewDidAppear:animated];
+ [self.schemeWeaponConfigViewController viewDidAppear:animated];
[super viewDidAppear:animated];
}
+-(void) viewWillDisappear:(BOOL)animated {
+ [self.mapConfigViewController viewWillDisappear:animated];
+ [self.teamConfigViewController viewWillDisappear:animated];
+ [self.schemeWeaponConfigViewController viewWillDisappear:animated];
+ [super viewWillDisappear:animated];
+}
+
+-(void) viewDidDisappear:(BOOL)animated {
+ [self.mapConfigViewController viewDidDisappear:animated];
+ [self.teamConfigViewController viewDidDisappear:animated];
+ [self.schemeWeaponConfigViewController viewDidDisappear:animated];
+ [super viewDidDisappear:animated];
+}
+
-(void) didReceiveMemoryWarning {
- if (activeController.view.superview == nil)
- activeController = nil;
- // Releases the view if it doesn't have a superview.
+ if (self.teamConfigViewController.view.superview == nil)
+ self.teamConfigViewController = nil;
+ if (self.schemeWeaponConfigViewController.view.superview == nil)
+ self.schemeWeaponConfigViewController = nil;
+ if (self.helpPage.view.superview == nil)
+ self.helpPage = nil;
+ if (self.mapConfigViewController.view.superview == nil)
+ self.mapConfigViewController = nil;
+
+ self.imgContainer = nil;
+ MSG_MEMCLEAN();
[super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren't in use.
- if (mapConfigViewController.view.superview == nil)
- mapConfigViewController = nil;
- if (teamConfigViewController.view.superview == nil)
- teamConfigViewController = nil;
- if (schemeWeaponConfigViewController.view.superview == nil)
- schemeWeaponConfigViewController = nil;
- MSG_MEMCLEAN();
}
-(void) viewDidUnload {
- activeController = nil;
- mapConfigViewController = nil;
- teamConfigViewController = nil;
- schemeWeaponConfigViewController = nil;
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ self.imgContainer = nil;
+ self.mapConfigViewController = nil;
+ self.teamConfigViewController = nil;
+ self.schemeWeaponConfigViewController = nil;
+ self.helpPage = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
-(void) dealloc {
+ [imgContainer release];
[mapConfigViewController release];
[teamConfigViewController release];
[schemeWeaponConfigViewController release];
+ [helpPage release];
[super dealloc];
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/GameSetup.h
--- a/project_files/HedgewarsMobile/Classes/GameSetup.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// gameSetup.h
-// hwengine
-//
-// Created by Vittorio on 10/01/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 10/01/2010.
+ */
+
#import
#import "SDL_net.h"
@@ -12,22 +25,29 @@
@interface GameSetup : NSObject {
NSDictionary *systemSettings;
NSDictionary *gameConfig;
-
+
NSInteger ipcPort; // Port on which engine will listen
TCPsocket csd; // Client socket descriptor
+
+ 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;
-(void) startThread:(NSString *)selector;
-(int) sendToEngine:(NSString *)string;
+-(int) sendToEngineNoSave:(NSString *)string;
-(void) provideTeamData:(NSString *)teamName forHogs:(NSInteger) numberOfPlayingHogs withHealth:(NSInteger) initialHealth ofColor:(NSNumber *)teamColor;
-(void) provideAmmoData:(NSString *)ammostoreName forPlayingTeams:(NSInteger) numberOfTeams;
-(NSInteger) provideScheme:(NSString *)schemeName;
--(const char **)getSettings;
+-(const char **)getSettings:(NSString *)recordFile;
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/GameSetup.m
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,40 +1,71 @@
-//
-// gameSetup.m
-// hwengine
-//
-// Created by Vittorio on 10/01/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 10/01/2010.
+ */
+
#import "GameSetup.h"
#import "SDL_uikitappdelegate.h"
#import "SDL_net.h"
#import "PascalImports.h"
#import "CommodityFunctions.h"
+#import "OverlayViewController.h"
-#define BUFFER_SIZE 256
+#define BUFFER_SIZE 255 // like in original frontend
@implementation GameSetup
-
-@synthesize systemSettings, gameConfig;
+@synthesize systemSettings, gameConfig, savePath, menuStyle;
-(id) initWithDictionary:(NSDictionary *)gameDictionary {
if (self = [super init]) {
ipcPort = randomPort();
-
- // should check they exist and throw and exection if not
+
+ // the general settings file + menu style (read by the overlay)
NSDictionary *dictSett = [[NSDictionary alloc] initWithContentsOfFile:SETTINGS_FILE()];
+ self.menuStyle = [[dictSett objectForKey:@"menu"] boolValue];
self.systemSettings = dictSett;
[dictSett release];
-
- self.gameConfig = gameDictionary;
- }
+
+ // this game run settings
+ self.gameConfig = [gameDictionary objectForKey:@"game_dictionary"];
+
+ // is it a netgame?
+ isNetGame = [[gameDictionary objectForKey:@"netgame"] boolValue];
+
+ // is it a Save?
+ NSString *path = [gameDictionary objectForKey:@"savefile"];
+ // if path is empty it means that you have to create a new file, otherwise read from that file
+ if ([path isEqualToString:@""] == YES) {
+ NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
+ [outputFormatter setDateFormat:@"yyyy-MM-dd '@' HH.mm"];
+ NSString *newDateString = [outputFormatter stringFromDate:[NSDate date]];
+ self.savePath = [SAVES_DIRECTORY() stringByAppendingFormat:@"%@.hws", newDateString];
+ [outputFormatter release];
+ } else
+ self.savePath = path;
+ }
return self;
}
-(void) dealloc {
[gameConfig release];
[systemSettings release];
+ [savePath release];
[super dealloc];
}
@@ -47,46 +78,46 @@
addhh
is 0 for human, 1-5 for bots (5 is the most stupid)
*/
-
+
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@", TEAMS_DIRECTORY(), teamName];
NSDictionary *teamData = [[NSDictionary alloc] initWithContentsOfFile:teamFile];
[teamFile release];
-
- NSString *teamHashColorAndName = [[NSString alloc] initWithFormat:@"eaddteam %@ %@ %@",
+
+ NSString *teamHashColorAndName = [[NSString alloc] initWithFormat:@"eaddteam %@ %@ %@",
[teamData objectForKey:@"hash"], [teamColor stringValue], [teamName stringByDeletingPathExtension]];
[self sendToEngine: teamHashColorAndName];
[teamHashColorAndName release];
-
+
NSString *grave = [[NSString alloc] initWithFormat:@"egrave %@", [teamData objectForKey:@"grave"]];
[self sendToEngine: grave];
[grave release];
-
+
NSString *fort = [[NSString alloc] initWithFormat:@"efort %@", [teamData objectForKey:@"fort"]];
[self sendToEngine: fort];
[fort release];
-
+
NSString *voicepack = [[NSString alloc] initWithFormat:@"evoicepack %@", [teamData objectForKey:@"voicepack"]];
[self sendToEngine: voicepack];
[voicepack release];
-
+
NSString *flag = [[NSString alloc] initWithFormat:@"eflag %@", [teamData objectForKey:@"flag"]];
[self sendToEngine: flag];
[flag release];
-
+
NSArray *hogs = [teamData objectForKey:@"hedgehogs"];
for (int i = 0; i < numberOfPlayingHogs; i++) {
NSDictionary *hog = [hogs objectAtIndex:i];
-
- NSString *hogLevelHealthAndName = [[NSString alloc] initWithFormat:@"eaddhh %@ %d %@",
+
+ NSString *hogLevelHealthAndName = [[NSString alloc] initWithFormat:@"eaddhh %@ %d %@",
[hog objectForKey:@"level"], initialHealth, [hog objectForKey:@"hogname"]];
[self sendToEngine: hogLevelHealthAndName];
[hogLevelHealthAndName release];
-
+
NSString *hogHat = [[NSString alloc] initWithFormat:@"ehat %@", [hog objectForKey:@"hat"]];
[self sendToEngine: hogHat];
[hogHat release];
}
-
+
[teamData release];
}
@@ -95,120 +126,99 @@
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];
[ammloadt release];
-
+
NSString *ammprob = [[NSString alloc] initWithFormat:@"eammprob %@%@", [ammoData objectForKey:@"ammostore_probability"], update];
[self sendToEngine: ammprob];
[ammprob release];
-
+
NSString *ammdelay = [[NSString alloc] initWithFormat:@"eammdelay %@%@", [ammoData objectForKey:@"ammostore_delay"], update];
[self sendToEngine: ammdelay];
[ammdelay release];
-
+
NSString *ammreinf = [[NSString alloc] initWithFormat:@"eammreinf %@%@", [ammoData objectForKey:@"ammostore_crate"], update];
[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];
[ammstore release];
-
+
[ammoData release];
}
// unpacks scheme data from the selected scheme.plist to a sequence of engine commands
-(NSInteger) provideScheme:(NSString *)schemeName {
NSString *schemePath = [[NSString alloc] initWithFormat:@"%@/%@",SCHEMES_DIRECTORY(),schemeName];
- NSArray *scheme = [[NSArray alloc] initWithContentsOfFile:schemePath];
+ NSDictionary *schemeDictionary = [[NSDictionary alloc] initWithContentsOfFile:schemePath];
[schemePath release];
+ NSArray *basicArray = [schemeDictionary objectForKey:@"basic"];
+ NSArray *gamemodArray = [schemeDictionary objectForKey:@"gamemod"];
+ int i = 0;
int result = 0;
- int i = 0;
+ int mask = 0x00000004;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x01;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x10;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x04;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x08;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x20;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x40;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x80;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x100;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x200;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x400;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x800;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x2000;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x4000;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x8000;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x10000;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x20000;
- if ([[scheme objectAtIndex:i++] boolValue])
- result |= 0x80000;
-
+ // pack the gameflags in a single var and send it
+ for (NSNumber *value in gamemodArray) {
+ if ([value boolValue] == YES)
+ result |= mask;
+ mask <<= 1;
+ }
NSString *flags = [[NSString alloc] initWithFormat:@"e$gmflags %d",result];
[self sendToEngine:flags];
[flags release];
-
- NSString *dmgMod = [[NSString alloc] initWithFormat:@"e$damagepct %d",[[scheme objectAtIndex:i++] intValue]];
+
+ NSString *dmgMod = [[NSString alloc] initWithFormat:@"e$damagepct %d",[[basicArray objectAtIndex:i++] intValue]];
[self sendToEngine:dmgMod];
[dmgMod release];
-
- NSString *turnTime = [[NSString alloc] initWithFormat:@"e$turntime %d",[[scheme objectAtIndex:i++] intValue] * 1000];
+
+ // support for endless games
+ NSInteger tentativeTurntime = [[basicArray objectAtIndex:i++] intValue];
+ if (tentativeTurntime == 100)
+ tentativeTurntime = 9999;
+ NSString *turnTime = [[NSString alloc] initWithFormat:@"e$turntime %d",tentativeTurntime * 1000];
[self sendToEngine:turnTime];
[turnTime release];
-
- result = [[scheme objectAtIndex:i++] intValue]; // initial health
-
- NSString *sdTime = [[NSString alloc] initWithFormat:@"e$sd_turns %d",[[scheme objectAtIndex:i++] intValue]];
+
+ result = [[basicArray objectAtIndex:i++] intValue]; // initial health
+
+ NSString *sdTime = [[NSString alloc] initWithFormat:@"e$sd_turns %d",[[basicArray objectAtIndex:i++] intValue]];
[self sendToEngine:sdTime];
[sdTime release];
-
- NSString *crateDrops = [[NSString alloc] initWithFormat:@"e$casefreq %d",[[scheme objectAtIndex:i++] intValue]];
+
+ NSString *crateDrops = [[NSString alloc] initWithFormat:@"e$casefreq %d",[[basicArray objectAtIndex:i++] intValue]];
[self sendToEngine:crateDrops];
[crateDrops release];
-
- NSString *minesTime = [[NSString alloc] initWithFormat:@"e$minestime %d",[[scheme objectAtIndex:i++] intValue] * 1000];
+
+ NSString *minesTime = [[NSString alloc] initWithFormat:@"e$minestime %d",[[basicArray objectAtIndex:i++] intValue] * 1000];
[self sendToEngine:minesTime];
[minesTime release];
-
- NSString *minesNumber = [[NSString alloc] initWithFormat:@"e$landadds %d",[[scheme objectAtIndex:i++] intValue]];
+
+ NSString *minesNumber = [[NSString alloc] initWithFormat:@"e$landadds %d",[[basicArray objectAtIndex:i++] intValue]];
[self sendToEngine:minesNumber];
[minesNumber release];
-
- NSString *dudMines = [[NSString alloc] initWithFormat:@"e$minedudpct %d",[[scheme objectAtIndex:i++] intValue]];
+
+ NSString *dudMines = [[NSString alloc] initWithFormat:@"e$minedudpct %d",[[basicArray objectAtIndex:i++] intValue]];
[self sendToEngine:dudMines];
[dudMines release];
-
- NSString *explosives = [[NSString alloc] initWithFormat:@"e$explosives %d",[[scheme objectAtIndex:i++] intValue]];
+
+ NSString *explosives = [[NSString alloc] initWithFormat:@"e$explosives %d",[[basicArray objectAtIndex:i++] intValue]];
[self sendToEngine:explosives];
[explosives release];
-
- [scheme release];
+
+ DLog(@"Sent %d flags and %d modes", [gamemodArray count], i);
+ [schemeDictionary release];
return result;
}
@@ -220,11 +230,30 @@
[NSThread detachNewThreadSelector:usage toTarget:self withObject:nil];
}
-// wrapper that computes the length of the message and then sends the command string
+-(void) dumpRawData:(const uint8_t*)buffer ofSize:(uint8_t) length {
+ // is it performant to reopen the stream every time?
+ NSOutputStream *os = [[NSOutputStream alloc] initToFileAtPath:self.savePath append:YES];
+ [os open];
+ [os write:&length maxLength:1];
+ [os write:buffer maxLength:length];
+ [os close];
+ [os release];
+}
+
+// wrapper that computes the length of the message and then sends the command string, saving the command on a file
-(int) sendToEngine: (NSString *)string {
uint8_t length = [string length];
-
- SDLNet_TCP_Send(csd, &length , 1);
+
+ [self dumpRawData:(const uint8_t *)[string UTF8String] ofSize:length];
+ SDLNet_TCP_Send(csd, &length, 1);
+ return SDLNet_TCP_Send(csd, [string UTF8String], length);
+}
+
+// wrapper that computes the length of the message and then sends the command string, skipping file writing
+-(int) sendToEngineNoSave: (NSString *)string {
+ uint8_t length = [string length];
+
+ SDLNet_TCP_Send(csd, &length, 1);
return SDLNet_TCP_Send(csd, [string UTF8String], length);
}
@@ -235,10 +264,9 @@
IPaddress ip;
int eProto;
BOOL clientQuit;
- char buffer[BUFFER_SIZE];
+ uint8_t buffer[BUFFER_SIZE];
uint8_t msgSize;
- uint16_t gameTicks;
-
+
clientQuit = NO;
csd = NULL;
@@ -246,67 +274,78 @@
DLog(@"SDLNet_Init: %s", SDLNet_GetError());
clientQuit = YES;
}
-
+
// Resolving the host using NULL make network interface to listen
if (SDLNet_ResolveHost(&ip, NULL, ipcPort) < 0 && !clientQuit) {
DLog(@"SDLNet_ResolveHost: %s\n", SDLNet_GetError());
clientQuit = YES;
}
-
- // Open a connection with the IP provided (listen on the host's port)
+
+ // Open a connection with the IP provided (listen on the host's port)
if (!(sd = SDLNet_TCP_Open(&ip)) && !clientQuit) {
DLog(@"SDLNet_TCP_Open: %s %\n", SDLNet_GetError(), ipcPort);
clientQuit = YES;
}
-
+
DLog(@"Waiting for a client on port %d", ipcPort);
- while (csd == NULL)
+ while (csd == NULL)
csd = SDLNet_TCP_Accept(sd);
SDLNet_TCP_Close(sd);
-
+
while (!clientQuit) {
msgSize = 0;
- memset(buffer, 0, BUFFER_SIZE);
+ memset(buffer, '\0', BUFFER_SIZE);
if (SDLNet_TCP_Recv(csd, &msgSize, sizeof(uint8_t)) <= 0)
- clientQuit = YES;
+ break;
if (SDLNet_TCP_Recv(csd, buffer, msgSize) <=0)
- clientQuit = YES;
-
+ break;
+
switch (buffer[0]) {
case 'C':
DLog(@"sending game config...\n%@",self.gameConfig);
-
- // local game
- [self sendToEngine:@"TL"];
-
+
+ if (isNetGame == YES)
+ [self sendToEngineNoSave:@"TN"];
+ else
+ [self sendToEngineNoSave:@"TL"];
+ NSString *saveHeader = @"TS";
+ [self dumpRawData:(const uint8_t *)[saveHeader UTF8String] ofSize:[saveHeader length]];
+
// seed info
[self sendToEngine:[self.gameConfig objectForKey:@"seed_command"]];
-
+
// dimension of the map
[self sendToEngine:[self.gameConfig objectForKey:@"templatefilter_command"]];
[self sendToEngine:[self.gameConfig objectForKey:@"mapgen_command"]];
[self sendToEngine:[self.gameConfig objectForKey:@"mazesize_command"]];
-
+
// static land (if set)
NSString *staticMap = [self.gameConfig objectForKey:@"staticmap_command"];
if ([staticMap length] != 0)
[self sendToEngine:staticMap];
+
+ // lua script (if set)
+ NSString *script = [self.gameConfig objectForKey:@"mission_command"];
+ if ([script length] != 0)
+ [self sendToEngine:script];
// theme info
[self sendToEngine:[self.gameConfig objectForKey:@"theme_command"]];
-
+
// scheme (returns initial health)
NSInteger health = [self provideScheme:[self.gameConfig objectForKey:@"scheme"]];
-
+
+ // send an ammostore for each team
NSArray *teamsConfig = [self.gameConfig objectForKey:@"teams_list"];
+ [self provideAmmoData:[self.gameConfig objectForKey:@"weapon"] forPlayingTeams:[teamsConfig count]];
+
+ // finally add hogs
for (NSDictionary *teamData in teamsConfig) {
- [self provideTeamData:[teamData objectForKey:@"team"]
+ [self provideTeamData:[teamData objectForKey:@"team"]
forHogs:[[teamData objectForKey:@"number"] intValue]
withHealth:health
ofColor:[teamData objectForKey:@"color"]];
}
-
- [self provideAmmoData:[self.gameConfig objectForKey:@"weapon"] forPlayingTeams:[teamsConfig count]];
break;
case '?':
DLog(@"Ping? Pong!");
@@ -317,10 +356,12 @@
clientQuit = YES;
break;
case 'e':
- sscanf(buffer, "%*s %d", &eProto);
+ [self dumpRawData:buffer ofSize:msgSize];
+
+ sscanf((char *)buffer, "%*s %d", &eProto);
short int netProto = 0;
char *versionStr;
-
+
HW_versionInfo(&netProto, &versionStr);
if (netProto == eProto) {
DLog(@"Setting protocol version %d (%s)", eProto, versionStr);
@@ -328,22 +369,30 @@
DLog(@"ERROR - wrong protocol number: [%s] - expecting %d", &buffer[1], eProto);
clientQuit = YES;
}
-
break;
case 'i':
switch (buffer[1]) {
case 'r':
- NSLog(@"Winning team: %s", &buffer[2]);
+ DLog(@"Winning team: %s", &buffer[2]);
break;
case 'k':
- NSLog(@"Best Hedgehog: %s", &buffer[2]);
+ DLog(@"Best Hedgehog: %s", &buffer[2]);
+ break;
+ default:
+ // TODO: losta stats stuff
break;
}
break;
+ case 'q':
+ // game ended, can remove the savefile
+ [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
+ //[[NSNotificationCenter defaultCenter] postNotificationName:@"removedSave" object:nil];
+ // and remove + disable the overlay
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"remove overlay" object:nil];
+ setGameRunning(NO);
+ break;
default:
- // empty packet or just statistics -- in either cases gameTicks is sent
- gameTicks = SDLNet_Read16 (&buffer[msgSize - 2]);
- //DLog(@"engineProtocol - %d: received [%s]", gameTicks, buffer);
+ [self dumpRawData:buffer ofSize:msgSize];
break;
}
}
@@ -351,9 +400,9 @@
// wait a little to let the client close cleanly
[NSThread sleepForTimeInterval:2];
// Close the client socket
- SDLNet_TCP_Close(csd);
+ SDLNet_TCP_Close(csd);
SDLNet_Quit();
-
+
[pool release];
//Invoking this method should be avoided as it does not give your thread a chance to clean up any resources it allocated during its execution.
//[NSThread exit];
@@ -362,30 +411,45 @@
#pragma mark -
#pragma mark Setting methods
// returns an array of c-strings that are read by engine at startup
--(const char **)getSettings {
+-(const char **)getSettings: (NSString *)recordFile {
+ NSInteger width, height;
NSString *ipcString = [[NSString alloc] initWithFormat:@"%d", ipcPort];
NSString *localeString = [[NSString alloc] initWithFormat:@"%@.txt", [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode]];
- CGRect screenBounds = [[UIScreen mainScreen] bounds];
- NSString *wSize = [[NSString alloc] initWithFormat:@"%d", (int) screenBounds.size.width];
- NSString *hSize = [[NSString alloc] initWithFormat:@"%d", (int) screenBounds.size.height];
+ NSString *rotation;
+ if (IS_DUALHEAD()) {
+ CGRect screenBounds = [[[UIScreen screens] objectAtIndex:1] bounds];
+ width = (int) screenBounds.size.width;
+ height = (int) screenBounds.size.height;
+ rotation = @"0";
+ } else {
+ CGRect screenBounds = [[UIScreen mainScreen] bounds];
+ width = (int) screenBounds.size.height;
+ height = (int) screenBounds.size.width;
+ UIDeviceOrientation orientation = (UIDeviceOrientation) [[self.gameConfig objectForKey:@"orientation"] intValue];
+ if (orientation == UIDeviceOrientationLandscapeLeft)
+ rotation = @"-90";
+ else
+ rotation = @"90";
+ }
+
+ NSString *horizontalSize = [[NSString alloc] initWithFormat:@"%d", width];
+ NSString *verticalSize = [[NSString alloc] initWithFormat:@"%d", height];
const char **gameArgs = (const char**) malloc(sizeof(char *) * 10);
NSInteger tmpQuality;
-
+
NSString *modelId = modelType();
if ([modelId hasPrefix:@"iPhone1"] || // = iPhone or iPhone 3G
[modelId hasPrefix:@"iPod1,1"] || [modelId hasPrefix:@"iPod2,1"]) // = iPod Touch or iPod Touch 2G
tmpQuality = 0x00000001 | 0x00000002 | 0x00000040; // rqLowRes | rqBlurryLand | rqKillFlakes
else if ([modelId hasPrefix:@"iPhone2"] || // = iPhone 3GS
[modelId hasPrefix:@"iPod3"]) // = iPod Touch 3G
- tmpQuality = 0x00000002 | 0x00000040; // rqBlurryLand | rqKillFlakes
+ tmpQuality = 0x00000002 | 0x00000040; // rqBlurryLand | rqKillFlakes
else if ([modelId hasPrefix:@"iPad1"]) // = iPad
tmpQuality = 0x00000002; // rqBlurryLand
else // = everything else
tmpQuality = 0; // full quality
- if (![modelId hasPrefix:@"iPad"]) // = disable tooltips unless iPad
+ if (IS_IPAD() == NO) // = disable tooltips on phone
tmpQuality = tmpQuality | 0x00000400;
-
- gameArgs[9] = [[[NSNumber numberWithInteger:tmpQuality] stringValue] UTF8String];
// prevents using an empty nickname
NSString *username;
@@ -394,19 +458,21 @@
username = [[NSString alloc] initWithFormat:@"MobileUser-%@",ipcString];
else
username = [[NSString alloc] initWithString:originalUsername];
-
- gameArgs[0] = [username UTF8String]; //UserNick
- gameArgs[1] = [ipcString UTF8String]; //ipcPort
- gameArgs[2] = [[[self.systemSettings objectForKey:@"sound"] stringValue] UTF8String]; //isSoundEnabled
- gameArgs[3] = [[[self.systemSettings objectForKey:@"music"] stringValue] UTF8String]; //isMusicEnabled
- gameArgs[4] = [localeString UTF8String]; //cLocaleFName
- gameArgs[5] = [[[self.systemSettings objectForKey:@"alternate"] stringValue] UTF8String]; //cAltDamage
- gameArgs[6] = [wSize UTF8String]; //cScreenHeight
- gameArgs[7] = [hSize UTF8String]; //cScreenWidth
- gameArgs[8] = NULL; //recordFileName
-
- [wSize release];
- [hSize release];
+
+ gameArgs[ 0] = [ipcString UTF8String]; //ipcPort
+ gameArgs[ 1] = [horizontalSize UTF8String]; //cScreenWidth
+ gameArgs[ 2] = [verticalSize UTF8String]; //cScreenHeight
+ gameArgs[ 3] = [[[NSNumber numberWithInteger:tmpQuality] stringValue] UTF8String]; //quality
+ gameArgs[ 4] = "en.txt";//[localeString UTF8String]; //cLocaleFName
+ gameArgs[ 5] = [username UTF8String]; //UserNick
+ gameArgs[ 6] = [[[self.systemSettings objectForKey:@"sound"] stringValue] UTF8String]; //isSoundEnabled
+ gameArgs[ 7] = [[[self.systemSettings objectForKey:@"music"] stringValue] UTF8String]; //isMusicEnabled
+ gameArgs[ 8] = [[[self.systemSettings objectForKey:@"alternate"] stringValue] UTF8String]; //cAltDamage
+ gameArgs[ 9] = [rotation UTF8String]; //rotateQt
+ gameArgs[10] = [recordFile UTF8String]; //recordFileName
+
+ [verticalSize release];
+ [horizontalSize release];
[localeString release];
[ipcString release];
[username release];
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.h
--- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// SettingsViewController.h
-// hwengine
-//
-// Created by Vittorio on 08/01/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/01/2010.
+ */
+
#import
#import "EditableCellView.h"
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m
--- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// SettingsViewController.m
-// hwengine
-//
-// Created by Vittorio on 08/01/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/01/2010.
+ */
+
#import "GeneralSettingsViewController.h"
#import "CommodityFunctions.h"
@@ -25,7 +38,7 @@
-(void) viewWillAppear:(BOOL)animated {
[self.tableView setContentOffset:CGPointMake(0,0) animated:NO];
-
+
NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:SETTINGS_FILE()];
self.settingsDictionary = dictionary;
[dictionary release];
@@ -34,7 +47,7 @@
}
-(void) viewWillDisappear:(BOOL)animated {
- [super viewWillDisappear:animated];
+ [super viewWillDisappear:animated];
[self.settingsDictionary writeToFile:SETTINGS_FILE() atomically:YES];
}
@@ -42,7 +55,7 @@
-(void) switchValueChanged:(id) sender {
UISwitch *theSwitch = (UISwitch *)sender;
UISwitch *theOtherSwitch = nil;
-
+
switch (theSwitch.tag) {
case 10: //soundSwitch
// this turn off also the switch below
@@ -63,6 +76,9 @@
case 30: //alternateSwitch
[self.settingsDictionary setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"alternate"];
break;
+ case 60: //getReady
+ [self.settingsDictionary setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"menu"];
+ break;
default:
DLog(@"Wrong tag");
break;
@@ -85,15 +101,16 @@
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
switch (section) {
case 0: // user and pass
- return 2;
+ return 1; // set 2 here for the password field
break;
case 1: // audio
return 2;
break;
- case 2: // alternate damage
- return 1;
+ case 2: // other stuff
+ return 2;
break;
default:
+ DLog(@"Nope");
break;
}
return 0;
@@ -103,7 +120,7 @@
NSString *sectionTitle = nil;
switch (section) {
case 0:
- sectionTitle = NSLocalizedString(@"Network Configuration", @"");
+ sectionTitle = NSLocalizedString(@"Main Configuration", @"");
break;
case 1:
sectionTitle = NSLocalizedString(@"Audio Preferences", @"");
@@ -121,49 +138,52 @@
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier0 = @"Cell0";
static NSString *cellIdentifier1 = @"Cell1";
+ static NSString *cellIdentifier2 = @"Cell2";
NSInteger row = [indexPath row];
NSInteger section = [indexPath section];
-
+
UITableViewCell *cell = nil;
EditableCellView *editableCell = nil;
- if (section == 0) {
- editableCell = (EditableCellView *)[aTableView dequeueReusableCellWithIdentifier:cellIdentifier0];
- if (nil == editableCell) {
- editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier0] autorelease];
- editableCell.minimumCharacters = 0;
- editableCell.delegate = self;
- editableCell.textField.font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
- editableCell.textField.textColor = [UIColor lightGrayColor];
- }
-
- if (row == 0) {
- editableCell.titleLabel.text = NSLocalizedString(@"Nickname","from the settings table");
- editableCell.textField.placeholder = NSLocalizedString(@"Insert your username (if you have one)",@"");
- editableCell.textField.text = [self.settingsDictionary objectForKey:@"username"];
- editableCell.textField.secureTextEntry = NO;
- editableCell.tag = 40;
- } else {
- editableCell.titleLabel.text = NSLocalizedString(@"Password","from the settings table");
- editableCell.textField.placeholder = NSLocalizedString(@"Insert your password",@"");
- editableCell.textField.text = [self.settingsDictionary objectForKey:@"password"];
- editableCell.textField.secureTextEntry = YES;
- editableCell.tag = 50;
- }
-
- editableCell.accessoryView = nil;
- cell = editableCell;
- } else {
- cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier1];
- if (nil == cell) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier1] autorelease];
- UISwitch *theSwitch = [[UISwitch alloc] init];
- [theSwitch addTarget:self action:@selector(switchValueChanged:) forControlEvents:UIControlEventValueChanged];
- cell.accessoryView = theSwitch;
- [theSwitch release];
- }
-
- UISwitch *switchContent = (UISwitch *)cell.accessoryView;
- if (section == 1) {
+ UISwitch *switchContent = nil;
+ switch(section) {
+ case 0:
+ editableCell = (EditableCellView *)[aTableView dequeueReusableCellWithIdentifier:cellIdentifier0];
+ if (nil == editableCell) {
+ editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier0] autorelease];
+ editableCell.minimumCharacters = 0;
+ editableCell.delegate = self;
+ editableCell.textField.font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
+ editableCell.textField.textColor = [UIColor lightGrayColor];
+ }
+
+ if (row == 0) {
+ editableCell.titleLabel.text = NSLocalizedString(@"Nickname","from the settings table");
+ editableCell.textField.placeholder = NSLocalizedString(@"Insert your username (if you have one)",@"");
+ editableCell.textField.text = [self.settingsDictionary objectForKey:@"username"];
+ editableCell.textField.secureTextEntry = NO;
+ editableCell.tag = 40;
+ } else {
+ editableCell.titleLabel.text = NSLocalizedString(@"Password","from the settings table");
+ editableCell.textField.placeholder = NSLocalizedString(@"Insert your password",@"");
+ editableCell.textField.text = [self.settingsDictionary objectForKey:@"password"];
+ editableCell.textField.secureTextEntry = YES;
+ editableCell.tag = 50;
+ }
+
+ editableCell.accessoryView = nil;
+ cell = editableCell;
+ break;
+ case 1:
+ cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier1];
+ if (nil == cell) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier1] autorelease];
+ UISwitch *theSwitch = [[UISwitch alloc] init];
+ [theSwitch addTarget:self action:@selector(switchValueChanged:) forControlEvents:UIControlEventValueChanged];
+ cell.accessoryView = theSwitch;
+ [theSwitch release];
+ }
+
+ switchContent = (UISwitch *)cell.accessoryView;
if (row == 0) {
cell.textLabel.text = NSLocalizedString(@"Sound", @"");
switchContent.on = [[self.settingsDictionary objectForKey:@"sound"] boolValue];
@@ -173,62 +193,41 @@
switchContent.on = [[self.settingsDictionary objectForKey:@"music"] boolValue];
switchContent.tag = 20;
}
- } else {
- cell.textLabel.text = NSLocalizedString(@"Alternate Damage", @"");
- switchContent.on = [[self.settingsDictionary objectForKey:@"alternate"] boolValue];
- switchContent.tag = 30;
- }
+ break;
+ case 2:
+ cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier2];
+ if (nil == cell) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier2] autorelease];
+ UISwitch *theSwitch = [[UISwitch alloc] init];
+ [theSwitch addTarget:self action:@selector(switchValueChanged:) forControlEvents:UIControlEventValueChanged];
+ cell.accessoryView = theSwitch;
+ [theSwitch release];
+ }
+
+ switchContent = (UISwitch *)cell.accessoryView;
+ if (row == 0) {
+ cell.textLabel.text = NSLocalizedString(@"Alternate Damage", @"");
+ cell.detailTextLabel.text = NSLocalizedString(@"Damage popups will notify you on every single hit a hedgehog suffers", @"");
+ switchContent.on = [[self.settingsDictionary objectForKey:@"alternate"] boolValue];
+ switchContent.tag = 30;
+ } else {
+ 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:
+ break;
}
cell.accessoryType = UITableViewCellAccessoryNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.imageView.image = nil;
-
+
return cell;
}
-/*
--(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
- UIView *containerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 50)] autorelease];
- UILabel *headerLabel = [[[UILabel alloc] initWithFrame:CGRectMake(10, 20, 300, 40)] autorelease];
- headerLabel.textColor = [UIColor lightGrayColor];
- headerLabel.shadowColor = [UIColor blackColor];
- headerLabel.shadowOffset = CGSizeMake(0, 1);
- headerLabel.font = [UIFont boldSystemFontOfSize:20];
- headerLabel.backgroundColor = [UIColor clearColor];
-
- switch (section) {
- case kNetworkFields:
- headerLabel.text = NSLocalizedString(@"Network Configuration", @"");
- break;
- case kAudioFields:
- headerLabel.text = NSLocalizedString(@"Audio Preferences", @"");
- break;
- case kOtherFields:
- headerLabel.text = NSLocalizedString(@"Other Settings", @"");
- break;
- default:
- NSLog(@"Warning: unset case value in titleForHeaderInSection!");
- headerLabel.text = @"!";
- break;
- }
-
- [containerView addSubview:headerLabel];
- return containerView;
-}
-
--(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- if (kAudioFields == [indexPath section] && 2 == [indexPath row])
- return volumeCell.frame.size.height;
- else
- return table.rowHeight;
-}
-
--(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
- return 57.0;
-}
-*/
-
#pragma mark -
#pragma mark Table view delegate
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/GravesViewController.h
--- a/project_files/HedgewarsMobile/Classes/GravesViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GravesViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,17 +1,30 @@
-//
-// GravesViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import
@interface GravesViewController : UITableViewController {
NSMutableDictionary *teamDictionary;
-
+
NSArray *graveArray;
NSIndexPath *lastIndexPath;
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/GravesViewController.m
--- a/project_files/HedgewarsMobile/Classes/GravesViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GravesViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// GravesViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import "GravesViewController.h"
#import "CommodityFunctions.h"
@@ -26,7 +39,7 @@
// load all the grave names and store them into graveArray
self.graveArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:GRAVES_DIRECTORY() error:NULL];
-
+
self.title = NSLocalizedString(@"Choose hedgehog graves",@"");
}
@@ -51,14 +64,14 @@
// Customize the appearance of table view cells.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
-
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
-
+
NSString *grave = [self.graveArray objectAtIndex:[indexPath row]];
cell.textLabel.text = [grave stringByDeletingPathExtension];
-
+
if ([grave isEqualToString:[self.teamDictionary objectForKey:@"grave"]]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
self.lastIndexPath = indexPath;
@@ -69,10 +82,10 @@
NSString *graveFilePath = [[NSString alloc] initWithFormat:@"%@/%@",GRAVES_DIRECTORY(),grave];
// because we also have multi frame graves, let's take the first one only
UIImage *graveSprite = [[UIImage alloc] initWithContentsOfFile:graveFilePath andCutAt:CGRectMake(0, 0, 32, 32)];
- [graveFilePath release];
+ [graveFilePath release];
cell.imageView.image = graveSprite;
[graveSprite release];
-
+
return cell;
}
@@ -82,13 +95,13 @@
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int newRow = [indexPath row];
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
-
+
if (newRow != oldRow) {
[teamDictionary setObject:[[graveArray objectAtIndex:newRow] stringByDeletingPathExtension] forKey:@"grave"];
-
+
// tell our boss to write this new stuff on disk
[[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
-
+
UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath];
newCell.accessoryType = UITableViewCellAccessoryCheckmark;
UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:lastIndexPath];
@@ -104,9 +117,9 @@
#pragma mark -
#pragma mark Memory management
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+ self.lastIndexPath = nil;
+ MSG_MEMCLEAN();
[super didReceiveMemoryWarning];
- // Relinquish ownership any cached data, images, etc that aren't in use.
}
-(void) viewDidUnload {
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/HelpPageInGameViewController.xib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/HelpPageInGameViewController.xib Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,889 @@
+
+
+
+ 1024
+ 10F569
+ 788
+ 1038.29
+ 461.00
+
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ 117
+
+
+ YES
+
+
+
+ YES
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+
+ YES
+
+ YES
+
+
+ YES
+
+
+
+ YES
+
+ IBFilesOwner
+ IBIPadFramework
+
+
+ IBFirstResponder
+ IBIPadFramework
+
+
+
+ 292
+
+ YES
+
+
+ 292
+ {{0, -1}, {1024, 768}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ helpingame.png
+
+
+
+
+ 292
+ {{79, 473}, {150, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Direction buttons
+
+ Helvetica-Bold
+ 18
+ 16
+
+
+ 1
+ MCAwIDAAA
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{79, 491}, {203, 85}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ With these buttons you can move your hog, aim and control certain weapons.
+
+ Helvetica
+ 16
+ 16
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{53, 97}, {186, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Timer
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{53, 118}, {187, 43}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Don't let your turn time run out!
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{780, 248}, {240, 128}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ helpright.png
+
+
+
+
+ 292
+ {{790, 256}, {109, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Ammo Menu
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{790, 282}, {214, 84}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ This menu contains all the weapons you can use. Drag your finger on a weapon for more details on what it does!
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{780, 97}, {186, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Pause / Open ammos
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{782, 118}, {187, 43}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Tap to pause or open the ammo menu.
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{418, 73}, {186, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Wind bar
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{418, 89}, {191, 63}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Some weapons are affected by the wind and their direction may shift.
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{447, 573}, {203, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Teams flags and health
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{447, 592}, {203, 85}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ These bars report the team name, the team flags and the global health status of every hog.
+
+
+
+ 1
+ 10
+ 4
+
+
+
+ 292
+ {{741, 501}, {135, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Joypad buttons
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{741, 520}, {211, 85}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Press X to jump forward, Y to jump backwards (double tap to jump twice) and Missile to attack or use items.
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{67, 238}, {240, 128}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ helpplain.png
+
+
+
+
+ 292
+ {{72, 246}, {229, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Tap to return to game
+
+
+
+ 1
+ 10
+ 1
+
+
+
+ 292
+ {{72, 268}, {229, 87}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Pan to move camera, pinch to zoom, double tap to center hog, and a single touch to interact with weapons and much more!
+
+
+
+ 1
+ 10
+ 0
+
+
+ {1024, 768}
+
+
+ 3
+ MCAwLjQAA
+
+ NO
+ NO
+
+ 3
+
+ IBIPadFramework
+
+
+
+
+ YES
+
+
+ view
+
+
+
+ 3
+
+
+
+ dismiss
+
+
+ 7
+
+ 16
+
+
+
+
+ YES
+
+ 0
+
+
+
+
+
+ -1
+
+
+ File's Owner
+
+
+ -2
+
+
+
+
+ 2
+
+
+ YES
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+
+
+
+
+ 6
+
+
+
+
+ 7
+
+
+
+
+ 8
+
+
+
+
+ 9
+
+
+
+
+ 10
+
+
+
+
+ 11
+
+
+
+
+ 12
+
+
+
+
+ 13
+
+
+
+
+ 14
+
+
+
+
+ 17
+
+
+
+
+ 18
+
+
+
+
+ 21
+
+
+
+
+ 22
+
+
+
+
+ 23
+
+
+
+
+ 24
+
+
+
+
+ 25
+
+
+
+
+ 26
+
+
+
+
+ 27
+
+
+
+
+
+
+ YES
+
+ YES
+ -1.CustomClassName
+ -2.CustomClassName
+ 10.IBPluginDependency
+ 11.IBPluginDependency
+ 12.IBPluginDependency
+ 13.IBPluginDependency
+ 14.IBPluginDependency
+ 17.IBPluginDependency
+ 18.IBPluginDependency
+ 2.CustomClassName
+ 2.IBEditorWindowLastContentRect
+ 2.IBPluginDependency
+ 21.IBPluginDependency
+ 22.IBPluginDependency
+ 23.IBPluginDependency
+ 24.IBPluginDependency
+ 25.IBPluginDependency
+ 26.IBPluginDependency
+ 27.IBPluginDependency
+ 5.IBPluginDependency
+ 6.IBPluginDependency
+ 7.IBPluginDependency
+ 8.IBPluginDependency
+ 9.IBPluginDependency
+
+
+ YES
+ HelpPageViewController
+ UIResponder
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ UIControl
+ {{288, 355}, {1024, 768}}
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+
+
+ YES
+
+
+ YES
+
+
+
+
+ YES
+
+
+ YES
+
+
+
+ 27
+
+
+
+ YES
+
+ HelpPageViewController
+ UIViewController
+
+ dismiss
+ id
+
+
+ dismiss
+
+ dismiss
+ id
+
+
+
+ IBProjectSource
+ Classes/HelpPageViewController.h
+
+
+
+
+ YES
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSError.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSFileManager.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueCoding.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueObserving.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyedArchiver.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSObject.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSRunLoop.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSThread.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURL.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURLConnection.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CAAnimation.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CALayer.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIAccessibility.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINibLoading.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIResponder.h
+
+
+
+ UIControl
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIControl.h
+
+
+
+ UIImageView
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIImageView.h
+
+
+
+ UILabel
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UILabel.h
+
+
+
+ UIResponder
+ NSObject
+
+
+
+ UISearchBar
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchBar.h
+
+
+
+ UISearchDisplayController
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchDisplayController.h
+
+
+
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITextField.h
+
+
+
+ UIView
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIView.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINavigationController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIPopoverController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISplitViewController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITabBarController.h
+
+
+
+ UIViewController
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIViewController.h
+
+
+
+
+ 0
+ IBIPadFramework
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS
+
+
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3
+
+
+ YES
+ ../Hedgewars.xcodeproj
+ 3
+
+ YES
+
+ YES
+ helpingame.png
+ helpplain.png
+ helpright.png
+
+
+ YES
+ {1024, 768}
+ {296, 138}
+ {308, 144}
+
+
+ 117
+
+
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.xib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.xib Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,1106 @@
+
+
+
+ 1024
+ 10F569
+ 788
+ 1038.29
+ 461.00
+
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ 117
+
+
+ YES
+
+
+
+ YES
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+
+ YES
+
+ YES
+
+
+ YES
+
+
+
+ YES
+
+ IBFilesOwner
+ IBIPadFramework
+
+
+ IBFirstResponder
+ IBIPadFramework
+
+
+
+ 292
+
+ YES
+
+
+ 292
+ {{742, 389}, {240, 102}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ helpabove.png
+
+
+
+
+ 292
+ {{753, 408}, {109, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Map theme
+
+ Helvetica-Bold
+ 18
+ 16
+
+
+ 1
+ MCAwIDAAA
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{753, 425}, {218, 66}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Here you can choose how your map will appear in game.
+
+ Helvetica
+ 16
+ 16
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{653, 202}, {240, 146}}
+
+ NO
+ NO
+ IBIPadFramework
+
+
+
+
+ 292
+ {{664, 221}, {109, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Map type
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{664, 244}, {218, 99}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Choose between a static map or a randomly generated one (might require more time). In a mission you need to perfom some action to win.
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{494, 20}, {240, 101}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ helpright.png
+
+
+
+
+ 292
+ {{502, 25}, {109, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Map preview
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{502, 46}, {218, 65}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ This is a small preview of your next map. Tap to select / generate a new map.
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{391, 389}, {242, 171}}
+
+ NO
+ NO
+ IBIPadFramework
+
+
+
+
+ 292
+ {{401, 413}, {109, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Teams
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{400, 434}, {232, 120}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Select which teams are playing! Add hogs by tapping on them and set their color to figure friend and foe teams out. AI teams will appear with a small robot badge next their name.
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{142, 125}, {240, 104}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ helpleft.png
+
+
+
+
+ 292
+ {{162, 133}, {204, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Schemes and Weapons
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{162, 152}, {210, 71}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Here you can choose which rules and which weapon set will be applied in game.
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{155, 8}, {278, 50}}
+
+ NO
+ NO
+ IBIPadFramework
+
+
+
+
+ 292
+ {{177, 6}, {248, 54}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Did you know you can customize almost everything in the settings page?
+
+ Helvetica-Oblique
+ 14
+ 16
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{686, 583}, {240, 117}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ helpbottom.png
+
+
+
+
+ 292
+ {{697, 592}, {138, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Max hedgehogs
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{697, 609}, {218, 73}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ This number is the maximum size for all the hogs playing (in every team).
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{20, 587}, {240, 109}}
+
+ NO
+ NO
+ IBIPadFramework
+
+
+
+
+ 292
+ {{30, 592}, {138, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Size slider
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{30, 608}, {218, 73}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ For Random and Maze maps you can decide to generate only maps of a certain size.
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{45, 318}, {240, 128}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ helpplain.png
+
+
+
+
+ 292
+ {{50, 326}, {229, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Tap anywhere to dismiss
+
+
+
+ 1
+ 10
+ 1
+
+
+
+ 292
+ {{52, 348}, {224, 87}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Still confused? Don't worry, it's really simple! Try a couple of games and everything will become clear to you.
+
+
+
+ 1
+ 10
+ 0
+
+
+
+ 292
+ {{344, 635}, {240, 61}}
+
+ NO
+ NO
+ IBIPadFramework
+
+
+
+
+ 292
+ {{353, 637}, {138, 22}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ Start button
+
+
+
+ 1
+ 10
+
+
+
+ 292
+ {{354, 650}, {218, 46}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ This button starts the game.
+
+
+
+ 1
+ 10
+ 0
+
+
+ {1024, 768}
+
+
+ 3
+ MCAwLjQAA
+
+ NO
+ NO
+
+ 3
+
+ IBIPadFramework
+
+
+
+
+ YES
+
+
+ view
+
+
+
+ 3
+
+
+
+ dismiss
+
+
+ 7
+
+ 16
+
+
+
+
+ YES
+
+ 0
+
+
+
+
+
+ -1
+
+
+ File's Owner
+
+
+ -2
+
+
+
+
+ 2
+
+
+ YES
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 6
+
+
+
+
+ 7
+
+
+
+
+ 8
+
+
+
+
+ 25
+
+
+
+
+ 26
+
+
+
+
+ 27
+
+
+
+
+ 28
+
+
+
+
+ 29
+
+
+
+
+ 30
+
+
+
+
+ 34
+
+
+
+
+ 35
+
+
+
+
+ 36
+
+
+
+
+ 37
+
+
+
+
+ 38
+
+
+
+
+ 39
+
+
+
+
+ 40
+
+
+
+
+ 41
+
+
+
+
+ 42
+
+
+
+
+ 43
+
+
+
+
+ 44
+
+
+
+
+ 45
+
+
+
+
+ 49
+
+
+
+
+ 50
+
+
+
+
+ 51
+
+
+
+
+ 52
+
+
+
+
+ 53
+
+
+
+
+ 54
+
+
+
+
+ 58
+
+
+
+
+ 59
+
+
+
+
+
+
+ YES
+
+ YES
+ -1.CustomClassName
+ -2.CustomClassName
+ 2.CustomClassName
+ 2.IBEditorWindowLastContentRect
+ 2.IBPluginDependency
+ 25.IBPluginDependency
+ 26.IBPluginDependency
+ 27.IBPluginDependency
+ 28.IBPluginDependency
+ 29.IBPluginDependency
+ 30.IBPluginDependency
+ 34.IBPluginDependency
+ 35.IBPluginDependency
+ 36.IBPluginDependency
+ 37.IBPluginDependency
+ 38.IBPluginDependency
+ 39.IBPluginDependency
+ 40.IBPluginDependency
+ 41.IBPluginDependency
+ 42.IBPluginDependency
+ 43.IBPluginDependency
+ 44.IBPluginDependency
+ 45.IBPluginDependency
+ 49.IBPluginDependency
+ 50.IBPluginDependency
+ 51.IBPluginDependency
+ 52.IBPluginDependency
+ 53.IBPluginDependency
+ 54.IBPluginDependency
+ 58.IBPluginDependency
+ 59.IBPluginDependency
+ 6.IBPluginDependency
+ 7.IBPluginDependency
+ 8.IBPluginDependency
+
+
+ YES
+ HelpPageViewController
+ UIResponder
+ UIControl
+ {{273, 125}, {1024, 768}}
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+
+
+ YES
+
+
+ YES
+
+
+
+
+ YES
+
+
+ YES
+
+
+
+ 59
+
+
+
+ YES
+
+ HelpPageViewController
+ UIViewController
+
+ dismiss
+ id
+
+
+ dismiss
+
+ dismiss
+ id
+
+
+
+ IBProjectSource
+ Classes/HelpPageViewController.h
+
+
+
+
+ YES
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSError.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSFileManager.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueCoding.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueObserving.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyedArchiver.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSObject.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSRunLoop.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSThread.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURL.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURLConnection.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CAAnimation.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CALayer.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIAccessibility.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINibLoading.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIResponder.h
+
+
+
+ UIControl
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIControl.h
+
+
+
+ UIImageView
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIImageView.h
+
+
+
+ UILabel
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UILabel.h
+
+
+
+ UIResponder
+ NSObject
+
+
+
+ UISearchBar
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchBar.h
+
+
+
+ UISearchDisplayController
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchDisplayController.h
+
+
+
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITextField.h
+
+
+
+ UIView
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIView.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINavigationController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIPopoverController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISplitViewController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITabBarController.h
+
+
+
+ UIViewController
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIViewController.h
+
+
+
+
+ 0
+ IBIPadFramework
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS
+
+
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3
+
+
+ YES
+ ../Hedgewars.xcodeproj
+ 3
+
+ YES
+
+ YES
+ helpabove.png
+ helpbottom.png
+ helpleft.png
+ helpplain.png
+ helpright.png
+
+
+ YES
+ {295, 156}
+ {295, 156}
+ {308, 144}
+ {296, 138}
+ {308, 144}
+
+
+ 117
+
+
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/HelpPageViewController.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/HelpPageViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,31 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 30/08/2010.
+ */
+
+
+#import
+
+
+@interface HelpPageViewController : UIViewController {
+
+}
+
+-(IBAction) dismiss;
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/HelpPageViewController.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/HelpPageViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,55 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 30/08/2010.
+ */
+
+
+#import "HelpPageViewController.h"
+#import "CommodityFunctions.h"
+
+@implementation HelpPageViewController
+
+
+-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
+ return rotationManager(interfaceOrientation);
+}
+
+-(void) didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+}
+
+-(void) viewDidUnload {
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+-(void) dealloc {
+ [super dealloc];
+}
+
+-(IBAction) dismiss {
+ [UIView beginAnimations:@"helpingame" context:NULL];
+ self.view.alpha = 0;
+ [UIView commitAnimations];
+ [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
+}
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/HogButtonView.h
--- a/project_files/HedgewarsMobile/Classes/HogButtonView.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/HogButtonView.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// HogButtonView.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 20/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 20/04/2010.
+ */
+
#import
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/HogButtonView.m
--- a/project_files/HedgewarsMobile/Classes/HogButtonView.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/HogButtonView.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,14 +1,28 @@
-//
-// HogButtonView.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 20/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 20/04/2010.
+ */
+
#import "HogButtonView.h"
#import "CommodityFunctions.h"
#import "UIImageExtra.h"
+#import "PascalImports.h"
@implementation HogButtonView
@synthesize singleHog, numberOfHogs, ownerDictionary;
@@ -16,11 +30,11 @@
-(id) initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
self.backgroundColor = [UIColor clearColor];
-
+
NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()];
UIImage *normalHogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)];
[normalHogFile release];
-
+
self.singleHog = normalHogSprite;
[normalHogSprite release];
[self addTarget:self action:@selector(addOne) forControlEvents:UIControlEventTouchUpInside];
@@ -29,6 +43,7 @@
}
-(void) addOne {
+ playSound(@"clickSound");
self.highlighted = NO;
NSInteger number = self.numberOfHogs;
number++;
@@ -37,21 +52,21 @@
-(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"];
-
+
UIImage *teamHogs = [[[UIImage alloc] init] autorelease];
for (int i = 0; i < numberOfHogs; i++) {
teamHogs = [singleHog mergeWith:teamHogs
- atPoint:CGPointMake(8, 0)
- atSize:CGSizeMake(88, 32)];
+ atPoint:CGPointMake(8, 0)
+ ofSize:CGSizeMake(88, 32)];
}
[self setImage:teamHogs forState:UIControlStateNormal];
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/HogHatViewController.h
--- a/project_files/HedgewarsMobile/Classes/HogHatViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/HogHatViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// HogHatViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import
@@ -12,7 +25,7 @@
@interface HogHatViewController : UITableViewController {
NSDictionary *teamDictionary;
NSInteger selectedHog;
-
+
NSArray *hatArray;
UIImage *normalHogSprite;
NSIndexPath *lastIndexPath;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/HogHatViewController.m
--- a/project_files/HedgewarsMobile/Classes/HogHatViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/HogHatViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// HogHatViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import "HogHatViewController.h"
#import "CommodityFunctions.h"
@@ -18,17 +31,16 @@
return rotationManager(interfaceOrientation);
}
-
#pragma mark -
#pragma mark View lifecycle
-- (void)viewDidLoad {
+-(void) viewDidLoad {
[super viewDidLoad];
// load all the hat file names and store them into hatArray
NSString *hatsDirectory = HATS_DIRECTORY();
NSArray *array = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:hatsDirectory error:NULL];
self.hatArray = array;
-
+
// load the base hog image, drawing will occure in cellForRow...
NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()];
UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)];
@@ -39,9 +51,9 @@
self.title = NSLocalizedString(@"Change hedgehog's hat",@"");
}
-- (void)viewWillAppear:(BOOL)animated {
+-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
-
+
// this updates the hog name and its hat
[self.tableView reloadData];
// this moves the tableview to the top
@@ -60,24 +72,24 @@
}
// Customize the appearance of table view cells.
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-
+-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+
static NSString *CellIdentifier = @"Cell";
-
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil)
+ if (cell == nil)
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
-
+
NSDictionary *hog = [[self.teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:selectedHog];
NSString *hat = [hatArray objectAtIndex:[indexPath row]];
cell.textLabel.text = [hat stringByDeletingPathExtension];
-
+
NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@", HATS_DIRECTORY(), hat];
UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)];
[hatFile release];
- cell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, -5)];
+ cell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, 5)];
[hatSprite release];
-
+
if ([hat isEqualToString:[hog objectForKey:@"hat"]]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
self.lastIndexPath = indexPath;
@@ -91,30 +103,30 @@
#pragma mark -
#pragma mark Table view delegate
-- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int newRow = [indexPath row];
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
-
+
if (newRow != oldRow) {
// if the two selected rows differ update data on the hog dictionary and reload table content
// TODO: maybe this section could be cleaned up
NSDictionary *oldHog = [[teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:selectedHog];
-
+
NSMutableDictionary *newHog = [[NSMutableDictionary alloc] initWithDictionary: oldHog];
[newHog setObject:[[hatArray objectAtIndex:newRow] stringByDeletingPathExtension] forKey:@"hat"];
[[teamDictionary objectForKey:@"hedgehogs"] replaceObjectAtIndex:selectedHog withObject:newHog];
[newHog release];
-
+
// tell our boss to write this new stuff on disk
[[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
-
+
UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath];
newCell.accessoryType = UITableViewCellAccessoryCheckmark;
UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:lastIndexPath];
oldCell.accessoryType = UITableViewCellAccessoryNone;
self.lastIndexPath = indexPath;
[aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
- }
+ }
[aTableView deselectRowAtIndexPath:indexPath animated:YES];
[self.navigationController popViewControllerAnimated:YES];
}
@@ -122,13 +134,13 @@
#pragma mark -
#pragma mark Memory management
-- (void)didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+-(void) didReceiveMemoryWarning {
+ self.lastIndexPath = nil;
+ MSG_MEMCLEAN();
[super didReceiveMemoryWarning];
- // Relinquish ownership any cached data, images, etc that aren't in use.
}
-- (void)viewDidUnload {
+-(void) viewDidUnload {
self.lastIndexPath = nil;
self.normalHogSprite = nil;
self.teamDictionary = nil;
@@ -137,7 +149,7 @@
[super viewDidUnload];
}
-- (void)dealloc {
+-(void) dealloc {
[hatArray release];
[teamDictionary release];
[normalHogSprite release];
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/InGameMenuViewController.h
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// popupMenuViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 25/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 25/03/2010.
+ */
+
#import
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/InGameMenuViewController.m
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,16 +1,30 @@
- //
-// popupMenuViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 25/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 25/03/2010.
+ */
+
#import "SDL_uikitappdelegate.h"
#import "InGameMenuViewController.h"
#import "PascalImports.h"
#import "CommodityFunctions.h"
#import "SDL_sysvideo.h"
+#import "SDL_uikitkeyboard.h"
@implementation InGameMenuViewController
@synthesize menuList;
@@ -21,29 +35,44 @@
}
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+ self.menuList = nil;
[super didReceiveMemoryWarning];
}
-(void) viewDidLoad {
NSArray *array = [[NSArray alloc] initWithObjects:
- NSLocalizedString(@"Return to Game", @""),
- NSLocalizedString(@"Chat", @""),
+ NSLocalizedString(@"Show Help", @""),
+ NSLocalizedString(@"Tag", @""),
NSLocalizedString(@"End Game", @""),
nil];
self.menuList = array;
[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];
}
+-(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];
}
@@ -59,7 +88,7 @@
CGRect screen = [[UIScreen mainScreen] bounds];
self.view.backgroundColor = [UIColor clearColor];
self.view.frame = CGRectMake(screen.size.height, 0, 200, 170);
-
+
[UIView beginAnimations:@"showing popover" context:NULL];
[UIView setAnimationDuration:0.35];
self.view.frame = CGRectMake(screen.size.height-200, 0, 200, 170);
@@ -72,9 +101,9 @@
[UIView setAnimationDuration:0.35];
self.view.frame = CGRectMake(screen.size.height, 0, 200, 170);
[UIView commitAnimations];
-
+
[self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.35];
-
+
[self removeChat];
}
@@ -90,26 +119,26 @@
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"CellIdentifier";
-
+
UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (nil == cell) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:cellIdentifier] autorelease];
}
cell.textLabel.text = [menuList objectAtIndex:[indexPath row]];
-
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+
+ if (IS_IPAD())
cell.textLabel.textAlignment = UITextAlignmentCenter;
-
+
return cell;
}
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIActionSheet *actionSheet;
-
+
switch ([indexPath row]) {
case 0:
- HW_pause();
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"show help ingame" object:nil];
break;
case 1:
if (SDL_iPhoneKeyboardIsShown(sdlwindow))
@@ -121,7 +150,7 @@
break;
case 2:
// expand the view (and table) so that the actionsheet can be selected on the iPhone
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
+ if (IS_IPAD()) {
CGRect screen = [[UIScreen mainScreen] bounds];
[self.tableView deselectRowAtIndexPath:indexPath animated:NO];
[UIView beginAnimations:@"table width more" context:NULL];
@@ -136,13 +165,13 @@
otherButtonTitles:nil];
[actionSheet showInView:self.view];
[actionSheet release];
-
+
break;
default:
DLog(@"Warning: unset case value in section!");
break;
}
-
+
[aTableView deselectRowAtIndexPath:indexPath animated:YES];
}
@@ -156,16 +185,16 @@
#pragma mark -
#pragma mark actionSheet methods
-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){
+ if (IS_IPAD()){
CGRect screen = [[UIScreen mainScreen] bounds];
[UIView beginAnimations:@"table width less" context:NULL];
[UIView setAnimationDuration:0.2];
self.view.frame = CGRectMake(screen.size.height-200, 0, 200, 170);
[UIView commitAnimations];
}
-
+
if ([actionSheet cancelButtonIndex] != buttonIndex)
- HW_terminate(NO);
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"remove overlay" object:nil];
}
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/LevelViewController.h
--- a/project_files/HedgewarsMobile/Classes/LevelViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/LevelViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,20 +1,35 @@
-//
-// LevelViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import
@interface LevelViewController : UITableViewController {
NSDictionary *teamDictionary;
-
+
NSArray *levelArray;
NSArray *levelSprites;
NSIndexPath *lastIndexPath;
+
+ NSInteger numberOfSections;
}
@property (nonatomic,retain) NSDictionary *teamDictionary;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/LevelViewController.m
--- a/project_files/HedgewarsMobile/Classes/LevelViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/LevelViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// LevelViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import "LevelViewController.h"
#import "CommodityFunctions.h"
@@ -21,11 +34,11 @@
#pragma mark -
#pragma mark View lifecycle
-- (void)viewDidLoad {
+-(void) viewDidLoad {
[super viewDidLoad];
+ srandom(time(NULL));
NSArray *array = [[NSArray alloc] initWithObjects:
- NSLocalizedString(@"Human",@""),
NSLocalizedString(@"Brutal",@""),
NSLocalizedString(@"Aggressive",@""),
NSLocalizedString(@"Bully",@""),
@@ -34,127 +47,146 @@
nil];
self.levelArray = array;
[array release];
-
+
self.title = NSLocalizedString(@"Set difficulty level",@"");
}
-- (void)viewWillAppear:(BOOL)animated {
+-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
+
+ if ([[[[self.teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:0] objectForKey:@"level"] intValue] == 0)
+ numberOfSections = 1;
+ else
+ numberOfSections = 2;
+
[self.tableView reloadData];
// this moves the tableview to the top
[self.tableView setContentOffset:CGPointMake(0,0) animated:NO];
}
+-(void) viewWillDisappear:(BOOL)animated {
+ // stuff like checking that at least 1 field was selected
+}
+
#pragma mark -
#pragma mark Table view data source
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
- return 1;
+ return numberOfSections;
}
--(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return [self.levelArray count];
+-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger) section {
+ if (section == 0)
+ return 1;
+ else
+ return 5;
}
// Customize the appearance of table view cells.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *CellIdentifier = @"Cell";
-
+ static NSString *CellIdentifier0 = @"Cell0";
+ static NSString *CellIdentifier1 = @"Cell1";
+
NSInteger row = [indexPath row];
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ NSInteger section = [indexPath section];
+ UITableViewCell *cell;
+
+ if (section == 0) {
+ cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier0];
+ if (cell == nil) {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier0] autorelease];
+ UISwitch *theSwitch = [[UISwitch alloc] init];
+ if (numberOfSections == 1)
+ theSwitch.on = NO;
+ else
+ theSwitch.on = YES;
+ [theSwitch addTarget:self action:@selector(switchValueChanged:) forControlEvents:UIControlEventValueChanged];
+ cell.accessoryView = theSwitch;
+ [theSwitch release];
+ }
+ cell.textLabel.text = NSLocalizedString(@"Hogs controlled by AI",@"");
+ } else {
+ cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
+ if (cell == nil)
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease];
+
+ cell.textLabel.text = [levelArray objectAtIndex:row];
+ NSDictionary *hog = [[self.teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:0];
+ if ([[hog objectForKey:@"level"] intValue] == row+1) {
+ cell.accessoryType = UITableViewCellAccessoryCheckmark;
+ self.lastIndexPath = indexPath;
+ } else {
+ cell.accessoryType = UITableViewCellAccessoryNone;
+ }
+
+ NSString *botlevelPath = [[NSString alloc] initWithFormat:@"%@/%d.png",BOTLEVELS_DIRECTORY(),row+1];
+ UIImage *levelImage = [[UIImage alloc] initWithContentsOfFile:botlevelPath];
+ [botlevelPath release];
+ cell.imageView.image = levelImage;
+ [levelImage release];
}
- cell.textLabel.text = [levelArray objectAtIndex:row];
- NSDictionary *hog = [[self.teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:0];
- if ([[hog objectForKey:@"level"] intValue] == row) {
- cell.accessoryType = UITableViewCellAccessoryCheckmark;
- self.lastIndexPath = indexPath;
- } else {
- cell.accessoryType = UITableViewCellAccessoryNone;
- }
-
- NSString *botlevelPath = [[NSString alloc] initWithFormat:@"%@/%d.png",BOTLEVELS_DIRECTORY(),row];
- UIImage *levelImage = [[UIImage alloc] initWithContentsOfFile:botlevelPath];
- [botlevelPath release];
- cell.imageView.image = levelImage;
- [levelImage release];
-
return cell;
}
-
-/*
-// Override to support conditional editing of the table view.
-- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
- // Return NO if you do not want the specified item to be editable.
- return YES;
-}
-*/
-
-
-/*
-// Override to support editing the table view.
-- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
+-(void) switchValueChanged:(id) sender {
+ UISwitch *theSwitch = (UISwitch *)sender;
+ NSIndexSet *sections = [[NSIndexSet alloc] initWithIndex:1];
+ NSMutableArray *hogs = [self.teamDictionary objectForKey:@"hedgehogs"];
+ NSInteger level;
- if (editingStyle == UITableViewCellEditingStyleDelete) {
- // Delete the row from the data source
- [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
- }
- else if (editingStyle == UITableViewCellEditingStyleInsert) {
- // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
- }
-}
-*/
-
+ if (theSwitch.on) {
+ numberOfSections = 2;
+ [self.tableView insertSections:sections withRowAnimation:UITableViewRowAnimationFade];
+ level = random() % [levelArray count];
+ } else {
+ numberOfSections = 1;
+ [self.tableView deleteSections:sections withRowAnimation:UITableViewRowAnimationFade];
+ level = 0;
+ }
-/*
-// Override to support rearranging the table view.
-- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
-}
-*/
-
+ DLog(@"New level is %d",level);
+ for (NSMutableDictionary *hog in hogs)
+ [hog setObject:[NSNumber numberWithInt:0] forKey:@"level"];
-/*
-// Override to support conditional rearranging of the table view.
-- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
- // Return NO if you do not want the item to be re-orderable.
- return YES;
+ [self.tableView reloadData];
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
+
+ [sections release];
}
-*/
#pragma mark -
#pragma mark Table view delegate
-- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int newRow = [indexPath row];
- int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
-
- if (newRow != oldRow) {
- NSMutableArray *hogs = [teamDictionary objectForKey:@"hedgehogs"];
-
- for (NSMutableDictionary *hog in hogs) {
- [hog setObject:[NSNumber numberWithInt:newRow] forKey:@"level"];
+ int oldRow = (self.lastIndexPath != nil) ? [self.lastIndexPath row] : -1;
+
+ if ([indexPath section] != 0) {
+ if (newRow != oldRow) {
+ NSMutableArray *hogs = [self.teamDictionary objectForKey:@"hedgehogs"];
+
+ for (NSMutableDictionary *hog in hogs)
+ [hog setObject:[NSNumber numberWithInt:newRow+1] forKey:@"level"];
+
+ // tell our boss to write this new stuff on disk
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
+ [self.tableView reloadData];
+
+ self.lastIndexPath = indexPath;
+ [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
}
-
- // tell our boss to write this new stuff on disk
- [[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
- [self.tableView reloadData];
-
- self.lastIndexPath = indexPath;
- [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
+ [self.navigationController popViewControllerAnimated:YES];
}
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
- [self.navigationController popViewControllerAnimated:YES];
}
#pragma mark -
#pragma mark Memory management
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+ self.lastIndexPath = nil;
+ MSG_MEMCLEAN();
[super didReceiveMemoryWarning];
- // Relinquish ownership any cached data, images, etc that aren't in use.
}
-(void) viewDidUnload {
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/MainMenuViewController.h
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,23 +1,43 @@
-//
-// MainMenuViewController.h
-// hwengine
-//
-// Created by Vittorio on 08/01/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/01/2010.
+ */
+
#import
+@class GameConfigViewController;
@class SplitViewRootController;
-@class GameConfigViewController;
+@class AboutViewController;
+@class SavedGamesViewController;
-@interface MainMenuViewController : UIViewController {
- UILabel *versionLabel;
+@interface MainMenuViewController : UIViewController {
+ GameConfigViewController *gameConfigViewController;
SplitViewRootController *settingsViewController;
- GameConfigViewController *gameConfigViewController;
+ AboutViewController *aboutViewController;
+ SavedGamesViewController *savedGamesViewController;
}
-@property (nonatomic,retain) IBOutlet UILabel *versionLabel;
+@property (nonatomic,retain) GameConfigViewController *gameConfigViewController;
+@property (nonatomic,retain) SplitViewRootController *settingsViewController;
+@property (nonatomic,retain) AboutViewController *aboutViewController;
+@property (nonatomic,retain) SavedGamesViewController *savedGamesViewController;
-(IBAction) switchViews:(id)sender;
+
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/MainMenuViewController.m
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,142 +1,194 @@
-//
-// MainMenuViewController.m
-// hwengine
-//
-// Created by Vittorio on 08/01/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/01/2010.
+ */
+
#import "MainMenuViewController.h"
+#import "CommodityFunctions.h"
#import "SDL_uikitappdelegate.h"
#import "PascalImports.h"
#import "GameConfigViewController.h"
#import "SplitViewRootController.h"
-#import "CommodityFunctions.h"
-#import "SDL_mixer.h"
+#import "AboutViewController.h"
+#import "SavedGamesViewController.h"
@implementation MainMenuViewController
-@synthesize versionLabel;
+@synthesize gameConfigViewController, settingsViewController, aboutViewController, savedGamesViewController;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
return rotationManager(interfaceOrientation);
}
-- (void)didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
- if (settingsViewController.view.superview == nil)
- settingsViewController = nil;
- if (gameConfigViewController.view.superview == nil)
- gameConfigViewController = nil;
- MSG_MEMCLEAN();
-}
-
// using a different thread for audio 'cos it's slow
-(void) initAudioThread {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 1, 512);
+ // do somthing in the future
[pool release];
}
--(void) viewDidLoad {
- [NSThread detachNewThreadSelector:@selector(initAudioThread)
- toTarget:self
- withObject:nil];
+// check if some configuration files are already set; if they are present it means that the current copy must be updated
+-(void) createNecessaryFiles {
+ NSError *err = nil;
+ NSString *directoryToCheck, *fileToCheck, *fileToUpdate;
+ NSString *resDir = [[NSBundle mainBundle] resourcePath];
+ DLog(@"Creating necessary files");
+
+ // create an empty saves directory by deleting the previous one (saves are incompatible between releases)
+ if ([[NSFileManager defaultManager] fileExistsAtPath:SAVES_DIRECTORY()])
+ [[NSFileManager defaultManager] removeItemAtPath:SAVES_DIRECTORY() error:NULL];
+ [[NSFileManager defaultManager] createDirectoryAtPath:SAVES_DIRECTORY() withIntermediateDirectories:NO attributes:nil error:NULL];
+
+ // if the settings file is already present, we merge current preferences with the update
+ directoryToCheck = [NSString stringWithFormat:@"%@/Settings/settings.plist",resDir];
+ if ([[NSFileManager defaultManager] fileExistsAtPath:SETTINGS_FILE()]) {
+ NSDictionary *settings = [[NSDictionary alloc] initWithContentsOfFile:SETTINGS_FILE()];
+ NSMutableDictionary *update = [[NSMutableDictionary alloc] initWithContentsOfFile:directoryToCheck];
+ [update addEntriesFromDictionary:settings];
+ [settings release];
+ [update writeToFile:SETTINGS_FILE() atomically:YES];
+ [update release];
+ } else
+ [[NSFileManager defaultManager] copyItemAtPath:directoryToCheck toPath:SETTINGS_FILE() error:&err];
- char *ver;
- HW_versionInfo(NULL, &ver);
- NSString *versionNumber = [[NSString alloc] initWithCString:ver];
- self.versionLabel.text = versionNumber;
- [versionNumber release];
-
- // listen to request to remove the modalviewcontroller
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(dismissModalViewController)
- name: @"dismissModalView"
- object:nil];
+ // if the teams are already present we merge the old teams if they still exist
+ directoryToCheck = [NSString stringWithFormat:@"%@/Settings/Teams",resDir];
+ if ([[NSFileManager defaultManager] fileExistsAtPath:TEAMS_DIRECTORY()]) {
+ for (NSString *str in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:directoryToCheck error:&err]) {
+ fileToCheck = [NSString stringWithFormat:@"%@/%@",TEAMS_DIRECTORY(),str];
+ fileToUpdate = [NSString stringWithFormat:@"%@/Settings/Teams/%@",resDir,str];
+ if ([[NSFileManager defaultManager] fileExistsAtPath:fileToCheck]) {
+ NSDictionary *team = [[NSDictionary alloc] initWithContentsOfFile:fileToCheck];
+ NSMutableDictionary *update = [[NSMutableDictionary alloc] initWithContentsOfFile:fileToUpdate];
+ [update addEntriesFromDictionary:team];
+ [team release];
+ [update writeToFile:fileToCheck atomically:YES];
+ [update release];
+ }
+ }
+ } else
+ [[NSFileManager defaultManager] copyItemAtPath:directoryToCheck toPath:TEAMS_DIRECTORY() error:&err];
- // initialize some files the first time we load the game
- if (!([[NSFileManager defaultManager] fileExistsAtPath:SETTINGS_FILE()]))
- [NSThread detachNewThreadSelector:@selector(checkFirstRun) toTarget:self withObject:nil];
+ // the same holds for schemes (but they're arrays)
+ directoryToCheck = [NSString stringWithFormat:@"%@/Settings/Schemes",resDir];
+ if ([[NSFileManager defaultManager] fileExistsAtPath:SCHEMES_DIRECTORY()]) {
+ for (NSString *str in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:directoryToCheck error:nil]) {
+ fileToCheck = [NSString stringWithFormat:@"%@/%@",SCHEMES_DIRECTORY(),str];
+ fileToUpdate = [NSString stringWithFormat:@"%@/Settings/Schemes/%@",resDir,str];
+ if ([[NSFileManager defaultManager] fileExistsAtPath:fileToCheck]) {
+ NSArray *scheme = [[NSArray alloc] initWithContentsOfFile:fileToCheck];
+ NSArray *update = [[NSArray alloc] initWithContentsOfFile:fileToUpdate];
+ if ([update count] > [scheme count])
+ [update writeToFile:fileToCheck atomically:YES];
+ [update release];
+ [scheme release];
+ }
+ }
+ } else
+ [[NSFileManager defaultManager] copyItemAtPath:directoryToCheck toPath:SCHEMES_DIRECTORY() error:&err];
- [super viewDidLoad];
+ // we create weapons the first time only, they are autoupdated each time
+ if ([[NSFileManager defaultManager] fileExistsAtPath:WEAPONS_DIRECTORY()] == NO) {
+ [[NSFileManager defaultManager] createDirectoryAtPath:WEAPONS_DIRECTORY()
+ withIntermediateDirectories:YES
+ attributes:nil
+ error:&err];
+ createWeaponNamed(@"Default", 0);
+ createWeaponNamed(@"Crazy", 1);
+ createWeaponNamed(@"Pro mode", 2);
+ createWeaponNamed(@"Shoppa", 3);
+ createWeaponNamed(@"Basketball", 4);
+ createWeaponNamed(@"Minefield", 5);
+ }
+
+ if (err != nil)
+ DLog(@"%@", err);
+ else
+ DLog(@"Success");
}
-// this is called to verify whether it's the first time the app is launched
-// if it is it blocks user interaction with an alertView until files are created
--(void) checkFirstRun {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- DLog(@"First time run, creating settings files at %@", SETTINGS_FILE());
-
- // show a popup with an indicator to make the user wait
- UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Please wait",@"")
- message:nil
- delegate:nil
- cancelButtonTitle:nil
- otherButtonTitles:nil];
- [alert show];
-
- UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc]
- initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
- indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50);
- [indicator startAnimating];
- [alert addSubview:indicator];
- [indicator release];
-
- // create default files (teams/weapons/scheme)
- createTeamNamed(@"Pirates");
- createTeamNamed(@"Ninjas");
- createWeaponNamed(@"Default");
- createSchemeNamed(@"Default");
-
- // create settings.plist
- NSMutableDictionary *saveDict = [[NSMutableDictionary alloc] init];
+#pragma mark -
+-(void) viewDidLoad {
+ [super viewDidLoad];
+
+ // listen to request to remove the modalviewcontroller (needed due to the splitcontroller)
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(dismissModalViewController)
+ name: @"dismissModalView"
+ object:nil];
- [saveDict setObject:@"" forKey:@"username"];
- [saveDict setObject:@"" forKey:@"password"];
- [saveDict setObject:[NSNumber numberWithBool:YES] forKey:@"music"];
- [saveDict setObject:[NSNumber numberWithBool:YES] forKey:@"sound"];
- [saveDict setObject:[NSNumber numberWithBool:NO] forKey:@"alternate"];
+ // get the app's version
+ NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];
+
+ // get the version number that we've been tracking
+ NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+ NSString *trackingVersion = [userDefaults stringForKey:@"HedgeVersion"];
- [saveDict writeToFile:SETTINGS_FILE() atomically:YES];
- [saveDict release];
-
- // ok let the user take control
- [alert dismissWithClickedButtonIndex:0 animated:YES];
- [alert release];
+ if (trackingVersion == nil || [trackingVersion isEqualToString:version] == NO) {
+ [userDefaults setObject:version forKey:@"HedgeVersion"];
+ [userDefaults synchronize];
+ [self createNecessaryFiles];
+ }
+}
- [pool release];
-
- // TODO: instead of this useless runtime initialization, check that all ammos remain compatible with engine
-}
#pragma mark -
-(IBAction) switchViews:(id) sender {
UIButton *button = (UIButton *)sender;
UIAlertView *alert;
- NSString *debugStr;
+ NSString *xib = nil;
+ NSString *debugStr = nil;
+ playSound(@"clickSound");
switch (button.tag) {
case 0:
- gameConfigViewController = [[GameConfigViewController alloc] initWithNibName:@"GameConfigViewController" bundle:nil];
+ if (nil == self.gameConfigViewController) {
+ if (IS_IPAD())
+ xib = nil;
+ else
+ xib = @"GameConfigViewController";
+
+ GameConfigViewController *gcvc = [[GameConfigViewController alloc] initWithNibName:xib bundle:nil];
+ gcvc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
+ self.gameConfigViewController = gcvc;
+ [gcvc release];
+ }
- [self presentModalViewController:gameConfigViewController animated:YES];
+ [self presentModalViewController:self.gameConfigViewController animated:YES];
break;
case 2:
- if (nil == settingsViewController) {
- settingsViewController = [[SplitViewRootController alloc] initWithNibName:nil bundle:nil];
- settingsViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
+ if (nil == self.settingsViewController) {
+ SplitViewRootController *svrc = [[SplitViewRootController alloc] initWithNibName:nil bundle:nil];
+ svrc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
+ self.settingsViewController = svrc;
+ [svrc release];
}
-
- [self presentModalViewController:settingsViewController animated:YES];
+
+ [self presentModalViewController:self.settingsViewController animated:YES];
break;
case 3:
+#ifdef DEBUG
debugStr = [[NSString alloc] initWithContentsOfFile:DEBUG_FILE()];
UITextView *scroll = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.height, self.view.frame.size.width)];
scroll.text = debugStr;
[debugStr release];
scroll.editable = NO;
-
+
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn addTarget:scroll action:@selector(removeFromSuperview) forControlEvents:UIControlEventTouchUpInside];
btn.backgroundColor = [UIColor blackColor];
@@ -144,6 +196,28 @@
[scroll addSubview:btn];
[self.view addSubview:scroll];
[scroll release];
+#else
+ if (nil == self.aboutViewController) {
+ AboutViewController *about = [[AboutViewController alloc] initWithNibName:@"AboutViewController" bundle:nil];
+ about.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
+ about.modalPresentationStyle = UIModalPresentationFormSheet;
+ self.aboutViewController = about;
+ [about release];
+ }
+
+ [self presentModalViewController:self.aboutViewController animated:YES];
+#endif
+ break;
+ case 4:
+ if (nil == self.savedGamesViewController) {
+ SavedGamesViewController *savedgames = [[SavedGamesViewController alloc] initWithNibName:@"SavedGamesViewController" bundle:nil];
+ savedgames.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
+ savedgames.modalPresentationStyle = UIModalPresentationPageSheet;
+ self.savedGamesViewController = savedgames;
+ [savedgames release];
+ }
+
+ [self presentModalViewController:self.savedGamesViewController animated:YES];
break;
default:
alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented"
@@ -157,24 +231,39 @@
}
}
-// allows child controllers to return to the main controller
+// must be kept for compatibility with the settings page
-(void) dismissModalViewController {
[self dismissModalViewControllerAnimated:YES];
}
-
-(void) viewDidUnload {
- self.versionLabel = nil;
- gameConfigViewController = nil;
- settingsViewController = nil;
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ self.gameConfigViewController = nil;
+ self.settingsViewController = nil;
+ self.aboutViewController = nil;
+ self.savedGamesViewController = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
+-(void) didReceiveMemoryWarning {
+ if (self.settingsViewController.view.superview == nil)
+ self.settingsViewController = nil;
+ if (self.gameConfigViewController.view.superview == nil)
+ self.gameConfigViewController = nil;
+ if (self.aboutViewController.view.superview == nil)
+ self.aboutViewController = nil;
+ if (self.savedGamesViewController.view.superview == nil)
+ self.savedGamesViewController = nil;
+ MSG_MEMCLEAN();
+ [super didReceiveMemoryWarning];
+}
+
-(void) dealloc {
- [versionLabel release];
[settingsViewController release];
[gameConfigViewController release];
+ [aboutViewController release];
+ [savedGamesViewController release];
[super dealloc];
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/MapConfigViewController.h
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,20 +1,32 @@
-//
-// MapConfigViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 22/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 22/04/2010.
+ */
+
#import
-#import "SDL_net.h"
+#import "MapPreviewButtonView.h"
-@interface MapConfigViewController : UIViewController {
- TCPsocket sd, csd;
+@interface MapConfigViewController : UIViewController {
NSInteger oldValue; //slider
NSInteger oldPage; //segmented control
BOOL busy;
-
+
// objects read (mostly) by parent view
NSInteger maxHogs;
NSString *seedCommand;
@@ -23,31 +35,33 @@
NSString *mazeSizeCommand;
NSString *themeCommand;
NSString *staticMapCommand;
-
+ NSString *missionCommand;
+
// various widgets in the view
- UIButton *previewButton;
+ MapPreviewButtonView *previewButton;
UITableView *tableView;
UILabel *maxLabel;
UILabel *sizeLabel;
UISegmentedControl *segmentedControl;
UISlider *slider;
-
+
// internal objects
NSIndexPath *lastIndexPath;
- NSArray *themeArray;
- NSArray *mapArray;
+ NSArray *dataSourceArray;
}
-@property (nonatomic) NSInteger maxHogs;
-@property (nonatomic) BOOL busy;
+
+@property (nonatomic,assign) NSInteger maxHogs;
+@property (nonatomic,assign) BOOL busy;
@property (nonatomic,retain) NSString *seedCommand;
@property (nonatomic,retain) NSString *templateFilterCommand;
@property (nonatomic,retain) NSString *mapGenCommand;
@property (nonatomic,retain) NSString *mazeSizeCommand;
@property (nonatomic,retain) NSString *themeCommand;
@property (nonatomic,retain) NSString *staticMapCommand;
+@property (nonatomic,retain) NSString *missionCommand;
-@property (nonatomic,retain) IBOutlet UIButton *previewButton;
+@property (nonatomic,retain) IBOutlet MapPreviewButtonView *previewButton;
@property (nonatomic,retain) IBOutlet UITableView *tableView;
@property (nonatomic,retain) IBOutlet UILabel *maxLabel;
@property (nonatomic,retain) IBOutlet UILabel *sizeLabel;
@@ -55,18 +69,19 @@
@property (nonatomic,retain) IBOutlet UISlider *slider;
@property (nonatomic,retain) NSIndexPath *lastIndexPath;
-@property (nonatomic,retain) NSArray *themeArray;
-@property (nonatomic,retain) NSArray *mapArray;
+@property (nonatomic,retain) NSArray *dataSourceArray;
--(IBAction) updatePreview;
+-(IBAction) buttonPressed:(id) sender;
+
+-(IBAction) mapButtonPressed;
-(IBAction) sliderChanged:(id) sender;
-(IBAction) sliderEndedChanging:(id) sender;
-(IBAction) segmentedControlChanged:(id) sender;
+
-(void) turnOnWidgets;
-(void) turnOffWidgets;
-(void) setLabelText:(NSString *)str;
--(void) setButtonImage:(UIImage *)img;
-
--(const uint8_t *)engineProtocol:(NSInteger) port;
+-(void) updatePreview;
+-(void) loadDataSourceArray;
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/MapConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,234 +1,79 @@
-//
-// MapConfigViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 22/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 22/04/2010.
+ */
+
#import "MapConfigViewController.h"
#import "PascalImports.h"
#import "CommodityFunctions.h"
#import "UIImageExtra.h"
-#import "SDL_net.h"
-#import
-#define INDICATOR_TAG 7654
+#define scIndex self.segmentedControl.selectedSegmentIndex
+#define isRandomness() (segmentedControl.selectedSegmentIndex == 0 || segmentedControl.selectedSegmentIndex == 2)
@implementation MapConfigViewController
@synthesize previewButton, maxHogs, seedCommand, templateFilterCommand, mapGenCommand, mazeSizeCommand, themeCommand, staticMapCommand,
- tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, themeArray, mapArray, busy;
+ missionCommand, tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return rotationManager(interfaceOrientation);
}
-#pragma mark -
-#pragma mark Preview Handling
--(int) sendToEngine: (NSString *)string {
- unsigned char length = [string length];
-
- SDLNet_TCP_Send(csd, &length , 1);
- return SDLNet_TCP_Send(csd, [string UTF8String], length);
+-(IBAction) mapButtonPressed {
+ playSound(@"clickSound");
+ [self updatePreview];
}
--(const uint8_t *)engineProtocol:(NSInteger) port {
- IPaddress ip;
- BOOL serverQuit = NO;
- static uint8_t map[128*32];
-
- if (SDLNet_Init() < 0) {
- DLog(@"SDLNet_Init: %s", SDLNet_GetError());
- serverQuit = YES;
- }
-
- // Resolving the host using NULL make network interface to listen
- if (SDLNet_ResolveHost(&ip, NULL, port) < 0) {
- DLog(@"SDLNet_ResolveHost: %s\n", SDLNet_GetError());
- serverQuit = YES;
- }
-
- // Open a connection with the IP provided (listen on the host's port)
- if (!(sd = SDLNet_TCP_Open(&ip))) {
- DLog(@"SDLNet_TCP_Open: %s %\n", SDLNet_GetError(), port);
- serverQuit = YES;
- }
-
- // launch the preview here so that we're sure the tcp channel is open
- pthread_t thread_id;
- pthread_create(&thread_id, NULL, (void *)GenLandPreview, (void *)port);
- pthread_detach(thread_id);
-
- DLog(@"Waiting for a client on port %d", port);
- while (!serverQuit) {
- /* This check the sd if there is a pending connection.
- * If there is one, accept that, and open a new socket for communicating */
- csd = SDLNet_TCP_Accept(sd);
- if (NULL != csd) {
- DLog(@"Client found");
-
- [self sendToEngine:self.seedCommand];
- [self sendToEngine:self.templateFilterCommand];
- [self sendToEngine:self.mapGenCommand];
- [self sendToEngine:self.mazeSizeCommand];
- [self sendToEngine:@"!"];
-
- memset(map, 0, 128*32);
- SDLNet_TCP_Recv(csd, map, 128*32);
- SDLNet_TCP_Recv(csd, &maxHogs, sizeof(uint8_t));
-
- SDLNet_TCP_Close(csd);
- serverQuit = YES;
- }
- }
-
- SDLNet_TCP_Close(sd);
- SDLNet_Quit();
- return map;
-}
-
--(void) drawingThread {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- // select the port for IPC and launch the preview generation through engineProtocol:
- int port = randomPort();
- const uint8_t *map = [self engineProtocol:port];
- uint8_t mapExp[128*32*8];
-
- // draw the buffer (1 pixel per component, 0= transparent 1= color)
- int k = 0;
- for (int i = 0; i < 32*128; i++) {
- unsigned char byte = map[i];
- for (int j = 0; j < 8; j++) {
- // select the color based on the leftmost bit
- if ((byte & 0x80) != 0)
- mapExp[k] = 100;
- else
- mapExp[k] = 255;
- // shift to next bit
- byte <<= 1;
- k++;
- }
- }
- CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceGray();
- CGContextRef bitmapImage = CGBitmapContextCreate(mapExp, 256, 128, 8, 256, colorspace, kCGImageAlphaNone);
- CGColorSpaceRelease(colorspace);
-
- CGImageRef previewCGImage = CGBitmapContextCreateImage(bitmapImage);
- CGContextRelease(bitmapImage);
- UIImage *previewImage = [[UIImage alloc] initWithCGImage:previewCGImage];
- CGImageRelease(previewCGImage);
- previewCGImage = nil;
-
- // set the preview image (autoreleased) in the button and the maxhog label on the main thread to prevent a leak
- [self performSelectorOnMainThread:@selector(setButtonImage:) withObject:[previewImage makeRoundCornersOfSize:CGSizeMake(12, 12)] waitUntilDone:NO];
- [previewImage release];
- [self performSelectorOnMainThread:@selector(setLabelText:) withObject:[NSString stringWithFormat:@"%d", maxHogs] waitUntilDone:NO];
-
- // restore functionality of button and remove the spinning wheel on the main thread to prevent a leak
- [self performSelectorOnMainThread:@selector(turnOnWidgets) withObject:nil waitUntilDone:NO];
-
- [pool release];
- //Invoking this method should be avoided as it does not give your thread a chance to clean up any resources it allocated during its execution.
- //[NSThread exit];
-
- /*
- // http://developer.apple.com/mac/library/qa/qa2001/qa1037.html
- UIGraphicsBeginImageContext(CGSizeMake(256,128));
- CGContextRef context = UIGraphicsGetCurrentContext();
- UIGraphicsPushContext(context);
-
- CGContextSetRGBFillColor(context, 0.5, 0.5, 0.7, 1.0);
- CGContextFillRect(context,CGRectMake(xc,yc,1,1));
-
- UIGraphicsPopContext();
- UIImage *previewImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- */
-}
-
--(IBAction) updatePreview {
+-(void) updatePreview {
// don't generate a new preview while it's already generating one
if (busy)
return;
-
+
// generate a seed
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
NSString *seed = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid);
CFRelease(uuid);
NSString *seedCmd = [[NSString alloc] initWithFormat:@"eseed {%@}", seed];
- [seed release];
self.seedCommand = seedCmd;
[seedCmd release];
-
+
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
+ NSArray *source = [self.dataSourceArray objectAtIndex:scIndex];
NSIndexPath *theIndex;
- if (segmentedControl.selectedSegmentIndex != 1) {
- // remove the current preview and title
- [self.previewButton setImage:nil forState:UIControlStateNormal];
- [self.previewButton setTitle:nil forState:UIControlStateNormal];
-
- // don't display preview on slower device, too slow and memory hog
- NSString *modelId = modelType();
- if ([modelId hasPrefix:@"iPhone1"] || [modelId hasPrefix:@"iPod1,1"] || [modelId hasPrefix:@"iPod2,1"]) {
- busy = NO;
- [self.previewButton setTitle:NSLocalizedString(@"Preview not available",@"") forState:UIControlStateNormal];
- } else {
- // prevent other events and add an activity while the preview is beign generated
- [self turnOffWidgets];
-
- // add a very nice spinning wheel
- UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc]
- initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
- indicator.center = CGPointMake(previewButton.bounds.size.width / 2, previewButton.bounds.size.height / 2);
- indicator.tag = INDICATOR_TAG;
- [indicator startAnimating];
- [self.previewButton addSubview:indicator];
- [indicator release];
-
- // let's draw in a separate thread so the gui can work; at the end it restore other widgets
- [NSThread detachNewThreadSelector:@selector(drawingThread) toTarget:self withObject:nil];
- }
-
- theIndex = [NSIndexPath indexPathForRow:(random()%[self.themeArray count]) inSection:0];
+ if (isRandomness()) {
+ // prevent other events and add an activity while the preview is beign generated
+ [self turnOffWidgets];
+ [self.previewButton updatePreviewWithSeed:seed];
+ theIndex = [NSIndexPath indexPathForRow:(random()%[source count]) inSection:0];
} else {
- theIndex = [NSIndexPath indexPathForRow:(random()%[self.mapArray count]) inSection:0];
+ theIndex = [NSIndexPath indexPathForRow:(random()%[source count]) inSection:0];
+ // the preview for static maps is loaded in didSelectRowAtIndexPath
}
- [self.tableView reloadData];
+ [seed release];
+
+ // perform as if user clicked on an entry
[self tableView:self.tableView didSelectRowAtIndexPath:theIndex];
[self.tableView scrollToRowAtIndexPath:theIndex atScrollPosition:UITableViewScrollPositionNone animated:YES];
}
-// instead of drawing a random map we load an image; this function is called by didSelectRowAtIndexPath only
--(void) updatePreviewWithMap:(NSInteger) index {
- // change the preview button
- NSString *fileImage = [[NSString alloc] initWithFormat:@"%@/%@/preview.png", MAPS_DIRECTORY(),[self.mapArray objectAtIndex:index]];
- UIImage *image = [[UIImage alloc] initWithContentsOfFile:fileImage];
- [fileImage release];
- [self.previewButton setImage:[image makeRoundCornersOfSize:CGSizeMake(12, 12)] forState:UIControlStateNormal];
- [image release];
-
- // update label
- maxHogs = 18;
- NSString *fileCfg = [[NSString alloc] initWithFormat:@"%@/%@/map.cfg", MAPS_DIRECTORY(),[self.mapArray objectAtIndex:index]];
- NSString *contents = [[NSString alloc] initWithContentsOfFile:fileCfg encoding:NSUTF8StringEncoding error:NULL];
- [fileCfg release];
- NSArray *split = [contents componentsSeparatedByString:@"\n"];
- [contents release];
-
- // set the theme and map here
- self.themeCommand = [NSString stringWithFormat:@"etheme %@", [split objectAtIndex:0]];
- self.staticMapCommand = [NSString stringWithFormat:@"emap %@", [self.mapArray objectAtIndex:index]];
-
- // if the number is not set we keep 18 standard;
- // sometimes it's not set but there are trailing characters, we get around them with the second equation
- if ([split count] > 1 && [[split objectAtIndex:1] intValue] > 0)
- maxHogs = [[split objectAtIndex:1] intValue];
- NSString *max = [[NSString alloc] initWithFormat:@"%d",maxHogs];
- self.maxLabel.text = max;
- [max release];
-}
-
-(void) turnOffWidgets {
busy = YES;
self.previewButton.alpha = 0.5f;
@@ -244,35 +89,21 @@
self.segmentedControl.enabled = YES;
self.slider.enabled = YES;
busy = NO;
-
- UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)[self.previewButton viewWithTag:INDICATOR_TAG];
- if (indicator) {
- [indicator stopAnimating];
- [indicator removeFromSuperview];
- }
}
-
+
-(void) setLabelText:(NSString *)str {
+ self.maxHogs = [str intValue];
self.maxLabel.text = str;
}
--(void) setButtonImage:(UIImage *)img {
- [self.previewButton setBackgroundImage:img forState:UIControlStateNormal];
-}
-
--(void) restoreBackgroundImage {
- // white rounded rectangle as background image for previewButton
- UIGraphicsBeginImageContext(CGSizeMake(256,128));
- CGContextRef context = UIGraphicsGetCurrentContext();
- UIGraphicsPushContext(context);
-
- CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
- CGContextFillRect(context,CGRectMake(0,0,256,128));
-
- UIGraphicsPopContext();
- UIImage *bkgImg = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- [self.previewButton setBackgroundImage:[bkgImg makeRoundCornersOfSize:CGSizeMake(12, 12)] forState:UIControlStateNormal];
+-(NSDictionary *)getDataForEngine {
+ NSDictionary *dictForEngine = [NSDictionary dictionaryWithObjectsAndKeys:
+ self.seedCommand,@"seedCommand",
+ self.templateFilterCommand,@"templateFilterCommand",
+ self.mapGenCommand,@"mapGenCommand",
+ self.mazeSizeCommand,@"mazeSizeCommand",
+ nil];
+ return dictForEngine;
}
#pragma mark -
@@ -282,64 +113,107 @@
}
-(NSInteger) tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger) section {
- if (self.segmentedControl.selectedSegmentIndex != 1)
- return [themeArray count];
- else
- return [mapArray count];
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
+ return [[self.dataSourceArray objectAtIndex:scIndex] count];
}
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
NSInteger row = [indexPath row];
-
+
UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil)
+ if (cell == nil)
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
-
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- cell.textLabel.textColor = [UIColor colorWithRed:(CGFloat)0xFE/255 green:(CGFloat)0xCB/255 blue:0 alpha:1 ];
- }
-
- if (self.segmentedControl.selectedSegmentIndex != 1) {
- // the % prevents a strange bug that occurs sporadically
- NSString *themeName = [self.themeArray objectAtIndex:row % [self.themeArray count]];
- cell.textLabel.text = themeName;
- UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),themeName]];
+
+ if (IS_IPAD())
+ cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
+
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
+ NSArray *source = [self.dataSourceArray objectAtIndex:scIndex];
+
+ NSString *labelString = [source objectAtIndex:row];
+ cell.textLabel.text = labelString;
+ cell.textLabel.adjustsFontSizeToFitWidth = YES;
+ cell.textLabel.minimumFontSize = 7;
+
+ if (isRandomness()) {
+ UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),labelString]];
cell.imageView.image = image;
[image release];
- } else {
- cell.textLabel.text = [self.mapArray objectAtIndex:row];
+ } else
cell.imageView.image = nil;
- }
-
- if (row == [self.lastIndexPath row])
- cell.accessoryType = UITableViewCellAccessoryCheckmark;
- else
- cell.accessoryType = UITableViewCellAccessoryNone;
+ if (row == [self.lastIndexPath row]) {
+ UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
+ cell.accessoryView = checkbox;
+ [checkbox release];
+ } else
+ cell.accessoryView = nil;
+
+ cell.backgroundColor = [UIColor blackColor];
return cell;
}
+// 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",
+ (scIndex == 1) ? MAPS_DIRECTORY() : MISSIONS_DIRECTORY(),[source objectAtIndex:index]];
+ NSString *contents = [[NSString alloc] initWithContentsOfFile:fileCfg encoding:NSUTF8StringEncoding error:NULL];
+ [fileCfg release];
+ NSArray *split = [contents componentsSeparatedByString:@"\n"];
+ [contents release];
+
+ // if the number is not set we keep 18 standard;
+ // sometimes it's not set but there are trailing characters, we get around them with the second equation
+ if ([split count] > 1 && [[split objectAtIndex:1] intValue] > 0)
+ maxHogs = [[split objectAtIndex:1] intValue];
+ else
+ maxHogs = 18;
+ NSString *max = [[NSString alloc] initWithFormat:@"%d",maxHogs];
+ self.maxLabel.text = max;
+ [max release];
+
+ self.themeCommand = [NSString stringWithFormat:@"etheme %@", [split objectAtIndex:0]];
+ self.staticMapCommand = [NSString stringWithFormat:@"emap %@", [source objectAtIndex:index]];
+
+ if (scIndex != 3)
+ self.missionCommand = @"";
+ else
+ self.missionCommand = [NSString stringWithFormat:@"escript Missions/Maps/%@/map.lua",[source objectAtIndex:index]];
+}
#pragma mark -
#pragma mark Table view delegate
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int newRow = [indexPath row];
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
-
+
if (newRow != oldRow) {
- if (self.segmentedControl.selectedSegmentIndex != 1) {
- NSString *theme = [self.themeArray objectAtIndex:newRow];
- self.themeCommand = [NSString stringWithFormat:@"etheme %@", theme];
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
+ NSArray *source = [self.dataSourceArray objectAtIndex:scIndex];
+ if (isRandomness()) {
+ // just change the theme, don't update preview
+ self.themeCommand = [NSString stringWithFormat:@"etheme %@", [source objectAtIndex:newRow]];
} else {
- // theme and map are set in the function below
- [self updatePreviewWithMap:newRow];
+ NSString *fileImage = [NSString stringWithFormat:@"%@/%@/preview.png",
+ (scIndex == 1) ? MAPS_DIRECTORY() : MISSIONS_DIRECTORY(),[source objectAtIndex:newRow]];
+ [self.previewButton updatePreviewWithFile:fileImage];
+ [self setDetailsForStaticMap:newRow];
}
-
- UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath];
- newCell.accessoryType = UITableViewCellAccessoryCheckmark;
+
+ UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath];
+ UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
+ newCell.accessoryView = checkbox;
+ [checkbox release];
UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:self.lastIndexPath];
- oldCell.accessoryType = UITableViewCellAccessoryNone;
+ oldCell.accessoryView = nil;
self.lastIndexPath = indexPath;
[aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
@@ -355,7 +229,7 @@
NSString *labelText;
NSString *templateCommand;
NSString *mazeCommand;
-
+
switch ((int)(self.slider.value*100)) {
case 0:
if (self.segmentedControl.selectedSegmentIndex == 0) {
@@ -417,7 +291,7 @@
mazeCommand = nil;
break;
}
-
+
self.sizeLabel.text = labelText;
self.templateFilterCommand = templateCommand;
self.mazeSizeCommand = mazeCommand;
@@ -430,128 +304,143 @@
[self updatePreview];
oldValue = num;
}
+ playSound(@"clickSound");
}
-// perform actions based on the activated section, then call updatePreview to visually update the selection
-// updatePreview will call didSelectRowAtIndexPath which will call the right update routine)
+// perform actions based on the activated section, then call updatePreview to visually update the selection
// and if necessary update the table with a slide animation
-(IBAction) segmentedControlChanged:(id) sender {
- NSString *mapgen, *staticmap;
+ NSString *mapgen, *staticmap, *mission;
NSInteger newPage = self.segmentedControl.selectedSegmentIndex;
-
+
+ playSound(@"selSound");
switch (newPage) {
case 0: // Random
mapgen = @"e$mapgen 0";
staticmap = @"";
+ mission = @"";
[self sliderChanged:nil];
self.slider.enabled = YES;
break;
-
+
case 1: // Map
+ case 3: // Mission
mapgen = @"e$mapgen 0";
- // dummy value, everything is set by -updatePreview -> -didSelectRowAtIndexPath -> -updatePreviewWithMap
+ // dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap
staticmap = @"map Bamboo";
+ mission = @"";
self.slider.enabled = NO;
- self.sizeLabel.text = @".";
- [self restoreBackgroundImage];
+ self.sizeLabel.text = NSLocalizedString(@"No filter",@"");
break;
-
+
case 2: // Maze
mapgen = @"e$mapgen 1";
staticmap = @"";
+ mission = @"";
[self sliderChanged:nil];
self.slider.enabled = YES;
break;
-
+
default:
mapgen = nil;
staticmap = nil;
+ mission = nil;
break;
}
self.mapGenCommand = mapgen;
self.staticMapCommand = staticmap;
- [self updatePreview];
-
+ self.missionCommand = mission;
+
// nice animation for updating the table when appropriate (on iphone)
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
- if (((oldPage == 0 || oldPage == 2) && newPage == 1) ||
- (oldPage == 1 && (newPage == 0 || newPage == 2))) {
- [UIView beginAnimations:@"moving out table" context:NULL];
+ if (IS_IPAD())
+ if (((oldPage == 0 || oldPage == 2) && (newPage == 1 || newPage == 3)) ||
+ ((oldPage == 1 || oldPage == 3) && (newPage == 0 || newPage == 2)) ||
+ ((oldPage == 1 && newPage == 3) || (oldPage == 3 || newPage == 1))) {
self.tableView.frame = CGRectMake(480, 0, 185, 276);
+ [UIView beginAnimations:@"moving in table" context:NULL];
+ self.tableView.frame = CGRectMake(295, 0, 185, 276);
[UIView commitAnimations];
- [self performSelector:@selector(moveTable) withObject:nil afterDelay:0.2];
}
+
+ [self.tableView reloadData];
+ [self updatePreview];
oldPage = newPage;
}
-// update data when table is not visible and then show it
--(void) moveTable {
- [self.tableView reloadData];
+#pragma mark -
+#pragma mark calls the parent's function that checks the parameters and starts the game
+-(IBAction) buttonPressed:(id) sender {
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"buttonPressed" object:nil userInfo:[NSDictionary dictionaryWithObject:sender forKey:@"sender"]];
+}
+
+-(void) loadDataSourceArray {
+ // themes.cfg contains all the user-selectable themes
+ NSString *string = [[NSString alloc] initWithContentsOfFile:[THEMES_DIRECTORY() stringByAppendingString:@"/themes.cfg"]
+ encoding:NSUTF8StringEncoding
+ error:NULL];
+ NSMutableArray *themeArray = [[NSMutableArray alloc] initWithArray:[string componentsSeparatedByString:@"\n"]];
+ [string release];
+ // remove a trailing "" element
+ [themeArray removeLastObject];
+ NSArray *mapArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MAPS_DIRECTORY() error:NULL];
+ NSArray *missionArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MISSIONS_DIRECTORY() error:NULL];
- [UIView beginAnimations:@"moving in table" context:NULL];
- self.tableView.frame = CGRectMake(295, 0, 185, 276);
- [UIView commitAnimations];
+ NSArray *array = [[NSArray alloc] initWithObjects:themeArray,mapArray,themeArray,missionArray,nil];
+ self.dataSourceArray = array;
+ [array release];
+ [themeArray release];
}
#pragma mark -
#pragma mark view management
-(void) viewDidLoad {
[super viewDidLoad];
-
+
srandom(time(NULL));
-
+
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
-
- // themes.cfg contains all the user-selectable themes
- NSString *string = [[NSString alloc] initWithContentsOfFile:[THEMES_DIRECTORY() stringByAppendingString:@"/themes.cfg"]
- encoding:NSUTF8StringEncoding
- error:NULL];
- NSMutableArray *array = [[NSMutableArray alloc] initWithArray:[string componentsSeparatedByString:@"\n"]];
- [string release];
- // remove a trailing "" element
- [array removeLastObject];
- self.themeArray = array;
- [array release];
- self.mapArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MAPS_DIRECTORY() error:NULL];
-
- self.tableView.rowHeight = 42;
- busy = NO;
-
- // draw a white background
- [self restoreBackgroundImage];
// initialize some "default" values
self.sizeLabel.text = NSLocalizedString(@"All",@"");
self.slider.value = 0.05f;
+ oldValue = 5;
- // on slower device we show directly the static map
- NSString *modelId = modelType();
- if ([modelId hasPrefix:@"iPhone1"] || [modelId hasPrefix:@"iPod1,1"] || [modelId hasPrefix:@"iPod2,1"])
- self.segmentedControl.selectedSegmentIndex = 1;
- else
- self.segmentedControl.selectedSegmentIndex = 0;
+ busy = NO;
+ [self loadDataSourceArray];
+ self.lastIndexPath = [NSIndexPath indexPathForRow:-1 inSection:0];
+
+ // select a map at first because it's faster - done in IB
+ oldPage = 1;
+ if (self.segmentedControl.selectedSegmentIndex == 1) {
+ self.slider.enabled = NO;
+ self.sizeLabel.text = NSLocalizedString(@"No filter",@"");
+ }
self.templateFilterCommand = @"e$template_filter 0";
self.mazeSizeCommand = @"e$maze_size 0";
self.mapGenCommand = @"e$mapgen 0";
self.staticMapCommand = @"";
-
- self.lastIndexPath = [NSIndexPath indexPathForRow:0 inSection:0];
-
- oldValue = 5;
- oldPage = 0;
+ self.missionCommand = @"";
+
+ if (IS_IPAD()) {
+ [self.tableView setBackgroundView:nil];
+ self.view.backgroundColor = [UIColor clearColor];
+ self.tableView.separatorColor = UICOLOR_HW_YELLOW_BODER;
+ self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+ self.tableView.rowHeight = 45;
+ }
+}
+
+-(void) viewWillAppear:(BOOL)animated {
+ if (self.dataSourceArray == nil)
+ [self loadDataSourceArray];
+ [super viewWillAppear:animated];
}
-(void) viewDidAppear:(BOOL) animated {
+ [self updatePreview];
[super viewDidAppear:animated];
- [self updatePreview];
-}
-
-#pragma mark -
-#pragma mark memory
--(void) didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
}
-(void) viewDidUnload {
@@ -562,22 +451,36 @@
self.mazeSizeCommand = nil;
self.themeCommand = nil;
self.staticMapCommand = nil;
-
+ self.missionCommand = nil;
+
self.previewButton = nil;
self.tableView = nil;
self.maxLabel = nil;
self.sizeLabel = nil;
self.segmentedControl = nil;
self.slider = nil;
-
+
self.lastIndexPath = nil;
- self.themeArray = nil;
- self.mapArray = nil;
-
+ self.dataSourceArray = nil;
+
MSG_DIDUNLOAD();
[super viewDidUnload];
}
+-(void) didReceiveMemoryWarning {
+ self.dataSourceArray = nil;
+
+ self.previewButton = nil;
+ self.tableView = nil;
+ self.maxLabel = nil;
+ self.sizeLabel = nil;
+ self.segmentedControl = nil;
+ self.slider = nil;
+
+ MSG_MEMCLEAN();
+ [super didReceiveMemoryWarning];
+}
+
-(void) dealloc {
[seedCommand release];
[templateFilterCommand release];
@@ -585,20 +488,19 @@
[mazeSizeCommand release];
[themeCommand release];
[staticMapCommand release];
-
+ [missionCommand release];
+
[previewButton release];
[tableView release];
[maxLabel release];
[sizeLabel release];
[segmentedControl release];
[slider release];
-
+
[lastIndexPath release];
- [themeArray release];
- [mapArray release];
-
+ [dataSourceArray release];
+
[super dealloc];
}
-
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/MapPreviewButtonView.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.h Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,49 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 26/09/2010.
+ */
+
+
+#import
+#import "SDL_net.h"
+
+@protocol MapPreviewViewDelegate
+
+-(void) turnOnWidgets;
+-(void) setLabelText:(NSString *)string;
+-(NSDictionary *)getDataForEngine;
+
+@end
+
+@interface MapPreviewButtonView : UIButton {
+ id delegate;
+ TCPsocket sd, csd;
+ NSInteger maxHogs;
+}
+
+@property (nonatomic,assign) id delegate;
+
+
+-(void) setBackgroundImageRounded:(UIImage *)image forState:(UIControlState)state;
+-(void) setImageRounded:(UIImage *)image forState:(UIControlState)state;
+-(void) setImageRoundedForNormalState:(UIImage *)image;
+-(void) updatePreviewWithSeed:(NSString *)seed;
+-(void) updatePreviewWithFile:(NSString *)filePath;
+-(NSDictionary *)getDataForEngine;
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/MapPreviewButtonView.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/MapPreviewButtonView.m Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,246 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 26/09/2010.
+ */
+
+
+#import "MapPreviewButtonView.h"
+#import "MapConfigViewController.h"
+#import "UIImageExtra.h"
+#import
+
+#define INDICATOR_TAG 7654
+
+@implementation MapPreviewButtonView
+@synthesize delegate;
+
+-(id) initWithFrame:(CGRect)frame {
+ if ((self = [super initWithFrame:frame])) {
+ delegate = nil;
+ [self setBackgroundImageRounded:[UIImage whiteImage:frame.size] forState:UIControlStateNormal];
+ }
+ return self;
+}
+
+-(id) initWithCoder:(NSCoder *)aDecoder {
+ if ((self = [super initWithCoder:aDecoder])) {
+ delegate = nil;
+ [self setBackgroundImageRounded:[UIImage whiteImage:self.frame.size] forState:UIControlStateNormal];
+ }
+ return self;
+}
+
+-(void) dealloc {
+ self.delegate = nil;
+ [super dealloc];
+}
+
+#pragma mark -
+#pragma mark image wrappers
+-(void) setBackgroundImageRounded:(UIImage *)image forState:(UIControlState)state {
+ [self setBackgroundImage:[image makeRoundCornersOfSize:CGSizeMake(12, 12)] forState:UIControlStateNormal];
+}
+
+-(void) setImageRounded:(UIImage *)image forState:(UIControlState)state {
+ [self setImage:[image makeRoundCornersOfSize:CGSizeMake(12, 12)] forState:UIControlStateNormal];
+}
+
+-(void) setImageRoundedForNormalState:(UIImage *)image {
+ [self setImageRounded:image forState:UIControlStateNormal];
+}
+
+#pragma mark -
+#pragma mark preview
+-(int) sendToEngine:(NSString *)string {
+ unsigned char length = [string length];
+
+ SDLNet_TCP_Send(csd, &length, 1);
+ return SDLNet_TCP_Send(csd, [string UTF8String], length);
+}
+
+-(const uint8_t *)engineProtocol {
+ IPaddress ip;
+ BOOL serverQuit = NO;
+ static uint8_t map[128*32];
+ int port = randomPort();
+
+ if (SDLNet_Init() < 0) {
+ DLog(@"SDLNet_Init: %s", SDLNet_GetError());
+ serverQuit = YES;
+ }
+
+ // Resolving the host using NULL make network interface to listen
+ if (SDLNet_ResolveHost(&ip, NULL, port) < 0) {
+ DLog(@"SDLNet_ResolveHost: %s\n", SDLNet_GetError());
+ serverQuit = YES;
+ }
+
+ // Open a connection with the IP provided (listen on the host's port)
+ if (!(sd = SDLNet_TCP_Open(&ip))) {
+ DLog(@"SDLNet_TCP_Open: %s %\n", SDLNet_GetError(), port);
+ serverQuit = YES;
+ }
+
+ // launch the preview here so that we're sure the tcp channel is open
+ pthread_t thread_id;
+ pthread_create(&thread_id, NULL, (void *)GenLandPreview, (void *)port);
+ pthread_detach(thread_id);
+
+ DLog(@"Waiting for a client on port %d", port);
+ while (!serverQuit) {
+ /* This check the sd if there is a pending connection.
+ * If there is one, accept that, and open a new socket for communicating */
+ csd = SDLNet_TCP_Accept(sd);
+ if (NULL != csd) {
+ DLog(@"Client found");
+
+ NSDictionary *dictForEngine = [self getDataForEngine];
+ [self sendToEngine:[dictForEngine objectForKey:@"seedCommand"]];
+ [self sendToEngine:[dictForEngine objectForKey:@"templateFilterCommand"]];
+ [self sendToEngine:[dictForEngine objectForKey:@"mapGenCommand"]];
+ [self sendToEngine:[dictForEngine objectForKey:@"mazeSizeCommand"]];
+ [self sendToEngine:@"!"];
+
+ memset(map, 0, 128*32);
+ SDLNet_TCP_Recv(csd, map, 128*32);
+ SDLNet_TCP_Recv(csd, &maxHogs, sizeof(uint8_t));
+
+ SDLNet_TCP_Close(csd);
+ serverQuit = YES;
+ }
+ }
+
+ SDLNet_TCP_Close(sd);
+ SDLNet_Quit();
+ return map;
+}
+
+-(void) drawingThread {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ const uint8_t *map = [self engineProtocol];
+ uint8_t mapExp[128*32*8];
+
+ // draw the buffer (1 pixel per component, 0= transparent 1= color)
+ int k = 0;
+ for (int i = 0; i < 32*128; i++) {
+ unsigned char byte = map[i];
+ for (int j = 0; j < 8; j++) {
+ // select the color based on the leftmost bit
+ if ((byte & 0x80) != 0)
+ mapExp[k] = 100;
+ else
+ mapExp[k] = 255;
+ // shift to next bit
+ byte <<= 1;
+ k++;
+ }
+ }
+ CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceGray();
+ CGContextRef bitmapImage = CGBitmapContextCreate(mapExp, 256, 128, 8, 256, colorspace, kCGImageAlphaNone);
+ CGColorSpaceRelease(colorspace);
+
+ CGImageRef previewCGImage = CGBitmapContextCreateImage(bitmapImage);
+ CGContextRelease(bitmapImage);
+ UIImage *previewImage = [[UIImage alloc] initWithCGImage:previewCGImage];
+ CGImageRelease(previewCGImage);
+ previewCGImage = nil;
+
+ // all these are performed on the main thread to prevent a leak
+ [self performSelectorOnMainThread:@selector(setImageRoundedForNormalState:)
+ withObject:previewImage
+ waitUntilDone:NO];
+ [previewImage release];
+ [self performSelectorOnMainThread:@selector(setLabelText:)
+ withObject:[NSString stringWithFormat:@"%d", maxHogs]
+ waitUntilDone:NO];
+ [self performSelectorOnMainThread:@selector(turnOnWidgets)
+ withObject:nil
+ waitUntilDone:NO];
+ [self performSelectorOnMainThread:@selector(removeIndicator)
+ withObject:nil
+ waitUntilDone:NO];
+
+ [pool release];
+
+ /*
+ // http://developer.apple.com/mac/library/qa/qa2001/qa1037.html
+ UIGraphicsBeginImageContext(CGSizeMake(256,128));
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ UIGraphicsPushContext(context);
+ CGContextSetRGBFillColor(context, 0.5, 0.5, 0.7, 1.0);
+ CGContextFillRect(context,CGRectMake(xc,yc,1,1));
+ UIGraphicsPopContext();
+ UIImage *previewImage = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+ */
+}
+
+-(void) updatePreviewWithSeed:(NSString *)seed {
+ // remove the current preview and title
+ [self setImage:nil forState:UIControlStateNormal];
+ [self setTitle:nil forState:UIControlStateNormal];
+
+ // don't display preview on slower device, too slow and memory hog
+ NSString *modelId = modelType();
+ if ([modelId hasPrefix:@"iPhone1"] || [modelId hasPrefix:@"iPod1,1"] || [modelId hasPrefix:@"iPod2,1"]) {
+ //self.delegate.busy = NO;
+ [self setTitle:NSLocalizedString(@"Preview not available",@"") forState:UIControlStateNormal];
+ } else {
+ // add a very nice spinning wheel
+ UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc]
+ initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
+ indicator.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
+ indicator.tag = INDICATOR_TAG;
+ [indicator startAnimating];
+ [self addSubview:indicator];
+ [indicator release];
+
+ // let's draw in a separate thread so the gui can work; at the end it restore other widgets
+ [NSThread detachNewThreadSelector:@selector(drawingThread) toTarget:self withObject:nil];
+ }
+}
+
+-(void) updatePreviewWithFile:(NSString *)filePath {
+ UIImage *image = [[UIImage alloc] initWithContentsOfFile:filePath];
+ [self setImageRounded:image forState:UIControlStateNormal];
+ [image release];
+}
+
+-(void) removeIndicator {
+ UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)[self viewWithTag:INDICATOR_TAG];
+ if (indicator) {
+ [indicator stopAnimating];
+ [indicator removeFromSuperview];
+ }
+}
+
+#pragma mark -
+#pragma mark delegate
+-(void) turnOnWidgets {
+ [self.delegate turnOnWidgets];
+}
+
+-(void) setLabelText:(NSString *)string {
+ [self.delegate setLabelText:string];
+}
+
+-(NSDictionary *)getDataForEngine {
+ return [self.delegate getDataForEngine];
+}
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/MasterViewController.h
--- a/project_files/HedgewarsMobile/Classes/MasterViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/MasterViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// MasterViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 27/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 27/03/2010.
+ */
+
#import
@@ -14,18 +27,20 @@
@class TeamSettingsViewController;
@class WeaponSettingsViewController;
@class SchemeSettingsViewController;
+@class SupportViewController;
@interface MasterViewController : UITableViewController {
- DetailViewController *detailViewController;
+ MasterViewController *targetController;
NSArray *controllerNames;
NSIndexPath *lastIndexPath;
GeneralSettingsViewController *generalSettingsViewController;
TeamSettingsViewController *teamSettingsViewController;
WeaponSettingsViewController *weaponSettingsViewController;
SchemeSettingsViewController *schemeSettingsViewController;
+ SupportViewController *supportViewController;
}
-@property (nonatomic, retain) DetailViewController *detailViewController;
+@property (nonatomic, retain) MasterViewController *targetController;
@property (nonatomic, retain) NSArray *controllerNames;
@property (nonatomic, retain) NSIndexPath *lastIndexPath;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/MasterViewController.m
--- a/project_files/HedgewarsMobile/Classes/MasterViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/MasterViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,21 +1,34 @@
-//
-// MasterViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 27/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 27/03/2010.
+ */
+
#import "MasterViewController.h"
-#import "DetailViewController.h"
+#import "CommodityFunctions.h"
#import "GeneralSettingsViewController.h"
#import "TeamSettingsViewController.h"
#import "WeaponSettingsViewController.h"
#import "SchemeSettingsViewController.h"
-#import "CommodityFunctions.h"
+#import "SupportViewController.h"
@implementation MasterViewController
-@synthesize detailViewController, controllerNames, lastIndexPath;
+@synthesize targetController, controllerNames, lastIndexPath;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
@@ -27,22 +40,33 @@
#pragma mark View lifecycle
-(void) viewDidLoad {
[super viewDidLoad];
-
+
// the list of selectable controllers
- controllerNames = [[NSArray alloc] initWithObjects:NSLocalizedString(@"General",@""),
- NSLocalizedString(@"Teams",@""),
- NSLocalizedString(@"Weapons",@""),
- NSLocalizedString(@"Schemes",@""),
- nil];
- // the "Done" button on top left
- self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
- target:self
- action:@selector(dismissSplitView)];
+ NSArray *array = [[NSArray alloc] initWithObjects:NSLocalizedString(@"General",@""),
+ NSLocalizedString(@"Teams",@""),
+ NSLocalizedString(@"Weapons",@""),
+ NSLocalizedString(@"Schemes",@""),
+ NSLocalizedString(@"Support",@""),
+ nil];
+ self.controllerNames = array;
+ [array release];
+
+ // targetControllers tells whether we're on the right or left side of the splitview -- on iphone we only use the right side
+ if (targetController == nil && IS_IPAD()) {
+ if (nil == generalSettingsViewController)
+ generalSettingsViewController = [[GeneralSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
+ generalSettingsViewController.navigationItem.hidesBackButton = YES;
+ [generalSettingsViewController viewWillAppear:YES];
+ [self.navigationController pushViewController:generalSettingsViewController animated:NO];
+ } else {
+ self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
+ target:self
+ action:@selector(dismissSplitView)];
+ }
}
#pragma mark -
#pragma mark Table view data source
-
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
@@ -54,13 +78,44 @@
// Customize the appearance of table view cells.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
-
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
+ if (cell == nil)
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
- cell.textLabel.text = [controllerNames objectAtIndex:[indexPath row]];
+
+ NSString *iconStr = nil;
+ switch ([indexPath row]) {
+ case 0:
+ iconStr = [NSString stringWithFormat:@"%@/TargetBee.png",GRAPHICS_DIRECTORY()];
+ break;
+ case 1:
+ iconStr = [NSString stringWithFormat:@"%@/Egg.png",GRAPHICS_DIRECTORY()];
+ break;
+ case 2:
+ iconStr = [NSString stringWithFormat:@"%@/Molotov.png",GRAPHICS_DIRECTORY()];
+ break;
+ case 3:
+ iconStr = [NSString stringWithFormat:@"%@/Target.png",GRAPHICS_DIRECTORY()];
+ break;
+ case 4:
+ iconStr = [NSString stringWithFormat:@"%@/Seduction.png",GRAPHICS_DIRECTORY()];
+ break;
+ default:
+ //seduction.png for support page
+ DLog(@"Nope");
+ break;
}
+ if (nil == targetController)
+ cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+ else
+ cell.accessoryType = UITableViewCellAccessoryNone;
+
+ cell.textLabel.text = [controllerNames objectAtIndex:[indexPath row]];
+ UIImage *icon = [[UIImage alloc] initWithContentsOfFile:iconStr];
+ cell.imageView.image = icon;
+ [icon release];
+
return cell;
}
@@ -70,11 +125,11 @@
int newRow = [indexPath row];
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
UIViewController *nextController = nil;
-
+
if (newRow != oldRow) {
[self.tableView deselectRowAtIndexPath:lastIndexPath animated:YES];
- [detailViewController.navigationController popToRootViewControllerAnimated:NO];
-
+ [targetController.navigationController popToRootViewControllerAnimated:NO];
+
switch (newRow) {
case 0:
if (nil == generalSettingsViewController)
@@ -96,13 +151,25 @@
schemeSettingsViewController = [[SchemeSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
nextController = schemeSettingsViewController;
break;
+ case 4:
+ if (nil == supportViewController)
+ supportViewController = [[SupportViewController alloc] initWithNibName:@"SupportViewController" bundle:nil];
+ nextController = supportViewController;
+ break;
}
-
- nextController.navigationItem.hidesBackButton = YES;
+
nextController.title = [controllerNames objectAtIndex:newRow];
- [detailViewController.navigationController pushViewController:nextController animated:NO];
self.lastIndexPath = indexPath;
[self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
+
+ if (nil == targetController) {
+ nextController.navigationItem.hidesBackButton = NO;
+ [self.navigationController pushViewController:nextController animated:YES];
+ } else {
+ playSound(@"clickSound");
+ nextController.navigationItem.hidesBackButton = YES;
+ [targetController.navigationController pushViewController:nextController animated:NO];
+ }
}
}
@@ -110,9 +177,6 @@
#pragma mark -
#pragma mark Memory management
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
- // Relinquish ownership any cached data, images, etc that aren't in use.
if (generalSettingsViewController.view.superview == nil)
generalSettingsViewController = nil;
if (teamSettingsViewController.view.superview == nil)
@@ -121,33 +185,39 @@
weaponSettingsViewController = nil;
if (schemeSettingsViewController.view.superview == nil)
schemeSettingsViewController = nil;
+ if (supportViewController.view.superview == nil)
+ supportViewController = nil;
MSG_MEMCLEAN();
+ [super didReceiveMemoryWarning];
}
-(void) viewDidUnload {
- self.detailViewController = nil;
+ self.targetController = nil;
self.controllerNames = nil;
self.lastIndexPath = nil;
generalSettingsViewController = nil;
teamSettingsViewController = nil;
weaponSettingsViewController = nil;
schemeSettingsViewController = nil;
+ supportViewController = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
-(void) dealloc {
+ targetController = nil;
[controllerNames release];
- [detailViewController release];
[lastIndexPath release];
[generalSettingsViewController release];
[teamSettingsViewController release];
[weaponSettingsViewController release];
[schemeSettingsViewController release];
+ [supportViewController release];
[super dealloc];
}
-(IBAction) dismissSplitView {
+ playSound(@"backSound");
[[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil];
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/OverlayViewController.h
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,36 +1,68 @@
-//
-// overlayViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 16/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 16/03/2010.
+ */
+
#import
#import "SDL_sysvideo.h"
@class InGameMenuViewController;
+@class HelpPageViewController;
+@class AmmoMenuViewController;
@interface OverlayViewController : UIViewController {
// the timer that dims the overlay
NSTimer *dimTimer;
// the in-game menu
- UIPopoverController *popoverController; // iPad only
+ UIPopoverController *popoverController; // iPad only, never set on iPhone
InGameMenuViewController *popupMenu;
BOOL isPopoverVisible;
+
+ // the help menu
+ HelpPageViewController *helpPage;
+
+ // the objc ammomenu
+ AmmoMenuViewController *amvc;
+ BOOL wasVisible;
// ths touch section
CGFloat initialDistanceForPinching;
CGPoint startingPoint;
BOOL isSegmentVisible;
+ BOOL isAttacking;
- // the sdl window underneath
- SDL_Window *sdlwindow;
+ // stuff initialized externally
+ BOOL isNetGame;
+ BOOL useClassicMenu;
+
+ // dual head support
+ NSInteger initialScreenCount;
+ NSInteger a, b;
}
@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;
@@ -44,8 +76,14 @@
-(void) dismissPopover;
-(void) dimOverlay;
-(void) activateOverlay;
+-(void) cleanup;
@end
+// actual game started (controls should be enabled)
BOOL isGameRunning;
-
+void setGameRunning(BOOL value);
+// black screen present
+BOOL isReplay;
+// cache the grenade time
+NSInteger cachedGrenadeTime;
\ No newline at end of file
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/OverlayViewController.m
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,161 +1,291 @@
-//
-// overlayViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 16/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 16/03/2010.
+ */
+
#import "OverlayViewController.h"
#import "SDL_uikitappdelegate.h"
+#import "InGameMenuViewController.h"
+#import "HelpPageViewController.h"
+#import "AmmoMenuViewController.h"
#import "PascalImports.h"
+#import "CommodityFunctions.h"
#import "CGPointUtils.h"
+#import "SDL_config_iphoneos.h"
#import "SDL_mouse.h"
-#import "InGameMenuViewController.h"
-#import "CommodityFunctions.h"
-#import "SDL_config_iphoneos.h"
#define HIDING_TIME_DEFAULT [NSDate dateWithTimeIntervalSinceNow:2.7]
#define HIDING_TIME_NEVER [NSDate dateWithTimeIntervalSinceNow:10000]
-#define doDim() [dimTimer setFireDate:HIDING_TIME_DEFAULT]
+#define doDim() [dimTimer setFireDate: (IS_DUALHEAD()) ? HIDING_TIME_NEVER : HIDING_TIME_DEFAULT]
#define doNotDim() [dimTimer setFireDate:HIDING_TIME_NEVER]
#define CONFIRMATION_TAG 5959
#define GRENADE_TAG 9595
+#define REPLAYBLACKVIEW_TAG 9955
+#define ACTIVITYINDICATOR_TAG 987654
#define ANIMATION_DURATION 0.25
-#define removeConfirmationInput() [[self.view viewWithTag:CONFIRMATION_TAG] removeFromSuperview];
+#define removeConfirmationInput() [[self.view viewWithTag:CONFIRMATION_TAG] removeFromSuperview];
@implementation OverlayViewController
-@synthesize popoverController, popupMenu;
+@synthesize popoverController, popupMenu, helpPage, amvc, isNetGame, useClassicMenu;
+#pragma mark -
+#pragma mark rotation
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
return rotationManager(interfaceOrientation);
}
--(void) didRotate:(NSNotification *)notification {
+// pause the game and remove objc menus so that animation is smoother
+-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation duration:(NSTimeInterval) duration{
+ [self dismissPopover];
+ if (HW_isPaused() == NO)
+ HW_pause();
+ if (self.amvc.isVisible && IS_DUALHEAD() == NO) {
+ [self.amvc disappear];
+ wasVisible = YES;
+ } else
+ wasVisible = NO;
+
+ [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
+}
+
+// now restore previous state
+-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation) fromInterfaceOrientation {
+ if (wasVisible || IS_DUALHEAD())
+ [self.amvc appearInView:self.view];
+ if (HW_isPaused() == YES)
+ HW_pause();
+
+ [super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
+}
+
+// rotate the sdl view according to the orientation -- the uiview is autorotated
+-(void) didRotate:(NSNotification *)notification {
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
- CGRect rect = [[UIScreen mainScreen] bounds];
- CGRect usefulRect = CGRectMake(0, 0, rect.size.width, rect.size.height);
UIView *sdlView = [[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG];
+ CGRect screenRect = [[UIScreen mainScreen] bounds];
[UIView beginAnimations:@"rotation" context:NULL];
- [UIView setAnimationDuration:0.8f];
- [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
+ [UIView setAnimationDuration:0.7];
switch (orientation) {
case UIDeviceOrientationLandscapeLeft:
- sdlView.transform = CGAffineTransformMakeRotation(degreesToRadian(0));
- self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90));
- HW_setLandscape(YES);
+ if (IS_DUALHEAD()) {
+ self.view.frame = CGRectMake(0, 0, screenRect.size.width, screenRect.size.height);
+ self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(90));
+ } else
+ sdlView.transform = CGAffineTransformMakeRotation(degreesToRadians(a));
break;
case UIDeviceOrientationLandscapeRight:
- sdlView.transform = CGAffineTransformMakeRotation(degreesToRadian(180));
- self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(-90));
- HW_setLandscape(YES);
+ if (IS_DUALHEAD()) {
+ self.view.frame = CGRectMake(0, 0, screenRect.size.width, screenRect.size.height);
+ self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(-90));
+ } else
+ sdlView.transform = CGAffineTransformMakeRotation(degreesToRadians(b));
break;
- /*
- case UIDeviceOrientationPortrait:
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- sdlView.transform = CGAffineTransformMakeRotation(degreesToRadian(270));
- self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(0));
- [self chatAppear];
- HW_setLandscape(NO);
- }
- break;
- case UIDeviceOrientationPortraitUpsideDown:
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- sdlView.transform = CGAffineTransformMakeRotation(degreesToRadian(90));
- self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(180));
- [self chatAppear];
- HW_setLandscape(NO);
- }
- break;
- */
default:
+ // a debug log would spam too much
break;
}
- self.view.frame = usefulRect;
- //sdlView.frame = usefulRect;
[UIView commitAnimations];
+
+ // for single screens only landscape mode is supported
+ // for dual screen mode the sdlview is not modified, but you can rotate the pad in any direction
}
#pragma mark -
#pragma mark View Management
+-(id) initWithCoder:(NSCoder *)aDecoder {
+ if ((self = [super initWithCoder:aDecoder])) {
+ isGameRunning = NO;
+ isReplay = NO;
+ cachedGrenadeTime = 2;
+
+ isAttacking = NO;
+ wasVisible = NO;
+ isPopoverVisible = NO; // it is called "popover" even on the iphone
+ }
+ return self;
+}
+
-(void) viewDidLoad {
- isPopoverVisible = NO;
+ CGRect screenRect = [[UIScreen mainScreen] bounds];
+ self.view.frame = CGRectMake(0, 0, screenRect.size.height, screenRect.size.width);
+ self.view.center = CGPointMake(self.view.frame.size.height/2, self.view.frame.size.width/2);
self.view.alpha = 0;
- self.view.center = CGPointMake(self.view.frame.size.height/2.0, self.view.frame.size.width/2.0);
-
- // set initial orientation
- UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
- UIView *sdlView = [[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG];
- switch (orientation) {
- case UIDeviceOrientationLandscapeLeft:
- sdlView.transform = CGAffineTransformMakeRotation(degreesToRadian(0));
- self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90));
- break;
- case UIDeviceOrientationLandscapeRight:
- sdlView.transform = CGAffineTransformMakeRotation(degreesToRadian(180));
- self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(-90));
- break;
- default:
- break;
+
+ // detrmine the quanitiy and direction of the rotation
+ if (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
+ a = 180;
+ b = 0;
+ } else {
+ a = 0;
+ b = 180;
}
- CGRect rect = [[UIScreen mainScreen] bounds];
- self.view.frame = CGRectMake(0, 0, rect.size.width, rect.size.height);
-
- dimTimer = [[NSTimer alloc] initWithFireDate:[NSDate dateWithTimeIntervalSinceNow:6]
+
+ // get the number of screens to know the previous state whan a display is connected or detached
+ initialScreenCount = [[UIScreen screens] count];
+
+ // set initial orientation of the controller orientation
+ if (IS_DUALHEAD()) {
+ switch (self.interfaceOrientation) {
+ case UIDeviceOrientationLandscapeLeft:
+ self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(90));
+ break;
+ case UIDeviceOrientationLandscapeRight:
+ self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(-90));
+ break;
+ default:
+ DLog(@"Nope");
+ break;
+ }
+ }
+
+ // the timer used to dim the overlay
+ dimTimer = [[NSTimer alloc] initWithFireDate:(IS_DUALHEAD()) ? HIDING_TIME_NEVER : [NSDate dateWithTimeIntervalSinceNow:6]
interval:1000
target:self
selector:@selector(dimOverlay)
userInfo:nil
repeats:YES];
-
- // add timer too runloop, otherwise it doesn't work
+ // add timer to runloop, otherwise it doesn't work
[[NSRunLoop currentRunLoop] addTimer:dimTimer forMode:NSDefaultRunLoopMode];
-
- [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
+
+ // become listener of some notifications
+ [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(showHelp:)
+ name:@"show help ingame"
+ object:nil];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(cleanup)
+ name:@"remove overlay"
+ object:nil];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(numberOfScreensIncreased)
+ name:UIScreenDidConnectNotification
+ object:nil];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(numberOfScreensDecreased)
+ name:UIScreenDidDisconnectNotification
+ object:nil];
+
+ // present the overlay
[UIView beginAnimations:@"showing overlay" context:NULL];
[UIView setAnimationDuration:1];
self.view.alpha = 1;
[UIView commitAnimations];
+}
+
+-(void) numberOfScreensIncreased {
+ if (initialScreenCount == 1) {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"New display detected"
+ message:NSLocalizedString(@"Hedgewars supports multi-monitor configurations, but the screen has to be connected before launching the game.",@"")
+ delegate:nil
+ cancelButtonTitle:@"Ok"
+ otherButtonTitles:nil];
+ [alert show];
+ [alert release];
+ if (HW_isPaused() == NO)
+ HW_pause();
+ }
+}
+
+-(void) numberOfScreensDecreased {
+ if (initialScreenCount == 2) {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Oh noes! Display disconnected"
+ message:NSLocalizedString(@"A monitor has been disconnected while playing and this has ended the match! You need to restart the game if you wish to use the second display again.",@"")
+ delegate:nil
+ cancelButtonTitle:@"Ok"
+ otherButtonTitles:nil];
+ [alert show];
+ [alert release];
+ [self cleanup];
+ }
+}
+
+
+-(void) showHelp:(id) sender {
+ if (self.helpPage == nil)
+ self.helpPage = [[HelpPageViewController alloc] initWithNibName:@"HelpPageInGameViewController" bundle:nil];
+ self.helpPage.view.alpha = 0;
+ [self.view addSubview:helpPage.view];
+ [UIView beginAnimations:@"helpingame" context:NULL];
+ self.helpPage.view.alpha = 1;
+ [UIView commitAnimations];
+ doNotDim();
+}
+
+-(void) cleanup {
+ [self dismissPopover];
+ HW_terminate(NO);
+ [self.view removeFromSuperview];
+}
+
+-(void) didReceiveMemoryWarning {
+ if (self.popupMenu.view.superview == nil)
+ self.popupMenu = nil;
+ if (self.helpPage.view.superview == nil)
+ self.helpPage = nil;
+ if (self.amvc.view.superview == nil)
+ self.amvc = nil;
+ if (IS_IPAD())
+ if (((UIPopoverController *)self.popoverController).contentViewController.view.superview == nil)
+ self.popoverController = nil;
- // find the sdl window we're on
- SDL_VideoDevice *_this = SDL_GetVideoDevice();
- SDL_VideoDisplay *display = &_this->displays[0];
- sdlwindow = display->windows;
+ MSG_MEMCLEAN();
+ [super didReceiveMemoryWarning];
}
-(void) viewDidUnload {
- // only object initialized in viewDidLoad should be here
+ // only objects initialized in viewDidLoad should be here
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [NSObject cancelPreviousPerformRequestsWithTarget:self
+ selector:@selector(unsetPreciseStatus)
+ object:nil];
dimTimer = nil;
+ self.helpPage = nil;
+ [self dismissPopover];
+ self.popoverController = nil;
+ self.amvc = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
--(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren't in use.
- if (popupMenu.view.superview == nil)
- popupMenu = nil;
- MSG_MEMCLEAN();
-}
-
-
-(void) dealloc {
[popupMenu release];
+ [helpPage release];
[popoverController release];
+ [amvc release];
// dimTimer is autoreleased
[super dealloc];
}
#pragma mark -
-#pragma mark Overlay actions and members
+#pragma mark overlay user interaction
// nice transition for dimming, should be called only by the timer himself
-(void) dimOverlay {
if (isGameRunning) {
@@ -174,11 +304,11 @@
// dim the overlay when there's no more input for a certain amount of time
-(IBAction) buttonReleased:(id) sender {
- if (!isGameRunning)
+ if (isGameRunning == NO)
return;
-
+
UIButton *theButton = (UIButton *)sender;
-
+
switch (theButton.tag) {
case 0:
case 1:
@@ -199,40 +329,43 @@
break;
}
+ isAttacking = NO;
doDim();
}
-// issue certain action based on the tag of the button
+// issue certain action based on the tag of the button
-(IBAction) buttonPressed:(id) sender {
[self activateOverlay];
- if (isPopoverVisible) {
+
+ if (isGameRunning == NO)
+ return;
+
+ if (isPopoverVisible)
[self dismissPopover];
- }
-
- if (!isGameRunning)
- return;
UIButton *theButton = (UIButton *)sender;
-
switch (theButton.tag) {
case 0:
- HW_walkLeft();
+ if (isAttacking == NO)
+ HW_walkLeft();
break;
case 1:
- HW_walkRight();
+ if (isAttacking == NO)
+ HW_walkRight();
break;
case 2:
[self performSelector:@selector(unsetPreciseStatus) withObject:nil afterDelay:0.8];
- HW_preciseSet(YES);
+ HW_preciseSet(!HW_isWeaponRope());
HW_aimUp();
break;
case 3:
[self performSelector:@selector(unsetPreciseStatus) withObject:nil afterDelay:0.8];
- HW_preciseSet(YES);
+ HW_preciseSet(!HW_isWeaponRope());
HW_aimDown();
break;
case 4:
HW_shoot();
+ isAttacking = YES;
break;
case 5:
HW_jump();
@@ -240,17 +373,36 @@
case 6:
HW_backjump();
break;
- case 7:
- HW_tab();
- break;
case 10:
+ playSound(@"clickSound");
HW_pause();
+ if (self.amvc.isVisible && IS_DUALHEAD() == NO) {
+ doDim();
+ [self.amvc disappear];
+ }
removeConfirmationInput();
[self showPopover];
break;
case 11:
+ playSound(@"clickSound");
removeConfirmationInput();
- HW_ammoMenu();
+
+ if (IS_DUALHEAD() || self.useClassicMenu == NO) {
+ if (self.amvc == nil)
+ self.amvc = [[AmmoMenuViewController alloc] init];
+
+ if (self.amvc.isVisible) {
+ doDim();
+ [self.amvc disappear];
+ } else {
+ if (HW_isAmmoMenuNotAllowed() == NO) {
+ doNotDim();
+ [self.amvc appearInView:self.view];
+ }
+ }
+ } else {
+ HW_ammoMenu();
+ }
break;
default:
DLog(@"Nope");
@@ -262,12 +414,28 @@
HW_preciseSet(NO);
}
+-(void) sendHWClick {
+ HW_click();
+ removeConfirmationInput();
+ doDim();
+}
+
+-(void) setGrenadeTime:(id) sender {
+ UISegmentedControl *theSegment = (UISegmentedControl *)sender;
+ if (cachedGrenadeTime != theSegment.selectedSegmentIndex) {
+ HW_setGrenadeTime(theSegment.selectedSegmentIndex + 1);
+ cachedGrenadeTime = theSegment.selectedSegmentIndex;
+ }
+}
+
+#pragma mark -
+#pragma mark other menu
// 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();
+ HW_pause();
}
// show up a popover containing a popupMenuViewController; we hook it with setPopoverContentSize
@@ -276,27 +444,27 @@
CGRect screen = [[UIScreen mainScreen] bounds];
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 (IS_IPAD()) {
+ 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
@@ -305,12 +473,12 @@
isPopoverVisible = NO;
if (HW_isPaused())
HW_pause();
-
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- [(InGameMenuViewController *)popoverController.contentViewController removeChat];
- [popoverController dismissPopoverAnimated:YES];
+
+ if (IS_IPAD()) {
+ [(InGameMenuViewController *)[[self popoverController] contentViewController] removeChat];
+ [self.popoverController dismissPopoverAnimated:YES];
} else {
- [popupMenu dismiss];
+ [self.popupMenu dismiss];
}
[self buttonReleased:nil];
}
@@ -321,24 +489,31 @@
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSSet *allTouches = [event allTouches];
UITouch *first, *second;
-
+
+ if (isGameRunning == NO)
+ return;
+
// hide in-game menu
if (isPopoverVisible)
[self dismissPopover];
-
+
+ if (self.amvc.isVisible && IS_DUALHEAD() == NO) {
+ doDim();
+ [self.amvc disappear];
+ }
// reset default dimming
doDim();
-
+
HW_setPianoSound([allTouches count]);
-
+
switch ([allTouches count]) {
- case 1:
+ case 1:
removeConfirmationInput();
startingPoint = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
if (2 == [[[allTouches allObjects] objectAtIndex:0] tapCount])
HW_zoomReset();
break;
- case 2:
+ case 2:
// pinching
first = [[allTouches allObjects] objectAtIndex:0];
second = [[allTouches allObjects] objectAtIndex:1];
@@ -349,26 +524,27 @@
}
}
- //if (currentPosition.y < screen.size.width - 130 || (currentPosition.x > 130 && currentPosition.x < screen.size.height - 130)) {
-
-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
CGRect screen = [[UIScreen mainScreen] bounds];
NSSet *allTouches = [event allTouches];
CGPoint currentPosition = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
+
+ if (isGameRunning == NO)
+ return;
switch ([allTouches count]) {
case 1:
// if we're in the menu we just click in the point
- if (HW_isAmmoOpen()) {
- HW_setCursor(HWX(currentPosition.x), HWY(currentPosition.y));
+ if (HW_isAmmoMenuOpen()) {
+ HW_setCursor(HWXZ(currentPosition.x), HWYZ(currentPosition.y));
// this click doesn't need any wrapping because the ammoMenu already limits the cursor
HW_click();
- } else
+ } else
// if weapon requires a further click, ask for tapping again
if (HW_isWeaponRequiringClick()) {
// here don't have to wrap thanks to isCursorVisible magic
HW_setCursor(HWX(currentPosition.x), HWY(currentPosition.y));
-
+
// draw the button at the last touched point (which is the current position)
UIButton *tapAgain = [UIButton buttonWithType:UIButtonTypeRoundedRect];
tapAgain.frame = CGRectMake(currentPosition.x - 75, currentPosition.y + 25, 150, 40);
@@ -377,13 +553,13 @@
[tapAgain addTarget:self action:@selector(sendHWClick) forControlEvents:UIControlEventTouchUpInside];
[tapAgain setTitle:NSLocalizedString(@"Tap to set!",@"from the overlay") forState:UIControlStateNormal];
[self.view addSubview:tapAgain];
-
+
// animation ftw!
- [UIView beginAnimations:@"inserting button" context:NULL];
+ [UIView beginAnimations:@"inserting button" context:NULL];
[UIView setAnimationDuration:ANIMATION_DURATION];
[self.view viewWithTag:CONFIRMATION_TAG].alpha = 1;
[UIView commitAnimations];
-
+
// keep the overlay active, or the button will fade
[self activateOverlay];
doNotDim();
@@ -391,35 +567,35 @@
if (HW_isWeaponTimerable()) {
if (isSegmentVisible) {
UISegmentedControl *grenadeTime = (UISegmentedControl *)[self.view viewWithTag:GRENADE_TAG];
-
+
[UIView beginAnimations:@"removing segmented control" context:NULL];
[UIView setAnimationDuration:ANIMATION_DURATION];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
grenadeTime.frame = CGRectMake(screen.size.height / 2 - 125, screen.size.width, 250, 50);
[UIView commitAnimations];
-
+
[grenadeTime performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:ANIMATION_DURATION];
} else {
NSArray *items = [[NSArray alloc] initWithObjects:@"1",@"2",@"3",@"4",@"5",nil];
UISegmentedControl *grenadeTime = [[UISegmentedControl alloc] initWithItems:items];
[items release];
-
+
[grenadeTime addTarget:self action:@selector(setGrenadeTime:) forControlEvents:UIControlEventValueChanged];
grenadeTime.frame = CGRectMake(screen.size.height / 2 - 125, screen.size.width, 250, 50);
- grenadeTime.selectedSegmentIndex = 2;
+ grenadeTime.selectedSegmentIndex = cachedGrenadeTime;
grenadeTime.tag = GRENADE_TAG;
[self.view addSubview:grenadeTime];
[grenadeTime release];
-
+
[UIView beginAnimations:@"inserting segmented control" context:NULL];
[UIView setAnimationDuration:ANIMATION_DURATION];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
grenadeTime.frame = CGRectMake(screen.size.height / 2 - 125, screen.size.width - 100, 250, 50);
[UIView commitAnimations];
-
+
[self activateOverlay];
doNotDim();
- }
+ }
isSegmentVisible = !isSegmentVisible;
} else
if (HW_isWeaponSwitch())
@@ -431,21 +607,10 @@
default:
break;
}
-
+
initialDistanceForPinching = 0;
}
--(void) sendHWClick {
- HW_click();
- removeConfirmationInput();
- doDim();
-}
-
--(void) setGrenadeTime:(id) sender {
- UISegmentedControl *theSegment = (UISegmentedControl *)sender;
- HW_setGrenadeTime(theSegment.selectedSegmentIndex + 1);
-}
-
-(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
[self touchesEnded:touches withEvent:event];
}
@@ -454,35 +619,43 @@
CGRect screen = [[UIScreen mainScreen] bounds];
NSSet *allTouches = [event allTouches];
int x, y, dx, dy;
-
UITouch *touch, *first, *second;
+ if (isGameRunning == NO)
+ return;
+
switch ([allTouches count]) {
case 1:
touch = [[allTouches allObjects] objectAtIndex:0];
CGPoint currentPosition = [touch locationInView:self.view];
- if (HW_isAmmoOpen() || HW_isWeaponRequiringClick()) {
- // moves the cursor around
- HW_setCursor(HWX(currentPosition.x), HWY(currentPosition.y));
- } else {
- // panning \o/
- dx = startingPoint.x - currentPosition.x;
- dy = currentPosition.y - startingPoint.y;
- HW_getCursor(&x, &y);
- // momentum (or something like that)
- if (abs(dx) > 40) dx *= log(abs(dx)/4);
- if (abs(dy) > 40) dy *= log(abs(dy)/4);
- HW_setCursor(x + dx, y + dy);
- startingPoint = currentPosition;
- }
+ if (HW_isAmmoMenuOpen()) {
+ // no zoom consideration for this
+ HW_setCursor(HWXZ(currentPosition.x), HWYZ(currentPosition.y));
+ } else
+ if (HW_isWeaponRequiringClick()) {
+ // moves the cursor around wrt zoom
+ HW_setCursor(HWX(currentPosition.x), HWY(currentPosition.y));
+ } else {
+ // panning \o/
+ dx = startingPoint.x - currentPosition.x;
+ dy = currentPosition.y - startingPoint.y;
+ HW_getCursor(&x, &y);
+ // momentum (or something like that)
+ /*if (abs(dx) > 40)
+ dx *= log(abs(dx)/4);
+ if (abs(dy) > 40)
+ dy *= log(abs(dy)/4);*/
+ HW_setCursor(x + dx/HW_zoomFactor(), y + dy/HW_zoomFactor());
+ startingPoint = currentPosition;
+ }
break;
case 2:
first = [[allTouches allObjects] objectAtIndex:0];
second = [[allTouches allObjects] objectAtIndex:1];
CGFloat currentDistanceOfPinching = distanceBetweenPoints([first locationInView:self.view], [second locationInView:self.view]);
const int pinchDelta = 40;
-
+
if (0 != initialDistanceForPinching) {
if (currentDistanceOfPinching - initialDistanceForPinching > pinchDelta) {
HW_zoomIn();
@@ -492,49 +665,106 @@
HW_zoomOut();
initialDistanceForPinching = currentDistanceOfPinching;
}
- } else
+ } else
initialDistanceForPinching = currentDistanceOfPinching;
-
break;
default:
+ DLog(@"Nope");
break;
}
}
#pragma mark -
-#pragma mark Functions called by pascal
-// called from AddProgress and FinishProgress (respectively)
+#pragma mark Functions called by pascal code
+void inline setGameRunning(BOOL value) {
+ isGameRunning = value;
+}
+
+// called by uStore from AddProgress
void startSpinning() {
- isGameRunning = NO;
- CGRect screen = [[UIScreen mainScreen] bounds];
+ setGameRunning(NO);
+ UIWindow *theWindow = [[UIApplication sharedApplication] keyWindow];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
- indicator.tag = 987654;
- indicator.center = CGPointMake(screen.size.width/2 - 118, screen.size.height/2);
+ indicator.tag = ACTIVITYINDICATOR_TAG;
+ int offset;
+ if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft)
+ offset = -120;
+ else
+ offset = 120;
+ if (IS_DUALHEAD())
+ indicator.center = CGPointMake(theWindow.frame.size.width/2, theWindow.frame.size.height/2 + offset);
+ else
+ indicator.center = CGPointMake(theWindow.frame.size.width/2 + offset, theWindow.frame.size.height/2);
indicator.hidesWhenStopped = YES;
[indicator startAnimating];
- [[[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG] addSubview:indicator];
+ [theWindow addSubview:indicator];
[indicator release];
}
+// called by uStore from FinishProgress and by OverlayViewController by replayBegan
void stopSpinning() {
- UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)[[[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG] viewWithTag:987654];
+ UIWindow *theWindow = [[UIApplication sharedApplication] keyWindow];
+ UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)[theWindow viewWithTag:ACTIVITYINDICATOR_TAG];
[indicator stopAnimating];
- isGameRunning = YES;
+ HW_zoomSet(1.7);
+ if (isReplay == NO)
+ setGameRunning(YES);
}
+// called by CCHandlers from chNextTurn
void clearView() {
- UIWindow *theWindow = [[UIApplication sharedApplication] keyWindow];
+ UIWindow *theWindow = (IS_DUALHEAD()) ? [SDLUIKitDelegate sharedAppDelegate].uiwindow : [[UIApplication sharedApplication] keyWindow];
UIButton *theButton = (UIButton *)[theWindow viewWithTag:CONFIRMATION_TAG];
UISegmentedControl *theSegment = (UISegmentedControl *)[theWindow viewWithTag:GRENADE_TAG];
-
+
[UIView beginAnimations:@"remove button" context:NULL];
[UIView setAnimationDuration:ANIMATION_DURATION];
theButton.alpha = 0;
theSegment.alpha = 0;
[UIView commitAnimations];
+
+ if (theButton)
+ [theWindow performSelector:@selector(removeFromSuperview) withObject:theButton afterDelay:ANIMATION_DURATION];
+ if (theSegment)
+ [theWindow performSelector:@selector(removeFromSuperview) withObject:theSegment afterDelay:ANIMATION_DURATION];
+
+ cachedGrenadeTime = 2;
+}
+
+// called by hwengine
+void replayBegan() {
+ UIWindow *theWindow = [[UIApplication sharedApplication] keyWindow];
+ UIView *blackView = [[UIView alloc] initWithFrame:theWindow.frame];
+ blackView.backgroundColor = [UIColor blackColor];
+ blackView.alpha = 0.6;
+ blackView.tag = REPLAYBLACKVIEW_TAG;
+ blackView.exclusiveTouch = NO;
+ blackView.multipleTouchEnabled = NO;
+ blackView.userInteractionEnabled = NO;
+ UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
+ indicator.center = theWindow.center;
+ [indicator startAnimating];
+ [blackView addSubview:indicator];
+ [indicator release];
+ [theWindow addSubview:blackView];
+ [blackView release];
+ isReplay = YES;
+ stopSpinning();
+}
+
+// called by uGame
+void replayFinished() {
+ UIWindow *theWindow = [[UIApplication sharedApplication] keyWindow];
+ UIView *blackView = (UIView *)[theWindow viewWithTag:REPLAYBLACKVIEW_TAG];
- [theWindow performSelector:@selector(removeFromSuperview) withObject:theButton afterDelay:0.3];
- [theWindow performSelector:@selector(removeFromSuperview) withObject:theSegment afterDelay:0.3];
+ [UIView beginAnimations:@"removing black" context:NULL];
+ [UIView setAnimationDuration:1];
+ blackView.alpha = 0;
+ [UIView commitAnimations];
+ [theWindow performSelector:@selector(removeFromSuperview) withObject:blackView afterDelay:1];
+
+ setGameRunning(YES);
+ isReplay = NO;
}
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/PascalImports.h
--- a/project_files/HedgewarsMobile/Classes/PascalImports.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/PascalImports.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,70 +1,99 @@
/*
- * PascalImports.h
-// fpciphonedel
-//
-// Created by Vittorio on 07/01/10.
-// Copyright __MyCompanyName__ 2010. All rights reserved.
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 07/01/2010.
*/
+
#ifndef PASCALIMPORTS
#define PASCALIMPORTS
#ifdef __cplusplus
extern "C" {
#endif
-
+
/* add C declarations below for all exported Pascal functions/procedure
* that you want to use
*/
void Game(const char *args[]);
void GenLandPreview(void);
-
+ void LoadLocaleWrapper(const char *filename);
void HW_versionInfo(short int *netProto, char **versionStr);
void HW_click(void);
+ void HW_ammoMenu(void);
+ void HW_zoomSet(float value);
void HW_zoomIn(void);
void HW_zoomOut(void);
void HW_zoomReset(void);
- void HW_ammoMenu(void);
-
+ float HW_zoomFactor(void);
+ int HW_zoomLevel(void);
+
void HW_walkingKeysUp(void);
void HW_otherKeysUp(void);
void HW_allKeysUp(void);
-
+
void HW_walkLeft(void);
void HW_walkRight(void);
void HW_aimUp(void);
void HW_aimDown(void);
void HW_preciseSet(BOOL status);
-
+
void HW_shoot(void);
void HW_jump(void);
void HW_backjump(void);
-
+
void HW_chat(void);
void HW_chatEnd(void);
void HW_tab(void);
void HW_pause(void);
-
+
void HW_terminate(BOOL andCloseFrontend);
-
- void HW_setLandscape(BOOL rotate);
+
void HW_setCursor(int x, int y);
void HW_getCursor(int *x, int *y);
- void HW_setPianoSound(int snd);
-
- BOOL HW_isAmmoOpen(void);
+ BOOL HW_isAmmoMenuOpen(void);
+ BOOL HW_isAmmoMenuNotAllowed(void);
BOOL HW_isPaused(void);
BOOL HW_isWeaponRequiringClick(void);
BOOL HW_isWeaponTimerable(void);
BOOL HW_isWeaponSwitch(void);
+ BOOL HW_isWeaponRope(void);
+
+ void HW_setGrenadeTime(int time);
+ void HW_setPianoSound(int snd);
- void HW_setGrenadeTime(int time);
+ void HW_setWeapon(int whichone);
+ BOOL HW_isWeaponAnEffect(int whichone);
+ char *HW_getWeaponNameByIndex(int whichone);
+ char *HW_getWeaponCaptionByIndex(int whichone);
+ char *HW_getWeaponDescriptionByIndex(int whichone);
+
+ void HW_getAmmoDelays(unsigned char *pointer);
+ int HW_getAmmoCounts(int *pointer);
+
+ int HW_getNumberOfWeapons(void);
+ int HW_getTurnsForCurrentTeam(void);
+ int HW_getMaxNumberOfHogs(void);
+ int HW_getMaxNumberOfTeams(void);
#ifdef __cplusplus
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.h
--- a/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.h Wed Oct 27 14:02:20 2010 +0200
@@ -21,21 +21,24 @@
*/
#import
-#import "SDL_uikitopenglview.h"
@class MainMenuViewController;
-@class OverlayViewController;
@interface SDLUIKitDelegate:NSObject {
MainMenuViewController *mainViewController;
+ UIWindow *uiwindow;
+ UIWindow *secondWindow;
BOOL isInGame;
}
+@property (assign) BOOL isInGame;
@property (nonatomic,retain) MainMenuViewController *mainViewController;
+@property (nonatomic,retain) UIWindow *uiwindow;
+@property (nonatomic,retain) UIWindow *secondWindow;
+(SDLUIKitDelegate *)sharedAppDelegate;
-(void) startSDLgame:(NSDictionary *)gameDictionary;
--(void) displayOverlayLater;
+-(void) displayOverlayLater:(id) object;
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m
--- a/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,21 +1,21 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
-
+
This library 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
+
Sam Lantinga, mods for Hedgewars by Vittorio Giovara
slouken@libsdl.org, vittorio.giovara@gmail.com
*/
@@ -39,6 +39,8 @@
#undef main
#endif
+#define BLACKVIEW_TAG 17935
+#define SECONDBLACKVIEW_TAG 48620
#define VALGRIND "/opt/valgrind/bin/valgrind"
int main (int argc, char *argv[]) {
@@ -56,7 +58,7 @@
}
@implementation SDLUIKitDelegate
-@synthesize mainViewController;
+@synthesize mainViewController, uiwindow, secondWindow, isInGame;
// convenience method
+(SDLUIKitDelegate *)sharedAppDelegate {
@@ -67,6 +69,8 @@
-(id) init {
if (self = [super init]){
mainViewController = nil;
+ uiwindow = nil;
+ secondWindow = nil;
isInGame = NO;
}
return self;
@@ -74,69 +78,133 @@
-(void) dealloc {
[mainViewController release];
+ [uiwindow release];
+ [secondWindow release];
[super dealloc];
}
// main routine for calling the actual game engine
--(IBAction) startSDLgame: (NSDictionary *)gameDictionary {
+-(void) startSDLgame:(NSDictionary *)gameDictionary {
+ UIWindow *gameWindow;
+ if (IS_DUALHEAD())
+ gameWindow = self.secondWindow;
+ else
+ gameWindow = self.uiwindow;
+
+ UIView *blackView = [[UIView alloc] initWithFrame:gameWindow.frame];
+ blackView.backgroundColor = [UIColor blackColor];
+ blackView.opaque = YES;
+ blackView.tag = BLACKVIEW_TAG;
+ [gameWindow addSubview:blackView];
+ if (IS_DUALHEAD()) {
+ blackView.alpha = 0;
+ [UIView beginAnimations:@"fading to game first" context:NULL];
+ [UIView setAnimationDuration:1];
+ blackView.alpha = 1;
+ [UIView commitAnimations];
+
+ UIView *secondBlackView = [[UIView alloc] initWithFrame:self.uiwindow.frame];
+ secondBlackView.backgroundColor = [UIColor blackColor];
+ secondBlackView.opaque = YES;
+ secondBlackView.tag = SECONDBLACKVIEW_TAG;
+ secondBlackView.alpha = 0;
+ [self.uiwindow addSubview:secondBlackView];
+ [UIView beginAnimations:@"fading to game second" context:NULL];
+ [UIView setAnimationDuration:1];
+ secondBlackView.alpha = 1;
+ [UIView commitAnimations];
+ [secondBlackView release];
+ }
+ [blackView release];
+
// pull out useful configuration info from various files
GameSetup *setup = [[GameSetup alloc] initWithDictionary:gameDictionary];
+ NSNumber *isNetGameNum = [gameDictionary objectForKey:@"netgame"];
- [setup startThread:@"engineProtocol"];
- const char **gameArgs = [setup getSettings];
+ 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:nil afterDelay:0.1];
-
+ NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:isNetGameNum,@"net",menuStyle,@"menu",nil];
+ [self performSelector:@selector(displayOverlayLater:) withObject:dict afterDelay:1];
+
// this is the pascal fuction that starts the game (wrapped around isInGame)
- isInGame = YES;
+ self.isInGame = YES;
Game(gameArgs);
- isInGame = NO;
+ self.isInGame = NO;
free(gameArgs);
+
+ [self.uiwindow makeKeyAndVisible];
+ [self.uiwindow bringSubviewToFront:self.mainViewController.view];
- // bring the uiwindow below in front
- UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0];
- [aWin makeKeyAndVisible];
-
- // notice that in the simulator this reports 2 windows
- DLog(@"%@",[[UIApplication sharedApplication] windows]);
+ UIView *refBlackView = [gameWindow viewWithTag:BLACKVIEW_TAG];
+ UIView *refSecondBlackView = [self.uiwindow viewWithTag:SECONDBLACKVIEW_TAG];
+ [UIView beginAnimations:@"fading in from ingame" context:NULL];
+ [UIView setAnimationDuration:1];
+ refBlackView.alpha = 0;
+ refSecondBlackView.alpha = 0;
+ [UIView commitAnimations];
+ [refBlackView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
+ [refSecondBlackView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
}
--(void) displayOverlayLater {
- // overlay with controls, become visible later, with a transparency effect
+// overlay with controls, become visible later, with a transparency effect
+-(void) displayOverlayLater:(id) object {
+ NSDictionary *dict = (NSDictionary *)object;
OverlayViewController *overlayController = [[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:nil];
-
- // keyWindow is the frontmost window
- [[[UIApplication sharedApplication] keyWindow] addSubview:overlayController.view];
+ overlayController.isNetGame = [[dict objectForKey:@"net"] boolValue];
+ overlayController.useClassicMenu = [[dict objectForKey:@"menu"] boolValue];
+
+ UIWindow *gameWindow;
+ if (IS_DUALHEAD())
+ gameWindow = self.uiwindow;
+ else
+ gameWindow = [[UIApplication sharedApplication] keyWindow];
+ [gameWindow addSubview:overlayController.view];
[overlayController release];
}
// override the direct execution of SDL_main to allow us to implement the frontend (or even using a nib)
-(void) applicationDidFinishLaunching:(UIApplication *)application {
- [application setStatusBarHidden:YES];
-
- UIWindow *uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
-
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+ [application setStatusBarHidden:YES];
+
+ self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+
+ if (IS_IPAD())
self.mainViewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPad" bundle:nil];
else
self.mainViewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPhone" bundle:nil];
- [uiwindow addSubview:self.mainViewController.view];
+ [self.uiwindow addSubview:self.mainViewController.view];
[self.mainViewController release];
- uiwindow.backgroundColor = [UIColor blackColor];
- [uiwindow makeKeyAndVisible];
+ self.uiwindow.backgroundColor = [UIColor blackColor];
+ [self.uiwindow makeKeyAndVisible];
// set working directory to resource path
[[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] resourcePath]];
+
+ // check for dual monitor support
+ if (IS_DUALHEAD()) {
+ 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:@"title.png"];
+ UIImageView *titleView = [[UIImageView alloc] initWithImage:titleImage];
+ titleView.center = self.secondWindow.center;
+ [self.secondWindow addSubview:titleView];
+ [titleView release];
+ [self.secondWindow makeKeyAndVisible];
+ }
}
-(void) applicationWillTerminate:(UIApplication *)application {
- Mix_CloseAudio();
SDL_SendQuit();
-
- if (isInGame) {
+
+ if (self.isInGame) {
HW_terminate(YES);
// hack to prevent automatic termination. See SDL_uikitevents.m for details
longjmp(*(jump_env()), 1);
@@ -150,9 +218,9 @@
}
-(void) applicationWillResignActive:(UIApplication *)application {
- if (isInGame) {
+ if (self.isInGame) {
HW_pause();
-
+
// Send every window on every screen a MINIMIZED event.
SDL_VideoDevice *_this = SDL_GetVideoDevice();
if (!_this)
@@ -169,7 +237,7 @@
}
-(void) applicationDidBecomeActive:(UIApplication *)application {
- if (isInGame) {
+ if (self.isInGame) {
HW_pause();
// Send every window on every screen a RESTORED event.
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SavedGamesViewController.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,38 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 22/09/2010.
+ */
+
+
+#import
+#import "EditableCellView.h"
+
+@interface SavedGamesViewController : UIViewController {
+ UITableView *tableView;
+ NSMutableArray *listOfSavegames;
+}
+
+@property (nonatomic,retain) IBOutlet UITableView *tableView;
+@property (nonatomic,retain) NSMutableArray *listOfSavegames;
+
+-(IBAction) buttonPressed:(id) sender;
+-(IBAction) toggleEdit:(id) sender;
+-(IBAction) clearAll:(id) sender;
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SavedGamesViewController.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,242 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 22/09/2010.
+ */
+
+
+#import "SavedGamesViewController.h"
+#import "SDL_uikitappdelegate.h"
+#import "CommodityFunctions.h"
+
+@implementation SavedGamesViewController
+@synthesize tableView, listOfSavegames;
+
+-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
+ return rotationManager(interfaceOrientation);
+}
+
+-(void) updateTable {
+ NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SAVES_DIRECTORY() error:NULL];
+ NSMutableArray *array = [[NSMutableArray alloc] initWithArray:contentsOfDir copyItems:YES];
+ self.listOfSavegames = array;
+ [array release];
+
+ [self.tableView reloadData];
+}
+
+-(void) viewDidLoad {
+ self.tableView.backgroundView = nil;
+ [super viewDidLoad];
+}
+
+-(void) viewWillAppear:(BOOL)animated {
+ [self updateTable];
+ [super viewWillAppear:animated];
+}
+
+#pragma mark -
+#pragma mark button functions
+-(IBAction) buttonPressed:(id) sender {
+ playSound(@"backSound");
+ [self.tableView setEditing:NO animated:YES];
+ [[self parentViewController] dismissModalViewControllerAnimated:YES];
+}
+
+-(IBAction) toggleEdit:(id) sender {
+ BOOL isEditing = self.tableView.editing;
+ [self.tableView setEditing:!isEditing animated:YES];
+}
+
+-(void) duplicateEntry:(id) sender {
+ UIButton *button = (UIButton *)sender;
+ NSUInteger row = button.tag;
+
+ if (self.listOfSavegames == nil)
+ [self updateTable];
+
+ [(EditableCellView *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:0]] save:nil];
+ NSString *currentSaveName = [self.listOfSavegames objectAtIndex:row];
+ NSString *newSaveName = [[currentSaveName stringByDeletingPathExtension] stringByAppendingFormat:@" %d.hws",[self.listOfSavegames count]];
+
+ NSString *currentFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),currentSaveName];
+ NSString *newFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),newSaveName];
+ [[NSFileManager defaultManager] copyItemAtPath:currentFilePath toPath:newFilePath error:nil];
+ [self.listOfSavegames addObject:newSaveName];
+ [self.listOfSavegames sortUsingSelector:@selector(compare:)];
+
+ //[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:[self.listOfSavegames indexOfObject:newSaveName] inSection:0]] withRowAnimation:UITableViewRowAnimationFade];
+ [self.tableView reloadData];
+}
+
+-(IBAction) clearAll:(id) sender {
+ NSString *titleStr, *cancelStr, *confirmStr;
+ if (IS_IPAD()) {
+ titleStr = nil;
+ cancelStr = nil;
+ confirmStr = NSLocalizedString(@"Tap to confirm",@"");
+ } else {
+ titleStr = NSLocalizedString(@"Are you reeeeeally sure?", @"");
+ cancelStr = NSLocalizedString(@"Well, maybe not...", @"");
+ confirmStr = NSLocalizedString(@"Of course!", @"");
+ }
+
+ UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:titleStr
+ delegate:self
+ cancelButtonTitle:cancelStr
+ destructiveButtonTitle:confirmStr
+ otherButtonTitles:nil];
+ [actionSheet showInView:self.view];
+ [actionSheet release];
+}
+
+-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
+ if ([actionSheet cancelButtonIndex] != buttonIndex) {
+ [[NSFileManager defaultManager] removeItemAtPath:SAVES_DIRECTORY() error:NULL];
+ [[NSFileManager defaultManager] createDirectoryAtPath:SAVES_DIRECTORY() withIntermediateDirectories:NO attributes:nil error:NULL];
+ [self updateTable];
+ }
+}
+
+#pragma mark -
+#pragma mark Table view data source
+-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
+ return 1;
+}
+
+-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+ if (self.listOfSavegames == nil)
+ [self updateTable];
+ return [self.listOfSavegames count];
+}
+
+-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+ static NSString *CellIdentifier = @"Cell";
+
+ if (self.listOfSavegames == nil)
+ [self updateTable];
+ EditableCellView *editableCell = (EditableCellView *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
+ if (editableCell == nil) {
+ editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ editableCell.delegate = self;
+ }
+ editableCell.tag = [indexPath row];
+ editableCell.respectEditing = YES;
+ editableCell.textField.text = [[self.listOfSavegames objectAtIndex:[indexPath row]] stringByDeletingPathExtension];
+ editableCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+
+ UIImage *addImg = [UIImage imageWithContentsOfFile:@"plus.png"];
+ UIButton *customButton = [UIButton buttonWithType:UIButtonTypeContactAdd];
+ customButton.tag = [indexPath row];
+ [customButton setImage:addImg forState:UIControlStateNormal];
+ [customButton addTarget:self action:@selector(duplicateEntry:) forControlEvents:UIControlEventTouchUpInside];
+ editableCell.editingAccessoryView = customButton;
+
+ return (UITableViewCell *)editableCell;
+}
+
+-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger) section {
+ UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 50)];
+ footer.backgroundColor = [UIColor clearColor];
+
+ UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width*80/100, 100)];
+ label.center = CGPointMake(self.tableView.frame.size.width/2,70);
+ label.textAlignment = UITextAlignmentCenter;
+ label.font = [UIFont systemFontOfSize:16];
+ label.textColor = [UIColor lightGrayColor];
+ label.numberOfLines = 5;
+ label.text = NSLocalizedString(@"Games are automatically saved and can be resumed by selecting an entry above.\nYou can modify this list by pressing the 'Edit' button.\nNotice that completed games are deleted, so make backups.",@"");
+
+ label.backgroundColor = [UIColor clearColor];
+ [footer addSubview:label];
+ [label release];
+ return [footer autorelease];
+}
+
+-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
+ NSUInteger row = [indexPath row];
+ [(EditableCellView *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:0]] save:nil];
+
+ if (self.listOfSavegames == nil)
+ [self updateTable];
+
+ NSString *saveName = [self.listOfSavegames objectAtIndex:row];
+ NSString *currentFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),saveName];
+ [[NSFileManager defaultManager] removeItemAtPath:currentFilePath error:nil];
+ [self.listOfSavegames removeObject:saveName];
+
+ [self.tableView reloadData];
+}
+
+#pragma mark -
+#pragma mark Table view delegate
+-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+ [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
+ if (self.listOfSavegames == nil)
+ [self updateTable];
+
+ [(EditableCellView *)[self.tableView cellForRowAtIndexPath:indexPath] save:nil];
+
+ NSString *filePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:[indexPath row]]];
+
+ NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys:
+ filePath,@"savefile",
+ [NSNumber numberWithBool:NO],@"netgame",
+ [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:self.interfaceOrientation] forKey:@"orientation"],@"game_dictionary",
+ nil];
+ [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
+ [self.parentViewController dismissModalViewControllerAnimated:NO];
+}
+
+#pragma mark -
+#pragma mark editableCellView delegate
+// rename old file if names differ
+-(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
+ if (self.listOfSavegames == nil)
+ [self updateTable];
+ NSString *oldFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:tagValue]];
+ NSString *newFilePath = [NSString stringWithFormat:@"%@/%@.hws",SAVES_DIRECTORY(),textString];
+
+ if ([oldFilePath isEqualToString:newFilePath] == NO) {
+ [[NSFileManager defaultManager] moveItemAtPath:oldFilePath toPath:newFilePath error:nil];
+ [self.listOfSavegames replaceObjectAtIndex:tagValue withObject:[textString stringByAppendingString:@".hws"]];
+ }
+
+}
+
+#pragma mark -
+#pragma mark Memory Management
+-(void) didReceiveMemoryWarning {
+ self.listOfSavegames = nil;
+ MSG_MEMCLEAN();
+ [super didReceiveMemoryWarning];
+}
+
+-(void) viewDidUnload {
+ self.tableView = nil;
+ self.listOfSavegames = nil;
+ MSG_DIDUNLOAD();
+ [super viewDidUnload];
+}
+
+-(void) dealloc {
+ [tableView release];
+ [listOfSavegames release];
+ [super dealloc];
+}
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,619 @@
+
+
+
+ 1024
+ 10F569
+ 788
+ 1038.29
+ 461.00
+
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ 117
+
+
+ YES
+
+
+
+ YES
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+
+ YES
+
+ YES
+
+
+ YES
+
+
+
+ YES
+
+ IBFilesOwner
+ IBIPadFramework
+
+
+ IBFirstResponder
+ IBIPadFramework
+
+
+
+ 292
+
+ YES
+
+
+ 292
+ {768, 768}
+
+ NO
+ IBIPadFramework
+
+ NSImage
+ background_med.png
+
+
+
+
+ 290
+ {768, 44}
+
+ NO
+ 458912
+ IBIPadFramework
+
+ YES
+
+ IBIPadFramework
+ 1
+
+ 0
+
+
+ IBIPadFramework
+
+ 5
+
+
+ Clear All
+ IBIPadFramework
+ 1
+
+
+
+ IBIPadFramework
+
+ 2
+
+
+
+
+
+ 274
+ {{0, 44}, {768, 724}}
+
+
+ 1
+ MCAwIDAgMAA
+
+ YES
+ IBIPadFramework
+ YES
+ 1
+ 2
+ 0
+ YES
+ 44
+ 10
+ 10
+
+
+ {768, 768}
+
+
+ 3
+ MQA
+
+ NO
+
+ 3
+
+ IBIPadFramework
+
+
+
+
+ YES
+
+
+ view
+
+
+
+ 3
+
+
+
+ buttonPressed:
+
+
+
+ 6
+
+
+
+ dataSource
+
+
+
+ 8
+
+
+
+ delegate
+
+
+
+ 9
+
+
+
+ tableView
+
+
+
+ 10
+
+
+
+ toggleEdit:
+
+
+
+ 14
+
+
+
+ clearAll:
+
+
+
+ 16
+
+
+
+
+ YES
+
+ 0
+
+
+
+
+
+ -1
+
+
+ File's Owner
+
+
+ -2
+
+
+
+
+ 2
+
+
+ YES
+
+
+
+
+
+
+
+ 4
+
+
+ YES
+
+
+
+
+
+
+
+
+ 5
+
+
+
+
+ 7
+
+
+
+
+ 11
+
+
+
+
+ 12
+
+
+
+
+ 13
+
+
+
+
+ 15
+
+
+
+
+
+
+ YES
+
+ YES
+ -1.CustomClassName
+ -2.CustomClassName
+ 11.IBPluginDependency
+ 12.IBPluginDependency
+ 13.IBPluginDependency
+ 15.IBPluginDependency
+ 2.IBEditorWindowLastContentRect
+ 2.IBPluginDependency
+ 4.IBPluginDependency
+ 5.IBPluginDependency
+ 7.IBPluginDependency
+
+
+ YES
+ SavedGamesViewController
+ UIResponder
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ {{467, 276}, {768, 768}}
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+
+
+ YES
+
+
+ YES
+
+
+
+
+ YES
+
+
+ YES
+
+
+
+ 16
+
+
+
+ YES
+
+ SavedGamesViewController
+ UIViewController
+
+ YES
+
+ YES
+ buttonPressed:
+ clearAll:
+ toggleEdit:
+
+
+ YES
+ id
+ id
+ id
+
+
+
+ YES
+
+ YES
+ buttonPressed:
+ clearAll:
+ toggleEdit:
+
+
+ YES
+
+ buttonPressed:
+ id
+
+
+ clearAll:
+ id
+
+
+ toggleEdit:
+ id
+
+
+
+
+ tableView
+ UITableView
+
+
+ tableView
+
+ tableView
+ UITableView
+
+
+
+ IBProjectSource
+ Classes/SavedGamesViewController.h
+
+
+
+
+ YES
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSError.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSFileManager.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueCoding.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueObserving.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyedArchiver.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSObject.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSRunLoop.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSThread.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURL.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURLConnection.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CAAnimation.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CALayer.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIAccessibility.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINibLoading.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIResponder.h
+
+
+
+ UIBarButtonItem
+ UIBarItem
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIBarButtonItem.h
+
+
+
+ UIBarItem
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIBarItem.h
+
+
+
+ UIImageView
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIImageView.h
+
+
+
+ UIResponder
+ NSObject
+
+
+
+ UIScrollView
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIScrollView.h
+
+
+
+ UISearchBar
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchBar.h
+
+
+
+ UISearchDisplayController
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchDisplayController.h
+
+
+
+ UITableView
+ UIScrollView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITableView.h
+
+
+
+ UIToolbar
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIToolbar.h
+
+
+
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITextField.h
+
+
+
+ UIView
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIView.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINavigationController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIPopoverController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISplitViewController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITabBarController.h
+
+
+
+ UIViewController
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIViewController.h
+
+
+
+
+ 0
+ IBIPadFramework
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS
+
+
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3
+
+
+ YES
+ ../Hedgewars.xcodeproj
+ 3
+
+ background_med.png
+ {768, 768}
+
+ 117
+
+
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.h
--- a/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// SchemeSettingsViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 19/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 19/04/2010.
+ */
+
#import
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m
--- a/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// SchemeSettingsViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 19/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 19/04/2010.
+ */
+
#import "SchemeSettingsViewController.h"
#import "CommodityFunctions.h"
@@ -21,24 +34,23 @@
#pragma mark View lifecycle
-(void) viewDidLoad {
[super viewDidLoad];
-
- UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Edit",@"from the scheme panel")
+
+ UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Edit",@"")
style:UIBarButtonItemStyleBordered
target:self
action:@selector(toggleEdit:)];
self.navigationItem.rightBarButtonItem = editButton;
[editButton release];
-
}
-(void) viewWillAppear:(BOOL) animated {
[super viewWillAppear:animated];
-
+
NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SCHEMES_DIRECTORY() error:NULL];
NSMutableArray *array = [[NSMutableArray alloc] initWithArray:contentsOfDir copyItems:YES];
self.listOfSchemes = array;
[array release];
-
+
[self.tableView reloadData];
}
@@ -46,7 +58,7 @@
-(void) toggleEdit:(id) sender {
BOOL isEditing = self.tableView.editing;
[self.tableView setEditing:!isEditing animated:YES];
-
+
if (isEditing) {
[self.navigationItem.rightBarButtonItem setTitle:NSLocalizedString(@"Edit",@"from the scheme panel")];
[self.navigationItem.rightBarButtonItem setStyle: UIBarButtonItemStyleBordered];
@@ -65,15 +77,15 @@
-(void) addScheme:(id) sender {
NSString *fileName = [[NSString alloc] initWithFormat:@"Scheme %u.plist", [self.listOfSchemes count]];
-
+
createSchemeNamed([fileName stringByDeletingPathExtension]);
-
+
[self.listOfSchemes addObject:fileName];
[fileName release];
-
+
// order the array alphabetically, so schemes will keep their position
[self.listOfSchemes sortUsingSelector:@selector(compare:)];
-
+
[self.tableView reloadData];
}
@@ -89,28 +101,28 @@
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
-
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
-
- NSUInteger row = [indexPath row];
- NSString *rowString = [[self.listOfSchemes objectAtIndex:row] stringByDeletingPathExtension];
- cell.textLabel.text = rowString;
+
+ NSUInteger row = [indexPath row];
+ NSString *rowString = [[self.listOfSchemes objectAtIndex:row] stringByDeletingPathExtension];
+ cell.textLabel.text = rowString;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
-
+
return cell;
}
// delete the row and the file
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
-
+
NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@",SCHEMES_DIRECTORY(),[self.listOfSchemes objectAtIndex:row]];
[[NSFileManager defaultManager] removeItemAtPath:schemeFile error:NULL];
[schemeFile release];
-
+
[self.listOfSchemes removeObjectAtIndex:row];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
@@ -121,10 +133,10 @@
if (childController == nil) {
childController = [[SingleSchemeViewController alloc] initWithStyle:UITableViewStyleGrouped];
}
-
+
NSInteger row = [indexPath row];
NSString *selectedSchemeFile = [self.listOfSchemes objectAtIndex:row];
-
+
// this must be set so childController can load the correct plist
childController.schemeName = [selectedSchemeFile stringByDeletingPathExtension];
[childController.tableView setContentOffset:CGPointMake(0,0) animated:NO];
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.h
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// SchemeWeaponConfigViewController.h
-// Hedgewars
-//
-// Created by Vittorio on 13/06/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 13/06/2010.
+ */
+
#import
@@ -12,7 +25,7 @@
@interface SchemeWeaponConfigViewController : UITableViewController {
NSArray *listOfSchemes;
NSArray *listOfWeapons;
-
+
NSIndexPath *lastIndexPath_sc;
NSIndexPath *lastIndexPath_we;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,13 +1,27 @@
-//
-// SchemeWeaponConfigViewController.m
-// Hedgewars
-//
-// Created by Vittorio on 13/06/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 13/06/2010.
+ */
+
#import "SchemeWeaponConfigViewController.h"
#import "CommodityFunctions.h"
+#import "SDL_uikitappdelegate.h"
@implementation SchemeWeaponConfigViewController
@synthesize listOfSchemes, listOfWeapons, lastIndexPath_sc, lastIndexPath_we, selectedScheme, selectedWeapon;
@@ -23,15 +37,13 @@
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
-
- self.selectedScheme = @"";
- self.selectedWeapon = @"";
-
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- [self.tableView setBackgroundView:nil];
- self.view.backgroundColor = [UIColor clearColor];
- self.tableView.separatorColor = [UIColor colorWithRed:(CGFloat)0xFE/255 green:(CGFloat)0xCB/255 blue:0 alpha:1];
- }
+
+ self.selectedScheme = nil;
+ self.selectedWeapon = nil;
+
+ [self.tableView setBackgroundView:nil];
+ self.view.backgroundColor = [UIColor clearColor];
+ self.tableView.separatorColor = UICOLOR_HW_YELLOW_BODER;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
@@ -40,16 +52,16 @@
NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SCHEMES_DIRECTORY() error:NULL];
self.listOfSchemes = contentsOfDir;
-
- if ([listOfSchemes containsObject:@"Default.plist"])
- self.selectedScheme = @"Default.plist";
+
+ if (self.selectedScheme == nil && [listOfSchemes containsObject:@"Default.plist"])
+ self.selectedScheme = @"Default.plist";
contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:WEAPONS_DIRECTORY() error:NULL];
self.listOfWeapons = contentsOfDir;
-
- if ([listOfWeapons containsObject:@"Default.plist"])
- self.selectedWeapon = @"Default.plist";
-
+
+ if (self.selectedWeapon == nil && [listOfWeapons containsObject:@"Default.plist"])
+ self.selectedWeapon = @"Default.plist";
+
[self.tableView reloadData];
}
@@ -61,7 +73,7 @@
}
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- if (section == 0)
+ if (section == 0)
return [self.listOfSchemes count];
else
return [self.listOfWeapons count];
@@ -71,29 +83,63 @@
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
NSInteger row = [indexPath row];
-
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
- }
-
- cell.accessoryType = UITableViewCellAccessoryNone;
+ if (cell == nil)
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
+
+ cell.accessoryView = nil;
if ([indexPath section] == 0) {
cell.textLabel.text = [[self.listOfSchemes objectAtIndex:row] stringByDeletingPathExtension];
+ NSString *str = [NSString stringWithFormat:@"%@/%@",SCHEMES_DIRECTORY(),[self.listOfSchemes objectAtIndex:row]];
+ NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:str];
+ cell.detailTextLabel.text = [dict objectForKey:@"description"];
+ [dict release];
if ([[self.listOfSchemes objectAtIndex:row] isEqualToString:self.selectedScheme]) {
- cell.accessoryType = UITableViewCellAccessoryCheckmark;
+ UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
+ cell.accessoryView = checkbox;
+ [checkbox release];
self.lastIndexPath_sc = indexPath;
}
} else {
cell.textLabel.text = [[self.listOfWeapons objectAtIndex:row] stringByDeletingPathExtension];
+ NSString *str = [NSString stringWithFormat:@"%@/%@",WEAPONS_DIRECTORY(),[self.listOfWeapons objectAtIndex:row]];
+ NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:str];
+ cell.detailTextLabel.text = [dict objectForKey:@"description"];
+ [dict release];
if ([[self.listOfWeapons objectAtIndex:row] isEqualToString:self.selectedWeapon]) {
- cell.accessoryType = UITableViewCellAccessoryCheckmark;
+ UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
+ cell.accessoryView = checkbox;
+ [checkbox release];
self.lastIndexPath_we = indexPath;
}
}
+
+ cell.backgroundColor = [UIColor blackColor];
+ cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
+ cell.detailTextLabel.textColor = [UIColor whiteColor];
return cell;
}
+-(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
+ return 40.0;
+}
+
+-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
+ CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
+ NSString *text;
+ if (section == 0)
+ text = NSLocalizedString(@"Schemes",@"");
+ else
+ text = NSLocalizedString(@"Weapons",@"");
+ UILabel *theLabel = createBlueLabel(text, frame);
+ theLabel.center = CGPointMake(self.view.frame.size.width/2, 20);
+
+ UIView *theView = [[[UIView alloc] init] autorelease];
+ [theView addSubview:theLabel];
+ [theLabel release];
+ return theView;
+}
#pragma mark -
#pragma mark Table view delegate
@@ -103,44 +149,43 @@
lastIndexPath = self.lastIndexPath_sc;
else
lastIndexPath = self.lastIndexPath_we;
-
+
int newRow = [indexPath row];
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
-
+
if (newRow != oldRow) {
//TODO: this code works only for a single section table
UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath];
- newCell.accessoryType = UITableViewCellAccessoryCheckmark;
+ UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
+ newCell.accessoryView = checkbox;
+ [checkbox release];
UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:lastIndexPath];
- oldCell.accessoryType = UITableViewCellAccessoryNone;
-
+ oldCell.accessoryView = nil;
+
if ([indexPath section] == 0) {
self.lastIndexPath_sc = indexPath;
self.selectedScheme = [self.listOfSchemes objectAtIndex:newRow];
} else {
self.lastIndexPath_we = indexPath;
self.selectedWeapon = [self.listOfWeapons objectAtIndex:newRow];
- }
-
+ }
+
[aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
}
[aTableView deselectRowAtIndexPath:indexPath animated:YES];
}
--(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger) section {
- if (section == 0) {
- return NSLocalizedString(@"Schemes",@"");
- } else {
- return NSLocalizedString(@"Weapons",@"");;
- }
-}
-
#pragma mark -
#pragma mark Memory management
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+ if ([[SDLUIKitDelegate sharedAppDelegate] isInGame]) {
+ self.lastIndexPath_sc = nil;
+ self.lastIndexPath_we = nil;
+ self.listOfSchemes = nil;
+ self.listOfWeapons = nil;
+ MSG_MEMCLEAN();
+ }
[super didReceiveMemoryWarning];
- // Relinquish ownership any cached data, images, etc that aren't in use.
}
-(void) viewDidUnload {
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SingleSchemeViewController.h
--- a/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,23 +1,36 @@
-//
-// SingleSchemeViewController.h
-// Hedgewars
-//
-// Created by Vittorio on 23/05/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 23/05/2010.
+ */
+
#import
#import "EditableCellView.h"
@interface SingleSchemeViewController : UITableViewController {
NSString *schemeName;
- NSMutableArray *schemeArray;
+ NSMutableDictionary *schemeDictionary;
NSArray *basicSettingList;
NSArray *gameModifierArray;
}
@property (nonatomic, retain) NSString *schemeName;
-@property (nonatomic, retain) NSMutableArray *schemeArray;
+@property (nonatomic, retain) NSMutableDictionary *schemeDictionary;
@property (nonatomic, retain) NSArray *basicSettingList;
@property (nonatomic, retain) NSArray *gameModifierArray;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m
--- a/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// SingleSchemeViewController.m
-// Hedgewars
-//
-// Created by Vittorio on 23/05/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 23/05/2010.
+ */
+
#import "SingleSchemeViewController.h"
#import
@@ -13,9 +26,10 @@
#define LABEL_TAG 12345
#define SLIDER_TAG 54321
+#define SWITCH_TAG 67890
@implementation SingleSchemeViewController
-@synthesize schemeName, schemeArray, basicSettingList, gameModifierArray;
+@synthesize schemeName, schemeDictionary, basicSettingList, gameModifierArray;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
return rotationManager(interfaceOrientation);
@@ -25,121 +39,59 @@
#pragma mark View lifecycle
-(void) viewDidLoad {
[super viewDidLoad];
+ NSString *path = nil;
- NSArray *mods = [[NSArray alloc] initWithObjects:
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Fort Mode",@""),@"title",
- NSLocalizedString(@"Defend your fort and destroy the opponents (two team colours max)",@""),@"description",
- @"Forts",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Divide Team",@""),@"title",
- NSLocalizedString(@"Teams will start on opposite sides of the terrain (two team colours max)",@""),@"description",
- @"TeamsDivide",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Solid Land",@""),@"title",
- NSLocalizedString(@"Land can not be destroyed",@""),@"description",
- @"Solid",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Add Border",@""),@"title",
- NSLocalizedString(@"Add an indestructable border around the terrain",@""),@"description",
- @"Border",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Low Gravity",@""),@"title",
- NSLocalizedString(@"Lower gravity",@""),@"description",
- @"LowGravity",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Laser Sight",@""),@"title",
- NSLocalizedString(@"Assisted aiming with laser sight",@""),@"description",
- @"LaserSight",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Invulnerable",@""),@"title",
- NSLocalizedString(@"All hogs have a personal forcefield",@""),@"description",
- @"Invulnerable",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Add Mines",@""),@"title",
- NSLocalizedString(@"Enable random mines",@""),@"description",
- @"Mines",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Vampirism Mode",@""),@"title",
- NSLocalizedString(@"Gain 80% of the damage you do back in health",@""),@"description",
- @"Vampiric",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Karma Mode",@""),@"title",
- NSLocalizedString(@"Share your opponents pain, share their damage",@""),@"description",
- @"Karma",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Artillery Mode",@""),@"title",
- NSLocalizedString(@"Your hogs are unable to move, test your aim",@""),@"description",
- @"Artillery",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Random Order",@""),@"title",
- NSLocalizedString(@"Order of play is random instead of in room order",@""),@"description",
- @"RandomOrder",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"King Mode",@""),@"title",
- NSLocalizedString(@"Play with a King. If he dies, your side loses",@""),@"description",
- @"King",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys: NSLocalizedString(@"Place Hedgehogs",@""),@"title",
- NSLocalizedString(@"Take turns placing your hedgehogs pre-game",@""),@"description",
- @"PlaceHog",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Clan Shares Ammo",@""),@"title",
- NSLocalizedString(@"Ammo is shared between all clan teams",@""),@"description",
- @"SharedAmmo",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Disable Girders",@""),@"title",
- NSLocalizedString(@"Disable girders when generating random maps",@""),@"description",
- @"DisableGirders",@"image",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Disable Land Objects",@""),@"title",
- NSLocalizedString(@"Disable land objects when generating maps",@""),@"description",
- @"DisableLandObjects",@"image",nil],
- nil];
+ // title, description, image name (+btn)
+ path = [NSString stringWithFormat:@"%@/gameFlags_en.plist",IFRONTEND_DIRECTORY()];
+ NSArray *mods = [[NSArray alloc] initWithContentsOfFile:path];
self.gameModifierArray = mods;
[mods release];
-
- NSArray *basicSettings = [[NSArray alloc] initWithObjects:
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Damage Modifier",@""),@"title",@"Damage",@"image",
- [NSNumber numberWithInt:100],@"default",[NSNumber numberWithInt:10],@"min",[NSNumber numberWithInt:300],@"max",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Turn Time",@""),@"title",@"Time",@"image",
- [NSNumber numberWithInt:45],@"default",[NSNumber numberWithInt:1],@"min",[NSNumber numberWithInt:99],@"max",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Initial Health",@""),@"title",@"Health",@"image",
- [NSNumber numberWithInt:100],@"default",[NSNumber numberWithInt:50],@"min",[NSNumber numberWithInt:200],@"max",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Sudden Death Timeout",@""),@"title",@"SuddenDeath",@"image",
- [NSNumber numberWithInt:15],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:50],@"max",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Crate Drops",@""),@"title",@"Box",@"image",
- [NSNumber numberWithInt:5],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:9],@"max",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Mines Time",@""),@"title",@"Time",@"image",
- [NSNumber numberWithInt:3],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:3],@"max",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Mines Number",@""),@"title",@"Mine",@"image",
- [NSNumber numberWithInt:4],@"default",[NSNumber numberWithInt:1],@"min",[NSNumber numberWithInt:80],@"max",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Dud Mines Probability",@""),@"title",@"Dud",@"image",
- [NSNumber numberWithInt:0],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:100],@"max",nil],
- [NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Explosives",@""),@"title",@"Damage",@"image",
- [NSNumber numberWithInt:2],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:40],@"max",nil],
- nil];
+
+ // title, image name (+icon), default value, max value, min value
+ path = [NSString stringWithFormat:@"%@/basicFlags_en.plist",IFRONTEND_DIRECTORY()];
+ NSArray *basicSettings = [[NSArray alloc] initWithContentsOfFile:path];
self.basicSettingList = basicSettings;
[basicSettings release];
-
+
self.title = NSLocalizedString(@"Edit scheme preferences",@"");
}
// load from file
-(void) viewWillAppear:(BOOL) animated {
[super viewWillAppear:animated];
-
+
NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName];
- NSMutableArray *scheme = [[NSMutableArray alloc] initWithContentsOfFile:schemeFile];
+ NSMutableDictionary *scheme = [[NSMutableDictionary alloc] initWithContentsOfFile:schemeFile];
[schemeFile release];
- self.schemeArray = scheme;
+ self.schemeDictionary = scheme;
[scheme release];
-
+
[self.tableView reloadData];
}
// save to file
-(void) viewWillDisappear:(BOOL) animated {
[super viewWillDisappear:animated];
-
+
NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName];
- [self.schemeArray writeToFile:schemeFile atomically:YES];
+ [self.schemeDictionary writeToFile:schemeFile atomically:YES];
[schemeFile release];
}
#pragma mark -
#pragma mark editableCellView delegate
// set the new value
--(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
- // delete old file
- [[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName] error:NULL];
- // update filename
- self.schemeName = textString;
- // save new file
- [self.schemeArray writeToFile:[NSString stringWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName] atomically:YES];
+-(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
+ if (tagValue == 0) {
+ // delete old file
+ [[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName] error:NULL];
+ // update filename
+ self.schemeName = textString;
+ // save new file
+ [self.schemeDictionary writeToFile:[NSString stringWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName] atomically:YES];
+ } else {
+ [self.schemeDictionary setObject:textString forKey:@"description"];
+ }
}
#pragma mark -
@@ -151,13 +103,13 @@
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
switch (section) {
case 0:
- return 1;
+ return 2;
break;
case 1:
- return [self.basicSettingList count];
+ return [[self.schemeDictionary objectForKey:@"basic"] count];
break;
case 2:
- return [self.gameModifierArray count];
+ return [[self.schemeDictionary objectForKey:@"gamemod"] count];
default:
break;
}
@@ -168,47 +120,53 @@
static NSString *CellIdentifier0 = @"Cell0";
static NSString *CellIdentifier1 = @"Cell1";
static NSString *CellIdentifier2 = @"Cell2";
-
+
UITableViewCell *cell = nil;
EditableCellView *editableCell = nil;
NSInteger row = [indexPath row];
-
+
switch ([indexPath section]) {
case 0:
editableCell = (EditableCellView *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier0];
if (editableCell == nil) {
- editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault
+ editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier0] autorelease];
editableCell.delegate = self;
}
-
- editableCell.textField.text = self.schemeName;
+ editableCell.tag = row;
+ editableCell.selectionStyle = UITableViewCellSelectionStyleNone;
+ editableCell.imageView.image = nil;
editableCell.detailTextLabel.text = nil;
- editableCell.imageView.image = nil;
- editableCell.selectionStyle = UITableViewCellSelectionStyleNone;
+
+ if (row == 0) {
+ editableCell.textField.text = self.schemeName;
+ } else {
+ editableCell.minimumCharacters = 0;
+ editableCell.textField.font = [UIFont systemFontOfSize:[UIFont labelFontSize]];
+ editableCell.textField.text = [self.schemeDictionary objectForKey:@"description"];
+ editableCell.textField.placeholder = NSLocalizedString(@"You can add a description if you wish",@"");
+ }
cell = editableCell;
break;
case 1:
cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier1];
NSDictionary *detail = [self.basicSettingList objectAtIndex:row];
// need to offset this section (see format in CommodityFunctions.m and above)
- NSInteger gmSize = [self.gameModifierArray count];
if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
reuseIdentifier:CellIdentifier1] autorelease];
-
+
int offset = 0;
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+ if (IS_IPAD())
offset = 50;
-
+
UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(offset+260, 12, offset+150, 23)];
slider.maximumValue = [[detail objectForKey:@"max"] floatValue];
slider.minimumValue = [[detail objectForKey:@"min"] floatValue];
- slider.tag = row+gmSize;
[slider addTarget:self action:@selector(sliderChanged:) forControlEvents:UIControlEventValueChanged];
[cell.contentView addSubview:slider];
[slider release];
-
+
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(50, 7, 200, 30)];
label.tag = LABEL_TAG;
label.backgroundColor = [UIColor clearColor];
@@ -216,23 +174,35 @@
[cell.contentView addSubview:label];
[label release];
}
-
+
UIImage *img = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/icon%@.png",BTN_DIRECTORY(),[[self.basicSettingList objectAtIndex:row] objectForKey:@"image"]]];
cell.imageView.image = img;
[img release];
-
+
UILabel *cellLabel = (UILabel *)[cell.contentView viewWithTag:LABEL_TAG];
cellLabel.text = [[self.basicSettingList objectAtIndex:row] objectForKey:@"title"];
+
+ // can't use the viewWithTag method because row is dynamic
+ UISlider *cellSlider = nil;
+ for (UIView *oneView in cell.contentView.subviews) {
+ if ([oneView isMemberOfClass:[UISlider class]]) {
+ cellSlider = (UISlider *)oneView;
+ break;
+ }
+ }
+ cellSlider.tag = SLIDER_TAG + row;
+ cellSlider.value = [[[self.schemeDictionary objectForKey:@"basic"] objectAtIndex:row] floatValue];
+
+ // forced to use this weird format otherwise the label disappears when size of the text is bigger than the original
+ NSString *prestring = [NSString stringWithFormat:@"%d",(NSInteger) cellSlider.value];
+ // turntime 100 means unlimited time turns (set in GameSetup)
+ if (row == 1 && (NSInteger) cellSlider.value == 100)
+ prestring = @"∞";
- UISlider *cellSlider = (UISlider *)[cell.contentView viewWithTag:row+gmSize];
- cellSlider.value = [[self.schemeArray objectAtIndex:row+gmSize] floatValue];
-
- // forced to use this weird format otherwise the label disappears when size of the text is bigger than the original
- NSString *prestring = [NSString stringWithFormat:@"%d",[[self.schemeArray objectAtIndex:row+gmSize] intValue]];
while ([prestring length] <= 4)
prestring = [NSString stringWithFormat:@" %@",prestring];
cell.detailTextLabel.text = prestring;
-
+
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
break;
case 2:
@@ -241,48 +211,54 @@
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier2] autorelease];
UISwitch *onOff = [[UISwitch alloc] init];
- onOff.tag = row;
[onOff addTarget:self action:@selector(toggleSwitch:) forControlEvents:UIControlEventValueChanged];
cell.accessoryView = onOff;
[onOff release];
}
+
+ UISwitch *switcher = (UISwitch *)cell.accessoryView;
+ switcher.tag = SWITCH_TAG + row;
+ [switcher setOn:[[[self.schemeDictionary objectForKey:@"gamemod"] objectAtIndex:row] boolValue] animated:NO];
UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/btn%@.png",BTN_DIRECTORY(),[[self.gameModifierArray objectAtIndex:row] objectForKey:@"image"]]];
cell.imageView.image = image;
[image release];
[cell.imageView.layer setCornerRadius:7.0f];
- [cell.imageView.layer setBorderWidth:1];
[cell.imageView.layer setMasksToBounds:YES];
cell.textLabel.text = [[self.gameModifierArray objectAtIndex:row] objectForKey:@"title"];
cell.detailTextLabel.text = [[self.gameModifierArray objectAtIndex:row] objectForKey:@"description"];
- [(UISwitch *)cell.accessoryView setOn:[[self.schemeArray objectAtIndex:row] boolValue] animated:NO];
-
+ cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
+ cell.detailTextLabel.minimumFontSize = 6;
+
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
-
+
return cell;
}
-(void) toggleSwitch:(id) sender {
UISwitch *theSwitch = (UISwitch *)sender;
- [self.schemeArray replaceObjectAtIndex:theSwitch.tag withObject:[NSNumber numberWithBool:theSwitch.on]];
+ NSMutableArray *array = [self.schemeDictionary objectForKey:@"gamemod"];
+ [array replaceObjectAtIndex:theSwitch.tag-SWITCH_TAG withObject:[NSNumber numberWithBool:theSwitch.on]];
}
-(void) sliderChanged:(id) sender {
- // need to offset this section (see format in CommodityFunctions.m and above)
- NSInteger gmSize = [self.gameModifierArray count];
// the slider that changed is sent as object
UISlider *theSlider = (UISlider *)sender;
// create the indexPath of the row of the slider
- NSIndexPath *indexPath = [NSIndexPath indexPathForRow:theSlider.tag-gmSize inSection:1];
+ NSIndexPath *indexPath = [NSIndexPath indexPathForRow:theSlider.tag-SLIDER_TAG inSection:1];
// get its cell
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
// grab the associated label
UILabel *label = (UILabel *)cell.detailTextLabel;
// modify it
- label.text = [NSString stringWithFormat:@"%d",(int)theSlider.value];
- // save changes in the main array (remember that you need to offset it)
- [self.schemeArray replaceObjectAtIndex:theSlider.tag withObject:[NSNumber numberWithInt:(int)theSlider.value]];
+ if ([indexPath row] == 1 && [indexPath section] == 1 && (NSInteger) theSlider.value == 100)
+ label.text = @"∞";
+ else
+ label.text = [NSString stringWithFormat:@"%d",(NSInteger) theSlider.value];
+ // save changes in the main array
+ NSMutableArray *array = [self.schemeDictionary objectForKey:@"basic"];
+ [array replaceObjectAtIndex:theSlider.tag-SLIDER_TAG withObject:[NSNumber numberWithInt:(NSInteger) theSlider.value]];
}
#pragma mark -
@@ -291,14 +267,14 @@
UITableViewCell *cell = [aTableView cellForRowAtIndexPath:indexPath];
EditableCellView *editableCell = nil;
UISlider *cellSlider = nil;
-
+
switch ([indexPath section]) {
case 0:
editableCell = (EditableCellView *)cell;
[editableCell replyKeyboard];
break;
case 1:
- cellSlider = (UISlider *)[cell.contentView viewWithTag:[indexPath row]+[self.gameModifierArray count]];
+ cellSlider = (UISlider *)[cell.contentView viewWithTag:[indexPath row]+SLIDER_TAG];
[cellSlider setValue:[[[self.basicSettingList objectAtIndex:[indexPath row]] objectForKey:@"default"] floatValue] animated:YES];
[self sliderChanged:cellSlider];
//cell.detailTextLabel.text = [[[self.basicSettingList objectAtIndex:[indexPath row]] objectForKey:@"default"] stringValue];
@@ -311,7 +287,7 @@
default:
break;
}
-
+
[aTableView deselectRowAtIndexPath:indexPath animated:YES];
}
@@ -338,11 +314,13 @@
#pragma mark Memory management
-(void) didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
+ self.basicSettingList = nil;
+ self.gameModifierArray = nil;
}
-(void) viewDidUnload {
self.schemeName = nil;
- self.schemeArray = nil;
+ self.schemeDictionary = nil;
self.basicSettingList = nil;
self.gameModifierArray = nil;
MSG_DIDUNLOAD();
@@ -351,7 +329,7 @@
-(void) dealloc {
[schemeName release];
- [schemeArray release];
+ [schemeDictionary release];
[basicSettingList release];
[gameModifierArray release];
[super dealloc];
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SingleTeamViewController.h
--- a/project_files/HedgewarsMobile/Classes/SingleTeamViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleTeamViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// SingleTeamViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import
#import "EditableCellView.h"
@@ -18,13 +31,14 @@
@interface SingleTeamViewController : UITableViewController {
NSMutableDictionary *teamDictionary;
-
+
NSString *teamName;
UIImage *normalHogSprite;
-
+
NSArray *secondaryItems;
+ NSArray *moreSecondaryItems;
BOOL isWriteNeeded;
-
+
HogHatViewController *hogHatViewController;
GravesViewController *gravesViewController;
VoicesViewController *voicesViewController;
@@ -37,6 +51,7 @@
@property (nonatomic,retain) NSString *teamName;
@property (nonatomic,retain) UIImage *normalHogSprite;
@property (nonatomic,retain) NSArray *secondaryItems;
+@property (nonatomic,retain) NSArray *moreSecondaryItems;
-(void) writeFile;
-(void) setWriteNeeded;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SingleTeamViewController.m
--- a/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// SingleTeamViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import "SingleTeamViewController.h"
#import "HogHatViewController.h"
@@ -15,11 +28,12 @@
#import "LevelViewController.h"
#import "CommodityFunctions.h"
#import "UIImageExtra.h"
+#import "PascalImports.h"
#define TEAMNAME_TAG 78789
@implementation SingleTeamViewController
-@synthesize teamDictionary, normalHogSprite, secondaryItems, teamName;
+@synthesize teamDictionary, normalHogSprite, secondaryItems, moreSecondaryItems, teamName;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
return rotationManager(interfaceOrientation);
@@ -48,7 +62,7 @@
#pragma mark View lifecycle
-(void) viewDidLoad {
[super viewDidLoad];
-
+
// labels for the entries
NSArray *array = [[NSArray alloc] initWithObjects:
NSLocalizedString(@"Grave",@""),
@@ -58,6 +72,16 @@
NSLocalizedString(@"Level",@""),nil];
self.secondaryItems = array;
[array release];
+
+ // labels for the subtitles
+ NSArray *moreArray = [[NSArray alloc] initWithObjects:
+ NSLocalizedString(@"Mark the death of your fallen warriors",@""),
+ NSLocalizedString(@"Pick a slang your hogs will speak",@""),
+ NSLocalizedString(@"Select the team invincible fortress (only valid for fort games)",@""),
+ NSLocalizedString(@"Choose a charismatic symbol for your team",@""),
+ NSLocalizedString(@"Opt for controlling the team or let the AI lead",@""),nil];
+ self.moreSecondaryItems = moreArray;
+ [moreArray release];
// load the base hog image, drawing will occure in cellForRow...
NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()];
@@ -65,27 +89,27 @@
[normalHogFile release];
self.normalHogSprite = hogSprite;
[hogSprite release];
-
+
// listen if any childController modifies the plist and write it if needed
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setWriteNeeded) name:@"setWriteNeedTeams" object:nil];
isWriteNeeded = NO;
-
+
self.title = NSLocalizedString(@"Edit team settings",@"");
}
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
-
+
// load data about the team and write if there has been a change from other childControllers
- if (isWriteNeeded)
+ if (isWriteNeeded)
[self writeFile];
-
+
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),self.teamName];
NSMutableDictionary *teamDict = [[NSMutableDictionary alloc] initWithContentsOfFile:teamFile];
self.teamDictionary = teamDict;
[teamDict release];
[teamFile release];
-
+
[self.tableView reloadData];
}
@@ -93,7 +117,7 @@
-(void) viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
- if (isWriteNeeded)
+ if (isWriteNeeded)
[self writeFile];
}
@@ -108,7 +132,7 @@
[self.teamDictionary writeToFile:teamFile atomically:YES];
[teamFile release];
- DLog(@"%@",teamDictionary);
+ //DLog(@"%@",teamDictionary);
isWriteNeeded = NO;
}
@@ -125,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];
@@ -159,23 +183,23 @@
static NSString *CellIdentifier0 = @"Cell0";
static NSString *CellIdentifier1 = @"Cell1";
static NSString *CellIdentifier2 = @"Cell2";
-
+
NSArray *hogArray;
UITableViewCell *cell = nil;
EditableCellView *editableCell = nil;
NSInteger row = [indexPath row];
UIImage *accessoryImage;
-
+
switch ([indexPath section]) {
case 0:
editableCell = (EditableCellView *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier0];
if (editableCell == nil) {
- editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault
+ editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier0] autorelease];
editableCell.delegate = self;
editableCell.tag = TEAMNAME_TAG;
}
-
+
editableCell.imageView.image = nil;
editableCell.accessoryType = UITableViewCellAccessoryNone;
editableCell.textField.text = self.teamName;
@@ -185,34 +209,35 @@
case 1:
editableCell = (EditableCellView *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
if (editableCell == nil) {
- editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault
+ editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier1] autorelease];
editableCell.delegate = self;
editableCell.tag = [indexPath row];
}
-
+
hogArray = [self.teamDictionary objectForKey:@"hedgehogs"];
-
+
// draw the hat on top of the hog
NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@.png", HATS_DIRECTORY(), [[hogArray objectAtIndex:row] objectForKey:@"hat"]];
UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)];
[hatFile release];
- editableCell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, -5)];
+ editableCell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, 5)];
[hatSprite release];
-
+
editableCell.textField.text = [[hogArray objectAtIndex:row] objectForKey:@"hogname"];
editableCell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
-
+
cell = editableCell;
break;
case 2:
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier2];
if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier2] autorelease];
}
-
+
cell.textLabel.text = [self.secondaryItems objectAtIndex:row];
+ cell.detailTextLabel.text = [self.moreSecondaryItems objectAtIndex:row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
switch (row) {
case 0: // grave
@@ -222,17 +247,22 @@
cell.imageView.image = accessoryImage;
[accessoryImage release];
break;
- case 2: // fort
- accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@L.png",
- FORTS_DIRECTORY(),[teamDictionary objectForKey:@"fort"]]];
- cell.imageView.image = [accessoryImage scaleToSize:CGSizeMake(42, 42)];
+ case 1: // voice
+ accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/HellishBomb.png",
+ GRAPHICS_DIRECTORY()]];
+ cell.imageView.image = accessoryImage;
[accessoryImage release];
break;
-
+ case 2: // fort
+ accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@-preview.png",
+ FORTS_DIRECTORY(),[teamDictionary objectForKey:@"fort"]]];
+ cell.imageView.image = [accessoryImage scaleToSize:CGSizeMake(32, 32)];
+ [accessoryImage release];
+ break;
case 3: // flags
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png",
FLAGS_DIRECTORY(),[teamDictionary objectForKey:@"flag"]]];
- cell.imageView.image = accessoryImage;
+ cell.imageView.image = [accessoryImage scaleToSize:CGSizeMake(27, 19)];
[accessoryImage release];
break;
case 4: // level
@@ -240,7 +270,7 @@
BOTLEVELS_DIRECTORY(),[[[[teamDictionary objectForKey:@"hedgehogs"]
objectAtIndex:0] objectForKey:@"level"]
intValue]]];
- cell.imageView.image = accessoryImage;
+ cell.imageView.image = [accessoryImage scaleToSize:CGSizeMake(32, 32)];
[accessoryImage release];
break;
default:
@@ -249,7 +279,7 @@
}
break;
}
-
+
return cell;
}
@@ -259,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)
+ 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];
@@ -310,15 +343,15 @@
-(void) tableView:(UITableView *)aTableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
if (nil == hogHatViewController)
hogHatViewController = [[HogHatViewController alloc] initWithStyle:UITableViewStyleGrouped];
-
+
// cache the dictionary file of the team, so that other controllers can modify it
hogHatViewController.teamDictionary = self.teamDictionary;
hogHatViewController.selectedHog = [indexPath row];
-
+
// if we are editing the field undo any change before proceeding
EditableCellView *cell = (EditableCellView *)[aTableView cellForRowAtIndexPath:indexPath];
[cell cancel:nil];
-
+
[self.navigationController pushViewController:hogHatViewController animated:YES];
}
@@ -343,11 +376,12 @@
}
-(void) viewDidUnload {
- [super viewDidUnload];
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
self.teamDictionary = nil;
self.teamName = nil;
self.normalHogSprite = nil;
self.secondaryItems = nil;
+ self.moreSecondaryItems = nil;
hogHatViewController = nil;
gravesViewController = nil;
voicesViewController = nil;
@@ -363,6 +397,7 @@
[teamName release];
[normalHogSprite release];
[secondaryItems release];
+ [moreSecondaryItems release];
[hogHatViewController release];
[gravesViewController release];
[fortsViewController release];
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SingleWeaponViewController.h
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// SingleWeaponViewController.h
-// Hedgewars
-//
-// Created by Vittorio on 19/06/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 19/06/2010.
+ */
+
#import
#import "EditableCellView.h"
@@ -12,10 +25,10 @@
@interface SingleWeaponViewController : UITableViewController {
NSString *weaponName;
-
+ NSString *description;
+
UIImage *ammoStoreImage;
- NSArray *ammoNames;
-
+
char *quantity;
char *probability;
char *delay;
@@ -23,8 +36,8 @@
}
@property (nonatomic,retain) NSString *weaponName;
+@property (nonatomic,retain) NSString *description;
@property (nonatomic,retain) UIImage *ammoStoreImage;
-@property (nonatomic,retain) NSArray *ammoNames;
-(void) saveAmmos;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,18 +1,31 @@
-//
-// SingleWeaponViewController.m
-// Hedgewars
-//
-// Created by Vittorio on 19/06/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 19/06/2010.
+ */
+
#import "SingleWeaponViewController.h"
-#import "WeaponCellView.h"
#import "CommodityFunctions.h"
#import "UIImageExtra.h"
+#import "PascalImports.h"
@implementation SingleWeaponViewController
-@synthesize weaponName, ammoStoreImage, ammoNames;
+@synthesize weaponName, description, ammoStoreImage;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
return rotationManager(interfaceOrientation);
@@ -23,61 +36,14 @@
-(void) viewDidLoad {
[super viewDidLoad];
- 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",@""),
- nil];
- self.ammoNames = array;
- [array release];
-
- 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));
+ 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)*(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];
@@ -94,6 +60,7 @@
NSDictionary *weapon = [[NSDictionary alloc] initWithContentsOfFile:ammoFile];
[ammoFile release];
+ self.description = [weapon objectForKey:@"description"];
const char *tmp1 = [[weapon objectForKey:@"ammostore_initialqt"] UTF8String];
const char *tmp2 = [[weapon objectForKey:@"ammostore_probability"] UTF8String];
const char *tmp3 = [[weapon objectForKey:@"ammostore_delay"] UTF8String];
@@ -109,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';
@@ -125,23 +92,24 @@
}
-(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];
NSString *delayStr = [NSString stringWithUTF8String:delay];
NSString *cratenessStr = [NSString stringWithUTF8String:crateness];
-
+
NSDictionary *weapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- [NSNumber numberWithInt:CURRENT_AMMOSIZE],@"version",
quantityStr,@"ammostore_initialqt",
probabilityStr,@"ammostore_probability",
delayStr,@"ammostore_delay",
- cratenessStr,@"ammostore_crate", nil];
-
+ cratenessStr,@"ammostore_crate",
+ self.description,@"description",
+ nil];
+
NSString *ammoFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",WEAPONS_DIRECTORY(),self.weaponName];
[weapon writeToFile:ammoFile atomically:YES];
[ammoFile release];
@@ -156,9 +124,9 @@
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0)
- return 1;
+ return 2;
else
- return CURRENT_AMMOSIZE;
+ return HW_getNumberOfWeapons();
}
// Customize the appearance of table view cells.
@@ -167,42 +135,50 @@
static NSString *CellIdentifier1 = @"Cell1";
NSInteger row = [indexPath row];
UITableViewCell *cell = nil;
-
+
if (0 == [indexPath section]) {
- EditableCellView *customCell = (EditableCellView *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier0];
- if (customCell == nil) {
- customCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault
- reuseIdentifier:CellIdentifier0] autorelease];
- customCell.delegate = self;
+ EditableCellView *editableCell = (EditableCellView *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier0];
+ if (editableCell == nil) {
+ editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault
+ reuseIdentifier:CellIdentifier0] autorelease];
+ editableCell.delegate = self;
}
+ editableCell.tag = row;
+ editableCell.selectionStyle = UITableViewCellSelectionStyleNone;
+ editableCell.imageView.image = nil;
+ editableCell.detailTextLabel.text = nil;
- customCell.textField.text = self.weaponName;
- customCell.detailTextLabel.text = nil;
- customCell.imageView.image = nil;
- customCell.selectionStyle = UITableViewCellSelectionStyleNone;
- cell = customCell;
+ if (row == 0) {
+ editableCell.textField.text = self.weaponName;
+ } else {
+ editableCell.minimumCharacters = 0;
+ editableCell.textField.font = [UIFont systemFontOfSize:[UIFont labelFontSize]];
+ editableCell.textField.text = self.description;
+ editableCell.textField.placeholder = NSLocalizedString(@"You can add a description if you wish",@"");
+ }
+ cell = editableCell;
} else {
- WeaponCellView *customCell = (WeaponCellView *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier1];
- if (customCell == nil) {
- customCell = [[[WeaponCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease];
- customCell.delegate = self;
+ WeaponCellView *weaponCell = (WeaponCellView *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier1];
+ if (weaponCell == nil) {
+ weaponCell = [[[WeaponCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease];
+ 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)];
- customCell.weaponIcon.image = img;
- customCell.weaponName.text = [ammoNames objectAtIndex:row];
- customCell.tag = row;
-
- [customCell.initialQt setValue:[[NSString stringWithFormat:@"%c",quantity[row]] intValue] animated:NO];
- [customCell.probabilityQt setValue:[[NSString stringWithFormat:@"%c", probability[row]] intValue] animated:NO];
- [customCell.delayQt setValue:[[NSString stringWithFormat:@"%c", delay[row]] intValue] animated:NO];
- [customCell.crateQt setValue:[[NSString stringWithFormat:@"%c", crateness[row]] intValue] animated:NO];
- cell = customCell;
+ weaponCell.weaponIcon.image = img;
+ weaponCell.weaponName.text = [NSString stringWithUTF8String:HW_getWeaponNameByIndex(row)];
+ weaponCell.tag = row;
+
+ [weaponCell.initialSli setValue:[[NSString stringWithFormat:@"%c",quantity[row]] intValue] animated:NO];
+ [weaponCell.probabilitySli setValue:[[NSString stringWithFormat:@"%c", probability[row]] intValue] animated:NO];
+ [weaponCell.delaySli setValue:[[NSString stringWithFormat:@"%c", delay[row]] intValue] animated:NO];
+ [weaponCell.crateSli setValue:[[NSString stringWithFormat:@"%c", crateness[row]] intValue] animated:NO];
+ cell = weaponCell;
}
-
+
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
@@ -214,6 +190,22 @@
return 120;
}
+-(NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section {
+ NSString *sectionTitle = nil;
+ switch (section) {
+ case 0:
+ sectionTitle = NSLocalizedString(@"Weaponset Name", @"");
+ break;
+ case 1:
+ sectionTitle = NSLocalizedString(@"Weapon Ammuntions", @"");
+ break;
+ default:
+ DLog(@"nope");
+ break;
+ }
+ return sectionTitle;
+}
+
#pragma mark -
#pragma mark Table view delegate
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -226,13 +218,17 @@
#pragma mark -
#pragma mark editableCellView delegate
// set the new value
--(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
- // delete old file
- [[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@.plist",WEAPONS_DIRECTORY(),self.weaponName] error:NULL];
- // update filename
- self.weaponName = textString;
- // save new file
- [self saveAmmos];
+-(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
+ if (tagValue == 0) {
+ // delete old file
+ [[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@.plist",WEAPONS_DIRECTORY(),self.weaponName] error:NULL];
+ // update filename
+ self.weaponName = textString;
+ // save new file
+ [self saveAmmos];
+ } else {
+ self.description = textString;
+ }
}
#pragma mark -
@@ -256,9 +252,9 @@
free(delay); delay = NULL;
free(crateness); crateness = NULL;
[super viewDidUnload];
+ self.description = nil;
self.weaponName = nil;
self.ammoStoreImage = nil;
- self.ammoNames = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
@@ -266,8 +262,8 @@
-(void) dealloc {
[weaponName release];
+ [description release];
[ammoStoreImage release];
- [ammoNames release];
[super dealloc];
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SplitViewRootController.h
--- a/project_files/HedgewarsMobile/Classes/SplitViewRootController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SplitViewRootController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,17 +1,32 @@
-//
-// SplitViewRootController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 27/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 27/03/2010.
+ */
+
#import
-@class DetailViewController;
+@class MasterViewController;
@interface SplitViewRootController: UIViewController {
- DetailViewController *detailViewController;
+ MasterViewController *activeController;
}
+@property (nonatomic,retain) MasterViewController *activeController;
+
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SplitViewRootController.m
--- a/project_files/HedgewarsMobile/Classes/SplitViewRootController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SplitViewRootController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,73 +1,87 @@
- //
-// SplitViewRootController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 27/03/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 27/03/2010.
+ */
+
#import "SplitViewRootController.h"
#import "MasterViewController.h"
-#import "DetailViewController.h"
#import "CommodityFunctions.h"
@implementation SplitViewRootController
-
+@synthesize activeController;
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return rotationManager(interfaceOrientation);
}
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren't in use.
- if (detailViewController.view.superview == nil)
- detailViewController = nil;
+ if (self.activeController.view.superview == nil)
+ self.activeController = nil;
MSG_MEMCLEAN();
+ [super didReceiveMemoryWarning];
}
-// load the view programmatically; we need a splitViewController that handles a MasterViewController
+// load the view programmatically; we need a splitViewController that handles a MasterViewController
// (which is just a UITableViewController) and a DetailViewController where we present options
-(void) viewDidLoad {
- detailViewController = [[DetailViewController alloc] initWithStyle:UITableViewStyleGrouped];
- UINavigationController *detailedNavController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
- [detailViewController release];
+ CGRect rect = [[UIScreen mainScreen] bounds];
+ self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
- CGRect rect = [[UIScreen mainScreen] bounds];
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
-
+ if (self.activeController == nil) {
+ MasterViewController *rightController = [[MasterViewController alloc] initWithStyle:UITableViewStyleGrouped];
+ rightController.targetController = nil;
+ self.activeController = rightController;
+ [rightController release];
+ }
+ UINavigationController *rightNavController = [[UINavigationController alloc] initWithRootViewController:self.activeController];
+
+ if (IS_IPAD()) {
+ MasterViewController *leftController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
+ leftController.targetController = self.activeController;
+ UINavigationController *leftNavController = [[UINavigationController alloc] initWithRootViewController:leftController];
+ [leftController release];
+
UISplitViewController *splitViewRootController = [[UISplitViewController alloc] init];
+ splitViewRootController.delegate = nil;
splitViewRootController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
-
- MasterViewController *masterViewController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
- UINavigationController *mainNavController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
- [masterViewController release];
+ splitViewRootController.viewControllers = [NSArray arrayWithObjects: leftNavController, rightNavController, nil];
+ [leftNavController release];
+ [rightNavController release];
- splitViewRootController.delegate = detailViewController;
- masterViewController.detailViewController = detailViewController;
- splitViewRootController.viewControllers = [NSArray arrayWithObjects: mainNavController, detailedNavController, nil];
- [mainNavController release];
- [detailedNavController release];
-
// add view to main controller
[self.view addSubview:splitViewRootController.view];
} else {
- [self.view addSubview:detailedNavController.view];
+ rightNavController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
+ [self.view addSubview:rightNavController.view];
}
[super viewDidLoad];
}
-
+
-(void) viewDidUnload {
- detailViewController = nil;
+ self.activeController = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
-(void) dealloc {
- [detailViewController release];
+ [self.activeController release];
[super dealloc];
}
@@ -76,22 +90,22 @@
// see http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
- [detailViewController.navigationController viewWillAppear:animated];
+ [self.activeController.navigationController viewWillAppear:animated];
}
-(void) viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
- [detailViewController.navigationController viewWillDisappear:animated];
+ [self.activeController.navigationController viewWillDisappear:animated];
}
-(void) viewDidAppear:(BOOL)animated {
[super viewDidLoad];
- [detailViewController.navigationController viewDidAppear:animated];
+ [self.activeController.navigationController viewDidAppear:animated];
}
-(void) viewDidDisappear:(BOOL)animated {
[super viewDidUnload];
- [detailViewController.navigationController viewDidDisappear:animated];
+ [self.activeController.navigationController viewDidDisappear:animated];
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SquareButtonView.h
--- a/project_files/HedgewarsMobile/Classes/SquareButtonView.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SquareButtonView.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// HogButtonView.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 20/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 20/04/2010.
+ */
+
#import
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SquareButtonView.m
--- a/project_files/HedgewarsMobile/Classes/SquareButtonView.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SquareButtonView.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// HogButtonView.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 20/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 20/04/2010.
+ */
+
#import "SquareButtonView.h"
#import
@@ -19,25 +32,17 @@
colorIndex = -1;
selectedColor = 0;
- // list of allowed colors
- NSArray *colors = [[NSArray alloc] initWithObjects: [NSNumber numberWithUnsignedInt:4421353], // bluette
- [NSNumber numberWithUnsignedInt:4100897], // greeeen
- [NSNumber numberWithUnsignedInt:10632635], // violett
- [NSNumber numberWithUnsignedInt:16749353], // oranngy
- [NSNumber numberWithUnsignedInt:14483456], // reddish
- [NSNumber numberWithUnsignedInt:7566195], // graaaay
- nil];
- self.colorArray = colors;
- [colors release];
+ self.colorArray = getAvailableColors();
// set the color to the first available one
[self nextColor];
-
+
// this makes the button round and nice with a border
[self.layer setCornerRadius:7.0f];
- [self.layer setMasksToBounds:YES];
+ [self.layer setMasksToBounds:YES];
[self.layer setBorderWidth:2];
-
+ [self.layer setBorderColor:[UICOLOR_HW_YELLOW_BODER CGColor]];
+
// this changes the color at button press
[self addTarget:self action:@selector(nextColor) forControlEvents:UIControlEventTouchUpInside];
}
@@ -51,11 +56,11 @@
colorIndex = 0;
NSUInteger color = [[self.colorArray objectAtIndex:colorIndex] unsignedIntValue];
- self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f
- green:((color & 0x0000FF00) >> 8)/255.0f
- blue: (color & 0x000000FF)/255.0f
+ self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f
+ green:((color & 0x0000FF00) >> 8)/255.0f
+ blue: (color & 0x000000FF)/255.0f
alpha:1.0f];
-
+
[ownerDictionary setObject:[NSNumber numberWithInt:color] forKey:@"color"];
}
@@ -63,10 +68,10 @@
if (color != selectedColor) {
selectedColor = color;
colorIndex = [colorArray indexOfObject:[NSNumber numberWithUnsignedInt:color]];
-
- self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f
- green:((color & 0x0000FF00) >> 8)/255.0f
- blue: (color & 0x000000FF)/255.0f
+
+ self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f
+ green:((color & 0x0000FF00) >> 8)/255.0f
+ blue: (color & 0x000000FF)/255.0f
alpha:1.0f];
}
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SupportViewController.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/SupportViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,30 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 19/09/2010.
+ */
+
+
+#import
+
+@interface SupportViewController : UIViewController {
+
+}
+
+-(IBAction) buttonPressed:(id) sender;
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SupportViewController.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/SupportViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,52 @@
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 19/09/2010.
+ */
+
+
+#import "SupportViewController.h"
+#import "CommodityFunctions.h"
+
+@implementation SupportViewController
+
+-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
+ return rotationManager(interfaceOrientation);
+}
+
+-(void) didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+}
+
+-(void) viewDidUnload {
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+-(void) dealloc {
+ [super dealloc];
+}
+
+-(IBAction) buttonPressed:(id) sender {
+ NSString *reviewURL = @"http://itunes.apple.com/us/app/hedgewars/id391234866?affC=QQABAAAAHgAFasEiWjVwUGZOc3k1VGctQkRJazlacXhUclpBTVpiU2xteVdfUQ%3D%3D#&mt=8";
+ [[UIApplication sharedApplication] openURL:[NSURL URLWithString:reviewURL]];
+}
+
+@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/SupportViewController.xib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/SupportViewController.xib Wed Oct 27 14:02:20 2010 +0200
@@ -0,0 +1,561 @@
+
+
+
+ 1024
+ 10F569
+ 788
+ 1038.29
+ 461.00
+
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ 117
+
+
+ YES
+
+
+
+ YES
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+
+ YES
+
+ YES
+
+
+ YES
+
+
+
+ YES
+
+ IBFilesOwner
+ IBIPadFramework
+
+
+ IBFirstResponder
+ IBIPadFramework
+
+
+
+ 292
+
+ YES
+
+
+ 292
+ {{94, 214}, {514, 21}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ If you like this app, please leave a positive review on the AppStore!
+
+ 1
+ MCAwIDAAA
+
+
+ 1
+ 10
+ 1
+
+
+
+ 292
+ {{231, 20}, {240, 160}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ denied.png
+
+
+
+
+ 292
+ {{191, 363}, {320, 240}}
+
+ NO
+ NO
+ IBIPadFramework
+
+ NSImage
+ surpise.png
+
+
+
+
+ 292
+ {{293, 269}, {116, 37}}
+
+ NO
+ IBIPadFramework
+ 0
+ 0
+
+ Helvetica-Bold
+ 15
+ 16
+
+ 1
+ Open iTunes
+
+ 3
+ MQA
+
+
+ 1
+ MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA
+
+
+ 3
+ MC41AA
+
+
+
+
+ 292
+ {{274, 611}, {153, 37}}
+
+ NO
+ YES
+ 7
+ NO
+ IBIPadFramework
+ ♥ THANK YOU ♥
+
+ Helvetica-Bold
+ 17
+ 16
+
+
+
+ 1
+ 10
+ 1
+
+
+ {703, 724}
+
+
+ 3
+ MQA
+
+ 2
+
+
+ NO
+
+ NO
+
+
+ 3
+
+
+ IBUISplitViewController
+
+ IBUISplitViewControllerContentSizeLocation
+ IBUISplitViewControllerContentSizeLocationDetail
+
+ IBIPadFramework
+ Detail
+
+ IBIPadFramework
+
+
+
+
+ YES
+
+
+ view
+
+
+
+ 3
+
+
+
+ buttonPressed:
+
+
+ 7
+
+ 11
+
+
+
+
+ YES
+
+ 0
+
+
+
+
+
+ -1
+
+
+ File's Owner
+
+
+ -2
+
+
+
+
+ 2
+
+
+ YES
+
+
+
+
+
+
+
+
+
+ 4
+
+
+
+
+ 5
+
+
+
+
+ 6
+
+
+
+
+ 7
+
+
+
+
+ 12
+
+
+
+
+
+
+ YES
+
+ YES
+ -1.CustomClassName
+ -2.CustomClassName
+ 12.IBPluginDependency
+ 2.IBEditorWindowLastContentRect
+ 2.IBPluginDependency
+ 4.IBPluginDependency
+ 5.IBPluginDependency
+ 6.IBPluginDependency
+ 7.IBPluginDependency
+
+
+ YES
+ SupportViewController
+ UIResponder
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ {{562, 125}, {703, 768}}
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+
+
+ YES
+
+
+ YES
+
+
+
+
+ YES
+
+
+ YES
+
+
+
+ 12
+
+
+
+ YES
+
+ SupportViewController
+ UIViewController
+
+ buttonPressed:
+ id
+
+
+ buttonPressed:
+
+ buttonPressed:
+ id
+
+
+
+ IBProjectSource
+ Classes/SupportViewController.h
+
+
+
+
+ YES
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSError.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSFileManager.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueCoding.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyValueObserving.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSKeyedArchiver.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSObject.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSRunLoop.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSThread.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURL.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ Foundation.framework/Headers/NSURLConnection.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CAAnimation.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ QuartzCore.framework/Headers/CALayer.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIAccessibility.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINibLoading.h
+
+
+
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIResponder.h
+
+
+
+ UIButton
+ UIControl
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIButton.h
+
+
+
+ UIControl
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIControl.h
+
+
+
+ UIImageView
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIImageView.h
+
+
+
+ UILabel
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UILabel.h
+
+
+
+ UIResponder
+ NSObject
+
+
+
+ UISearchBar
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchBar.h
+
+
+
+ UISearchDisplayController
+ NSObject
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISearchDisplayController.h
+
+
+
+ UIView
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITextField.h
+
+
+
+ UIView
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIView.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UINavigationController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIPopoverController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UISplitViewController.h
+
+
+
+ UIViewController
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UITabBarController.h
+
+
+
+ UIViewController
+ UIResponder
+
+ IBFrameworkSource
+ UIKit.framework/Headers/UIViewController.h
+
+
+
+
+ 0
+ IBIPadFramework
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS
+
+
+
+ com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3
+
+
+ YES
+ ../Hedgewars.xcodeproj
+ 3
+
+ YES
+
+ YES
+ denied.png
+ surpise.png
+
+
+ YES
+ {240, 160}
+ {320, 240}
+
+
+ 117
+
+
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/TeamConfigViewController.h
--- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// TeamConfigViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 20/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 20/04/2010.
+ */
+
#import
@@ -12,10 +25,11 @@
@interface TeamConfigViewController : UITableViewController {
NSMutableArray *listOfTeams;
NSMutableArray *listOfSelectedTeams;
- BOOL isFirstLoad;
+ NSArray *cachedContentsOfDir;
}
@property (nonatomic, retain) NSMutableArray *listOfTeams;
@property (nonatomic, retain) NSMutableArray *listOfSelectedTeams;
+@property (nonatomic, retain) NSArray *cachedContentsOfDir;
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/TeamConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// TeamConfigViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 20/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 20/04/2010.
+ */
+
#import "TeamConfigViewController.h"
#import "CommodityFunctions.h"
@@ -12,7 +25,7 @@
#import "SquareButtonView.h"
@implementation TeamConfigViewController
-@synthesize listOfTeams, listOfSelectedTeams;
+@synthesize listOfTeams, listOfSelectedTeams, cachedContentsOfDir;
#define NUMBERBUTTON_TAG 123456
#define SQUAREBUTTON_TAG 654321
@@ -22,36 +35,40 @@
#pragma mark View lifecycle
-(void) viewDidLoad {
[super viewDidLoad];
-
+
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
- isFirstLoad = YES;
+
+ [self.tableView setBackgroundView:nil];
+ self.view.backgroundColor = [UIColor clearColor];
+ self.tableView.separatorColor = UICOLOR_HW_YELLOW_BODER;
+ self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
+ NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:TEAMS_DIRECTORY() error:NULL];
// avoid overwriting selected teams when returning on this view
- if (isFirstLoad) {
- // integer representation of various color (defined in SquareButtonView)
- NSUInteger colors[6] = { 4421353, 4100897, 10632635, 16749353, 14483456, 7566195 };
- NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:TEAMS_DIRECTORY() error:NULL];
+ if ([self.cachedContentsOfDir isEqualToArray:contentsOfDir] == NO) {
+ NSArray *colors = getAvailableColors();
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:[contentsOfDir count]];
for (int i = 0; i < [contentsOfDir count]; i++) {
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[contentsOfDir objectAtIndex:i],@"team",
[NSNumber numberWithInt:4],@"number",
- [NSNumber numberWithInt:colors[i%6]],@"color",nil];
+ [colors objectAtIndex:i%[colors count]],@"color",nil];
[array addObject:dict];
[dict release];
}
self.listOfTeams = array;
[array release];
-
+
NSMutableArray *emptyArray = [[NSMutableArray alloc] initWithObjects:nil];
self.listOfSelectedTeams = emptyArray;
[emptyArray release];
- isFirstLoad = NO;
+
+ cachedContentsOfDir = [[NSArray alloc] initWithArray:contentsOfDir copyItems:YES];
}
[self.tableView reloadData];
}
@@ -74,20 +91,13 @@
return [listOfTeams count];
}
--(NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section {
- if (section == 0)
- return NSLocalizedString(@"Playing Teams",@"");
- else
- return NSLocalizedString(@"Available Teams",@"");
-}
-
// Customize the appearance of table view cells.
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier0 = @"Cell0";
static NSString *CellIdentifier1 = @"Cell1";
NSInteger section = [indexPath section];
UITableViewCell *cell;
-
+
if (section == 0) {
cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier0];
if (cell == nil) {
@@ -97,50 +107,84 @@
numberButton.tag = NUMBERBUTTON_TAG;
[cell addSubview:numberButton];
[numberButton release];
-
- SquareButtonView *squareButton = [[SquareButtonView alloc] initWithFrame:CGRectMake(12+88+7, 5, 36, 36)];
+
+ SquareButtonView *squareButton = [[SquareButtonView alloc] initWithFrame:CGRectMake(12+88+6, 5, 36, 36)];
squareButton.tag = SQUAREBUTTON_TAG;
[cell addSubview:squareButton];
[squareButton release];
-
- UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(12+88+7+36+7, 10, 250, 25)];
+
+ UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(12+88+6+36, 10, 103, 25)];
label.textAlignment = UITextAlignmentLeft;
+ label.minimumFontSize = 11;
+ label.adjustsFontSizeToFitWidth = YES;
+ label.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
label.backgroundColor = [UIColor clearColor];
- label.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize] + 2];
+ label.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
+ label.textColor = UICOLOR_HW_YELLOW_TEXT;
label.tag = LABEL_TAG;
[cell.contentView addSubview:label];
[label release];
}
-
+
NSMutableDictionary *selectedRow = [listOfSelectedTeams objectAtIndex:[indexPath row]];
-
+
UILabel *cellLabel = (UILabel *)[cell viewWithTag:LABEL_TAG];
cellLabel.text = [[selectedRow objectForKey:@"team"] stringByDeletingPathExtension];
-
+
HogButtonView *numberButton = (HogButtonView *)[cell viewWithTag:NUMBERBUTTON_TAG];
[numberButton drawManyHogs:[[selectedRow objectForKey:@"number"] intValue]];
numberButton.ownerDictionary = selectedRow;
-
+
SquareButtonView *squareButton = (SquareButtonView *)[cell viewWithTag:SQUAREBUTTON_TAG];
[squareButton selectColor:[[selectedRow objectForKey:@"color"] intValue]];
squareButton.ownerDictionary = selectedRow;
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- cellLabel.textColor = [UIColor colorWithRed:(CGFloat)0xFE/255 green:(CGFloat)0xCB/255 blue:0 alpha:1];
- }
+
+ NSString *teamPath = [NSString stringWithFormat:@"%@/%@",TEAMS_DIRECTORY(),[selectedRow objectForKey:@"team"]];
+ NSDictionary *firstHog = [[[NSDictionary dictionaryWithContentsOfFile:teamPath] objectForKey:@"hedgehogs"] objectAtIndex:0];
+ if ([[firstHog objectForKey:@"level"] intValue]> 0) {
+ NSString *filePath = [NSString stringWithFormat:@"%@/cyborg.png",HATS_DIRECTORY()];
+ UIImage *sprite = [[UIImage alloc] initWithContentsOfFile:filePath andCutAt:CGRectMake(0, 2, 32, 32)];
+ UIImageView *spriteView = [[UIImageView alloc] initWithImage:sprite];
+ [sprite release];
+
+ cell.accessoryView = spriteView;
+ [spriteView release];
+ } else
+ cell.accessoryView = nil;
} else {
cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier1];
- if (cell == nil)
+ if (cell == nil)
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease];
-
+
cell.textLabel.text = [[[listOfTeams objectAtIndex:[indexPath row]] objectForKey:@"team"] stringByDeletingPathExtension];
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
- cell.textLabel.textColor = [UIColor colorWithRed:(CGFloat)0xFE/255 green:(CGFloat)0xCB/255 blue:0 alpha:1 ];
- }
+ cell.accessoryView = nil;
}
+ cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
+ cell.backgroundColor = [UIColor blackColor];
+
return cell;
}
+-(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
+ return 40.0;
+}
+
+-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
+ CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
+ NSString *text;
+ if (section == 0)
+ text = NSLocalizedString(@"Playing Teams",@"");
+ else
+ text = NSLocalizedString(@"Available Teams",@"");
+ UILabel *theLabel = createBlueLabel(text, frame);
+ theLabel.center = CGPointMake(self.view.frame.size.width/2, 20);
+
+ UIView *theView = [[[UIView alloc] init] autorelease];
+ [theView addSubview:theLabel];
+ [theLabel release];
+ return theView;
+}
#pragma mark -
#pragma mark Table view delegate
@@ -153,7 +197,7 @@
[self.listOfSelectedTeams removeObjectAtIndex:row];
} else {
[self.listOfSelectedTeams addObject:[self.listOfTeams objectAtIndex:row]];
- [self.listOfTeams removeObjectAtIndex:row];
+ [self.listOfTeams removeObjectAtIndex:row];
}
[aTableView reloadData];
}
@@ -162,20 +206,25 @@
#pragma mark -
#pragma mark Memory management
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+ // Relinquish ownership any cached data, images, etc that aren't in use.
+ self.cachedContentsOfDir = nil;
+ MSG_MEMCLEAN();
[super didReceiveMemoryWarning];
- // Relinquish ownership any cached data, images, etc that aren't in use.
}
-(void) viewDidUnload {
self.listOfTeams = nil;
+ self.listOfSelectedTeams = nil;
+ self.cachedContentsOfDir = nil;
MSG_DIDUNLOAD();
[super viewDidUnload];
}
-(void) dealloc {
- [self.listOfTeams release];
+ [listOfTeams release];
+ [listOfSelectedTeams release];
+ [cachedContentsOfDir release];
[super dealloc];
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/TeamSettingsViewController.h
--- a/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// TeamSettingsViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/TeamSettingsViewController.m
--- a/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/TeamSettingsViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// TeamSettingsViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import "TeamSettingsViewController.h"
#import "SingleTeamViewController.h"
@@ -24,7 +37,7 @@
-(void) viewDidLoad {
[super viewDidLoad];
- UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Edit",@"from the team panel")
+ UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Edit",@"")
style:UIBarButtonItemStyleBordered
target:self
action:@selector(toggleEdit:)];
@@ -35,12 +48,12 @@
// load the list of teams in the teams directory
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
-
+
NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:TEAMS_DIRECTORY() error:NULL];
NSMutableArray *array = [[NSMutableArray alloc] initWithArray:contentsOfDir copyItems:YES];
self.listOfTeams = array;
[array release];
-
+
[self.tableView reloadData];
}
@@ -48,7 +61,7 @@
-(void) toggleEdit:(id) sender {
BOOL isEditing = self.tableView.editing;
[self.tableView setEditing:!isEditing animated:YES];
-
+
if (isEditing) {
[self.navigationItem.rightBarButtonItem setTitle:NSLocalizedString(@"Edit",@"from the team panel")];
[self.navigationItem.rightBarButtonItem setStyle: UIBarButtonItemStyleBordered];
@@ -68,15 +81,15 @@
// add a team file with default values and updates the table
-(void) addTeam:(id) sender {
NSString *fileName = [[NSString alloc] initWithFormat:@"Default Team %u.plist", [self.listOfTeams count]];
-
+
createTeamNamed([fileName stringByDeletingPathExtension]);
-
+
[self.listOfTeams addObject:fileName];
[fileName release];
-
+
// order the array alphabetically, so teams will keep their position
[self.listOfTeams sortUsingSelector:@selector(compare:)];
-
+
[self.tableView reloadData];
}
@@ -93,28 +106,28 @@
// Customize the appearance of table view cells.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
-
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
-
- NSUInteger row = [indexPath row];
- NSString *rowString = [[self.listOfTeams objectAtIndex:row] stringByDeletingPathExtension];
- cell.textLabel.text = rowString;
+
+ NSUInteger row = [indexPath row];
+ NSString *rowString = [[self.listOfTeams objectAtIndex:row] stringByDeletingPathExtension];
+ cell.textLabel.text = rowString;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
-
+
return cell;
}
// delete the row and the file
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
-
+
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@",TEAMS_DIRECTORY(),[self.listOfTeams objectAtIndex:row]];
[[NSFileManager defaultManager] removeItemAtPath:teamFile error:NULL];
[teamFile release];
-
+
[self.listOfTeams removeObjectAtIndex:row];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
@@ -126,10 +139,10 @@
if (childController == nil) {
childController = [[SingleTeamViewController alloc] initWithStyle:UITableViewStyleGrouped];
}
-
+
NSInteger row = [indexPath row];
NSString *selectedTeamFile = [listOfTeams objectAtIndex:row];
-
+
// this must be set so childController can load the correct plist
childController.teamName = [selectedTeamFile stringByDeletingPathExtension];
[childController.tableView setContentOffset:CGPointMake(0,0) animated:NO];
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/UIImageExtra.h
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// UIImageExtra.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 08/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/04/2010.
+ */
+
#import
@@ -13,11 +26,13 @@
-(UIImage *)scaleToSize:(CGSize) size;
-(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint;
--(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint atSize:(CGSize) resultingSize;
+-(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint ofSize:(CGSize) resultingSize;
-(id) initWithContentsOfFile:(NSString *)path andCutAt:(CGRect) rect;
-(UIImage *)cutAt:(CGRect) rect;
-(UIImage *)convertToGrayScale;
+-(UIImage *)convertToNegative;
-(UIImage *)maskImageWith:(UIImage *)maskImage;
-(UIImage *)makeRoundCornersOfSize:(CGSize) sizewh;
++(UIImage *)whiteImage:(CGSize) ofSize;
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/UIImageExtra.m
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,74 +1,102 @@
-//
-// UIImageExtra.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 08/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 08/04/2010.
+ */
+
#import "UIImageExtra.h"
@implementation UIImage (extra)
-
+
-(UIImage *)scaleToSize:(CGSize) size {
DLog(@"warning - this is a very expensive operation, you should avoid using it");
-
+
// Create a bitmap graphics context; this will also set it as the current context
UIGraphicsBeginImageContext(size);
-
+
// Draw the scaled image in the current context
[self drawInRect:CGRectMake(0, 0, size.width, size.height)];
-
+
// Create a new image from current context
UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
-
+
// Pop the current context from the stack
UIGraphicsEndImageContext();
-
+
// Return our new scaled image (autoreleased)
return scaledImage;
}
-(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint {
// create a contex of size of the background image
- return [self mergeWith:secondImage atPoint:secondImagePoint atSize:self.size];
+ return [self mergeWith:secondImage atPoint:secondImagePoint ofSize:self.size];
}
--(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint atSize:(CGSize) resultingSize {
- // Create a bitmap graphics context; this will also set it as the current context
- UIGraphicsBeginImageContext(resultingSize);
+-(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint ofSize:(CGSize) resultingSize {
+ if (secondImage == nil) {
+ DLog(@"Warning, secondImage == nil");
+ return self;
+ }
+ int w = resultingSize.width;
+ int h = resultingSize.height;
- // draw the background image in the current context
- [self drawAtPoint:CGPointMake(0,0)];
+ if (w == 0 || h == 0) {
+ DLog(@"Can have 0 dimesions");
+ return self;
+ }
- // draw the image on top of the first image (because the context is the same)
- [secondImage drawAtPoint:secondImagePoint];
+ // Create a bitmap graphics context; this will also set it as the current context
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, 4 * w, colorSpace, kCGImageAlphaPremultipliedFirst);
+
+ // draw the two images in the current context
+ CGContextDrawImage(context, CGRectMake(0, 0, self.size.width, self.size.height), [self CGImage]);
+ CGContextDrawImage(context, CGRectMake(secondImagePoint.x, secondImagePoint.y, secondImage.size.width, secondImage.size.height), [secondImage CGImage]);
- // create an image from the current contex (not thread safe)
- UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
+ // Create bitmap image info from pixel data in current context
+ CGImageRef imageRef = CGBitmapContextCreateImage(context);
- // free drawing contex
- UIGraphicsEndImageContext();
-
- // return the resulting autoreleased image
+ // Create a new UIImage object
+ UIImage *resultImage = [UIImage imageWithCGImage:imageRef];
+
+ // Release colorspace, context and bitmap information
+ CGColorSpaceRelease(colorSpace);
+ CGContextRelease(context);
+ CFRelease(imageRef);
+
return resultImage;
}
-(id) initWithContentsOfFile:(NSString *)path andCutAt:(CGRect) rect {
// load image from path
UIImage *image = [[UIImage alloc] initWithContentsOfFile: path];
-
+
if (nil != image) {
// get its CGImage representation with a give size
CGImageRef cgImage = CGImageCreateWithImageInRect([image CGImage], rect);
-
+
// clean memory
[image release];
-
+
// create a UIImage from the CGImage (memory must be allocated already)
UIImage *sprite = [self initWithCGImage:cgImage];
-
+
// clean memory
CGImageRelease(cgImage);
@@ -82,38 +110,38 @@
-(UIImage *)cutAt:(CGRect) rect {
CGImageRef cgImage = CGImageCreateWithImageInRect([self CGImage], rect);
-
+
UIImage *res = [UIImage imageWithCGImage:cgImage];
CGImageRelease(cgImage);
-
+
return res;
}
-(UIImage *)convertToGrayScale {
// Create image rectangle with current image width/height
CGRect imageRect = CGRectMake(0, 0, self.size.width, self.size.height);
-
+
// Grayscale color space
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
-
+
// Create bitmap content with current image size and grayscale colorspace
CGContextRef context = CGBitmapContextCreate(nil, self.size.width, self.size.height, 8, 0, colorSpace, kCGImageAlphaNone);
-
+
// Draw image into current context, with specified rectangle
// using previously defined context (with grayscale colorspace)
CGContextDrawImage(context, imageRect, [self CGImage]);
-
+
// Create bitmap image info from pixel data in current context
CGImageRef imageRef = CGBitmapContextCreateImage(context);
-
- // Create a new UIImage object
+
+ // Create a new UIImage object
UIImage *newImage = [UIImage imageWithCGImage:imageRef];
-
+
// Release colorspace, context and bitmap information
- CGColorSpaceRelease(colorSpace);
+ CFRelease(imageRef);
CGContextRelease(context);
- CFRelease(imageRef);
-
+ CGColorSpaceRelease(colorSpace);
+
// Return the new grayscale image
return newImage;
}
@@ -122,7 +150,7 @@
-(UIImage*) maskImageWith:(UIImage *)maskImage {
// prepare the reference image
CGImageRef maskRef = [maskImage CGImage];
-
+
// create the mask using parameters of the mask reference
CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef),
CGImageGetHeight(maskRef),
@@ -130,14 +158,14 @@
CGImageGetBitsPerPixel(maskRef),
CGImageGetBytesPerRow(maskRef),
CGImageGetDataProvider(maskRef), NULL, false);
-
+
// create an image in the current context
CGImageRef masked = CGImageCreateWithMask([self CGImage], mask);
CGImageRelease(mask);
-
+
UIImage* retImage = [UIImage imageWithCGImage:masked];
CGImageRelease(masked);
-
+
return retImage;
}
@@ -162,31 +190,59 @@
CGContextRestoreGState(context);
}
--(UIImage *)makeRoundCornersOfSize:(CGSize) sizewh {
+-(UIImage *)makeRoundCornersOfSize:(CGSize) sizewh {
CGFloat cornerWidth = sizewh.width;
CGFloat cornerHeight = sizewh.height;
CGFloat w = self.size.width;
CGFloat h = self.size.height;
-
+
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, 4 * w, colorSpace, kCGImageAlphaPremultipliedFirst);
-
+
CGContextBeginPath(context);
CGRect rect = CGRectMake(0, 0, w, h);
addRoundedRectToPath(context, rect, cornerWidth, cornerHeight);
CGContextClosePath(context);
CGContextClip(context);
-
+
CGContextDrawImage(context, CGRectMake(0, 0, w, h), [self CGImage]);
-
+
CGImageRef imageMasked = CGBitmapContextCreateImage(context);
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);
-
+
UIImage *newImage = [UIImage imageWithCGImage:imageMasked];
CGImageRelease(imageMasked);
-
+
return newImage;
}
+// by http://www.sixtemia.com/journal/2010/06/23/uiimage-negative-color-effect/
+-(UIImage *)convertToNegative {
+ UIGraphicsBeginImageContext(self.size);
+ CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeCopy);
+ [self drawInRect:CGRectMake(0, 0, self.size.width, self.size.height)];
+ CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeDifference);
+ CGContextSetFillColorWithColor(UIGraphicsGetCurrentContext(),[UIColor whiteColor].CGColor);
+ CGContextFillRect(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, self.size.width, self.size.height));
+ // create an image from the current contex (not thread safe)
+ UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+ return result;
+}
+
++(UIImage *)whiteImage:(CGSize) ofSize {
+ UIGraphicsBeginImageContext(ofSize);
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ UIGraphicsPushContext(context);
+
+ CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
+ CGContextFillRect(context,CGRectMake(0,0,ofSize.width,ofSize.height));
+
+ UIGraphicsPopContext();
+ UIImage *bkgImg = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+ return bkgImg;
+}
+
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/VoicesViewController.h
--- a/project_files/HedgewarsMobile/Classes/VoicesViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/VoicesViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,17 +1,30 @@
-//
-// VoicesViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import
#import "SDL_mixer.h"
@interface VoicesViewController : UITableViewController {
NSMutableDictionary *teamDictionary;
-
+
NSArray *voiceArray;
NSIndexPath *lastIndexPath;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/VoicesViewController.m
--- a/project_files/HedgewarsMobile/Classes/VoicesViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/VoicesViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,15 +1,27 @@
-//
-// VoicesViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 02/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 02/04/2010.
+ */
+
#import "VoicesViewController.h"
#import "CommodityFunctions.h"
-
@implementation VoicesViewController
@synthesize teamDictionary, voiceArray, lastIndexPath;
@@ -18,7 +30,6 @@
return rotationManager(interfaceOrientation);
}
-
#pragma mark -
#pragma mark View lifecycle
-(void) viewDidLoad {
@@ -31,24 +42,30 @@
// it's here and not in viewWillAppear because user cannot add/remove them
NSArray *array = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:VOICES_DIRECTORY() error:NULL];
self.voiceArray = array;
-
+
self.title = NSLocalizedString(@"Set hedgehog voices",@"");
}
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
-
+
// this moves the tableview to the top
[self.tableView setContentOffset:CGPointMake(0,0) animated:NO];
}
--(void) viewWillDisappear:(BOOL)animated {
- [super viewWillDisappear:animated];
+-(void) viewDidAppear:(BOOL)animated {
+ [super viewDidAppear:animated];
+ Mix_OpenAudio(44100, 0x8010, 1, 1024);
+}
+
+-(void) viewDidDisappear:(BOOL)animated {
+ [super viewDidDisappear:animated];
if(voiceBeingPlayed != NULL) {
Mix_HaltChannel(lastChannel);
Mix_FreeChunk(voiceBeingPlayed);
voiceBeingPlayed = NULL;
}
+ Mix_CloseAudio();
}
@@ -64,17 +81,17 @@
// Customize the appearance of table view cells.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-
+
static NSString *CellIdentifier = @"Cell";
-
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
-
+
NSString *voice = [[voiceArray objectAtIndex:[indexPath row]] stringByDeletingPathExtension];
cell.textLabel.text = voice;
-
+
if ([voice isEqualToString:[teamDictionary objectForKey:@"voicepack"]]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
self.lastIndexPath = indexPath;
@@ -91,46 +108,56 @@
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int newRow = [indexPath row];
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
-
+
if (newRow != oldRow) {
[teamDictionary setObject:[voiceArray objectAtIndex:newRow] forKey:@"voicepack"];
-
+
// tell our boss to write this new stuff on disk
[[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
[self.tableView reloadData];
-
+
self.lastIndexPath = indexPath;
[self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
- }
+ }
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
-
+
+ // stop any sound before playing another one
if (voiceBeingPlayed != NULL) {
Mix_HaltChannel(lastChannel);
Mix_FreeChunk(voiceBeingPlayed);
voiceBeingPlayed = NULL;
}
-
+
NSString *voiceDir = [[NSString alloc] initWithFormat:@"%@/%@/",VOICES_DIRECTORY(),[voiceArray objectAtIndex:newRow]];
NSArray *array = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:voiceDir error:NULL];
-
+
int index = random() % [array count];
-
+
voiceBeingPlayed = Mix_LoadWAV([[voiceDir stringByAppendingString:[array objectAtIndex:index]] UTF8String]);
[voiceDir release];
- lastChannel = Mix_PlayChannel(-1, voiceBeingPlayed, 0);
+ lastChannel = Mix_PlayChannel(-1, voiceBeingPlayed, 0);
}
#pragma mark -
#pragma mark Memory management
-(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+ if (voiceBeingPlayed != NULL) {
+ Mix_HaltChannel(lastChannel);
+ Mix_FreeChunk(voiceBeingPlayed);
+ voiceBeingPlayed = NULL;
+ }
+ self.lastIndexPath = nil;
+ MSG_MEMCLEAN();
[super didReceiveMemoryWarning];
- // Relinquish ownership any cached data, images, etc that aren't in use.
}
-(void) viewDidUnload {
- voiceBeingPlayed = NULL;
+ if (voiceBeingPlayed != NULL) {
+ Mix_HaltChannel(lastChannel);
+ Mix_FreeChunk(voiceBeingPlayed);
+ voiceBeingPlayed = NULL;
+ }
self.lastIndexPath = nil;
self.teamDictionary = nil;
self.voiceArray = nil;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/WeaponCellView.h
--- a/project_files/HedgewarsMobile/Classes/WeaponCellView.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/WeaponCellView.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// WeaponCellView.h
-// Hedgewars
-//
-// Created by Vittorio on 03/07/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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/07/2010.
+ */
+
#import
@@ -18,42 +31,46 @@
id delegate;
UILabel *weaponName;
UIImageView *weaponIcon;
-
- UISlider *initialQt;
- UISlider *probabilityQt;
- UISlider *delayQt;
- UISlider *crateQt;
-
+
+ UISlider *initialSli;
+ UISlider *probabilitySli;
+ UISlider *delaySli;
+ UISlider *crateSli;
+
@private
UIImageView *initialImg;
- UIImageView *probabImg;
+ UIImageView *probabilityImg;
UIImageView *delayImg;
UIImageView *crateImg;
-
+
UILabel *initialLab;
- UILabel *probLab;
- UILabel *delLab;
- UILabel *craLab;
+ UILabel *probabilityLab;
+ UILabel *delayLab;
+ UILabel *crateLab;
+
+ UILabel *helpLabel;
}
@property (nonatomic,assign) id delegate;
@property (nonatomic,retain) UILabel *weaponName;
@property (nonatomic,retain) UIImageView *weaponIcon;
-
-@property (nonatomic,retain) UISlider *initialQt;
-@property (nonatomic,retain) UISlider *probabilityQt;
-@property (nonatomic,retain) UISlider *delayQt;
-@property (nonatomic,retain) UISlider *crateQt;
+
+@property (nonatomic,retain) UISlider *initialSli;
+@property (nonatomic,retain) UISlider *probabilitySli;
+@property (nonatomic,retain) UISlider *delaySli;
+@property (nonatomic,retain) UISlider *crateSli;
@property (nonatomic,retain) UIImageView *initialImg;
-@property (nonatomic,retain) UIImageView *probabImg;
+@property (nonatomic,retain) UIImageView *probabilityImg;
@property (nonatomic,retain) UIImageView *delayImg;
@property (nonatomic,retain) UIImageView *crateImg;
@property (nonatomic,retain) UILabel *initialLab;
-@property (nonatomic,retain) UILabel *probLab;
-@property (nonatomic,retain) UILabel *delLab;
-@property (nonatomic,retain) UILabel *craLab;
+@property (nonatomic,retain) UILabel *probabilityLab;
+@property (nonatomic,retain) UILabel *delayLab;
+@property (nonatomic,retain) UILabel *crateLab;
+
+@property (nonatomic,retain) UILabel *helpLabel;
@end
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/WeaponCellView.m
--- a/project_files/HedgewarsMobile/Classes/WeaponCellView.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/WeaponCellView.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,94 +1,127 @@
-//
-// WeaponCellView.m
-// Hedgewars
-//
-// Created by Vittorio on 03/07/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 07/03/2010.
+ */
+
#import "WeaponCellView.h"
#import "CommodityFunctions.h"
@implementation WeaponCellView
-@synthesize delegate, weaponName, weaponIcon, initialQt, probabilityQt, delayQt, crateQt,
- initialImg, probabImg, delayImg, crateImg, initialLab, probLab, delLab, craLab;
+@synthesize delegate, weaponName, weaponIcon, initialSli, probabilitySli, delaySli, crateSli, helpLabel,
+ initialImg, probabilityImg, delayImg, crateImg, initialLab, probabilityLab, delayLab, crateLab;
-(id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
delegate = nil;
-
+
weaponName = [[UILabel alloc] init];
weaponName.backgroundColor = [UIColor clearColor];
weaponName.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
weaponIcon = [[UIImageView alloc] init];
-
- initialQt = [[UISlider alloc] init];
- [initialQt addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
- initialQt.maximumValue = 9;
- initialQt.minimumValue = 0;
-
- probabilityQt = [[UISlider alloc] init];
- [probabilityQt addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
- probabilityQt.maximumValue = 9;
- probabilityQt.minimumValue = 0;
-
- delayQt = [[UISlider alloc] init];
- [delayQt addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
- delayQt.maximumValue = 9;
- delayQt.minimumValue = 0;
-
- crateQt = [[UISlider alloc] init];
- [crateQt addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
- crateQt.maximumValue = 9;
- crateQt.minimumValue = 0;
-
+
+ initialSli = [[UISlider alloc] init];
+ [initialSli addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
+ [initialSli addTarget:self action:@selector(startDragging:) forControlEvents:UIControlEventTouchDown];
+ [initialSli addTarget:self action:@selector(stopDragging:) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside];
+ initialSli.maximumValue = 9;
+ initialSli.minimumValue = 0;
+ initialSli.tag = 100;
+
+ probabilitySli = [[UISlider alloc] init];
+ [probabilitySli addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
+ [probabilitySli addTarget:self action:@selector(startDragging:) forControlEvents:UIControlEventTouchDown];
+ [probabilitySli addTarget:self action:@selector(stopDragging:) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside];
+ probabilitySli.maximumValue = 9;
+ probabilitySli.minimumValue = 0;
+ probabilitySli.tag = 200;
+
+ delaySli = [[UISlider alloc] init];
+ [delaySli addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
+ [delaySli addTarget:self action:@selector(startDragging:) forControlEvents:UIControlEventTouchDown];
+ [delaySli addTarget:self action:@selector(stopDragging:) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside];
+ delaySli.maximumValue = 9;
+ delaySli.minimumValue = 0;
+ delaySli.tag = 300;
+
+ crateSli = [[UISlider alloc] init];
+ [crateSli addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
+ [crateSli addTarget:self action:@selector(startDragging:) forControlEvents:UIControlEventTouchDown];
+ [crateSli addTarget:self action:@selector(stopDragging:) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside];
+ crateSli.maximumValue = 9;
+ crateSli.minimumValue = 0;
+ crateSli.tag = 400;
+
NSString *imgAmmoStr = [NSString stringWithFormat:@"%@/iconAmmo.png",BTN_DIRECTORY()];
NSString *imgDamageStr = [NSString stringWithFormat:@"%@/iconDamage.png",BTN_DIRECTORY()];
NSString *imgTimeStr = [NSString stringWithFormat:@"%@/iconTime.png",BTN_DIRECTORY()];
NSString *imgBoxStr = [NSString stringWithFormat:@"%@/iconBox.png",BTN_DIRECTORY()];
initialImg = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:imgAmmoStr]];
- probabImg = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:imgDamageStr]];
+ probabilityImg = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:imgDamageStr]];
delayImg = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:imgTimeStr]];
crateImg = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:imgBoxStr]];
-
+
initialLab = [[UILabel alloc] init];
initialLab.backgroundColor = [UIColor clearColor];
initialLab.textColor = [UIColor grayColor];
initialLab.textAlignment = UITextAlignmentCenter;
-
- probLab = [[UILabel alloc] init];
- probLab.backgroundColor = [UIColor clearColor];
- probLab.textColor = [UIColor grayColor];
- probLab.textAlignment = UITextAlignmentCenter;
-
- delLab = [[UILabel alloc] init];
- delLab.backgroundColor = [UIColor clearColor];
- delLab.textColor = [UIColor grayColor];
- delLab.textAlignment = UITextAlignmentCenter;
-
- craLab = [[UILabel alloc] init];
- craLab.backgroundColor = [UIColor clearColor];
- craLab.textColor = [UIColor grayColor];
- craLab.textAlignment = UITextAlignmentCenter;
-
- [self.contentView addSubview:weaponName]; // [weaponName release];
- [self.contentView addSubview:weaponIcon]; // [weaponIcon release];
-
- [self.contentView addSubview:initialQt]; // [initialQt release];
- [self.contentView addSubview:probabilityQt]; // [probabilityQt release];
- [self.contentView addSubview:delayQt]; // [delayQt release];
- [self.contentView addSubview:crateQt]; // [crateQt release];
-
- [self.contentView addSubview:initialImg]; // [initialImg release];
- [self.contentView addSubview:probabImg]; // [probabImg release];
- [self.contentView addSubview:delayImg]; // [delayImg release];
- [self.contentView addSubview:crateImg]; // [crateImg release];
+
+ probabilityLab = [[UILabel alloc] init];
+ probabilityLab.backgroundColor = [UIColor clearColor];
+ probabilityLab.textColor = [UIColor grayColor];
+ probabilityLab.textAlignment = UITextAlignmentCenter;
+
+ delayLab = [[UILabel alloc] init];
+ delayLab.backgroundColor = [UIColor clearColor];
+ delayLab.textColor = [UIColor grayColor];
+ delayLab.textAlignment = UITextAlignmentCenter;
+
+ crateLab = [[UILabel alloc] init];
+ crateLab.backgroundColor = [UIColor clearColor];
+ crateLab.textColor = [UIColor grayColor];
+ crateLab.textAlignment = UITextAlignmentCenter;
- [self.contentView addSubview:initialLab]; // [initialLab release];
- [self.contentView addSubview:probLab]; // [probLab release];
- [self.contentView addSubview:delLab]; // [delLab release];
- [self.contentView addSubview:craLab]; // [craLab release];
+ helpLabel = [[UILabel alloc] init];
+ helpLabel.backgroundColor = [UIColor clearColor];
+ helpLabel.textColor = [UIColor grayColor];
+ helpLabel.textAlignment = UITextAlignmentRight;
+ helpLabel.font = [UIFont italicSystemFontOfSize:[UIFont smallSystemFontSize]];
+
+ [self.contentView addSubview:weaponName];
+ [self.contentView addSubview:weaponIcon];
+
+ [self.contentView addSubview:initialSli];
+ [self.contentView addSubview:probabilitySli];
+ [self.contentView addSubview:delaySli];
+ [self.contentView addSubview:crateSli];
+
+ [self.contentView addSubview:initialImg];
+ [self.contentView addSubview:probabilityImg];
+ [self.contentView addSubview:delayImg];
+ [self.contentView addSubview:crateImg];
+
+ [self.contentView addSubview:initialLab];
+ [self.contentView addSubview:probabilityLab];
+ [self.contentView addSubview:delayLab];
+ [self.contentView addSubview:crateLab];
+
+ [self.contentView addSubview:helpLabel];
}
return self;
}
@@ -97,37 +130,41 @@
[super layoutSubviews];
CGRect contentRect = self.contentView.bounds;
- CGFloat boundsX = contentRect.origin.x;
-
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
- boundsX += 65;
- else
- boundsX -= 9;
+ CGFloat shiftSliders = contentRect.origin.x;
+ CGFloat shiftLabel = 0;
+
+ if (IS_IPAD()) {
+ shiftSliders += 65;
+ shiftLabel += 165;
+ } else
+ shiftSliders -= 13;
weaponIcon.frame = CGRectMake(5, 5, 32, 32);
weaponName.frame = CGRectMake(45, 8, 200, 25);
+ helpLabel.frame = CGRectMake(shiftLabel + 200, 8, 250, 15);
+
// second line
- initialImg.frame = CGRectMake(boundsX+20, 40, 32, 32);
- initialLab.frame = CGRectMake(boundsX+56, 40, 20, 32);
- initialLab.text = ((int)initialQt.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)initialQt.value];
- initialQt.frame = CGRectMake(boundsX+80, 40, 150, 32);
-
- probabImg.frame = CGRectMake(boundsX+255, 40, 32, 32);
- probLab.frame = CGRectMake(boundsX+291, 40, 20, 32);
- probLab.text = ((int)probabilityQt.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)probabilityQt.value];
- probabilityQt.frame = CGRectMake(boundsX+314, 40, 150, 32);
-
+ initialImg.frame = CGRectMake(shiftSliders + 20, 40, 32, 32);
+ initialLab.frame = CGRectMake(shiftSliders + 56, 40, 20, 32);
+ initialLab.text = ((int)initialSli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)initialSli.value];
+ initialSli.frame = CGRectMake(shiftSliders + 80, 40, 150, 32);
+
+ probabilityImg.frame = CGRectMake(shiftSliders + 255, 40, 32, 32);
+ probabilityLab.frame = CGRectMake(shiftSliders + 291, 40, 20, 32);
+ probabilityLab.text = ((int)probabilitySli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)probabilitySli.value];
+ probabilitySli.frame = CGRectMake(shiftSliders + 314, 40, 150, 32);
+
// third line
- delayImg.frame = CGRectMake(boundsX+20, 80, 32, 32);
- delLab.frame = CGRectMake(boundsX+56, 80, 20, 32);
- delLab.text = ((int)delayQt.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)delayQt.value];
- delayQt.frame = CGRectMake(boundsX+80, 80, 150, 32);
-
- crateImg.frame = CGRectMake(boundsX+255, 80, 32, 32);
- craLab.frame = CGRectMake(boundsX+291, 80, 20, 32);
- craLab.text = ((int)crateQt.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)crateQt.value];
- crateQt.frame = CGRectMake(boundsX+314, 80, 150, 32);
+ delayImg.frame = CGRectMake(shiftSliders + 20, 80, 32, 32);
+ delayLab.frame = CGRectMake(shiftSliders + 56, 80, 20, 32);
+ delayLab.text = ((int)delaySli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)delaySli.value];
+ delaySli.frame = CGRectMake(shiftSliders + 80, 80, 150, 32);
+
+ crateImg.frame = CGRectMake(shiftSliders + 255, 80, 32, 32);
+ crateLab.frame = CGRectMake(shiftSliders + 291, 80, 20, 32);
+ crateLab.text = ((int)crateSli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)crateSli.value];
+ crateSli.frame = CGRectMake(shiftSliders + 314, 80, 150, 32);
}
/*
@@ -139,37 +176,66 @@
-(void) valueChanged:(id) sender {
if (self.delegate != nil) {
- initialLab.text = ((int)initialQt.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)initialQt.value];
- probLab.text = ((int)probabilityQt.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)probabilityQt.value];
- delLab.text = ((int)delayQt.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)delayQt.value];
- craLab.text = ((int)crateQt.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)crateQt.value];
-
+ initialLab.text = ((int)initialSli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)initialSli.value];
+ probabilityLab.text = ((int)probabilitySli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)probabilitySli.value];
+ delayLab.text = ((int)delaySli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)delaySli.value];
+ crateLab.text = ((int)crateSli.value == 9) ? @"∞" : [NSString stringWithFormat:@"%d",(int)crateSli.value];
+
[delegate updateValues:[NSArray arrayWithObjects:
- [NSNumber numberWithInt:(int)initialQt.value],
- [NSNumber numberWithInt:(int)probabilityQt.value],
- [NSNumber numberWithInt:(int)delayQt.value],
- [NSNumber numberWithInt:(int)crateQt.value], nil]
+ [NSNumber numberWithInt:(int)initialSli.value],
+ [NSNumber numberWithInt:(int)probabilitySli.value],
+ [NSNumber numberWithInt:(int)delaySli.value],
+ [NSNumber numberWithInt:(int)crateSli.value], nil]
atIndex:self.tag];
} else
DLog(@"error - delegate = nil!");
}
+-(void) startDragging:(id) sender {
+ UISlider *slider = (UISlider *)sender;
+ NSString *str = nil;
+
+ switch (slider.tag) {
+ case 100:
+ str = NSLocalizedString(@"Initial quantity ",@"ammo selection");
+ break;
+ case 200:
+ str = NSLocalizedString(@"Presence probability in crates ",@"ammo selection");
+ break;
+ case 300:
+ str = NSLocalizedString(@"Number of turns before you can use this weapon ",@"ammo selection");
+ break;
+ case 400:
+ str = NSLocalizedString(@"Quantity that you will find in a crate ",@"ammo selection");
+ break;
+ default:
+ DLog(@"Nope");
+ break;
+ }
+ self.helpLabel.text = str;
+}
+
+-(void) stopDragging:(id) sender {
+ self.helpLabel.text = @"";
+}
+
-(void) dealloc {
self.delegate = nil;
releaseAndNil(weaponName);
releaseAndNil(weaponIcon);
- releaseAndNil(initialQt);
- releaseAndNil(probabilityQt);
- releaseAndNil(delayQt);
- releaseAndNil(crateQt);
+ releaseAndNil(initialSli);
+ releaseAndNil(probabilitySli);
+ releaseAndNil(delaySli);
+ releaseAndNil(crateSli);
releaseAndNil(initialImg);
- releaseAndNil(probabImg);
+ releaseAndNil(probabilityImg);
releaseAndNil(delayImg);
releaseAndNil(crateImg);
releaseAndNil(initialLab);
- releaseAndNil(probLab);
- releaseAndNil(delLab);
- releaseAndNil(craLab);
+ releaseAndNil(probabilityLab);
+ releaseAndNil(delayLab);
+ releaseAndNil(crateLab);
+ releaseAndNil(helpLabel);
[super dealloc];
}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.h
--- a/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.h Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.h Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// WeaponSettingsViewController.h
-// HedgewarsMobile
-//
-// Created by Vittorio on 19/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 19/04/2010.
+ */
+
#import
@class SingleWeaponViewController;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m
--- a/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m Wed Oct 27 14:02:20 2010 +0200
@@ -1,10 +1,23 @@
-//
-// WeaponSettingsViewController.m
-// HedgewarsMobile
-//
-// Created by Vittorio on 19/04/10.
-// Copyright 2010 __MyCompanyName__. All rights reserved.
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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 19/04/2010.
+ */
+
#import "WeaponSettingsViewController.h"
#import "CommodityFunctions.h"
@@ -21,24 +34,24 @@
#pragma mark View lifecycle
-(void) viewDidLoad {
[super viewDidLoad];
-
- UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Edit",@"from the weapon panel")
+
+ UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Edit",@"")
style:UIBarButtonItemStyleBordered
target:self
action:@selector(toggleEdit:)];
self.navigationItem.rightBarButtonItem = editButton;
[editButton release];
-
+
}
-(void) viewWillAppear:(BOOL) animated {
[super viewWillAppear:animated];
-
+
NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:WEAPONS_DIRECTORY() error:NULL];
NSMutableArray *array = [[NSMutableArray alloc] initWithArray:contentsOfDir copyItems:YES];
self.listOfWeapons = array;
[array release];
-
+
[self.tableView reloadData];
}
@@ -46,7 +59,7 @@
-(void) toggleEdit:(id) sender {
BOOL isEditing = self.tableView.editing;
[self.tableView setEditing:!isEditing animated:YES];
-
+
if (isEditing) {
[self.navigationItem.rightBarButtonItem setTitle:NSLocalizedString(@"Edit",@"from the scheme panel")];
[self.navigationItem.rightBarButtonItem setStyle: UIBarButtonItemStyleBordered];
@@ -65,15 +78,15 @@
-(void) addWeapon:(id) sender {
NSString *fileName = [[NSString alloc] initWithFormat:@"Weapon %u.plist", [self.listOfWeapons count]];
-
- createWeaponNamed([fileName stringByDeletingPathExtension]);
-
+
+ createWeaponNamed([fileName stringByDeletingPathExtension], 0);
+
[self.listOfWeapons addObject:fileName];
[fileName release];
-
+
// order the array alphabetically, so schemes will keep their position
[self.listOfWeapons sortUsingSelector:@selector(compare:)];
-
+
[self.tableView reloadData];
}
@@ -89,28 +102,28 @@
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
-
+
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
-
- NSUInteger row = [indexPath row];
- NSString *rowString = [[self.listOfWeapons objectAtIndex:row] stringByDeletingPathExtension];
- cell.textLabel.text = rowString;
+
+ NSUInteger row = [indexPath row];
+ NSString *rowString = [[self.listOfWeapons objectAtIndex:row] stringByDeletingPathExtension];
+ cell.textLabel.text = rowString;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
-
+
return cell;
}
// delete the row and the file
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
-
+
NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@",WEAPONS_DIRECTORY(),[self.listOfWeapons objectAtIndex:row]];
[[NSFileManager defaultManager] removeItemAtPath:schemeFile error:NULL];
[schemeFile release];
-
+
[self.listOfWeapons removeObjectAtIndex:row];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
@@ -121,10 +134,10 @@
if (childController == nil) {
childController = [[SingleWeaponViewController alloc] initWithStyle:UITableViewStyleGrouped];
}
-
+
NSInteger row = [indexPath row];
NSString *selectedWeaponFile = [self.listOfWeapons objectAtIndex:row];
-
+
// this must be set so childController can load the correct plist
childController.weaponName = [selectedWeaponFile stringByDeletingPathExtension];
[childController.tableView setContentOffset:CGPointMake(0,0) animated:NO];
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Wed Oct 27 14:02:20 2010 +0200
@@ -25,19 +25,39 @@
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; settings = {ATTRIBUTES = (Required, ); }; };
+ 610D5FB21270E2660033333A /* Icon-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43411E290650040BA66 /* Icon-Small@2x.png */; };
+ 610D5FB31270E26C0033333A /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43611E290650040BA66 /* Icon@2x.png */; };
+ 611D9BFB12497E9800008271 /* SavedGamesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 611D9BF912497E9800008271 /* SavedGamesViewController.m */; };
+ 611D9BFC12497E9800008271 /* SavedGamesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 611D9BFA12497E9800008271 /* SavedGamesViewController.xib */; };
+ 611DA031124E2BC500008271 /* background_med.png in Resources */ = {isa = PBXBuildFile; fileRef = 611DA030124E2BC500008271 /* background_med.png */; };
+ 611DA1D0124E5C6300008271 /* plus.png in Resources */ = {isa = PBXBuildFile; fileRef = 611DA1CF124E5C6300008271 /* plus.png */; };
611E03E711FA747C0077A41E /* libvorbis.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 611E037C11FA74590077A41E /* libvorbis.a */; };
611E0E5111FA92170077A41E /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 611E0E5011FA92130077A41E /* libfreetype.a */; };
611E0EE711FB20610077A41E /* ammoButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 611E0EE511FB20610077A41E /* ammoButton.png */; };
611E0EE811FB20610077A41E /* cornerButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 611E0EE611FB20610077A41E /* cornerButton.png */; };
611E12FF117BBBDA0044B62F /* Entitlements-Development.plist in Resources */ = {isa = PBXBuildFile; fileRef = 611E12FE117BBBDA0044B62F /* Entitlements-Development.plist */; };
+ 611EE974122A9C4100DF6938 /* clickSound.wav in Resources */ = {isa = PBXBuildFile; fileRef = 611EE973122A9C4100DF6938 /* clickSound.wav */; };
+ 611EE9D9122AA10A00DF6938 /* backSound.wav in Resources */ = {isa = PBXBuildFile; fileRef = 611EE9D7122AA10A00DF6938 /* backSound.wav */; };
+ 611EE9DA122AA10A00DF6938 /* selSound.wav in Resources */ = {isa = PBXBuildFile; fileRef = 611EE9D8122AA10A00DF6938 /* selSound.wav */; };
+ 611EEA7E122B09C200DF6938 /* background_small.png in Resources */ = {isa = PBXBuildFile; fileRef = 611EEA7D122B09C200DF6938 /* background_small.png */; };
+ 611EEAEE122B2A4D00DF6938 /* HelpPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 611EEAEC122B2A4D00DF6938 /* HelpPageViewController.m */; };
+ 611EEAEF122B2A4D00DF6938 /* HelpPageLobbyViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 611EEAED122B2A4D00DF6938 /* HelpPageLobbyViewController.xib */; };
+ 611EEBC1122B34A800DF6938 /* helpingame.png in Resources */ = {isa = PBXBuildFile; fileRef = 611EEBC0122B34A800DF6938 /* helpingame.png */; };
+ 611EEBC4122B355700DF6938 /* helpbottom.png in Resources */ = {isa = PBXBuildFile; fileRef = 611EEBC2122B355700DF6938 /* helpbottom.png */; };
+ 611EEBC5122B355700DF6938 /* helpright.png in Resources */ = {isa = PBXBuildFile; fileRef = 611EEBC3122B355700DF6938 /* helpright.png */; };
+ 611EEC31122B54D700DF6938 /* helpplain.png in Resources */ = {isa = PBXBuildFile; fileRef = 611EEC30122B54D700DF6938 /* helpplain.png */; };
611F4D4B11B27A9900F9759A /* uScript.pas in Sources */ = {isa = PBXBuildFile; fileRef = 611F4D4A11B27A9900F9759A /* uScript.pas */; };
61272334117DF764005B90CF /* libSDL_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61272333117DF752005B90CF /* libSDL_image.a */; };
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 */; };
+ 615AD9E9120764CA00F2FF04 /* backButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 615AD9E8120764CA00F2FF04 /* backButton.png */; };
+ 615AD9EB1207654E00F2FF04 /* helpButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 615AD9EA1207654E00F2FF04 /* helpButton.png */; };
6163EE7E11CC2600001C0453 /* SingleWeaponViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */; };
- 6165920C11CA9BA200D6E256 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591DF11CA9BA200D6E256 /* DetailViewController.m */; };
6165920D11CA9BA200D6E256 /* FlagsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E111CA9BA200D6E256 /* FlagsViewController.m */; };
6165920E11CA9BA200D6E256 /* FortsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E311CA9BA200D6E256 /* FortsViewController.m */; };
6165920F11CA9BA200D6E256 /* GameConfigViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591E511CA9BA200D6E256 /* GameConfigViewController.m */; };
@@ -66,9 +86,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 */; };
@@ -109,15 +127,32 @@
61798A14114AB65C00BA94A9 /* libSDL_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61798A13114AB65600BA94A9 /* libSDL_ttf.a */; };
61799289114AE08700BA94A9 /* Data in Resources */ = {isa = PBXBuildFile; fileRef = 61798A5E114AE08600BA94A9 /* Data */; };
6183D83E11E2BCE200A88903 /* LI-ipad-Landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 6183D83C11E2BCE200A88903 /* LI-ipad-Landscape.png */; };
- 6183D83F11E2BCE200A88903 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 6183D83D11E2BCE200A88903 /* Default.png */; };
- 619C09EA11E8B8D600F1DF16 /* title_small.png in Resources */ = {isa = PBXBuildFile; fileRef = 619C09E911E8B8D600F1DF16 /* title_small.png */; };
+ 61842B24122B619D0096E335 /* HelpPageInGameViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61842B23122B619D0096E335 /* HelpPageInGameViewController.xib */; };
+ 61842B3E122B65BD0096E335 /* helpabove.png in Resources */ = {isa = PBXBuildFile; fileRef = 61842B3D122B65BD0096E335 /* helpabove.png */; };
+ 61842B40122B66280096E335 /* helpleft.png in Resources */ = {isa = PBXBuildFile; fileRef = 61842B3F122B66280096E335 /* helpleft.png */; };
+ 6187AEBD120781B900B31A27 /* Settings in Resources */ = {isa = PBXBuildFile; fileRef = 6187AEA5120781B900B31A27 /* Settings */; };
+ 6199E81612463EA800DADF8C /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6199E81512463EA800DADF8C /* CFNetwork.framework */; };
+ 6199E81A12463EC400DADF8C /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6199E81912463EC400DADF8C /* SystemConfiguration.framework */; };
+ 6199E839124647DE00DADF8C /* SupportViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6199E837124647DE00DADF8C /* SupportViewController.m */; };
+ 6199E83A124647DE00DADF8C /* SupportViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6199E838124647DE00DADF8C /* SupportViewController.xib */; };
+ 6199E86D12464A8E00DADF8C /* surpise.png in Resources */ = {isa = PBXBuildFile; fileRef = 6199E86C12464A8E00DADF8C /* surpise.png */; };
+ 619C5ACF124F7DE200D041AE /* libLua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 619C5ACE124F7DDF00D041AE /* libLua.a */; };
+ 619C5AF4124F7E3100D041AE /* LuaPas.pas in Sources */ = {isa = PBXBuildFile; fileRef = 619C5AF3124F7E3100D041AE /* LuaPas.pas */; };
+ 619C5BA2124FA59000D041AE /* MapPreviewButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 619C5BA1124FA59000D041AE /* MapPreviewButtonView.m */; };
61A1188511683A8C00359010 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61A117FE1168322700359010 /* CoreGraphics.framework */; settings = {ATTRIBUTES = (Required, ); }; };
61A118D311683CD100359010 /* HedgewarsTitle.png in Resources */ = {isa = PBXBuildFile; fileRef = 611FD9CB1155A28C00C2203D /* HedgewarsTitle.png */; };
+ 61A670BE12747D8900B06CE7 /* borderBottom.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903E911DF58550068B24D /* borderBottom.png */; };
+ 61A670BF12747D9100B06CE7 /* borderTop.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903EA11DF58550068B24D /* borderTop.png */; };
+ 61A670C012747D9B00B06CE7 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 6183D83D11E2BCE200A88903 /* Default.png */; };
+ 61A670C112747DB900B06CE7 /* MainMenuViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924C11CA9CB400D6E256 /* MainMenuViewController-iPhone.xib */; };
+ 61A670C212747DBD00B06CE7 /* MapConfigViewController-iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924E11CA9CB400D6E256 /* MapConfigViewController-iPhone.xib */; };
+ 61A670FA12747E0000B06CE7 /* playButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903EC11DF58550068B24D /* playButton.png */; };
+ 61A670FB12747E0D00B06CE7 /* title_small.png in Resources */ = {isa = PBXBuildFile; fileRef = 619C09E911E8B8D600F1DF16 /* title_small.png */; };
+ 61A6710612747E4000B06CE7 /* backgroundCenter.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903E511DF58550068B24D /* backgroundCenter.png */; };
61B3D71C11EA6F2700EC7420 /* uKeys.pas in Sources */ = {isa = PBXBuildFile; fileRef = 617987FE114AA34C00BA94A9 /* uKeys.pas */; };
61C079E411F35A300072BF46 /* EditableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 61C079E311F35A300072BF46 /* EditableCellView.m */; };
- 61C3255B1179A384001E70B1 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61C3255A1179A384001E70B1 /* OpenAL.framework */; };
+ 61DE8F221257EB1100B80214 /* AmmoMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61DE8F211257EB1100B80214 /* AmmoMenuViewController.m */; };
61E1F4F811D004240016A5AA /* adler32.pas in Sources */ = {isa = PBXBuildFile; fileRef = 61E1F4F711D004240016A5AA /* adler32.pas */; };
- 61EBA62911DFF2BC0048B68A /* bricks.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62711DFF2BC0048B68A /* bricks.png */; };
61EBA62A11DFF2BC0048B68A /* title.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62811DFF2BC0048B68A /* title.png */; };
61EBA62D11DFF3310048B68A /* backgroundAndTitle.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EBA62C11DFF3310048B68A /* backgroundAndTitle.png */; };
61EF920E11DF57AC003441C4 /* arrowDown.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920511DF57AC003441C4 /* arrowDown.png */; };
@@ -127,30 +162,17 @@
61EF921211DF57AC003441C4 /* joyButton_attack.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920911DF57AC003441C4 /* joyButton_attack.png */; };
61EF921311DF57AC003441C4 /* joyButton_backjump.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920A11DF57AC003441C4 /* joyButton_backjump.png */; };
61EF921411DF57AC003441C4 /* joyButton_forwardjump.png in Resources */ = {isa = PBXBuildFile; fileRef = 61EF920B11DF57AC003441C4 /* joyButton_forwardjump.png */; };
- 61F7A35511E27D3C0040BA66 /* background-lobby.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A35411E27D3C0040BA66 /* background-lobby.png */; };
+ 61F2E7CE1205EDE0005734F7 /* AboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F2E7CC1205EDE0005734F7 /* AboutViewController.m */; };
+ 61F2E7CF1205EDE0005734F7 /* AboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61F2E7CD1205EDE0005734F7 /* AboutViewController.xib */; };
+ 61F2E7EC12060E31005734F7 /* checkbox.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F2E7EB12060E31005734F7 /* checkbox.png */; };
61F7A43811E290650040BA66 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43111E290650040BA66 /* Icon-72.png */; };
61F7A43911E290650040BA66 /* Icon-Small-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43211E290650040BA66 /* Icon-Small-50.png */; };
61F7A43A11E290650040BA66 /* Icon-Small.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43311E290650040BA66 /* Icon-Small.png */; };
- 61F7A43B11E290650040BA66 /* Icon-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43411E290650040BA66 /* Icon-Small@2x.png */; };
61F7A43C11E290650040BA66 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43511E290650040BA66 /* Icon.png */; };
- 61F7A43D11E290650040BA66 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43611E290650040BA66 /* Icon@2x.png */; };
61F7A43E11E290650040BA66 /* iTunesArtwork.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43711E290650040BA66 /* iTunesArtwork.png */; };
- 61F903EF11DF58550068B24D /* backgroundBottom.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903E411DF58550068B24D /* backgroundBottom.png */; };
- 61F903F011DF58550068B24D /* backgroundCenter.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903E511DF58550068B24D /* backgroundCenter.png */; };
- 61F903F111DF58550068B24D /* backgroundLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903E611DF58550068B24D /* backgroundLeft.png */; };
- 61F903F211DF58550068B24D /* backgroundRight.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903E711DF58550068B24D /* backgroundRight.png */; };
- 61F903F311DF58550068B24D /* backgroundTop.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903E811DF58550068B24D /* backgroundTop.png */; };
- 61F903F411DF58550068B24D /* borderBottom.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903E911DF58550068B24D /* borderBottom.png */; };
- 61F903F511DF58550068B24D /* borderTop.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903EA11DF58550068B24D /* borderTop.png */; };
- 61F903F611DF58550068B24D /* networkButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903EB11DF58550068B24D /* networkButton.png */; };
- 61F903F711DF58550068B24D /* playButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903EC11DF58550068B24D /* playButton.png */; };
- 61F903F811DF58550068B24D /* storeButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F903ED11DF58550068B24D /* storeButton.png */; };
61F9040911DF58B00068B24D /* settingsButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9040811DF58B00068B24D /* settingsButton.png */; };
61F9040B11DF59370068B24D /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9040A11DF59370068B24D /* background.png */; };
61F9040E11DF59D10068B24D /* localplayButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9040C11DF59D10068B24D /* localplayButton.png */; };
- 61F9040F11DF59D10068B24D /* netplayButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9040D11DF59D10068B24D /* netplayButton.png */; };
- 61F9041411DF5E9B0068B24D /* toolbarBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9041311DF5E9B0068B24D /* toolbarBackground.png */; };
- 61F9043A11DF64E20068B24D /* bluebox.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F9043911DF64E20068B24D /* bluebox.png */; };
61F904D711DF7DA30068B24D /* WeaponCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F904D611DF7DA30068B24D /* WeaponCellView.m */; };
922F64900F10F53100DC6EC0 /* libfpc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 928301170F10CAFC00CC5A3C /* libfpc.a */; };
/* End PBXBuildFile section */
@@ -666,6 +688,27 @@
remoteGlobalIDString = 006E982211955059001DE610;
remoteInfo = testsdl;
};
+ 619C5AC9124F7DDF00D041AE /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 619C5AC0124F7DDF00D041AE /* Lua.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 1D6058910D05DD3D006BFB54;
+ remoteInfo = "Test Lua";
+ };
+ 619C5ACB124F7DDF00D041AE /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 619C5AC0124F7DDF00D041AE /* Lua.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 506EE05E10304ED200A389B3;
+ remoteInfo = "cocos2d libraries";
+ };
+ 619C5ACD124F7DDF00D041AE /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 619C5AC0124F7DDF00D041AE /* Lua.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = E14CF7C110ABC177005470B6;
+ remoteInfo = Lua;
+ };
928301590F10E41300CC5A3C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
@@ -682,22 +725,41 @@
28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
32CA4F630368D1EE00C91783 /* Hedgewars_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Hedgewars_Prefix.pch; sourceTree = ""; };
+ 611D9BF812497E9800008271 /* SavedGamesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SavedGamesViewController.h; sourceTree = ""; };
+ 611D9BF912497E9800008271 /* SavedGamesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SavedGamesViewController.m; sourceTree = ""; };
+ 611D9BFA12497E9800008271 /* SavedGamesViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SavedGamesViewController.xib; sourceTree = ""; };
+ 611DA030124E2BC500008271 /* background_med.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = background_med.png; path = Resources/Overlay/background_med.png; sourceTree = ""; };
+ 611DA1CF124E5C6300008271 /* plus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = plus.png; path = Resources/Overlay/plus.png; sourceTree = ""; };
611E02EC11FA74580077A41E /* cocos2d-iphone.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "cocos2d-iphone.xcodeproj"; path = "../../../Library/cocos2d/cocos2d-iphone.xcodeproj"; sourceTree = SOURCE_ROOT; };
611E0E4B11FA92130077A41E /* freetype.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = freetype.xcodeproj; path = "../../../Library/freetype/Xcode-iPhoneOS/freetype.xcodeproj"; sourceTree = SOURCE_ROOT; };
611E0EE511FB20610077A41E /* ammoButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ammoButton.png; path = Resources/Overlay/ammoButton.png; sourceTree = ""; };
611E0EE611FB20610077A41E /* cornerButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cornerButton.png; path = Resources/Overlay/cornerButton.png; sourceTree = ""; };
611E12FE117BBBDA0044B62F /* Entitlements-Development.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Entitlements-Development.plist"; sourceTree = ""; };
+ 611EE973122A9C4100DF6938 /* clickSound.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = clickSound.wav; path = Resources/clickSound.wav; sourceTree = ""; };
+ 611EE9D7122AA10A00DF6938 /* backSound.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = backSound.wav; path = Resources/backSound.wav; sourceTree = ""; };
+ 611EE9D8122AA10A00DF6938 /* selSound.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = selSound.wav; path = Resources/selSound.wav; sourceTree = ""; };
+ 611EEA7D122B09C200DF6938 /* background_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = background_small.png; path = Resources/Overlay/background_small.png; sourceTree = ""; };
+ 611EEAEB122B2A4D00DF6938 /* HelpPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpPageViewController.h; sourceTree = ""; };
+ 611EEAEC122B2A4D00DF6938 /* HelpPageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HelpPageViewController.m; sourceTree = ""; };
+ 611EEAED122B2A4D00DF6938 /* HelpPageLobbyViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HelpPageLobbyViewController.xib; sourceTree = ""; };
+ 611EEBC0122B34A800DF6938 /* helpingame.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpingame.png; path = Resources/Overlay/helpingame.png; sourceTree = ""; };
+ 611EEBC2122B355700DF6938 /* helpbottom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpbottom.png; path = Resources/Overlay/helpbottom.png; sourceTree = ""; };
+ 611EEBC3122B355700DF6938 /* helpright.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpright.png; path = Resources/Overlay/helpright.png; sourceTree = ""; };
+ 611EEC30122B54D700DF6938 /* helpplain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpplain.png; path = Resources/Overlay/helpplain.png; sourceTree = ""; };
611F4D4A11B27A9900F9759A /* uScript.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uScript.pas; path = ../../hedgewars/uScript.pas; sourceTree = SOURCE_ROOT; };
611FD9CB1155A28C00C2203D /* HedgewarsTitle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HedgewarsTitle.png; path = ../../QTfrontend/res/HedgewarsTitle.png; sourceTree = SOURCE_ROOT; };
6127232E117DF752005B90CF /* SDL_image.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_image.xcodeproj; path = "../../../Library/SDL-1.3/SDL_image/Xcode_iPhone/SDL_image.xcodeproj"; sourceTree = SOURCE_ROOT; };
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 = ""; };
61370652117B1D50004EE44A /* Entitlements-Distribution.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Entitlements-Distribution.plist"; sourceTree = ""; };
+ 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 = ""; };
614E333D11DE9A93009DBA4E /* VGSHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = VGSHandlers.inc; path = ../../hedgewars/VGSHandlers.inc; sourceTree = SOURCE_ROOT; };
+ 615AD96112073B4D00F2FF04 /* startGameButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = startGameButton.png; path = "Resources/Frontend-iPad/startGameButton.png"; sourceTree = ""; };
+ 615AD9E8120764CA00F2FF04 /* backButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = backButton.png; path = "Resources/Frontend-iPad/backButton.png"; sourceTree = ""; };
+ 615AD9EA1207654E00F2FF04 /* helpButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpButton.png; path = "Resources/Frontend-iPad/helpButton.png"; sourceTree = ""; };
6163EE7C11CC2600001C0453 /* SingleWeaponViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleWeaponViewController.h; sourceTree = ""; };
6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SingleWeaponViewController.m; sourceTree = ""; };
- 616591DE11CA9BA200D6E256 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; };
- 616591DF11CA9BA200D6E256 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; };
616591E011CA9BA200D6E256 /* FlagsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlagsViewController.h; sourceTree = ""; };
616591E111CA9BA200D6E256 /* FlagsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlagsViewController.m; sourceTree = ""; };
616591E211CA9BA200D6E256 /* FortsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FortsViewController.h; sourceTree = ""; };
@@ -807,15 +869,28 @@
61798A5E114AE08600BA94A9 /* Data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Data; sourceTree = ""; };
6183D83C11E2BCE200A88903 /* LI-ipad-Landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "LI-ipad-Landscape.png"; path = "Resources/Icons/LI-ipad-Landscape.png"; sourceTree = ""; };
6183D83D11E2BCE200A88903 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/Icons/Default.png; sourceTree = ""; };
+ 61842B23122B619D0096E335 /* HelpPageInGameViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HelpPageInGameViewController.xib; sourceTree = ""; };
+ 61842B3D122B65BD0096E335 /* helpabove.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpabove.png; path = Resources/Overlay/helpabove.png; sourceTree = ""; };
+ 61842B3F122B66280096E335 /* helpleft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = helpleft.png; path = Resources/Overlay/helpleft.png; sourceTree = ""; };
618736B8118CA28600123B23 /* GearDrawing.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = GearDrawing.inc; path = ../../hedgewars/GearDrawing.inc; sourceTree = SOURCE_ROOT; };
+ 6187AEA5120781B900B31A27 /* Settings */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Settings; path = Resources/Settings; sourceTree = ""; };
+ 6199E81512463EA800DADF8C /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
+ 6199E81912463EC400DADF8C /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
+ 6199E836124647DE00DADF8C /* SupportViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SupportViewController.h; sourceTree = ""; };
+ 6199E837124647DE00DADF8C /* SupportViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SupportViewController.m; sourceTree = ""; };
+ 6199E838124647DE00DADF8C /* SupportViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SupportViewController.xib; sourceTree = ""; };
+ 6199E86C12464A8E00DADF8C /* surpise.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = surpise.png; path = Resources/surpise.png; sourceTree = ""; };
619C09E911E8B8D600F1DF16 /* title_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = title_small.png; path = "Resources/Frontend-iPhone/title_small.png"; sourceTree = ""; };
+ 619C5AC0124F7DDF00D041AE /* Lua.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Lua.xcodeproj; path = ../../../Library/Lua/Lua.xcodeproj; sourceTree = SOURCE_ROOT; };
+ 619C5AF3124F7E3100D041AE /* LuaPas.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = LuaPas.pas; path = ../../hedgewars/LuaPas.pas; sourceTree = SOURCE_ROOT; };
+ 619C5BA0124FA59000D041AE /* MapPreviewButtonView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MapPreviewButtonView.h; path = Classes/MapPreviewButtonView.h; sourceTree = ""; };
+ 619C5BA1124FA59000D041AE /* MapPreviewButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MapPreviewButtonView.m; path = Classes/MapPreviewButtonView.m; sourceTree = ""; };
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 = ""; };
61C079E311F35A300072BF46 /* EditableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditableCellView.m; sourceTree = ""; };
- 61C3251D1179A300001E70B1 /* libopenalbridge.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libopenalbridge.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 61C3255A1179A384001E70B1 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
+ 61DE8F201257EB1100B80214 /* AmmoMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AmmoMenuViewController.h; sourceTree = ""; };
+ 61DE8F211257EB1100B80214 /* AmmoMenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AmmoMenuViewController.m; sourceTree = ""; };
61E1F4F711D004240016A5AA /* adler32.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = adler32.pas; path = ../../hedgewars/adler32.pas; sourceTree = SOURCE_ROOT; };
- 61EBA62711DFF2BC0048B68A /* bricks.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = bricks.png; path = "Resources/Frontend-iPad/bricks.png"; sourceTree = ""; };
61EBA62811DFF2BC0048B68A /* title.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = title.png; path = "Resources/Frontend-iPad/title.png"; sourceTree = ""; };
61EBA62C11DFF3310048B68A /* backgroundAndTitle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = backgroundAndTitle.png; path = "Resources/Frontend-iPad/backgroundAndTitle.png"; sourceTree = ""; };
61EF920511DF57AC003441C4 /* arrowDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = arrowDown.png; path = Resources/Overlay/arrowDown.png; sourceTree = ""; };
@@ -825,7 +900,10 @@
61EF920911DF57AC003441C4 /* joyButton_attack.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = joyButton_attack.png; path = Resources/Overlay/joyButton_attack.png; sourceTree = ""; };
61EF920A11DF57AC003441C4 /* joyButton_backjump.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = joyButton_backjump.png; path = Resources/Overlay/joyButton_backjump.png; sourceTree = ""; };
61EF920B11DF57AC003441C4 /* joyButton_forwardjump.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = joyButton_forwardjump.png; path = Resources/Overlay/joyButton_forwardjump.png; sourceTree = ""; };
- 61F7A35411E27D3C0040BA66 /* background-lobby.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "background-lobby.png"; path = "Resources/Frontend-iPad/background-lobby.png"; sourceTree = ""; };
+ 61F2E7CB1205EDE0005734F7 /* AboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutViewController.h; sourceTree = ""; };
+ 61F2E7CC1205EDE0005734F7 /* AboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AboutViewController.m; sourceTree = ""; };
+ 61F2E7CD1205EDE0005734F7 /* AboutViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AboutViewController.xib; sourceTree = ""; };
+ 61F2E7EB12060E31005734F7 /* checkbox.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = checkbox.png; path = Resources/checkbox.png; sourceTree = ""; };
61F7A43111E290650040BA66 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "Resources/Icons/Icon-72.png"; sourceTree = ""; };
61F7A43211E290650040BA66 /* Icon-Small-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-Small-50.png"; path = "Resources/Icons/Icon-Small-50.png"; sourceTree = ""; };
61F7A43311E290650040BA66 /* Icon-Small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-Small.png"; path = "Resources/Icons/Icon-Small.png"; sourceTree = ""; };
@@ -845,10 +923,8 @@
61F903ED11DF58550068B24D /* storeButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = storeButton.png; path = "Resources/Frontend-iPhone/storeButton.png"; sourceTree = ""; };
61F9040811DF58B00068B24D /* settingsButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = settingsButton.png; path = Resources/settingsButton.png; sourceTree = ""; };
61F9040A11DF59370068B24D /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = background.png; path = "Resources/Frontend-iPad/background.png"; sourceTree = ""; };
- 61F9040C11DF59D10068B24D /* localplayButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = localplayButton.png; path = "../../../../Desktop/ForKoda/Main Menu/localplayButton.png"; sourceTree = SOURCE_ROOT; };
- 61F9040D11DF59D10068B24D /* netplayButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = netplayButton.png; path = "../../../../Desktop/ForKoda/Main Menu/netplayButton.png"; sourceTree = SOURCE_ROOT; };
- 61F9041311DF5E9B0068B24D /* toolbarBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = toolbarBackground.png; path = "Resources/Frontend-iPad/toolbarBackground.png"; sourceTree = ""; };
- 61F9043911DF64E20068B24D /* bluebox.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = bluebox.png; path = "Resources/Frontend-iPad/bluebox.png"; sourceTree = ""; };
+ 61F9040C11DF59D10068B24D /* localplayButton.png */ = {isa = PBXFileReference; explicitFileType = image.png; name = localplayButton.png; path = "Resources/Frontend-iPad/localplayButton.png"; sourceTree = ""; };
+ 61F9040D11DF59D10068B24D /* netplayButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = netplayButton.png; path = "Resources/Frontend-iPad/netplayButton.png"; sourceTree = ""; };
61F904D511DF7DA30068B24D /* WeaponCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeaponCellView.h; sourceTree = ""; };
61F904D611DF7DA30068B24D /* WeaponCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeaponCellView.m; sourceTree = ""; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
@@ -868,6 +944,7 @@
922F64900F10F53100DC6EC0 /* libfpc.a in Frameworks */,
611E03E711FA747C0077A41E /* libvorbis.a in Frameworks */,
611E0E5111FA92170077A41E /* libfreetype.a in Frameworks */,
+ 619C5ACF124F7DE200D041AE /* libLua.a in Frameworks */,
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
61A1188511683A8C00359010 /* CoreGraphics.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
@@ -875,14 +952,8 @@
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */,
61798935114AB25F00BA94A9 /* AudioToolbox.framework in Frameworks */,
61272339117DF778005B90CF /* MobileCoreServices.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 61C3251B1179A300001E70B1 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 61C3255B1179A384001E70B1 /* OpenAL.framework in Frameworks */,
+ 6199E81612463EA800DADF8C /* CFNetwork.framework in Frameworks */,
+ 6199E81A12463EC400DADF8C /* SystemConfiguration.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -894,6 +965,7 @@
children = (
6163EE4D11CC247D001C0453 /* Game Config */,
6163EE4C11CC2478001C0453 /* Settings Pages */,
+ 611D9BF312497B7700008271 /* Other Controllers */,
6163EE6C11CC253F001C0453 /* Overlay */,
616591F011CA9BA200D6E256 /* MainMenuViewController.h */,
616591F111CA9BA200D6E256 /* MainMenuViewController.m */,
@@ -910,7 +982,6 @@
children = (
1D6058910D05DD3D006BFB54 /* Hedgewars.app */,
928301170F10CAFC00CC5A3C /* libfpc.a */,
- 61C3251D1179A300001E70B1 /* libopenalbridge.a */,
);
name = Products;
sourceTree = "";
@@ -933,18 +1004,15 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
+ 61DE91561258B76800B80214 /* Custom Buttons */,
32CA4F630368D1EE00C91783 /* Hedgewars_Prefix.pch */,
6165922911CA9BD500D6E256 /* PascalImports.h */,
- 6165929C11CA9E2F00D6E256 /* SDL_uikitappdelegate.h */,
- 6165929D11CA9E2F00D6E256 /* SDL_uikitappdelegate.m */,
6165922411CA9BD500D6E256 /* CGPointUtils.h */,
6165922311CA9BD500D6E256 /* CGPointUtils.c */,
+ 6165929C11CA9E2F00D6E256 /* SDL_uikitappdelegate.h */,
+ 6165929D11CA9E2F00D6E256 /* SDL_uikitappdelegate.m */,
6165922511CA9BD500D6E256 /* CommodityFunctions.h */,
6165922611CA9BD500D6E256 /* CommodityFunctions.m */,
- 6165922711CA9BD500D6E256 /* HogButtonView.h */,
- 6165922811CA9BD500D6E256 /* HogButtonView.m */,
- 6165922A11CA9BD500D6E256 /* SquareButtonView.h */,
- 6165922B11CA9BD500D6E256 /* SquareButtonView.m */,
6165922C11CA9BD500D6E256 /* UIImageExtra.h */,
6165922D11CA9BD500D6E256 /* UIImageExtra.m */,
);
@@ -954,12 +1022,25 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
+ 6147DAD21253DCDE0010357E /* savesButton.png */,
+ 6199E86C12464A8E00DADF8C /* surpise.png */,
+ 611EEBC0122B34A800DF6938 /* helpingame.png */,
+ 611EEC30122B54D700DF6938 /* helpplain.png */,
+ 611EEBC2122B355700DF6938 /* helpbottom.png */,
+ 61842B3D122B65BD0096E335 /* helpabove.png */,
+ 611EEBC3122B355700DF6938 /* helpright.png */,
+ 61842B3F122B66280096E335 /* helpleft.png */,
6129B9F611EFB04D0017E305 /* denied.png */,
+ 61F2E7EB12060E31005734F7 /* checkbox.png */,
+ 611EE973122A9C4100DF6938 /* clickSound.wav */,
+ 611EE9D7122AA10A00DF6938 /* backSound.wav */,
+ 611EE9D8122AA10A00DF6938 /* selSound.wav */,
61F7A42811E2905C0040BA66 /* Icons */,
61F903FA11DF58680068B24D /* Frontend-iPad */,
61F903E311DF584D0068B24D /* Frontend-iPhone */,
6179936611501D1E00BA94A9 /* Overlay */,
61798A5E114AE08600BA94A9 /* Data */,
+ 6187AEA5120781B900B31A27 /* Settings */,
611FD9CB1155A28C00C2203D /* HedgewarsTitle.png */,
8D1107310486CEB800E47090 /* Info.plist */,
61F9040811DF58B00068B24D /* settingsButton.png */,
@@ -970,6 +1051,7 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 619C5AC0124F7DDF00D041AE /* Lua.xcodeproj */,
611E02EC11FA74580077A41E /* cocos2d-iphone.xcodeproj */,
611E0E4B11FA92130077A41E /* freetype.xcodeproj */,
617988D3114AAA3900BA94A9 /* SDLiPhoneOS.xcodeproj */,
@@ -983,12 +1065,26 @@
28FD14FF0DC6FC520079059D /* OpenGLES.framework */,
28FD15070DC6FC5B0079059D /* QuartzCore.framework */,
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
- 61C3255A1179A384001E70B1 /* OpenAL.framework */,
61272338117DF778005B90CF /* MobileCoreServices.framework */,
+ 6199E81512463EA800DADF8C /* CFNetwork.framework */,
+ 6199E81912463EC400DADF8C /* SystemConfiguration.framework */,
);
name = Frameworks;
sourceTree = "";
};
+ 611D9BF312497B7700008271 /* Other Controllers */ = {
+ isa = PBXGroup;
+ children = (
+ 61F2E7CB1205EDE0005734F7 /* AboutViewController.h */,
+ 61F2E7CC1205EDE0005734F7 /* AboutViewController.m */,
+ 61F2E7CD1205EDE0005734F7 /* AboutViewController.xib */,
+ 611D9BF812497E9800008271 /* SavedGamesViewController.h */,
+ 611D9BF912497E9800008271 /* SavedGamesViewController.m */,
+ 611D9BFA12497E9800008271 /* SavedGamesViewController.xib */,
+ );
+ name = "Other Controllers";
+ sourceTree = "";
+ };
611E02ED11FA74580077A41E /* Products */ = {
isa = PBXGroup;
children = (
@@ -1083,8 +1179,6 @@
6165920311CA9BA200D6E256 /* SplitViewRootController.m */,
616591F411CA9BA200D6E256 /* MasterViewController.h */,
616591F511CA9BA200D6E256 /* MasterViewController.m */,
- 616591DE11CA9BA200D6E256 /* DetailViewController.h */,
- 616591DF11CA9BA200D6E256 /* DetailViewController.m */,
6163EE4E11CC248D001C0453 /* First Level */,
6163EE4F11CC2497001C0453 /* Second Level */,
6163EE5011CC24A1001C0453 /* Third Level */,
@@ -1121,6 +1215,9 @@
6165920B11CA9BA200D6E256 /* WeaponSettingsViewController.m */,
616591FA11CA9BA200D6E256 /* SchemeSettingsViewController.h */,
616591FB11CA9BA200D6E256 /* SchemeSettingsViewController.m */,
+ 6199E836124647DE00DADF8C /* SupportViewController.h */,
+ 6199E837124647DE00DADF8C /* SupportViewController.m */,
+ 6199E838124647DE00DADF8C /* SupportViewController.xib */,
);
name = "First Level";
sourceTree = "";
@@ -1169,6 +1266,12 @@
616591F611CA9BA200D6E256 /* OverlayViewController.h */,
616591F711CA9BA200D6E256 /* OverlayViewController.m */,
6165925011CA9CB400D6E256 /* OverlayViewController.xib */,
+ 611EEAEB122B2A4D00DF6938 /* HelpPageViewController.h */,
+ 611EEAEC122B2A4D00DF6938 /* HelpPageViewController.m */,
+ 611EEAED122B2A4D00DF6938 /* HelpPageLobbyViewController.xib */,
+ 61842B23122B619D0096E335 /* HelpPageInGameViewController.xib */,
+ 61DE8F201257EB1100B80214 /* AmmoMenuViewController.h */,
+ 61DE8F211257EB1100B80214 /* AmmoMenuViewController.m */,
);
name = Overlay;
sourceTree = "";
@@ -1224,12 +1327,15 @@
6179936611501D1E00BA94A9 /* Overlay */ = {
isa = PBXGroup;
children = (
+ 611DA1CF124E5C6300008271 /* plus.png */,
+ 611DA030124E2BC500008271 /* background_med.png */,
611E0EE511FB20610077A41E /* ammoButton.png */,
611E0EE611FB20610077A41E /* cornerButton.png */,
61EF920511DF57AC003441C4 /* arrowDown.png */,
61EF920611DF57AC003441C4 /* arrowLeft.png */,
61EF920711DF57AC003441C4 /* arrowRight.png */,
61EF920811DF57AC003441C4 /* arrowUp.png */,
+ 611EEA7D122B09C200DF6938 /* background_small.png */,
61EF920911DF57AC003441C4 /* joyButton_attack.png */,
61EF920A11DF57AC003441C4 /* joyButton_backjump.png */,
61EF920B11DF57AC003441C4 /* joyButton_forwardjump.png */,
@@ -1237,6 +1343,29 @@
name = Overlay;
sourceTree = "";
};
+ 619C5AC1124F7DDF00D041AE /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 619C5ACA124F7DDF00D041AE /* Lua.app */,
+ 619C5ACC124F7DDF00D041AE /* libcocos2d libraries.a */,
+ 619C5ACE124F7DDF00D041AE /* libLua.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 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 = "";
+ };
61F7A42811E2905C0040BA66 /* Icons */ = {
isa = PBXGroup;
children = (
@@ -1274,14 +1403,13 @@
61F903FA11DF58680068B24D /* Frontend-iPad */ = {
isa = PBXGroup;
children = (
- 61F9043911DF64E20068B24D /* bluebox.png */,
- 61EBA62711DFF2BC0048B68A /* bricks.png */,
+ 615AD96112073B4D00F2FF04 /* startGameButton.png */,
+ 615AD9EA1207654E00F2FF04 /* helpButton.png */,
+ 615AD9E8120764CA00F2FF04 /* backButton.png */,
61EBA62811DFF2BC0048B68A /* title.png */,
- 61F9041311DF5E9B0068B24D /* toolbarBackground.png */,
61F9040C11DF59D10068B24D /* localplayButton.png */,
61F9040D11DF59D10068B24D /* netplayButton.png */,
61F9040A11DF59370068B24D /* background.png */,
- 61F7A35411E27D3C0040BA66 /* background-lobby.png */,
61EBA62C11DFF3310048B68A /* backgroundAndTitle.png */,
);
name = "Frontend-iPad";
@@ -1290,6 +1418,8 @@
9283015C0F10E48900CC5A3C /* Pascal Sources */ = {
isa = PBXGroup;
children = (
+ 61399012125D19C0003C2DC0 /* uMobile.pas */,
+ 619C5AF3124F7E3100D041AE /* LuaPas.pas */,
61798892114AA56300BA94A9 /* inc */,
61E1F4F711D004240016A5AA /* adler32.pas */,
617987E7114AA34C00BA94A9 /* hwengine.pas */,
@@ -1331,16 +1461,6 @@
};
/* End PBXGroup section */
-/* Begin PBXHeadersBuildPhase section */
- 61C325191179A300001E70B1 /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* Hedgewars */ = {
isa = PBXNativeTarget;
@@ -1361,23 +1481,6 @@
productReference = 1D6058910D05DD3D006BFB54 /* Hedgewars.app */;
productType = "com.apple.product-type.application";
};
- 61C3251C1179A300001E70B1 /* openalbridge */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 61C325351179A314001E70B1 /* Build configuration list for PBXNativeTarget "openalbridge" */;
- buildPhases = (
- 61C325191179A300001E70B1 /* Headers */,
- 61C3251A1179A300001E70B1 /* Sources */,
- 61C3251B1179A300001E70B1 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = openalbridge;
- productName = openalbridge;
- productReference = 61C3251D1179A300001E70B1 /* libopenalbridge.a */;
- productType = "com.apple.product-type.library.static";
- };
928301160F10CAFC00CC5A3C /* fpc */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9283011C0F10CB4B00CC5A3C /* Build configuration list for PBXNativeTarget "fpc" */;
@@ -1404,7 +1507,14 @@
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Hedgewars" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectReferences = (
@@ -1417,6 +1527,10 @@
ProjectRef = 611E0E4B11FA92130077A41E /* freetype.xcodeproj */;
},
{
+ ProductGroup = 619C5AC1124F7DDF00D041AE /* Products */;
+ ProjectRef = 619C5AC0124F7DDF00D041AE /* Lua.xcodeproj */;
+ },
+ {
ProductGroup = 6127232F117DF752005B90CF /* Products */;
ProjectRef = 6127232E117DF752005B90CF /* SDL_image.xcodeproj */;
},
@@ -1441,7 +1555,6 @@
targets = (
1D6058900D05DD3D006BFB54 /* Hedgewars */,
928301160F10CAFC00CC5A3C /* fpc */,
- 61C3251C1179A300001E70B1 /* openalbridge */,
6179928B114AE0C800BA94A9 /* UpdateDataFolder */,
);
};
@@ -1945,6 +2058,27 @@
remoteRef = 6184608B11DA8BF3000E1314 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
+ 619C5ACA124F7DDF00D041AE /* Lua.app */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.application;
+ path = Lua.app;
+ remoteRef = 619C5AC9124F7DDF00D041AE /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 619C5ACC124F7DDF00D041AE /* libcocos2d libraries.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = "libcocos2d libraries.a";
+ remoteRef = 619C5ACB124F7DDF00D041AE /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 619C5ACE124F7DDF00D041AE /* libLua.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libLua.a;
+ remoteRef = 619C5ACD124F7DDF00D041AE /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
@@ -1958,9 +2092,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 */,
@@ -1969,39 +2101,54 @@
61EF921211DF57AC003441C4 /* joyButton_attack.png in Resources */,
61EF921311DF57AC003441C4 /* joyButton_backjump.png in Resources */,
61EF921411DF57AC003441C4 /* joyButton_forwardjump.png in Resources */,
- 61F903EF11DF58550068B24D /* backgroundBottom.png in Resources */,
- 61F903F011DF58550068B24D /* backgroundCenter.png in Resources */,
- 61F903F111DF58550068B24D /* backgroundLeft.png in Resources */,
- 61F903F211DF58550068B24D /* backgroundRight.png in Resources */,
- 61F903F311DF58550068B24D /* backgroundTop.png in Resources */,
- 61F903F411DF58550068B24D /* borderBottom.png in Resources */,
- 61F903F511DF58550068B24D /* borderTop.png in Resources */,
- 61F903F611DF58550068B24D /* networkButton.png in Resources */,
- 61F903F711DF58550068B24D /* playButton.png in Resources */,
- 61F903F811DF58550068B24D /* storeButton.png in Resources */,
61F9040911DF58B00068B24D /* settingsButton.png in Resources */,
61F9040B11DF59370068B24D /* background.png in Resources */,
61F9040E11DF59D10068B24D /* localplayButton.png in Resources */,
- 61F9040F11DF59D10068B24D /* netplayButton.png in Resources */,
- 61F9041411DF5E9B0068B24D /* toolbarBackground.png in Resources */,
- 61F9043A11DF64E20068B24D /* bluebox.png in Resources */,
- 61EBA62911DFF2BC0048B68A /* bricks.png in Resources */,
61EBA62A11DFF2BC0048B68A /* title.png in Resources */,
61EBA62D11DFF3310048B68A /* backgroundAndTitle.png in Resources */,
- 61F7A35511E27D3C0040BA66 /* background-lobby.png in Resources */,
61F7A43811E290650040BA66 /* Icon-72.png in Resources */,
61F7A43911E290650040BA66 /* Icon-Small-50.png in Resources */,
61F7A43A11E290650040BA66 /* Icon-Small.png in Resources */,
- 61F7A43B11E290650040BA66 /* Icon-Small@2x.png in Resources */,
61F7A43C11E290650040BA66 /* Icon.png in Resources */,
- 61F7A43D11E290650040BA66 /* Icon@2x.png in Resources */,
61F7A43E11E290650040BA66 /* iTunesArtwork.png in Resources */,
6183D83E11E2BCE200A88903 /* LI-ipad-Landscape.png in Resources */,
- 6183D83F11E2BCE200A88903 /* Default.png in Resources */,
- 619C09EA11E8B8D600F1DF16 /* title_small.png in Resources */,
6129B9F711EFB04D0017E305 /* denied.png in Resources */,
611E0EE711FB20610077A41E /* ammoButton.png in Resources */,
611E0EE811FB20610077A41E /* cornerButton.png in Resources */,
+ 61F2E7CF1205EDE0005734F7 /* AboutViewController.xib in Resources */,
+ 61F2E7EC12060E31005734F7 /* checkbox.png in Resources */,
+ 615AD96212073B4D00F2FF04 /* startGameButton.png in Resources */,
+ 615AD9E9120764CA00F2FF04 /* backButton.png in Resources */,
+ 615AD9EB1207654E00F2FF04 /* helpButton.png in Resources */,
+ 6187AEBD120781B900B31A27 /* Settings in Resources */,
+ 611EE974122A9C4100DF6938 /* clickSound.wav in Resources */,
+ 611EE9D9122AA10A00DF6938 /* backSound.wav in Resources */,
+ 611EE9DA122AA10A00DF6938 /* selSound.wav in Resources */,
+ 611EEA7E122B09C200DF6938 /* background_small.png in Resources */,
+ 611EEAEF122B2A4D00DF6938 /* HelpPageLobbyViewController.xib in Resources */,
+ 611EEBC1122B34A800DF6938 /* helpingame.png in Resources */,
+ 611EEBC4122B355700DF6938 /* helpbottom.png in Resources */,
+ 611EEBC5122B355700DF6938 /* helpright.png in Resources */,
+ 611EEC31122B54D700DF6938 /* helpplain.png in Resources */,
+ 61842B24122B619D0096E335 /* HelpPageInGameViewController.xib in Resources */,
+ 61842B3E122B65BD0096E335 /* helpabove.png in Resources */,
+ 61842B40122B66280096E335 /* helpleft.png in Resources */,
+ 6199E83A124647DE00DADF8C /* SupportViewController.xib in Resources */,
+ 6199E86D12464A8E00DADF8C /* surpise.png in Resources */,
+ 611D9BFC12497E9800008271 /* SavedGamesViewController.xib in Resources */,
+ 611DA031124E2BC500008271 /* background_med.png in Resources */,
+ 611DA1D0124E5C6300008271 /* plus.png in Resources */,
+ 6147DAD31253DCDE0010357E /* savesButton.png in Resources */,
+ 610D5FB21270E2660033333A /* Icon-Small@2x.png in Resources */,
+ 610D5FB31270E26C0033333A /* Icon@2x.png in Resources */,
+ 61A670BE12747D8900B06CE7 /* borderBottom.png in Resources */,
+ 61A670BF12747D9100B06CE7 /* borderTop.png in Resources */,
+ 61A670C012747D9B00B06CE7 /* Default.png in Resources */,
+ 61A670C112747DB900B06CE7 /* MainMenuViewController-iPhone.xib in Resources */,
+ 61A670C212747DBD00B06CE7 /* MapConfigViewController-iPhone.xib in Resources */,
+ 61A670FA12747E0000B06CE7 /* playButton.png in Resources */,
+ 61A670FB12747E0D00B06CE7 /* title_small.png in Resources */,
+ 61A6710612747E4000B06CE7 /* backgroundCenter.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2019,7 +2166,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\ncp -R ${PROJECT_DIR}/../../share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some files from QTfrontend/res\nmkdir ${PROJECT_DIR}/Data/Graphics/Btn\ncp ${PROJECT_DIR}/../../QTfrontend/res/btn*.png ${PROJECT_DIR}/Data/Graphics/Btn\ncp ${PROJECT_DIR}/../../QTfrontend/res/ammopic.png ${PROJECT_DIR}/Data/Graphics/Btn/iconAmmo.png\ncp ${PROJECT_DIR}/../../QTfrontend/res/icon*.png ${PROJECT_DIR}/Data/Graphics/Btn\ncp -R ${PROJECT_DIR}/../../QTfrontend/res/botlevels ${PROJECT_DIR}/Data/Graphics/Hedgehog/botlevels\n\n#delete all CMakeLists.txt and image source files\nfind ${PROJECT_DIR}/Data -name CMakeLists.txt -delete\nfind ${PROJECT_DIR}/Data -name *.svg -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\n\n#delete desktop frontend translation\nrm -rf ${PROJECT_DIR}/Data/Locale/hedgewars_*\n\n#delete dummy maps\nrm -rf ${PROJECT_DIR}/Data/Maps/{test*,KnockBall,Ruler,BasketBall}\n\n#the following ones must be removed when their support is implemented\n\n#delete some voices\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/{Classic,British,Mobster,Pirate,Robot,Russian,Singer,Surfer}\n\n#delete all names\nrm -rf ${PROJECT_DIR}/Data/Names/\n\n#delete all missions\nrm -rf ${PROJECT_DIR}/Data/Missions/\n\n#delete all reserved hats\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/";
+ shellScript = "#copy new stuff over old stuff\nrm -rf ${PROJECT_DIR}/Data\ncp -R ${PROJECT_DIR}/../../share/hedgewars/Data ${PROJECT_DIR}/Data\n\n#copy some files from QTfrontend/res\nmkdir ${PROJECT_DIR}/Data/Graphics/Btn\ncp ${PROJECT_DIR}/../../QTfrontend/res/btn*.png ${PROJECT_DIR}/Data/Graphics/Btn\ncp ${PROJECT_DIR}/../../QTfrontend/res/ammopic.png ${PROJECT_DIR}/Data/Graphics/Btn/iconAmmo.png\ncp ${PROJECT_DIR}/../../QTfrontend/res/icon*.png ${PROJECT_DIR}/Data/Graphics/Btn\ncp -R ${PROJECT_DIR}/../../QTfrontend/res/botlevels ${PROJECT_DIR}/Data/Graphics/Hedgehog/botlevels\n\n#delete all CMakeLists.txt and image source files\nfind ${PROJECT_DIR}/Data -name CMakeLists.txt -delete\nfind ${PROJECT_DIR}/Data -name *.svg -delete\nfind ${PROJECT_DIR}/Data -name *.svgz -delete\nfind ${PROJECT_DIR}/Data -name *.sifz -delete\nfind ${PROJECT_DIR}/Data -name *.xcf -delete\nfind ${PROJECT_DIR}/Data -name *.orig -delete\n\n#delete desktop frontend translation\nrm -rf ${PROJECT_DIR}/Data/Locale/hedgewars_*\n\n#delete dummy maps and hats\nrm -rf ${PROJECT_DIR}/Data/Maps/{test*,Ruler}\nrm -rf ${PROJECT_DIR}/Data/Hats/{TeamCap,TeamHeadband,TeamHair}\n\n#copy mono audio\ncp -R ${PROJECT_DIR}/audio/* ${PROJECT_DIR}/Data/\n\n#the following ones must be removed when their support is implemented\nrm -rf ${PROJECT_DIR}/Data/Maps/{Cheese,FlightJoust}\n\n#move Lua maps in Missions\nmkdir ${PROJECT_DIR}/Data/Missions/Maps/\nmv ${PROJECT_DIR}/Data/Maps/{Basketball,Knockball} ${PROJECT_DIR}/Data/Missions/Maps/\n\n#reduce the number of flakes for City\nawk '{if ($1 == 1500) $1=40; print $0}' < ${PROJECT_DIR}/Data/Themes/City/theme.cfg > /tmp/tempfile\nmv /tmp/tempfile ${PROJECT_DIR}/Data/Themes/City/theme.cfg\n\n#remove Isalnd from the list of Themes\nawk '{if ($1 != \"Island\") print $0}' < ${PROJECT_DIR}/Data/Themes/themes.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Themes/themes.cfg\n\n#remove Isalnd from the Maps and themes\nrm -rf ${PROJECT_DIR}/Data/Themes/Island\nawk '{if ($1 == \"Island\") print \"Nature\"}' < ${PROJECT_DIR}/Data/Maps/Cave/map.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Maps/Cave/map.cfg\nawk '{if ($1 == \"Island\") print \"Nature\"}' < ${PROJECT_DIR}/Data/Maps/Lonely_Island/map.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Maps/Lonely_Island/map.cfg\nawk '{if ($1 == \"Island\") print \"Nature\"}' < ${PROJECT_DIR}/Data/Maps/PirateFlag/map.cfg > /tmp/tempfile && mv /tmp/tempfile ${PROJECT_DIR}/Data/Maps/PirateFlag/map.cfg\n\n#delete the Classic voice\nrm -rf ${PROJECT_DIR}/Data/Sounds/voices/Classic\n\n#delete useless fonts\nrm -rf ${PROJECT_DIR}/Data/Fonts/{wqy-zenhei.ttc,DroidSansFallback.ttf}\n\n#delete all names, reserved hats\nrm -rf ${PROJECT_DIR}/Data/Names/\nrm -rf ${PROJECT_DIR}/Data/Graphics/Hats/Reserved/\n";
showEnvVarsInLog = 0;
};
9283011B0F10CB2D00CC5A3C /* Build libfpc.a */ = {
@@ -2092,7 +2239,6 @@
6179883C114AA34C00BA94A9 /* uVisualGears.pas in Sources */,
6179883D114AA34C00BA94A9 /* uWorld.pas in Sources */,
611F4D4B11B27A9900F9759A /* uScript.pas in Sources */,
- 6165920C11CA9BA200D6E256 /* DetailViewController.m in Sources */,
6165920D11CA9BA200D6E256 /* FlagsViewController.m in Sources */,
6165920E11CA9BA200D6E256 /* FortsViewController.m in Sources */,
6165920F11CA9BA200D6E256 /* GameConfigViewController.m in Sources */,
@@ -2126,13 +2272,14 @@
61F904D711DF7DA30068B24D /* WeaponCellView.m in Sources */,
61B3D71C11EA6F2700EC7420 /* uKeys.pas in Sources */,
61C079E411F35A300072BF46 /* EditableCellView.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 61C3251A1179A300001E70B1 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
+ 61F2E7CE1205EDE0005734F7 /* AboutViewController.m in Sources */,
+ 611EEAEE122B2A4D00DF6938 /* HelpPageViewController.m in Sources */,
+ 6199E839124647DE00DADF8C /* SupportViewController.m in Sources */,
+ 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;
};
@@ -2154,6 +2301,8 @@
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
+ GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Hedgewars_Prefix.pch;
@@ -2162,8 +2311,12 @@
"$(inherited)",
"\"$(SRCROOT)\"",
);
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-lgcov",
+ );
PRODUCT_NAME = Hedgewars;
- TARGETED_DEVICE_FAMILY = "1,2";
+ TARGETED_DEVICE_FAMILY = "$(inherited)";
};
name = Debug;
};
@@ -2186,13 +2339,107 @@
PRODUCT_NAME = Hedgewars;
PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
- TARGETED_DEVICE_FAMILY = "1,2";
+ TARGETED_DEVICE_FAMILY = "$(inherited)";
};
name = Release;
};
- 6137064B117B1CB3004EE44A /* Distribution */ = {
+ 61022D7C12305A2800B08935 /* DistributionAppStore */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ APPLY_RULES_IN_COPY_FILES = YES;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CODE_SIGN_IDENTITY = "iPhone Distribution: Vittorio Giovara";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Vittorio Giovara";
+ FPC_COMMON_OPTIONS = "-dIPHONEOS -Cs2000000 -vwi -B -Sgix -Sc";
+ FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.5.1;
+ FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas";
+ FPC_RTL_UNITS_BASE = /usr/local/lib/fpc;
+ FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -O-2 -Xs -Cfvfpv2 -dNOCONSOLE";
+ FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\"";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_DEBUGGING_SYMBOLS = default;
+ GCC_FAST_MATH = YES;
+ GCC_OPTIMIZATION_LEVEL = 2;
+ GCC_PREPROCESSOR_DEFINITIONS = "";
+ GCC_STRICT_ALIASING = YES;
+ GCC_THUMB_SUPPORT = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/events\"",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/video\"/**",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include/\"",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net/\"",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer/\"",
+ );
+ IPHONEOS_DEPLOYMENT_TARGET = 3.2;
+ ONLY_ACTIVE_ARCH = NO;
+ OTHER_LDFLAGS = (
+ "-lz",
+ "-Wl,-no_order_inits",
+ );
+ PREBINDING = NO;
+ PROVISIONING_PROFILE = "450C4020-346A-4F44-8DDE-E71300796C94";
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "450C4020-346A-4F44-8DDE-E71300796C94";
+ SDKROOT = iphoneos4.1;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ VALID_ARCHS = "armv6 armv7";
+ };
+ name = DistributionAppStore;
+ };
+ 61022D7D12305A2800B08935 /* DistributionAppStore */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CODE_SIGN_ENTITLEMENTS = "Entitlements-Development.plist";
+ CODE_SIGN_IDENTITY = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = Hedgewars_Prefix.pch;
+ INFOPLIST_FILE = Info.plist;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)\"",
+ );
+ PRODUCT_NAME = Hedgewars;
+ PROVISIONING_PROFILE = "";
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+ TARGETED_DEVICE_FAMILY = "$(inherited)";
+ };
+ name = DistributionAppStore;
+ };
+ 61022D7E12305A2800B08935 /* DistributionAppStore */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ PREBINDING = NO;
+ PRODUCT_NAME = fpc;
+ ZERO_LINK = NO;
+ };
+ name = DistributionAppStore;
+ };
+ 61022D7F12305A2800B08935 /* DistributionAppStore */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ PRODUCT_NAME = UpdateDataFolder;
+ ZERO_LINK = NO;
+ };
+ name = DistributionAppStore;
+ };
+ 6137064B117B1CB3004EE44A /* DistributionAdHoc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ APPLY_RULES_IN_COPY_FILES = YES;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_ENTITLEMENTS = "Entitlements-Distribution.plist";
CODE_SIGN_IDENTITY = "iPhone Distribution";
@@ -2207,19 +2454,20 @@
GCC_DEBUGGING_SYMBOLS = default;
GCC_FAST_MATH = YES;
GCC_OPTIMIZATION_LEVEL = 2;
+ GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_STRICT_ALIASING = YES;
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
- /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/\"/**",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/events\"",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/video\"/**",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include/\"",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net/\"",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer/\"",
);
- IPHONEOS_DEPLOYMENT_TARGET = 3.1;
+ IPHONEOS_DEPLOYMENT_TARGET = 3.2;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"-lz",
@@ -2228,14 +2476,14 @@
PREBINDING = NO;
PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
- SDKROOT = iphoneos4.0;
+ SDKROOT = iphoneos4.1;
TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_PRODUCT = NO;
- VALID_ARCHS = "armv7 armv6";
+ VALIDATE_PRODUCT = YES;
+ VALID_ARCHS = "armv6 armv7";
};
- name = Distribution;
+ name = DistributionAdHoc;
};
- 6137064C117B1CB3004EE44A /* Distribution */ = {
+ 6137064C117B1CB3004EE44A /* DistributionAdHoc */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
@@ -2252,11 +2500,11 @@
);
PRODUCT_NAME = Hedgewars;
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
- TARGETED_DEVICE_FAMILY = "1,2";
+ TARGETED_DEVICE_FAMILY = "$(inherited)";
};
- name = Distribution;
+ name = DistributionAdHoc;
};
- 6137064D117B1CB3004EE44A /* Distribution */ = {
+ 6137064D117B1CB3004EE44A /* DistributionAdHoc */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
@@ -2267,33 +2515,9 @@
PRODUCT_NAME = fpc;
ZERO_LINK = NO;
};
- name = Distribution;
+ name = DistributionAdHoc;
};
- 6137064E117B1CB3004EE44A /* Distribution */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- HEADER_SEARCH_PATHS = (
- /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
- "\"$(SRCROOT)/../../../Library/lpng141\"",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer\"",
- "\"$(SRCROOT)/../../../Library/libvorbis-1.3.1/include\"",
- "\"$(SRCROOT)/../../../Library/libogg-1.2.0/include\"",
- );
- OTHER_LDFLAGS = "";
- PREBINDING = NO;
- PRODUCT_NAME = openalbridge;
- ZERO_LINK = NO;
- };
- name = Distribution;
- };
- 6137064F117B1CB3004EE44A /* Distribution */ = {
+ 6137064F117B1CB3004EE44A /* DistributionAdHoc */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
@@ -2302,11 +2526,12 @@
PRODUCT_NAME = UpdateDataFolder;
ZERO_LINK = NO;
};
- name = Distribution;
+ name = DistributionAdHoc;
};
6164429D11B5CDE500B9A6F3 /* Valgrind */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ APPLY_RULES_IN_COPY_FILES = YES;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)";
@@ -2331,23 +2556,23 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
- /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/\"/**",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/events\"",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/video\"/**",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include/\"",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net/\"",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer/\"",
);
- IPHONEOS_DEPLOYMENT_TARGET = 3.1;
+ IPHONEOS_DEPLOYMENT_TARGET = 3.2;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"-lz",
"-Wl,-no_order_inits",
);
PREBINDING = NO;
- SDKROOT = iphoneos4.0;
+ SDKROOT = iphoneos4.1;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = NO;
- VALID_ARCHS = "armv7 armv6";
+ VALID_ARCHS = "armv6 armv7";
};
name = Valgrind;
};
@@ -2367,7 +2592,7 @@
"\"$(SRCROOT)\"",
);
PRODUCT_NAME = Hedgewars;
- TARGETED_DEVICE_FAMILY = "1,2";
+ TARGETED_DEVICE_FAMILY = "$(inherited)";
};
name = Valgrind;
};
@@ -2383,29 +2608,6 @@
};
name = Valgrind;
};
- 616442A011B5CDE500B9A6F3 /* Valgrind */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- HEADER_SEARCH_PATHS = (
- /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
- "\"$(SRCROOT)/../../../Library/lpng141\"",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer\"",
- "\"$(SRCROOT)/../../../Library/libvorbis-1.3.1/include\"",
- "\"$(SRCROOT)/../../../Library/libogg-1.2.0/include\"",
- );
- OTHER_LDFLAGS = "";
- PREBINDING = NO;
- PRODUCT_NAME = openalbridge;
- };
- name = Valgrind;
- };
616442A111B5CDE500B9A6F3 /* Valgrind */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -2437,53 +2639,6 @@
};
name = Release;
};
- 61C3251E1179A300001E70B1 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- HEADER_SEARCH_PATHS = (
- /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
- "\"$(SRCROOT)/../../../Library/lpng141\"",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer\"",
- "\"$(SRCROOT)/../../../Library/libvorbis-1.3.1/include\"",
- "\"$(SRCROOT)/../../../Library/libogg-1.2.0/include\"",
- );
- OTHER_LDFLAGS = "";
- PREBINDING = NO;
- PRODUCT_NAME = openalbridge;
- };
- name = Debug;
- };
- 61C3251F1179A300001E70B1 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- HEADER_SEARCH_PATHS = (
- /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
- "\"$(SRCROOT)/../../../Library/lpng141\"",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer\"",
- "\"$(SRCROOT)/../../../Library/libvorbis-1.3.1/include\"",
- "\"$(SRCROOT)/../../../Library/libogg-1.2.0/include\"",
- );
- OTHER_LDFLAGS = "";
- PREBINDING = NO;
- PRODUCT_NAME = openalbridge;
- ZERO_LINK = NO;
- };
- name = Release;
- };
928301180F10CAFD00CC5A3C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -2512,6 +2667,7 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ APPLY_RULES_IN_COPY_FILES = YES;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Vittorio Giovara (DC2BRETXAC)";
@@ -2529,33 +2685,34 @@
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_STRICT_ALIASING = YES;
GCC_THUMB_SUPPORT = NO;
- GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
- /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/\"/**",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/events\"",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/video\"/**",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include/\"",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net/\"",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer/\"",
);
- IPHONEOS_DEPLOYMENT_TARGET = 3.1;
+ IPHONEOS_DEPLOYMENT_TARGET = 3.2;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"-lz",
"-Wl,-no_order_inits",
);
PREBINDING = NO;
- SDKROOT = iphoneos4.0;
+ SDKROOT = iphoneos4.1;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = NO;
- VALID_ARCHS = "armv7 armv6";
+ VALID_ARCHS = "armv6 armv7";
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ APPLY_RULES_IN_COPY_FILES = YES;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -2563,7 +2720,7 @@
FPC_COMPILER_BINARY_DIR = /usr/local/lib/fpc/2.5.1;
FPC_MAIN_FILE = "$(PROJECT_DIR)/../../hedgewars/hwLibrary.pas";
FPC_RTL_UNITS_BASE = /usr/local/lib/fpc;
- FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -O-2 -Xs -Cfvfpv2";
+ FPC_SPECIFIC_OPTIONS = "-Ci- -Cr- -Co- -O-2 -Xs -Cfvfpv2 -dDEBUGFILE";
FPC_UNITS_PATH = "-Fu\"$(PROJECT_DIR)\"";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_DEBUGGING_SYMBOLS = default;
@@ -2576,13 +2733,13 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
- /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
- "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/\"/**",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/events\"",
+ "\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/video\"/**",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include/\"",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net/\"",
"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_mixer/\"",
);
- IPHONEOS_DEPLOYMENT_TARGET = 3.1;
+ IPHONEOS_DEPLOYMENT_TARGET = 3.2;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"-lz",
@@ -2591,10 +2748,10 @@
PREBINDING = NO;
PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
- SDKROOT = iphoneos4.0;
+ SDKROOT = iphoneos4.1;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = NO;
- VALID_ARCHS = "armv7 armv6";
+ VALID_ARCHS = "armv6 armv7";
};
name = Release;
};
@@ -2606,7 +2763,8 @@
buildConfigurations = (
1D6058940D05DD3E006BFB54 /* Debug */,
1D6058950D05DD3E006BFB54 /* Release */,
- 6137064C117B1CB3004EE44A /* Distribution */,
+ 6137064C117B1CB3004EE44A /* DistributionAdHoc */,
+ 61022D7D12305A2800B08935 /* DistributionAppStore */,
6164429E11B5CDE500B9A6F3 /* Valgrind */,
);
defaultConfigurationIsVisible = 0;
@@ -2617,29 +2775,20 @@
buildConfigurations = (
6179928C114AE0C800BA94A9 /* Debug */,
6179928D114AE0C800BA94A9 /* Release */,
- 6137064F117B1CB3004EE44A /* Distribution */,
+ 6137064F117B1CB3004EE44A /* DistributionAdHoc */,
+ 61022D7F12305A2800B08935 /* DistributionAppStore */,
616442A111B5CDE500B9A6F3 /* Valgrind */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- 61C325351179A314001E70B1 /* Build configuration list for PBXNativeTarget "openalbridge" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 61C3251E1179A300001E70B1 /* Debug */,
- 61C3251F1179A300001E70B1 /* Release */,
- 6137064E117B1CB3004EE44A /* Distribution */,
- 616442A011B5CDE500B9A6F3 /* Valgrind */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
9283011C0F10CB4B00CC5A3C /* Build configuration list for PBXNativeTarget "fpc" */ = {
isa = XCConfigurationList;
buildConfigurations = (
928301180F10CAFD00CC5A3C /* Debug */,
928301190F10CAFD00CC5A3C /* Release */,
- 6137064D117B1CB3004EE44A /* Distribution */,
+ 6137064D117B1CB3004EE44A /* DistributionAdHoc */,
+ 61022D7E12305A2800B08935 /* DistributionAppStore */,
6164429F11B5CDE500B9A6F3 /* Valgrind */,
);
defaultConfigurationIsVisible = 0;
@@ -2650,7 +2799,8 @@
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
- 6137064B117B1CB3004EE44A /* Distribution */,
+ 6137064B117B1CB3004EE44A /* DistributionAdHoc */,
+ 61022D7C12305A2800B08935 /* DistributionAppStore */,
6164429D11B5CDE500B9A6F3 /* Valgrind */,
);
defaultConfigurationIsVisible = 0;
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Hedgewars_Prefix.pch
--- a/project_files/HedgewarsMobile/Hedgewars_Prefix.pch Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Hedgewars_Prefix.pch Wed Oct 27 14:02:20 2010 +0200
@@ -1,11 +1,32 @@
-//
-// Prefix header for all source files of the 'OpenGL ES app' target in the 'OpenGL ES app' project
-//
+/*
+ * Hedgewars-iOS, a Hedgewars port for iOS devices
+ * Copyright (c) 2009-2010 Vittorio Giovara
+ *
+ * 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.
+ */
#ifdef __OBJC__
#import
#import
#import
+#import "PascalImports.h"
+#import "UIImageExtra.h"
+#import "CommodityFunctions.h"
+#import "SDL.h"
+#import "SDL_video.h"
+#import "SDL_net.h"
+#import "SDL_mixer.h"
#endif
// by http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/
@@ -19,7 +40,7 @@
#endif
#define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#endif
-
+
#define ZAssert(condition, ...) do { if (!(condition)) { ALog(__VA_ARGS__); }} while(0)
// by http://blog.coriolis.ch/2009/01/05/macros-for-xcode/
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Info.plist
--- a/project_files/HedgewarsMobile/Info.plist Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Info.plist Wed Oct 27 14:02:20 2010 +0200
@@ -28,9 +28,13 @@
CFBundleSignature
????
CFBundleVersion
- 1.0
+ 1.2
LSRequiresIPhoneOS
+ UIApplicationExitsOnSuspend
+
+ UILaunchImageFile~ipad
+ LI-ipad
UIStatusBarHidden
UISupportedInterfaceOrientations
@@ -38,11 +42,5 @@
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
- UILaunchImageFile~ipad
- LI-ipad
- UILaunchImageFile~iphone
- LI-iphone
- UIApplicationExitsOnSuspend
-
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/Frontend-iPad/backButton.png
Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/backButton.png has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/Frontend-iPad/background-lobby.png
Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/background-lobby.png has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/Frontend-iPad/bluebox.png
Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/bluebox.png has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/Frontend-iPad/helpButton.png
Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/helpButton.png has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/Frontend-iPad/localplayButton.png
Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/localplayButton.png has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/Frontend-iPad/netplayButton.png
Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/netplayButton.png has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/Frontend-iPad/startGameButton.png
Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/startGameButton.png has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/Frontend-iPad/toolbarBackground.png
Binary file project_files/HedgewarsMobile/Resources/Frontend-iPad/toolbarBackground.png has changed
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/MainMenuViewController-iPad.xib
--- a/project_files/HedgewarsMobile/Resources/MainMenuViewController-iPad.xib Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Resources/MainMenuViewController-iPad.xib Wed Oct 27 14:02:20 2010 +0200
@@ -1,7 +1,7 @@
- 800
+ 1024
10F569
788
1038.29
@@ -57,7 +57,7 @@
292
- {{154, 417}, {258, 215}}
+ {{383, 427}, {263, 244}}
NO
IBIPadFramework
@@ -68,7 +68,7 @@
15
16
- 188
+ 215
0.0
0.0
0.0
@@ -90,39 +90,13 @@
localplayButton.png
-
-
- 292
- {{611, 417}, {258, 215}}
-
- NO
- 1
- IBIPadFramework
- 0
- 0
-
- 188
- 0.0
- 0.0
- 0.0
- Multiplayer
-
-
- 2
- MC45OTYwNzg0OTEyIDAuODAwMDAwMDcxNSAwLjAzOTIxNTY4NzY2AA
-
-
-
- NSImage
- netplayButton.png
-
-
292
- {{20, 729}, {18, 19}}
+ {{788, 300}, {18, 19}}
NO
+ 0.31690141558647156
3
IBIPadFramework
0
@@ -137,37 +111,10 @@
-
-
- 292
- {{390, 345}, {243, 21}}
-
- NO
- YES
- 7
- NO
- IBIPadFramework
-
-
- Helvetica-Oblique
- 17
- 16
-
-
- 1
- MSAxIDEAA
-
- 1
-
-
-
- 1
- 10
-
292
- {{476, 686}, {72, 62}}
+ {{932, 686}, {72, 62}}
NO
2
@@ -186,6 +133,28 @@
settingsButton.png
+
+
+ 292
+ {{20, 686}, {72, 62}}
+
+ NO
+ 4
+ IBIPadFramework
+ 0
+ 0
+
+
+
+ 1
+ MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA
+
+
+
+ NSImage
+ savesButton.png
+
+
{1024, 768}
@@ -231,29 +200,21 @@
switchViews:
-
-
- 7
-
- 49
-
-
-
- versionLabel
-
-
-
- 51
-
-
-
- switchViews:
7
54
+
+
+ switchViews:
+
+
+ 7
+
+ 89
+
@@ -270,10 +231,9 @@
YES
-
+
-
-
+
@@ -296,22 +256,11 @@
local
- 40
-
-
- multi
-
-
45
- 50
-
-
-
-
52
@@ -321,6 +270,11 @@
+
+ 88
+
+
+
@@ -333,10 +287,9 @@
1.IBPluginDependency
37.IBPluginDependency
39.IBPluginDependency
- 40.IBPluginDependency
45.IBPluginDependency
- 50.IBPluginDependency
52.IBPluginDependency
+ 88.IBPluginDependency
YES
@@ -349,7 +302,6 @@
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- com.apple.InterfaceBuilder.IBCocoaTouchPlugin
@@ -368,7 +320,7 @@
- 87
+ 89
@@ -387,17 +339,6 @@
id
-
- versionLabel
- UILabel
-
-
- versionLabel
-
- versionLabel
- UILabel
-
-
IBProjectSource
Classes/MainMenuViewController.h
@@ -445,13 +386,6 @@
NSObject
IBFrameworkSource
- Foundation.framework/Headers/NSNetServices.h
-
-
-
- NSObject
-
- IBFrameworkSource
Foundation.framework/Headers/NSObject.h
@@ -459,13 +393,6 @@
NSObject
IBFrameworkSource
- Foundation.framework/Headers/NSPort.h
-
-
-
- NSObject
-
- IBFrameworkSource
Foundation.framework/Headers/NSRunLoop.h
@@ -473,13 +400,6 @@
NSObject
IBFrameworkSource
- Foundation.framework/Headers/NSStream.h
-
-
-
- NSObject
-
- IBFrameworkSource
Foundation.framework/Headers/NSThread.h
@@ -501,13 +421,6 @@
NSObject
IBFrameworkSource
- Foundation.framework/Headers/NSXMLParser.h
-
-
-
- NSObject
-
- IBFrameworkSource
QuartzCore.framework/Headers/CAAnimation.h
@@ -564,14 +477,6 @@
- UILabel
- UIView
-
- IBFrameworkSource
- UIKit.framework/Headers/UILabel.h
-
-
-
UIResponder
NSObject
@@ -649,7 +554,7 @@
IBIPadFramework
com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS
-
+
com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3
@@ -664,14 +569,14 @@
YES
backgroundAndTitle.png
localplayButton.png
- netplayButton.png
+ savesButton.png
settingsButton.png
YES
{1024, 768}
{263, 244}
- {263, 244}
+ {61, 59}
{61, 59}
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/MainMenuViewController-iPhone.xib
--- a/project_files/HedgewarsMobile/Resources/MainMenuViewController-iPhone.xib Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Resources/MainMenuViewController-iPhone.xib Wed Oct 27 14:02:20 2010 +0200
@@ -1,18 +1,18 @@
- 800
+ 1024
10F569
- 788
+ 804
1038.29
461.00
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- 117
+ 123
YES
-
+
YES
@@ -62,7 +62,7 @@
293
- {{118, 25}, {240, 52}}
+ {{120, 44}, {240, 52}}
NO
NO
@@ -77,7 +77,7 @@
289
- {{240, 102}, {220, 52}}
+ {{130, 166}, {220, 52}}
1
@@ -110,88 +110,10 @@
playButton.png
-
-
- 265
- {{240, 177}, {220, 52}}
-
-
- 1
- MCAwIDAgMAA
-
- NO
- NO
- 3
- IBCocoaTouchFramework
- 0
- 0
-
-
-
- 1
- MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA
-
-
-
- NSImage
- networkButton.png
-
-
-
-
- 260
- {{12, 144}, {220, 52}}
-
-
- 1
- MCAwIDAgMAA
-
- NO
- NO
- 3
- IBCocoaTouchFramework
- 0
- 0
-
-
-
- 3
- MAA
-
-
-
- NSImage
- storeButton.png
-
-
-
-
- 292
- {{37, 102}, {168, 21}}
-
- NO
- YES
- NO
- IBCocoaTouchFramework
-
-
- Helvetica-Oblique
- 17
- 16
-
-
- 1
- MSAxIDEAA
-
-
- 1
- 10
- 1
-
269
- {{209, 237}, {59, 52}}
+ {{401, 247}, {59, 52}}
NO
NO
@@ -211,6 +133,29 @@
settingsButton.png
+
+
+ 269
+ {{20, 247}, {59, 52}}
+
+ NO
+ NO
+ 4
+ IBCocoaTouchFramework
+ 0
+ 0
+
+
+
+ 1
+ MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA
+
+
+
+ NSImage
+ savesButton.png
+
+
290
@@ -244,9 +189,10 @@
292
- {{20, 270}, {18, 19}}
+ {{0, 20}, {18, 19}}
NO
+ 0.5
3
IBCocoaTouchFramework
0
@@ -295,32 +241,6 @@
30
-
- versionLabel
-
-
-
- 37
-
-
-
- switchViews:
-
-
- 7
-
- 38
-
-
-
- switchViews:
-
-
- 7
-
- 39
-
-
switchViews:
@@ -338,6 +258,15 @@
42
+
+
+ switchViews:
+
+
+ 7
+
+ 44
+
@@ -354,15 +283,13 @@
YES
-
-
+
-
-
+
-
+
@@ -398,21 +325,6 @@
- 25
-
-
-
-
- 26
-
-
-
-
- 27
-
-
-
-
28
@@ -427,6 +339,11 @@
+
+ 43
+
+
+
@@ -439,14 +356,17 @@
1.IBPluginDependency
22.IBPluginDependency
23.IBPluginDependency
+ 23.IBViewBoundsToFrameTransform
24.IBPluginDependency
- 25.IBPluginDependency
- 26.IBPluginDependency
- 27.IBPluginDependency
+ 24.IBViewBoundsToFrameTransform
28.IBPluginDependency
+ 28.IBViewBoundsToFrameTransform
35.IBPluginDependency
36.IBPluginDependency
41.IBPluginDependency
+ 41.IBViewBoundsToFrameTransform
+ 43.IBPluginDependency
+ 43.IBViewBoundsToFrameTransform
YES
@@ -456,14 +376,27 @@
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+ P4AAAL+AAABC7AAAwpYAAA
+
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+ P4AAAL+AAABC7AAAw0gAAA
+
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+ AUPIgABDdwAAA
+
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+ P4AAAL+AAABBoAAAw4+AAA
+
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- com.apple.InterfaceBuilder.IBCocoaTouchPlugin
+
+ P4AAAL+AAABDywAAw5cAAA
+
@@ -482,7 +415,7 @@
- 42
+ 44
@@ -501,17 +434,6 @@
id
-
- versionLabel
- UILabel
-
-
- versionLabel
-
- versionLabel
- UILabel
-
-
IBProjectSource
Classes/MainMenuViewController.h
@@ -559,13 +481,6 @@
NSObject
IBFrameworkSource
- Foundation.framework/Headers/NSNetServices.h
-
-
-
- NSObject
-
- IBFrameworkSource
Foundation.framework/Headers/NSObject.h
@@ -573,13 +488,6 @@
NSObject
IBFrameworkSource
- Foundation.framework/Headers/NSPort.h
-
-
-
- NSObject
-
- IBFrameworkSource
Foundation.framework/Headers/NSRunLoop.h
@@ -587,13 +495,6 @@
NSObject
IBFrameworkSource
- Foundation.framework/Headers/NSStream.h
-
-
-
- NSObject
-
- IBFrameworkSource
Foundation.framework/Headers/NSThread.h
@@ -615,13 +516,6 @@
NSObject
IBFrameworkSource
- Foundation.framework/Headers/NSXMLParser.h
-
-
-
- NSObject
-
- IBFrameworkSource
QuartzCore.framework/Headers/CAAnimation.h
@@ -678,14 +572,6 @@
- UILabel
- UIView
-
- IBFrameworkSource
- UIKit.framework/Headers/UILabel.h
-
-
-
UIResponder
NSObject
@@ -763,7 +649,7 @@
IBCocoaTouchFramework
com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS
-
+
com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3
@@ -779,10 +665,9 @@
backgroundCenter.png
borderBottom.png
borderTop.png
- networkButton.png
playButton.png
+ savesButton.png
settingsButton.png
- storeButton.png
title_small.png
@@ -790,13 +675,12 @@
{480, 278}
{480, 21}
{480, 21}
- {217, 51}
{216, 51}
{61, 59}
- {216, 51}
+ {61, 59}
{262, 84}
- 117
+ 123
diff -r 793386610068 -r b1c2c2f6fc5e project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib
--- a/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Thu Aug 26 23:59:18 2010 +0200
+++ b/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Wed Oct 27 14:02:20 2010 +0200
@@ -1,7 +1,7 @@
- 800
+ 1024
10F569
788
1038.29
@@ -12,7 +12,7 @@
YES
-
+
YES
@@ -45,107 +45,70 @@
292
- {1024, 704}
+ {1024, 768}
+ NO
NO
IBIPadFramework
NSImage
- background-lobby.png
-
-
-
-
- 292
- {{1, 214}, {304, 490}}
-
- NO
- NO
- IBIPadFramework
-
- NSImage
- bluebox.png
+ background.png
-
-
- 292
- {{715, 214}, {309, 490}}
-
- NO
- NO
- IBIPadFramework
-
-
-
-
- 292
- {{357, 214}, {309, 490}}
-
- NO
- NO
- IBIPadFramework
-
-
-
-
- 292
- {{17, 20}, {272, 162}}
-
- NO
- NO
- IBIPadFramework
-
-
289
- {{754, 169}, {240, 30}}
+ {{725, 166}, {277, 30}}
NO
IBIPadFramework
2
- 3
- 0
+ 4
+ 1
YES
Random
Map
Maze
+ Mission
YES
+
YES
+
YES
{0, 0}
{0, 0}
{0, 0}
+ {0, 0}
YES
+
1
- MCAwLjUwMTk2MDgxNCAwAA
+ MCAwIDAAA
292
- {{75, 138}, {149, 23}}
+ {{263, 723}, {149, 23}}
NO
IBIPadFramework
@@ -157,7 +120,7 @@
289
- {{746, 20}, {256, 128}}
+ {{736, 26}, {256, 128}}
NO
IBIPadFramework
@@ -188,7 +151,7 @@
292
- {{129, 41}, {42, 21}}
+ {{778, 724}, {42, 21}}
NO
YES
@@ -196,6 +159,11 @@
NO
IBIPadFramework
...
+
+ Helvetica-Bold
+ 17
+ 16
+
2
MC45MTc2NDcxMjMzIDAuNjc0NTA5ODIzMyAwAA
@@ -208,7 +176,7 @@