--- a/project_files/HedgewarsMobile/Classes/CreationChamber.m Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Classes/CreationChamber.m Thu Dec 09 22:51:07 2010 +0100
@@ -148,6 +148,7 @@
NSMutableArray *basicArray = [[NSMutableArray alloc] initWithObjects:
[NSNumber numberWithInt:100], //initialhealth
[NSNumber numberWithInt:45], //turntime
+ [NSNumber numberWithInt:3], //minestime
[NSNumber numberWithInt:100], //damagemodifier
[NSNumber numberWithInt:15], //suddendeathtimeout
[NSNumber numberWithInt:47], //waterrise
@@ -156,7 +157,6 @@
[NSNumber numberWithInt:5], //cratedrops
[NSNumber numberWithInt:35], //healthprob
[NSNumber numberWithInt:25], //healthamount
- [NSNumber numberWithInt:3], //minestime
[NSNumber numberWithInt:4], //minesnumber
[NSNumber numberWithInt:0], //dudmines
[NSNumber numberWithInt:2], //explosives
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m Thu Dec 09 22:51:07 2010 +0100
@@ -165,7 +165,6 @@
[schemePath release];
NSArray *basicArray = [schemeDictionary objectForKey:@"basic"];
NSArray *gamemodArray = [schemeDictionary objectForKey:@"gamemod"];
- int i = 0;
int result = 0;
int mask = 0x00000004;
@@ -184,22 +183,23 @@
NSArray *mods = [[NSArray alloc] initWithContentsOfFile:path];
[path release];
+ int i = 0;
// initial health
- result = [[basicArray objectAtIndex:0] intValue];
+ result = [[basicArray objectAtIndex:i++] intValue];
// turn time
- NSInteger tentativeTurntime = [[basicArray objectAtIndex:1] intValue];
+ 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];
- NSString *minesTime = [[NSString alloc] initWithFormat:@"e$turntime %d",[[basicArray objectAtIndex:2] intValue] * 1000];
+ NSString *minesTime = [[NSString alloc] initWithFormat:@"e$turntime %d",[[basicArray objectAtIndex:i++] intValue] * 1000];
[self sendToEngine:minesTime];
[minesTime release];
- for (i = 2; i < [basicArray count]; i++) {
+ for (; i < [basicArray count]; i++) {
NSDictionary *basicDict = [mods objectAtIndex:i];
NSString *command = [basicDict objectForKey:@"command"];
NSInteger value = [[basicArray objectAtIndex:i] intValue];
--- a/project_files/HedgewarsMobile/Classes/HoldTableViewCell.h Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Classes/HoldTableViewCell.h Thu Dec 09 22:51:07 2010 +0100
@@ -29,6 +29,7 @@
@interface HoldTableViewCell : UITableViewCell {
id<HoldTableViewCellDelegate> delegate;
+ NSTimeInterval time;
}
@property (nonatomic,assign) id<HoldTableViewCellDelegate> delegate;
--- a/project_files/HedgewarsMobile/Classes/HoldTableViewCell.m Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Classes/HoldTableViewCell.m Thu Dec 09 22:51:07 2010 +0100
@@ -18,8 +18,6 @@
* File created on 03/07/2010.
*/
-//http://devblog.wm-innovations.com/2010/03/30/custom-swipe-uitableviewcell/
-
#import "HoldTableViewCell.h"
#import "CGPointUtils.h"
@@ -38,17 +36,25 @@
}
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
- [self performSelector:@selector(holdAction) withObject:nil afterDelay:0.4];
+ UITouch *touch = [[event allTouches] anyObject];
+
+ time = touch.timestamp;
+ [self performSelector:@selector(holdAction) withObject:nil afterDelay:0.25];
[super touchesBegan:touches withEvent:event];
}
-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
- [NSObject cancelPreviousPerformRequestsWithTarget:self
- selector:@selector(holdAction)
- object:nil];
-
- [super touchesEnded:touches withEvent:event];
+ UITouch *touch = [[event allTouches] anyObject];
+
+ if ( touch.timestamp - time < 0.25 ) {
+ [NSObject cancelPreviousPerformRequestsWithTarget:self
+ selector:@selector(holdAction)
+ object:nil];
+
+ [super touchesEnded:touches withEvent:event];
+ } else
+ [super touchesCancelled:touches withEvent:event];
}
-(void) holdAction {
--- a/project_files/HedgewarsMobile/Classes/ObjcExports.m Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Classes/ObjcExports.m Thu Dec 09 22:51:07 2010 +0100
@@ -171,14 +171,14 @@
Float32 volume;
OSStatus n = AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareOutputVolume, &propertySize, &volume);
if (n != 0)
- DLog( @"AudioSessionGetProperty: %d", n );
+ DLog( @"AudioSessionGetProperty 'volume': %d", n );
BOOL volumeResult = (volume == 0.0);
// this checks if the device is muted
CFStringRef state;
n = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &propertySize, &state);
if (n != 0)
- DLog( @"AudioSessionGetProperty: %d", n );
+ DLog( @"AudioSessionGetProperty 'audioRoute': %d", n );
NSString *result = (NSString *)state;
BOOL muteResult = ([result length] == 0);
releaseAndNil(result);
--- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Thu Dec 09 22:51:07 2010 +0100
@@ -253,19 +253,7 @@
NSInteger row = [indexPath row];
NSInteger section = [indexPath section];
- if (section == 0) {
- NSMutableDictionary *selectedRow = [self.listOfSelectedTeams objectAtIndex:[indexPath row]];
- UITableViewCell *cell = [aTableView cellForRowAtIndexPath:indexPath];
- SquareButtonView *squareButton = (SquareButtonView *)cell.accessoryView;
-
- NSInteger increaseNumber = [[selectedRow objectForKey:@"number"] intValue] + 1;
- NSNumber *newNumber = [NSNumber numberWithInt:[self filterNumberOfHogs:increaseNumber]];
- [squareButton setTitle:[newNumber stringValue] forState:UIControlStateNormal];
- [selectedRow setObject:newNumber forKey:@"number"];
-
- cell.imageView.image = [self drawHogsRepeated:[newNumber intValue]];
- [cell setNeedsLayout];
- } else {
+ if (section == 1 && [self.listOfTeams count] > row) {
[self.listOfSelectedTeams addObject:[self.listOfTeams objectAtIndex:row]];
[self.listOfTeams removeObjectAtIndex:row];
@@ -277,6 +265,18 @@
[aTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight];
[aTableView endUpdates];
}
+ if (section == 0 && [self.listOfSelectedTeams count] > row) {
+ NSMutableDictionary *selectedRow = [self.listOfSelectedTeams objectAtIndex:row];
+ UITableViewCell *cell = [aTableView cellForRowAtIndexPath:indexPath];
+ SquareButtonView *squareButton = (SquareButtonView *)cell.accessoryView;
+
+ NSInteger increaseNumber = [[selectedRow objectForKey:@"number"] intValue] + 1;
+ NSNumber *newNumber = [NSNumber numberWithInt:[self filterNumberOfHogs:increaseNumber]];
+ [squareButton setTitle:[newNumber stringValue] forState:UIControlStateNormal];
+ [selectedRow setObject:newNumber forKey:@"number"];
+
+ cell.imageView.image = [self drawHogsRepeated:[newNumber intValue]];
+ }
}
-(void) holdAction:(NSString *)content {
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Barrel Mayhem.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Barrel Mayhem.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>30</integer>
+ <integer>0</integer>
<integer>100</integer>
<integer>15</integer>
<integer>47</integer>
@@ -16,7 +17,6 @@
<integer>25</integer>
<integer>0</integer>
<integer>0</integer>
- <integer>0</integer>
<integer>40</integer>
</array>
<key>gamemod</key>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Clean Slate.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Clean Slate.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>45</integer>
+ <integer>3</integer>
<integer>100</integer>
<integer>15</integer>
<integer>47</integer>
@@ -14,7 +15,6 @@
<integer>5</integer>
<integer>35</integer>
<integer>25</integer>
- <integer>3</integer>
<integer>4</integer>
<integer>0</integer>
<integer>2</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Default.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Default.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>45</integer>
+ <integer>3</integer>
<integer>100</integer>
<integer>15</integer>
<integer>47</integer>
@@ -14,7 +15,6 @@
<integer>5</integer>
<integer>35</integer>
<integer>25</integer>
- <integer>3</integer>
<integer>4</integer>
<integer>0</integer>
<integer>2</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Fort Mode.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Fort Mode.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>45</integer>
+ <integer>3</integer>
<integer>100</integer>
<integer>15</integer>
<integer>47</integer>
@@ -14,7 +15,6 @@
<integer>5</integer>
<integer>35</integer>
<integer>25</integer>
- <integer>3</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/King Mode.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/King Mode.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>45</integer>
+ <integer>3</integer>
<integer>100</integer>
<integer>15</integer>
<integer>47</integer>
@@ -14,7 +15,6 @@
<integer>5</integer>
<integer>35</integer>
<integer>25</integer>
- <integer>3</integer>
<integer>4</integer>
<integer>0</integer>
<integer>2</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Minefield.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Minefield.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>50</integer>
<integer>30</integer>
+ <integer>0</integer>
<integer>150</integer>
<integer>15</integer>
<integer>47</integer>
@@ -14,7 +15,6 @@
<integer>0</integer>
<integer>35</integer>
<integer>25</integer>
- <integer>0</integer>
<integer>80</integer>
<integer>0</integer>
<integer>0</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Pro Mode.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Pro Mode.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>15</integer>
+ <integer>3</integer>
<integer>100</integer>
<integer>15</integer>
<integer>47</integer>
@@ -14,7 +15,6 @@
<integer>0</integer>
<integer>35</integer>
<integer>25</integer>
- <integer>3</integer>
<integer>0</integer>
<integer>0</integer>
<integer>2</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Shoppa.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Shoppa.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>300</integer>
+ <integer>3</integer>
<integer>100</integer>
<integer>50</integer>
<integer>47</integer>
@@ -14,7 +15,6 @@
<integer>1</integer>
<integer>0</integer>
<integer>35</integer>
- <integer>3</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Thinking with Portals.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Thinking with Portals.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>45</integer>
+ <integer>4</integer>
<integer>100</integer>
<integer>15</integer>
<integer>47</integer>
@@ -14,7 +15,6 @@
<integer>2</integer>
<integer>25</integer>
<integer>25</integer>
- <integer>4</integer>
<integer>5</integer>
<integer>0</integer>
<integer>5</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Timeless.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Timeless.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>100</integer>
+ <integer>5</integer>
<integer>100</integer>
<integer>100</integer>
<integer>47</integer>
@@ -15,7 +16,6 @@
<integer>35</integer>
<integer>30</integer>
<integer>3</integer>
- <integer>5</integer>
<integer>10</integer>
<integer>2</integer>
</array>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Tunnel Hogs.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Tunnel Hogs.plist Thu Dec 09 22:51:07 2010 +0100
@@ -6,6 +6,7 @@
<array>
<integer>100</integer>
<integer>30</integer>
+ <integer>3</integer>
<integer>100</integer>
<integer>15</integer>
<integer>47</integer>
@@ -14,7 +15,6 @@
<integer>5</integer>
<integer>35</integer>
<integer>25</integer>
- <integer>3</integer>
<integer>10</integer>
<integer>10</integer>
<integer>10</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist Thu Dec 09 11:12:40 2010 -0500
+++ b/project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist Thu Dec 09 22:51:07 2010 +0100
@@ -38,6 +38,22 @@
<key>checkOverMax</key>
<false/>
<key>command</key>
+ <string>e$minestime</string>
+ <key>default</key>
+ <integer>3</integer>
+ <key>image</key>
+ <string>Time</string>
+ <key>max</key>
+ <integer>5</integer>
+ <key>min</key>
+ <integer>-1</integer>
+ <key>title</key>
+ <string>Mines Time</string>
+ </dict>
+ <dict>
+ <key>checkOverMax</key>
+ <false/>
+ <key>command</key>
<string>e$damagepct</string>
<key>default</key>
<integer>100</integer>
@@ -166,22 +182,6 @@
<key>checkOverMax</key>
<false/>
<key>command</key>
- <string>e$minestime</string>
- <key>default</key>
- <integer>3</integer>
- <key>image</key>
- <string>Time</string>
- <key>max</key>
- <integer>5</integer>
- <key>min</key>
- <integer>-1</integer>
- <key>title</key>
- <string>Mines Time</string>
- </dict>
- <dict>
- <key>checkOverMax</key>
- <false/>
- <key>command</key>
<string>e$minesnum</string>
<key>default</key>
<integer>4</integer>