in the cocoa ammomenu show descriptions properly for lower weapons
authorkoda
Fri, 18 Feb 2011 00:21:36 +0100
changeset 4945 541d35d1f2e8
parent 4944 e43a3da2fc22
child 4946 076767e86f2b
in the cocoa ammomenu show descriptions properly for lower weapons updated the way to update weaponset
project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m
project_files/HedgewarsMobile/Classes/CreationChamber.m
project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj
project_files/HedgewarsMobile/SDL.patch
--- a/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m	Wed Feb 16 13:07:00 2011 +0300
+++ b/project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m	Fri Feb 18 00:21:36 2011 +0100
@@ -116,7 +116,7 @@
     [self.view addSubview:self.captionLabel];
     [caption release];
 
-    UILabel *description = [[UILabel alloc] initWithFrame:CGRectMake(x+2, y+20, 410, 53)];
+    UILabel *description = [[UILabel alloc] initWithFrame:CGRectMake(x+2, y+20, 415, 53)];
     description.backgroundColor = [UIColor clearColor];
     description.textColor = [UIColor whiteColor];
     description.text = DEFAULT_DESCRIPTION;
@@ -271,12 +271,30 @@
         self.captionLabel.text = NSLocalizedString(@"This weapon is locked",@"");
     else
         self.captionLabel.text = [NSString stringWithUTF8String:HW_getWeaponCaptionByIndex(theButton.tag)];
+    
+    self.nameLabel.backgroundColor = [UIColor blackColor];
+    self.captionLabel.backgroundColor = [UIColor blackColor];
+    self.extraLabel.backgroundColor = [UIColor blackColor];
+
+    int y, x = 8;
+    // display labels on top for lower buttons
+    if (theButton.tag > 41)
+        y = 5;
+    else
+        y = (HW_getNumberOfWeapons()/BTNS_PER_ROW)*44 + 18;
+
+    self.nameLabel.frame = CGRectMake(x, y, 200, 20);
+    self.captionLabel.frame = CGRectMake(x+200, y, 220, 20);
+    self.extraLabel.frame = CGRectMake(x+2, y+20, 415, 53);
 }
 
 -(void) buttonCancelled:(id) sender {
     self.nameLabel.text = nil;
     self.extraLabel.text = nil;
     self.captionLabel.text = nil;
+    self.extraLabel.backgroundColor = [UIColor clearColor];
+    self.captionLabel.backgroundColor = [UIColor clearColor];
+    self.nameLabel.backgroundColor = [UIColor clearColor];
 }
 
 -(void) buttonReleased:(id) sender {
@@ -284,15 +302,13 @@
     if (self.nameLabel == nil || self.extraLabel == nil)
         [self loadLabels];
 
-    self.nameLabel.text = nil;
-    self.extraLabel.text = nil;
-    self.captionLabel.text = nil;
     if (theButton.currentTitle == nil) {
         HW_setWeapon(theButton.tag);
         playSound(@"clickSound");
         if (IS_DUALHEAD() == NO)
             [self disappear];
     }
+    [self buttonCancelled:sender];
 }
 
 -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
--- a/project_files/HedgewarsMobile/Classes/CreationChamber.m	Wed Feb 16 13:07:00 2011 +0300
+++ b/project_files/HedgewarsMobile/Classes/CreationChamber.m	Fri Feb 18 00:21:36 2011 +0100
@@ -75,53 +75,102 @@
     NSDictionary *theWeapon = nil;
     switch (type) {
         default: //default
-            theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
-                         @"939192942219912103223511100120100000021111010101112",@"ammostore_initialqt",
-                         @"040504054160065554655446477657666666615551010111541",@"ammostore_probability",
-                         @"000000000000020550000004000700400000000020000000060",@"ammostore_delay",
-                         @"131111031211111112311411111111111111121111110111112",@"ammostore_crate", nil];
+            theWeapon = [[NSDictionary alloc] initWithObjects:
+                         [NSArray arrayWithObjects:
+                          @"93919294221991210322351110012010000002111101010111299",
+                          @"04050405416006555465544647765766666661555101011154111",
+                          @"00000000000002055000000400070040000000002000000006000",
+                          @"13111103121111111231141111111111111112111111011111211",
+                          nil]
+                                                      forKeys: [NSArray arrayWithObjects:
+                                                                @"ammostore_initialqt",
+                                                                @"ammostore_probability",
+                                                                @"ammostore_delay",
+                                                                @"ammostore_crate", nil]];
             break;
         case 1: //crazy
