pimp-my-savagame-table
authorkoda
Sat, 25 Sep 2010 18:38:05 +0200
changeset 3903 db01c37494af
parent 3902 3aac7ca07b0e
child 3904 22e4d74240e5
pimp-my-savagame-table
project_files/HedgewarsMobile/Classes/AboutViewController.xib
project_files/HedgewarsMobile/Classes/MainMenuViewController.m
project_files/HedgewarsMobile/Classes/SavedGamesViewController.h
project_files/HedgewarsMobile/Classes/SavedGamesViewController.m
project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib
project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m
project_files/HedgewarsMobile/Classes/UIImageExtra.h
project_files/HedgewarsMobile/Classes/UIImageExtra.m
project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj
project_files/HedgewarsMobile/Resources/Overlay/background_med.png
project_files/HedgewarsMobile/Resources/Overlay/background_small.png
project_files/HedgewarsMobile/Resources/Overlay/plus.png
--- a/project_files/HedgewarsMobile/Classes/AboutViewController.xib	Sat Sep 25 03:04:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/AboutViewController.xib	Sat Sep 25 18:38:05 2010 +0200
@@ -12,7 +12,6 @@
 		</object>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
-			<integer value="2"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -50,8 +49,9 @@
 							<object class="IBUISegmentedControl" id="674364401">
 								<reference key="NSNextResponder" ref="241300702"/>
 								<int key="NSvFlags">292</int>
-								<string key="NSFrame">{{70, 7}, {289, 30}}</string>
+								<string key="NSFrame">{{127, 7}, {289, 30}}</string>
 								<reference key="NSSuperview" ref="241300702"/>
+								<reference key="NSWindow"/>
 								<bool key="IBUIOpaque">NO</bool>
 								<string key="targetRuntimeIdentifier">IBIPadFramework</string>
 								<int key="IBSegmentControlStyle">2</int>
@@ -99,8 +99,9 @@
 								</object>
 							</object>
 						</object>
-						<string key="NSFrameSize">{429, 44}</string>
+						<string key="NSFrameSize">{543, 44}</string>
 						<reference key="NSSuperview" ref="766721923"/>
+						<reference key="NSWindow"/>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
 						<object class="NSArray" key="IBUIItems">
 							<bool key="EncodedWithXMLCoder">YES</bool>
@@ -120,8 +121,9 @@
 					<object class="IBUIImageView" id="326158270">
 						<reference key="NSNextResponder" ref="766721923"/>
 						<int key="NSvFlags">274</int>
