# HG changeset patch
# User koda
# Date 1283125126 -7200
# Node ID c3eb56754e92f55a7c6b692f71e21eb13da9b75d
# Parent 6e84339eefee020415e65f56235438c5100634ab
added a smaller version of forts, fixed a couple of regressions
diff -r 6e84339eefee -r c3eb56754e92 hedgewars/PascalExports.pas
--- a/hedgewars/PascalExports.pas Sun Aug 29 23:36:22 2010 +0200
+++ b/hedgewars/PascalExports.pas Mon Aug 30 01:38:46 2010 +0200
@@ -165,6 +165,11 @@
if closeFrontend then alsoShutdownFrontend:= true;
end;
+procedure HW_dismissReady; cdecl; export;
+begin
+ ReadyTimeLeft:= 0;
+end;
+
procedure HW_setLandscape(landscape: boolean); cdecl; export;
begin
if landscape then
diff -r 6e84339eefee -r c3eb56754e92 project_files/HedgewarsMobile/Classes/FortsViewController.m
--- a/project_files/HedgewarsMobile/Classes/FortsViewController.m Sun Aug 29 23:36:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/FortsViewController.m Mon Aug 30 01:38:46 2010 +0200
@@ -25,10 +25,10 @@
[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];
@@ -88,15 +88,13 @@
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;
diff -r 6e84339eefee -r c3eb56754e92 project_files/HedgewarsMobile/Classes/MapConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Sun Aug 29 23:36:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m Mon Aug 30 01:38:46 2010 +0200
@@ -536,8 +536,8 @@
self.sizeLabel.text = NSLocalizedString(@"All",@"");
self.slider.value = 0.05f;
- // select a map at first because it's faster
- self.segmentedControl.selectedSegmentIndex = 1;
+ // select a map at first because it's faster - done in IB
+ //self.segmentedControl.selectedSegmentIndex = 1;
self.templateFilterCommand = @"e$template_filter 0";
self.mazeSizeCommand = @"e$maze_size 0";
diff -r 6e84339eefee -r c3eb56754e92 project_files/HedgewarsMobile/Classes/OverlayViewController.m
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Sun Aug 29 23:36:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Mon Aug 30 01:38:46 2010 +0200
@@ -217,7 +217,7 @@
return;
if (HW_isWaiting())
- HW_shoot();
+ HW_dismissReady();
UIButton *theButton = (UIButton *)sender;
switch (theButton.tag) {
@@ -369,7 +369,7 @@
case 1:
// this dismisses the "get ready"
if (HW_isWaiting())
- HW_shoot();
+ HW_dismissReady();
// if we're in the menu we just click in the point
if (HW_isAmmoOpen()) {
diff -r 6e84339eefee -r c3eb56754e92 project_files/HedgewarsMobile/Classes/PascalImports.h
--- a/project_files/HedgewarsMobile/Classes/PascalImports.h Sun Aug 29 23:36:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/PascalImports.h Mon Aug 30 01:38:46 2010 +0200
@@ -54,6 +54,7 @@
void HW_pause(void);
void HW_terminate(BOOL andCloseFrontend);
+ void HW_dismissReady(void);
void HW_setLandscape(BOOL rotate);
void HW_setCursor(int x, int y);
diff -r 6e84339eefee -r c3eb56754e92 project_files/HedgewarsMobile/Classes/SingleTeamViewController.m
--- a/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m Sun Aug 29 23:36:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m Mon Aug 30 01:38:46 2010 +0200
@@ -108,7 +108,7 @@
[self.teamDictionary writeToFile:teamFile atomically:YES];
[teamFile release];
- DLog(@"%@",teamDictionary);
+ //DLog(@"%@",teamDictionary);
isWriteNeeded = NO;
}
@@ -223,7 +223,7 @@
[accessoryImage release];
break;
case 2: // fort
- accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@L.png",
+ accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@-preview.png",
FORTS_DIRECTORY(),[teamDictionary objectForKey:@"fort"]]];
cell.imageView.image = [accessoryImage scaleToSize:CGSizeMake(42, 42)];
[accessoryImage release];
diff -r 6e84339eefee -r c3eb56754e92 project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib
--- a/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Sun Aug 29 23:36:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Resources/MapConfigViewController-iPad.xib Mon Aug 30 01:38:46 2010 +0200
@@ -154,7 +154,7 @@
IBIPadFramework
2
3
- 0
+ 1