-            theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
-                         @"999999999999999999299999999999999929999999990999999",@"ammostore_initialqt",
-                         @"111111011111111111111111111111111111111111110111111",@"ammostore_probability",
-                         @"000000000000000000000000000000000000000000000000000",@"ammostore_delay",
-                         @"131111031211111112311411111111111111121111010111111",@"ammostore_crate", nil];
+            theWeapon = [[NSDictionary alloc] initWithObjects:
+                         [NSArray arrayWithObjects:
+                          @"99999999999999999929999999999999992999999999099999922",
+                          @"11111101111111111111111111111111111111111111011111111",
+                          @"00000000000000000000000000000000000000000000000000000",
+                          @"13111103121111111231141111111111111112111101011111111",
+                          nil]
+                                                      forKeys: [NSArray arrayWithObjects:
+                                                                @"ammostore_initialqt",
+                                                                @"ammostore_probability",
+                                                                @"ammostore_delay",
+                                                                @"ammostore_crate", nil]];
             break;
         case 2: //pro mode
-            theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
-                         @"909000900000000000000900000000000000000000000000000",@"ammostore_initialqt",
-                         @"000000000000000000000000000000000000000000000000000",@"ammostore_probability",
-                         @"000000000000020550000004000700400000000020000000000",@"ammostore_delay",
-                         @"111111111111111111111111111111111111111110010111111",@"ammostore_crate", nil];
+            theWeapon = [[NSDictionary alloc] initWithObjects:
+                         [NSArray arrayWithObjects:
+                          @"90900090000000000000090000000000000000000000000000000",
+                          @"00000000000000000000000000000000000000000000000000000",
+                          @"00000000000002055000000400070040000000002000000000000",
+                          @"11111111111111111111111111111111111111111001011111111",
+                          nil]
+                                                      forKeys: [NSArray arrayWithObjects:
+                                                                @"ammostore_initialqt",
+                                                                @"ammostore_probability",
+                                                                @"ammostore_delay",
+                                                                @"ammostore_crate", nil]];
             break;
         case 3: //shoppa
-            theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
-                         @"000000990000000000000000000000000000000000000000000",@"ammostore_initialqt",
-                         @"444441004424440221011212122242200000000200040001001",@"ammostore_probability",
-                         @"000000000000000000000000000000000000000000000000000",@"ammostore_delay",
-                         @"111111111111111111111111111111111111111110110111111",@"ammostore_crate", nil];
+            theWeapon = [[NSDictionary alloc] initWithObjects:
+                         [NSArray arrayWithObjects:
+                          @"00000099000000000000000000000000000000000000000000000",
+                          @"44444100442444022101121212224220000000020004000100111",
+                          @"00000000000000000000000000000000000000000000000000000",
+                          @"11111111111111111111111111111111111111111011011111111",
+                          nil]
+                                                      forKeys: [NSArray arrayWithObjects:
+                                                                @"ammostore_initialqt",
+                                                                @"ammostore_probability",
+                                                                @"ammostore_delay",
+                                                                @"ammostore_crate", nil]];
             break;
         case 4: //clean slate
-            theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
-                         @"101000900001000001100000000000000000000000000000100",@"ammostore_initialqt",
-                         @"040504054160065554655446477657666666615551010111541",@"ammostore_probability",
-                         @"000000000000020550000004000700400000000020000000000",@"ammostore_delay",
-                         @"131111031211111112311411111111111111121111110111111",@"ammostore_crate", nil];
+            theWeapon = [[NSDictionary alloc] initWithObjects:
+                         [NSArray arrayWithObjects:
+                          @"10100090000100000110000000000000000000000000000010000",
+                          @"04050405416006555465544647765766666661555101011154111",
+                          @"00000000000000000000000000000000000000000000000000000",
+                          @"13111103121111111231141111111111111112111111011111111",
+                          nil]
+                                                      forKeys: [NSArray arrayWithObjects:
+                                                                @"ammostore_initialqt",
+                                                                @"ammostore_probability",
+                                                                @"ammostore_delay",
+                                                                @"ammostore_crate", nil]];
             break;
         case 5: //minefield
-            theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
-                         @"000000990009000000030000000000000000000000000000000",@"ammostore_initialqt",
-                         @"000000000000000000000000000000000000000000000000000",@"ammostore_probability",
-                         @"000000000000020550000004000700400000000020000000000",@"ammostore_delay",
-                         @"111111111111111111111111111111111111111111110111111",@"ammostore_crate", nil];
+            theWeapon = [[NSDictionary alloc] initWithObjects:
+                         [NSArray arrayWithObjects:
+                          @"00000099000900000003000000000000000000000000000000000",
+                          @"00000000000000000000000000000000000000000000000000000",
+                          @"00000000000002055000000400070040000000002000000006000",
+                          @"11111111111111111111111111111111111111111111011111111",
+                          nil]
+                                                      forKeys: [NSArray arrayWithObjects:
+                                                                @"ammostore_initialqt",
+                                                                @"ammostore_probability",
+                                                                @"ammostore_delay",
+                                                                @"ammostore_crate", nil]];
             break;
         case 6: //thinking with portals