-						<string key="NSFrame">{{0, 44}, {429, 433}}</string>
+						<string key="NSFrame">{{0, 44}, {543, 577}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
+						<reference key="NSWindow"/>
 						<bool key="IBUIUserInteractionEnabled">NO</bool>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
 						<object class="NSCustomResource" key="IBUIImage">
@@ -132,8 +134,9 @@
 					<object class="IBUITableView" id="411460868">
 						<reference key="NSNextResponder" ref="766721923"/>
 						<int key="NSvFlags">274</int>
-						<string key="NSFrame">{{0, 44}, {429, 433}}</string>
+						<string key="NSFrame">{{0, 44}, {543, 577}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
+						<reference key="NSWindow"/>
 						<object class="NSColor" key="IBUIBackgroundColor">
 							<int key="NSColorSpace">1</int>
 							<bytes key="NSRGB">MCAwIDAgMAA</bytes>
@@ -150,8 +153,9 @@
 						<float key="IBUISectionFooterHeight">10</float>
 					</object>
 				</object>
-				<string key="NSFrameSize">{429, 477}</string>
+				<string key="NSFrameSize">{543, 621}</string>
 				<reference key="NSSuperview"/>
+				<reference key="NSWindow"/>
 				<object class="NSColor" key="IBUIBackgroundColor">
 					<int key="NSColorSpace">3</int>
 					<bytes key="NSWhite">MQA</bytes>
@@ -318,7 +322,7 @@
 					<string>UIResponder</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
-					<string>{{505, 182}, {429, 477}}</string>
+					<string>{{376, 170}, {543, 621}}</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -685,7 +689,7 @@
 		<int key="IBDocument.defaultPropertyAccessControl">3</int>
 		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
 			<string key="NS.key.0">background_small.png</string>
-			<string key="NS.object.0">{320, 436}</string>
+			<string key="NS.object.0">{539, 639}</string>
 		</object>
 		<string key="IBCocoaTouchPluginVersion">117</string>
 	</data>
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Sat Sep 25 03:04:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Sat Sep 25 18:38:05 2010 +0200
@@ -292,7 +292,7 @@
             if (nil == self.savedGamesViewController) {
                 SavedGamesViewController *savedgames = [[SavedGamesViewController alloc] initWithNibName:@"SavedGamesViewController" bundle:nil];
                 savedgames.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
-                savedgames.modalPresentationStyle = UIModalPresentationFormSheet;
+                savedgames.modalPresentationStyle = UIModalPresentationPageSheet;
                 self.savedGamesViewController = savedgames;
                 [savedgames release];
             }
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.h	Sat Sep 25 03:04:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.h	Sat Sep 25 18:38:05 2010 +0200
@@ -20,9 +20,9 @@
 
 
 #import <UIKit/UIKit.h>
-
+#import "EditableCellView.h"
 
-@interface SavedGamesViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>  {
+@interface SavedGamesViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, EditableCellViewDelegate>  {
     UITableView *tableView;
     NSMutableArray *listOfSavegames;
 }
@@ -30,7 +30,7 @@
 @property (nonatomic,retain) IBOutlet UITableView *tableView;
 @property (nonatomic,retain) NSMutableArray *listOfSavegames;
 
-
 -(IBAction) buttonPressed:(id) sender;
+-(IBAction) toggleEdit:(id) sender;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Sat Sep 25 03:04:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Sat Sep 25 18:38:05 2010 +0200
@@ -49,9 +49,22 @@
 
 -(IBAction) buttonPressed:(id) sender {
     playSound(@"backSound");
+    [self.tableView setEditing:NO animated:YES];
     [[self parentViewController] dismissModalViewControllerAnimated:YES];
 }
 
+// modifies the navigation bar to add the "Add" and "Done" buttons
+-(IBAction) toggleEdit:(id) sender {
+    BOOL isEditing = self.tableView.editing;
+    [self.tableView setEditing:!isEditing animated:YES];
+
+    UIBarButtonItem *barButton = (UIBarButtonItem *)sender;
+    if (isEditing)
+        [barButton setTitle:NSLocalizedString(@"Edit",@"")];
+    else
+        [barButton setTitle:NSLocalizedString(@"Commit",@"")];
+}
+
 #pragma mark -
 #pragma mark Table view data source
 -(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
@@ -65,15 +78,61 @@
 -(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];
+    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.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 {
+    UITableViewCellEditingStyleInsert
+}*//*
+-(UITableViewCellEditingStyle) tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
+    return UITableViewCellEditingStyleInsert;
+}*/
 
-    // first all the names, then the title (which is offset 5)
-    cell.textLabel.text = [[self.listOfSavegames objectAtIndex:[indexPath row]] stringByDeletingPathExtension];
-    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+-(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];
+    
+    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];
+}
 
-    return cell;
+-(void) duplicateEntry:(id) sender {
+    UIButton *button = (UIButton *)sender;
+    NSUInteger row = button.tag;
+    
+    [(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];
 }
 
 #pragma mark -
@@ -81,6 +140,8 @@
 -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
     
+    [(EditableCellView *)[self.tableView cellForRowAtIndexPath:indexPath] save:nil];
+    
     NSString *filePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:[indexPath row]]];
     
     NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys:
@@ -92,6 +153,20 @@
 }
 
 #pragma mark -
