Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » Stracciatella Project (Platform Independent JA2) » [Patch] Clothes change
[Patch] Clothes change[message #236398] Sat, 31 October 2009 10:47 Go to previous message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
Another patch for people who can build stracciatella themselves.

In the tactical screen, press:
SHIFT + V to cycle the available vest palettes of the selected merc.
SHIFT + P to cycle the pants palettes.

It works for the civilians you escort too.

I did nothing in this patch, all the code was already there for a "Palette edit" screen. I have never seen it.

And, as a bonus, the 'j' key will let you climb roofs and jump fences, since I didn't bother to remove this part from the patch. 'j' is stolen from 1.13.

clothes_change.diff:
Index: Build/JAScreens.h
===================================================================
--- Build/JAScreens.h	(revision 7056)
+++ Build/JAScreens.h	(working copy)
@@ -4,7 +4,13 @@
 #include "ScreenIDs.h"
 #include "Types.h"
 
+/* mgl: Clothes change
+ * SOLDIERTYPE, resp PaletteRepID defined there
+ */
+#include "Soldier_Control.h"
+#include "Overhead_Types.h"
 
+
 ScreenID ErrorScreenHandle(void);
 
 ScreenID InitScreenHandle(void);
@@ -38,4 +44,10 @@
 ScreenID DemoExitScreenHandle(void);
 #endif
 
+/* mgl: Clothes change
+ * Exported function.
+ * It was a local function called by "PalEditScreenHandle()".
+ */
+void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal);
+
 #endif
Index: Build/JAScreens.cc
===================================================================
--- Build/JAScreens.cc	(revision 7056)
+++ Build/JAScreens.cc	(working copy)
@@ -285,7 +285,10 @@
 }
 
 
-static void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
+/* mgl: Clothes change
+ * Exported function.
+ */
+void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
 {
 	UINT8 ubPaletteRep = GetPaletteRepIndexFromID(pal);
 	const UINT8 ubType = gpPalRep[ubPaletteRep].ubType;
Index: Build/Tactical/Turn_Based_Input.cc
===================================================================
--- Build/Tactical/Turn_Based_Input.cc	(revision 7056)
+++ Build/Tactical/Turn_Based_Input.cc	(working copy)
@@ -1354,6 +1354,39 @@
 		case 'g': HandlePlayerTogglingLightEffects(TRUE);                      break;
 		case 'h': ShouldTheHelpScreenComeUp(HELP_SCREEN_TACTICAL, TRUE);       break;
 		case 'i': ToggleItemGlow(!gGameSettings.fOptions[TOPTION_GLOW_ITEMS]); break;
+		/* mgl: kbd shortcut 'j' = climb roof. From JA2 v1.13 */
+		case 'j':
+			{
+			SOLDIERTYPE* const s = GetSelectedMan();
+			if (!s) { break; }
+			
+			// Prevent the robot, Maria, Joey etc from climbing
+			if (!IsValidStance(s, ANIM_CROUCH)) { break; }
+				
+			// Make sure the merc is not collapsed!
+			if (s->bCollapsed && s->bBreath < OKBREATH)
+			{
+				// Merc can't change stance message
+				ScreenMsg(FONT_MCOLOR_LTYELLOW,
+				          MSG_UI_FEEDBACK,
+				          gzLateLocalizedString[3],
+				          s->name);
+				break;
+			}
+
+			if (FindHigherLevel(s))
+			{	 BeginSoldierClimbUpRoof(s);
+			}
+			else if (FindLowerLevel(s))
+			{ 	BeginSoldierClimbDownRoof(s);
+			}
+			else if (FindFenceJumpDirection(s))
+			{	 BeginSoldierClimbFence(s);
+			}
+
+			break;
+			} /* case 'j' */
+
 		case 'k': BeginKeyPanelFromKeyShortcut();                              break;
 
 		case 'l':
@@ -1561,6 +1594,18 @@
 			}
 			break;
 
+		/* mgl: Clothes change */
+		case 'v':
+		{
+		SOLDIERTYPE* const s = GetSelectedMan();
+		if (!s) { break; }
+		// Anyone except the robot can change clothes
+		if (AM_A_ROBOT(s)) { break; }
+		CyclePaletteReplacement(*s, s->VestPal);
+		break;
+		}
+
+
 #ifdef JA2BETAVERSION
 		case 'l':
 		{
@@ -1573,6 +1618,17 @@
 		}
 #endif
 
+		/* mgl: Clothes change */
+		case 'p':
+		{
+		SOLDIERTYPE* const s = GetSelectedMan();
+		if (!s) { break; }
+		// Anyone except the robot can change clothes
+		if (AM_A_ROBOT(s)) { break; }
+		CyclePaletteReplacement(*s, s->PantsPal);
+		break;
+		}
+		
 		case SDLK_F1:
 		case SDLK_F2:
 		case SDLK_F3:

Enjoy the trendy pink war vest.

Report message to a moderator

Master Sergeant
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Patch] Skip militia turns by holding SHIFT
Next Topic: can ja2 stracciatella support other format music???
Goto Forum:
  


Current Time: Fri Jan 10 20:39:41 GMT+2 2025

Total time taken to generate the page: 0.01084 seconds