-            theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
-                         @"900000900200000000210000000000000011000009000000000",@"ammostore_initialqt",
-                         @"040504054160065554655446477657666666615551010111541",@"ammostore_probability",
-                         @"000000000000020550000004000700400000000020000000060",@"ammostore_delay",
-                         @"131111031211111112311411111111111111121111110111111",@"ammostore_crate", nil];
+            theWeapon = [[NSDictionary alloc] initWithObjects:
+                         [NSArray arrayWithObjects:
+                          @"90000090020000000021000000000000001100000900000000000",
+                          @"04050405416006555465544647765766666661555101011154111",
+                          @"00000000000002055000000400070040000000002000000006000",
+                          @"13111103121111111231141111111111111112111111011111111",
+                          nil]
+                                                      forKeys: [NSArray arrayWithObjects:
+                                                                @"ammostore_initialqt",
+                                                                @"ammostore_probability",
+                                                                @"ammostore_delay",
+                                                                @"ammostore_crate", nil]];
             break;
     }
 
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Wed Feb 16 13:07:00 2011 +0300
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Fri Feb 18 00:21:36 2011 +0100
@@ -1576,7 +1576,7 @@
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
-		1D6058900D05DD3D006BFB54 /* Test Lua */ = {
+		1D6058900D05DD3D006BFB54 /* Hedgewars */ = {
 			isa = PBXNativeTarget;
 			buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Hedgewars" */;
 			buildPhases = (
@@ -1667,7 +1667,7 @@
 			);
 			projectRoot = "";
 			targets = (
-				1D6058900D05DD3D006BFB54 /* Test Lua */,
+				1D6058900D05DD3D006BFB54 /* Hedgewars */,
 				928301160F10CAFC00CC5A3C /* fpc */,
 				6179928B114AE0C800BA94A9 /* UpdateDataFolder */,
 			);
--- a/project_files/HedgewarsMobile/SDL.patch	Wed Feb 16 13:07:00 2011 +0300
+++ b/project_files/HedgewarsMobile/SDL.patch	Fri Feb 18 00:21:36 2011 +0100
@@ -1,6 +1,6 @@
 diff -r 1fbe1c202501 Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
 --- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Feb 07 10:40:21 2011 -0800
-+++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Mon Feb 07 23:21:28 2011 +0100
++++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj	Fri Feb 18 00:09:03 2011 +0100
 @@ -1603,11 +1603,15 @@
  			isa = XCBuildConfiguration;
  			buildSettings = {
@@ -39,7 +39,7 @@
  				TARGETED_DEVICE_FAMILY = "1,2";
 diff -r 1fbe1c202501 include/SDL_config_iphoneos.h
 --- a/include/SDL_config_iphoneos.h	Mon Feb 07 10:40:21 2011 -0800
-+++ b/include/SDL_config_iphoneos.h	Mon Feb 07 23:21:28 2011 +0100
++++ b/include/SDL_config_iphoneos.h	Fri Feb 18 00:09:03 2011 +0100
 @@ -119,7 +119,7 @@
  /* enable iPhone version of Core Audio driver */
  #define SDL_AUDIO_DRIVER_COREAUDIOIPHONE 1
@@ -79,9 +79,24 @@
 +#define SDL_VIEW_TAG 456987
 +
  #endif /* _SDL_config_iphoneos_h */
+diff -r 1fbe1c202501 src/video/SDL_video.c
+--- a/src/video/SDL_video.c	Mon Feb 07 10:40:21 2011 -0800
++++ b/src/video/SDL_video.c	Fri Feb 18 00:09:03 2011 +0100
+@@ -1657,9 +1657,11 @@
+         SDL_MinimizeWindow(window);
+     }
+ 
++    /*
+     if (display->gamma && _this->SetDisplayGammaRamp) {
+         _this->SetDisplayGammaRamp(_this, display, display->saved_gamma);
+     }
++    */
+     if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN))
+         && _this->SetWindowGrab) {
+         _this->SetWindowGrab(_this, window);
 diff -r 1fbe1c202501 src/video/uikit/SDL_uikitopengles.m
 --- a/src/video/uikit/SDL_uikitopengles.m	Mon Feb 07 10:40:21 2011 -0800
-+++ b/src/video/uikit/SDL_uikitopengles.m	Mon Feb 07 23:21:28 2011 +0100
++++ b/src/video/uikit/SDL_uikitopengles.m	Fri Feb 18 00:09:03 2011 +0100
 @@ -117,6 +117,7 @@
                                      majorVersion: _this->gl_config.major_version];