+#pragma mark editableCellView delegate
+// rename old file if names differ
+-(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
+    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 {
     [super didReceiveMemoryWarning];
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib	Sat Sep 25 03:04:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.xib	Sat Sep 25 18:38:05 2010 +0200
@@ -42,10 +42,22 @@
 				<int key="NSvFlags">292</int>
 				<object class="NSMutableArray" key="NSSubviews">
 					<bool key="EncodedWithXMLCoder">YES</bool>
+					<object class="IBUIImageView" id="405529720">
+						<reference key="NSNextResponder" ref="766721923"/>
+						<int key="NSvFlags">292</int>
+						<string key="NSFrameSize">{768, 768}</string>
+						<reference key="NSSuperview" ref="766721923"/>
+						<bool key="IBUIUserInteractionEnabled">NO</bool>
+						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
+						<object class="NSCustomResource" key="IBUIImage">
+							<string key="NSClassName">NSImage</string>
+							<string key="NSResourceName">background_med.png</string>
+						</object>
+					</object>
 					<object class="IBUIToolbar" id="832454237">
 						<reference key="NSNextResponder" ref="766721923"/>
 						<int key="NSvFlags">290</int>
-						<string key="NSFrameSize">{408, 44}</string>
+						<string key="NSFrameSize">{768, 44}</string>
 						<reference key="NSSuperview" ref="766721923"/>
 						<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -57,12 +69,23 @@
 								<reference key="IBUIToolbar" ref="832454237"/>
 								<int key="IBUISystemItemIdentifier">0</int>
 							</object>
+							<object class="IBUIBarButtonItem" id="881124109">
+								<string key="targetRuntimeIdentifier">IBIPadFramework</string>
+								<reference key="IBUIToolbar" ref="832454237"/>
+								<int key="IBUISystemItemIdentifier">5</int>
+							</object>
+							<object class="IBUIBarButtonItem" id="793091239">
+								<string key="IBUITitle">Edit</string>
+								<string key="targetRuntimeIdentifier">IBIPadFramework</string>
+								<int key="IBUIStyle">1</int>
+								<reference key="IBUIToolbar" ref="832454237"/>
+							</object>
 						</object>
 					</object>
 					<object class="IBUITableView" id="399289716">
 						<reference key="NSNextResponder" ref="766721923"/>
 						<int key="NSvFlags">274</int>
-						<string key="NSFrame">{{0, 44}, {408, 414}}</string>
+						<string key="NSFrame">{{0, 44}, {768, 724}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
 						<object class="NSColor" key="IBUIBackgroundColor">
 							<int key="NSColorSpace">1</int>
@@ -80,7 +103,7 @@
 						<float key="IBUISectionFooterHeight">10</float>
 					</object>
 				</object>
-				<string key="NSFrameSize">{408, 458}</string>
+				<string key="NSFrameSize">{768, 768}</string>
 				<reference key="NSSuperview"/>
 				<object class="NSColor" key="IBUIBackgroundColor">
 					<int key="NSColorSpace">3</int>
@@ -136,6 +159,14 @@
 					</object>
 					<int key="connectionID">10</int>
 				</object>
+				<object class="IBConnectionRecord">
+					<object class="IBCocoaTouchEventConnection" key="connection">
+						<string key="label">toggleEdit:</string>
+						<reference key="source" ref="793091239"/>
+						<reference key="destination" ref="841351856"/>
+					</object>
+					<int key="connectionID">14</int>
+				</object>
 			</object>
 			<object class="IBMutableOrderedSet" key="objectRecords">
 				<object class="NSArray" key="orderedObjects">
@@ -164,6 +195,7 @@
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="832454237"/>
 							<reference ref="399289716"/>
+							<reference ref="405529720"/>
 						</object>
 						<reference key="parent" ref="0"/>
 					</object>
@@ -173,6 +205,8 @@
 						<object class="NSMutableArray" key="children">
 							<bool key="EncodedWithXMLCoder">YES</bool>
 							<reference ref="422926197"/>
+							<reference ref="793091239"/>
+							<reference ref="881124109"/>
 						</object>
 						<reference key="parent" ref="766721923"/>
 					</object>
@@ -186,6 +220,21 @@
 						<reference key="object" ref="399289716"/>
 						<reference key="parent" ref="766721923"/>
 					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">11</int>
+						<reference key="object" ref="405529720"/>
+						<reference key="parent" ref="766721923"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">12</int>
+						<reference key="object" ref="793091239"/>
+						<reference key="parent" ref="832454237"/>
+					</object>
+					<object class="IBObjectRecord">
+						<int key="objectID">13</int>
+						<reference key="object" ref="881124109"/>
+						<reference key="parent" ref="832454237"/>
+					</object>
 				</object>
 			</object>
 			<object class="NSMutableDictionary" key="flattenedProperties">
@@ -194,6 +243,9 @@
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<string>-1.CustomClassName</string>
 					<string>-2.CustomClassName</string>
+					<string>11.IBPluginDependency</string>
+					<string>12.IBPluginDependency</string>
+					<string>13.IBPluginDependency</string>
 					<string>2.IBEditorWindowLastContentRect</string>
 					<string>2.IBPluginDependency</string>
 					<string>4.IBPluginDependency</string>
@@ -204,7 +256,10 @@
 					<bool key="EncodedWithXMLCoder">YES</bool>
 					<string>SavedGamesViewController</string>
 					<string>UIResponder</string>
-					<string>{{677, 547}, {408, 458}}</string>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+					<string>{{486, 215}, {768, 768}}</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -227,7 +282,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">10</int>
+			<int key="maxID">14</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -236,14 +291,35 @@
 					<string key="className">SavedGamesViewController</string>
 					<string key="superclassName">UIViewController</string>
 					<object class="NSMutableDictionary" key="actions">
-						<string key="NS.key.0">buttonPressed:</string>
-						<string key="NS.object.0">id</string>
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>buttonPressed:</string>
+							<string>toggleEdit:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>id</string>
+							<string>id</string>
+						</object>
 					</object>
 					<object class="NSMutableDictionary" key="actionInfosByName">
-						<string key="NS.key.0">buttonPressed:</string>
-						<object class="IBActionInfo" key="NS.object.0">
-							<string key="name">buttonPressed:</string>
-							<string key="candidateClassName">id</string>
+						<bool key="EncodedWithXMLCoder">YES</bool>
+						<object class="NSArray" key="dict.sortedKeys">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<string>buttonPressed:</string>
+							<string>toggleEdit:</string>
+						</object>
+						<object class="NSMutableArray" key="dict.values">
+							<bool key="EncodedWithXMLCoder">YES</bool>
+							<object class="IBActionInfo">
+								<string key="name">buttonPressed:</string>
+								<string key="candidateClassName">id</string>
+							</object>
+							<object class="IBActionInfo">
+								<string key="name">toggleEdit:</string>
+								<string key="candidateClassName">id</string>
+							</object>
 						</object>
 					</object>
 					<object class="NSMutableDictionary" key="outlets">
@@ -387,6 +463,14 @@
 					</object>
 				</object>
 				<object class="IBPartialClassDescription">
+					<string key="className">UIImageView</string>
+					<string key="superclassName">UIView</string>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBFrameworkSource</string>
+						<string key="minorKey">UIKit.framework/Headers/UIImageView.h</string>
+					</object>
+				</object>
+				<object class="IBPartialClassDescription">
 					<string key="className">UIResponder</string>
 					<string key="superclassName">NSObject</string>
 					<reference key="sourceIdentifier" ref="786211723"/>
@@ -497,6 +581,10 @@
 		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
 		<string key="IBDocument.LastKnownRelativeProjectPath">../Hedgewars.xcodeproj</string>
 		<int key="IBDocument.defaultPropertyAccessControl">3</int>
+		<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+			<string key="NS.key.0">background_med.png</string>
+			<string key="NS.object.0">{768, 768}</string>
+		</object>
 		<string key="IBCocoaTouchPluginVersion">117</string>
 	</data>
 </archive>
--- a/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Sat Sep 25 03:04:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Sat Sep 25 18:38:05 2010 +0200
@@ -41,7 +41,6 @@
                                                                   action:@selector(toggleEdit:)];
     self.navigationItem.rightBarButtonItem = editButton;
     [editButton release];
-
 }
 
 -(void) viewWillAppear:(BOOL) animated {
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.h	Sat Sep 25 03:04:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.h	Sat Sep 25 18:38:05 2010 +0200
@@ -30,6 +30,7 @@
 -(id) initWithContentsOfFile:(NSString *)path andCutAt:(CGRect) rect;
 -(UIImage *)cutAt:(CGRect) rect;
 -(UIImage *)convertToGrayScale;
+-(UIImage *)convertToNegative;
 -(UIImage *)maskImageWith:(UIImage *)maskImage;
 -(UIImage *)makeRoundCornersOfSize:(CGSize) sizewh;
 
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Sat Sep 25 03:04:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Sat Sep 25 18:38:05 2010 +0200
@@ -207,4 +207,17 @@
     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));
+    UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return result;
+}
+
 @end
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sat Sep 25 03:04:22 2010 +0200
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sat Sep 25 18:38:05 2010 +0200
@@ -28,6 +28,8 @@
 		611D9B12124949D000008271 /* NSStringExtra.m in Sources */ = {isa = PBXBuildFile; fileRef = 611D9B11124949D000008271 /* NSStringExtra.m */; };
 		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 */; };
@@ -700,6 +702,8 @@
 		611D9BF812497E9800008271 /* SavedGamesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SavedGamesViewController.h; sourceTree = "<group>"; };
 		611D9BF912497E9800008271 /* SavedGamesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SavedGamesViewController.m; sourceTree = "<group>"; };
 		611D9BFA12497E9800008271 /* SavedGamesViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SavedGamesViewController.xib; sourceTree = "<group>"; };
+		611DA030124E2BC500008271 /* background_med.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = background_med.png; path = Resources/Overlay/background_med.png; sourceTree = "<group>"; };
+		611DA1CF124E5C6300008271 /* plus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = plus.png; path = Resources/Overlay/plus.png; sourceTree = "<group>"; };
 		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 = "<group>"; };
@@ -1291,6 +1295,8 @@
 		6179936611501D1E00BA94A9 /* Overlay */ = {
 			isa = PBXGroup;
 			children = (
+				611DA1CF124E5C6300008271 /* plus.png */,
+				611DA030124E2BC500008271 /* background_med.png */,
 				611E0EE511FB20610077A41E /* ammoButton.png */,
 				611E0EE611FB20610077A41E /* cornerButton.png */,
 				61EF920511DF57AC003441C4 /* arrowDown.png */,
@@ -2051,6 +2057,8 @@
 				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 */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
Binary file project_files/HedgewarsMobile/Resources/Overlay/background_med.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/background_small.png has changed
Binary file project_files/HedgewarsMobile/Resources/Overlay/plus.png has changed