diff --git a/Editor/Editor_VS2005.vcproj b/Editor/Editor_VS2005.vcproj
index 92bb418d..3fcf3ae1 100644
--- a/Editor/Editor_VS2005.vcproj
+++ b/Editor/Editor_VS2005.vcproj
@@ -552,6 +552,10 @@
RelativePath=".\Smoothing Utils.cpp"
>
+
+
diff --git a/Editor/Editor_VS2008.vcproj b/Editor/Editor_VS2008.vcproj
index efd16c40..b4befac9 100644
--- a/Editor/Editor_VS2008.vcproj
+++ b/Editor/Editor_VS2008.vcproj
@@ -551,6 +551,10 @@
RelativePath="Smoothing Utils.cpp"
>
+
+
diff --git a/Editor/Editor_VS2010.vcxproj b/Editor/Editor_VS2010.vcxproj
index 28a36a00..19d9aa89 100644
--- a/Editor/Editor_VS2010.vcxproj
+++ b/Editor/Editor_VS2010.vcxproj
@@ -77,6 +77,7 @@
+
{23EA0500-038A-4EB8-B753-0C709B25470D}
diff --git a/Editor/Editor_VS2010.vcxproj.filters b/Editor/Editor_VS2010.vcxproj.filters
index ca9d84a6..547bab05 100644
--- a/Editor/Editor_VS2010.vcxproj.filters
+++ b/Editor/Editor_VS2010.vcxproj.filters
@@ -167,5 +167,8 @@
Source Files
+
+ Source Files
+
\ No newline at end of file
diff --git a/Editor/Item Statistics.cpp b/Editor/Item Statistics.cpp
index b014390b..c2b09431 100644
--- a/Editor/Item Statistics.cpp
+++ b/Editor/Item Statistics.cpp
@@ -34,12 +34,15 @@
#endif
#include "soldier profile type.h"
+#include "LuaInitNPCs.h"
INT32 giBothCheckboxButton = -1;
INT32 giRealisticCheckboxButton = -1;
INT32 giSciFiCheckboxButton = -1;
INT32 giAlarmTriggerButton = -1;
INT32 giOwnershipGroupButton = -1;
+
+CHAR16 gszActionItemDesc[ NUM_ACTIONITEMS ][ 30 ];
/*
CHAR16 gszActionItemDesc[ NUM_ACTIONITEMS ][ 30 ] =
{
@@ -77,14 +80,93 @@ CHAR16 gszActionItemDesc[ NUM_ACTIONITEMS ][ 30 ] =
L"Museum alarm",
L"Bloodcat alarm",
L"Big teargas",
+#ifdef JA2UB
+ L"BIGGENS BOMBS",
+ L"ABIGGENS WARNING",
+ L"SEE FORTIFIED DOOR",
+ L"OPEN FORTIFED DOOR",
+ L"SEE POWER GEN FAN",
+#endif
};
*/
const STR16 GetActionItemName( OBJECTTYPE *pItem )
{
+UINT32 i,o;
+CHAR16 temp[30];
+
if( !pItem || pItem->usItem != ACTION_ITEM )
return NULL;
+
+
+if( (*pItem)[0]->data.misc.bActionValue != ACTION_ITEM_BLOW_UP )
+ {
+ for (i= ACTIONITEM_TRIP_KLAXON; i<=ACTIONITEM_NEW; i++ )
+ {
+ if ( ActionItemsValues[ i ].BlowUp == 0 )
+ {
+ if ( (*pItem)[0]->data.misc.bActionValue == ActionItemsValues[ i ].ActionID )
+ {
+ wcscpy(temp, gszActionItemDesc[i]);
+ o = i;
+ }
+ }
+ }
+ return ActionItemsValues[ o ].szName;
+ }
+ else
+ {
+ for (i= ACTIONITEM_TRIP_KLAXON; i<=ACTIONITEM_NEW; i++ )
+ {
+ if ( ActionItemsValues[ i ].BlowUp == 1 )
+ {
+ if ( (*pItem)[0]->data.misc.bActionValue == ACTION_ITEM_BLOW_UP )
+ {
+ if ( (*pItem)[0]->data.misc.usBombItem == ActionItemsValues[ i ].BombItem )
+ o = i;
+ }
+ }
+ }
+ return ActionItemsValues[ o ].szName;
+ /*
+
+
+
+ if ( (*pItem)[0]->data.misc.usBombItem == STUN_GRENADE )
+ o = ACTIONITEM_STUN;
+ else if ( (*pItem)[0]->data.misc.usBombItem == SMOKE_GRENADE )
+ o = ACTIONITEM_SMOKE;
+ else if ( (*pItem)[0]->data.misc.usBombItem == TEARGAS_GRENADE )
+ o = ACTIONITEM_TEARGAS;
+ else if ( (*pItem)[0]->data.misc.usBombItem == MUSTARD_GRENADE )
+ o = ACTIONITEM_MUSTARD;
+ else if ( (*pItem)[0]->data.misc.usBombItem == HAND_GRENADE )
+ o = ACTIONITEM_SMALL;
+ else if ( (*pItem)[0]->data.misc.usBombItem == TNT )
+ o = ACTIONITEM_MEDIUM;
+ else if ( (*pItem)[0]->data.misc.usBombItem == C4 )
+ o = ACTIONITEM_LARGE;
+ else if ( (*pItem)[0]->data.misc.usBombItem == MINE )
+ o = ACTIONITEM_MINE;
+ else if ( (*pItem)[0]->data.misc.usBombItem == TRIP_FLARE )
+ o = ACTIONITEM_FLARE;
+ else if ( (*pItem)[0]->data.misc.usBombItem == TRIP_KLAXON )
+ o = ACTIONITEM_TRIP_KLAXON;
+ else if ( (*pItem)[0]->data.misc.usBombItem == BIG_TEAR_GAS )
+ o = ACTIONITEM_BIG_TEAR_GAS;
+
+ return ActionItemsValues[ o ].szName;
+
+ */
+ }
+
+/*
+ if( !pItem || pItem->usItem != ACTION_ITEM )
+ return NULL;
+
if( (*pItem)[0]->data.misc.bActionValue != ACTION_ITEM_BLOW_UP )
{
+
+
switch( (*pItem)[0]->data.misc.bActionValue )
{
case ACTION_ITEM_OPEN_DOOR: return gszActionItemDesc[ ACTIONITEM_OPEN ];
@@ -110,6 +192,13 @@ const STR16 GetActionItemName( OBJECTTYPE *pItem )
case ACTION_ITEM_TOGGLE_PRESSURE_ITEMS: return gszActionItemDesc[ ACTIONITEM_TOGGLE_PRESSURE_ITEMS ];
case ACTION_ITEM_MUSEUM_ALARM: return gszActionItemDesc[ ACTIONITEM_MUSEUM_ALARM ];
case ACTION_ITEM_BLOODCAT_ALARM: return gszActionItemDesc[ ACTIONITEM_BLOODCAT_ALARM ];
+#ifdef JA2UB
+ case ACTION_ITEM_BIGGENS_BOMBS: return gszActionItemDesc[ ACTIONITEM_BIGGENS_BOMBS ];
+ case ACTION_ITEM_BIGGENS_WARNING: return gszActionItemDesc[ ACTIONITEM_BIGGENS_WARNING ];
+ case ACTION_ITEM_SEE_FORTIFIED_DOOR: return gszActionItemDesc[ ACTIONITEM_SEE_FORTIFIED_DOOR ];
+ case ACTION_ITEM_OPEN_FORTIFED_DOOR: return gszActionItemDesc[ ACTIONITEM_OPEN_FORTIFED_DOOR ];
+ case ACTION_ITEM_SEE_POWER_GEN_FAN: return gszActionItemDesc[ ACTIONITEM_SEE_POWER_GEN_FAN ];
+#endif
default: return NULL;
}
}
@@ -128,6 +217,8 @@ const STR16 GetActionItemName( OBJECTTYPE *pItem )
case BIG_TEAR_GAS: return gszActionItemDesc[ ACTIONITEM_BIG_TEAR_GAS ];
default: return NULL;
}
+
+*/
}
enum
@@ -1412,6 +1503,26 @@ void ActionItemCallback( GUI_BUTTON *btn, INT32 reason )
void ChangeActionItem( OBJECTTYPE *pItem, INT8 bActionItemIndex )
{
+UINT32 i;
+pItem->usItem = ACTION_ITEM;
+//(*pItem)[0]->data.misc.bActionValue = ACTION_ITEM_BLOW_UP;
+
+ for (i= ACTIONITEM_TRIP_KLAXON; i<=ACTIONITEM_NEW; i++ )
+ {
+ if ( bActionItemIndex == i && ActionItemsValues[ i ].BlowUp == 1 )
+ {
+ (*pItem)[0]->data.misc.usBombItem = ActionItemsValues[ i ].BombItem;
+ (*pItem)[0]->data.misc.bActionValue = ACTION_ITEM_BLOW_UP;
+ }
+ else if ( bActionItemIndex == i && ActionItemsValues[ i ].BlowUp == 0 )
+ {
+ (*pItem)[0]->data.misc.usBombItem = ActionItemsValues[ i ].BombItem;
+ (*pItem)[0]->data.misc.bActionValue = ActionItemsValues[ i ].ActionID;
+ }
+ }
+
+
+/*
pItem->usItem = ACTION_ITEM;
(*pItem)[0]->data.misc.bActionValue = ACTION_ITEM_BLOW_UP;
switch( bActionItemIndex )
@@ -1541,8 +1652,31 @@ void ChangeActionItem( OBJECTTYPE *pItem, INT8 bActionItemIndex )
case ACTIONITEM_BIG_TEAR_GAS:
(*pItem)[0]->data.misc.usBombItem = BIG_TEAR_GAS;
break;
-
+#ifdef JA2UB
+ case ACTIONITEM_BIGGENS_BOMBS:
+ (*pItem)[0]->data.misc.usBombItem = NOTHING;
+ (*pItem)[0]->data.misc.bActionValue = ACTION_ITEM_BIGGENS_BOMBS;
+ break;
+ case ACTIONITEM_BIGGENS_WARNING:
+ (*pItem)[0]->data.misc.usBombItem = NOTHING;
+ (*pItem)[0]->data.misc.bActionValue = ACTION_ITEM_BIGGENS_WARNING;
+ break;
+ case ACTIONITEM_SEE_FORTIFIED_DOOR:
+ (*pItem)[0]->data.misc.usBombItem = NOTHING;
+ (*pItem)[0]->data.misc.bActionValue = ACTION_ITEM_SEE_FORTIFIED_DOOR;
+ break;
+ case ACTIONITEM_OPEN_FORTIFED_DOOR:
+ (*pItem)[0]->data.misc.usBombItem = NOTHING;
+ (*pItem)[0]->data.misc.bActionValue = ACTION_ITEM_OPEN_FORTIFED_DOOR;
+ break;
+ case ACTIONITEM_SEE_POWER_GEN_FAN:
+ (*pItem)[0]->data.misc.usBombItem = NOTHING;
+ (*pItem)[0]->data.misc.bActionValue = ACTION_ITEM_SEE_POWER_GEN_FAN;
+ break;
+#endif
}
+
+ */
}
void UpdateActionItem( INT8 bActionItemIndex )
diff --git a/Editor/Item Statistics.h b/Editor/Item Statistics.h
index e87a5f7e..cb836f94 100644
--- a/Editor/Item Statistics.h
+++ b/Editor/Item Statistics.h
@@ -84,6 +84,18 @@ enum
ACTIONITEM_MUSEUM_ALARM,
ACTIONITEM_BLOODCAT_ALARM,
ACTIONITEM_BIG_TEAR_GAS,
+
+#ifdef JA2UB
+ ACTIONITEM_BIGGENS_BOMBS,
+ ACTIONITEM_BIGGENS_WARNING,
+ ACTIONITEM_SEE_FORTIFIED_DOOR,
+ ACTIONITEM_OPEN_FORTIFED_DOOR,
+ ACTIONITEM_SEE_POWER_GEN_FAN,
+ ACTIONITEM_NEW = ACTIONITEM_SEE_POWER_GEN_FAN + 215,
+#else
+ ACTIONITEM_NEW = ACTIONITEM_BIG_TEAR_GAS + 220,
+#endif
+
NUM_ACTIONITEMS
};
extern CHAR16 gszActionItemDesc[ NUM_ACTIONITEMS ][ 30 ];
@@ -98,5 +110,7 @@ extern INT8 gbDefaultBombTrapLevel;
extern void SetOwnershipGroup( UINT8 ubNewGroup );
+//extern CHAR16 gszActionItemDesc[ NUM_ACTIONITEMS ][ 30 ];
+
#endif
#endif
diff --git a/Editor/XML_ActionItems.cpp b/Editor/XML_ActionItems.cpp
new file mode 100644
index 00000000..eca5543e
--- /dev/null
+++ b/Editor/XML_ActionItems.cpp
@@ -0,0 +1,252 @@
+#ifdef PRECOMPILEDHEADERS
+ #include "Tactical All.h"
+ #include "Editor All.h"
+ #include "LuaInitNPCs.h"
+#else
+ #include "Editor All.h"
+ #include "sgp.h"
+ #include "Debug Control.h"
+ #include "expat.h"
+ #include "XML.h"
+ #include "Interface.h"
+ #include "Item Statistics.h"
+ #include "LuaInitNPCs.h"
+#endif
+
+struct
+{
+ PARSE_STAGE curElement;
+
+ CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
+ ACTION_ITEM_VALUES curActionItems;
+ ACTION_ITEM_VALUES * curArray;
+
+ UINT32 maxArraySize;
+ UINT32 curIndex;
+ UINT32 currentDepth;
+ UINT32 maxReadDepth;
+ //CHAR16 gzEnemyNames[MAX_ENEMY_NAMES_CHARS];
+}
+typedef actionItemsParseData;
+
+BOOLEAN ActionItems_TextOnly;
+
+static void XMLCALL
+actionItemsStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
+{
+ actionItemsParseData * pData = (actionItemsParseData *)userData;
+
+ if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
+ {
+ if(strcmp(name, "ACTION_ITEM_LIST") == 0 && pData->curElement == ELEMENT_NONE)
+ {
+ pData->curElement = ELEMENT_LIST;
+
+ pData->maxReadDepth++; //we are not skipping this element
+ }
+ else if(strcmp(name, "ACTION_ITEM") == 0 && pData->curElement == ELEMENT_LIST)
+ {
+ pData->curElement = ELEMENT;
+
+ pData->maxReadDepth++; //we are not skipping this element
+ }
+ else if(pData->curElement == ELEMENT &&
+ (strcmp(name, "uiIndex") == 0 ||
+ strcmp(name, "ActionID") == 0 ||
+ strcmp(name, "Name") == 0 ||
+ strcmp(name, "BombItem") == 0 ||
+ strcmp(name, "Blow_up") == 0 ))
+ {
+ pData->curElement = ELEMENT_PROPERTY;
+
+ pData->maxReadDepth++; //we are not skipping this element
+ }
+
+ pData->szCharData[0] = '\0';
+ }
+
+ pData->currentDepth++;
+
+}
+
+static void XMLCALL
+actionItemsCharacterDataHandle(void *userData, const XML_Char *str, int len)
+{
+ actionItemsParseData * pData = (actionItemsParseData *)userData;
+
+ if( (pData->currentDepth <= pData->maxReadDepth) &&
+ (strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
+ ){
+ strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
+ }
+}
+
+
+static void XMLCALL
+actionItemsEndElementHandle(void *userData, const XML_Char *name)
+{
+ actionItemsParseData * pData = (actionItemsParseData *)userData;
+
+ if(pData->currentDepth <= pData->maxReadDepth)
+ {
+ if(strcmp(name, "ACTION_ITEM_LIST") == 0)
+ {
+ pData->curElement = ELEMENT_NONE;
+ }
+ else if(strcmp(name, "ACTION_ITEM") == 0)
+ {
+ pData->curElement = ELEMENT_LIST;
+
+ if (!ActionItems_TextOnly)
+ {
+ //if ( ActionItemsValues[pData->curActionItems.uiIndex].ActionID > 0 )
+ wcscpy(ActionItemsValues[pData->curActionItems.uiIndex].szName, pData->curActionItems.szName);
+
+ #ifdef JA2EDITOR
+ //if ( ActionItemsValues[pData->curActionItems.uiIndex].ActionID > 0 )
+ wcscpy(gszActionItemDesc[pData->curActionItems.uiIndex], pData->curActionItems.szName);
+ #endif
+
+ ActionItemsValues[pData->curActionItems.uiIndex].ActionID = pData->curActionItems.ActionID;
+ ActionItemsValues[pData->curActionItems.uiIndex].BlowUp = pData->curActionItems.BlowUp;
+ ActionItemsValues[pData->curActionItems.uiIndex].BombItem = pData->curActionItems.BombItem;
+
+ }
+ else
+ {
+ //if ( ActionItemsValues[pData->curActionItems.uiIndex].ActionID > 0 )
+ wcscpy(ActionItemsValues[pData->curActionItems.uiIndex].szName, pData->curActionItems.szName);
+
+ #ifdef JA2EDITOR
+ //if ( ActionItemsValues[pData->curActionItems.uiIndex].ActionID > 0 )
+ wcscpy(gszActionItemDesc[pData->curActionItems.uiIndex], pData->curActionItems.szName);
+ #endif
+ }
+
+ }
+ else if(strcmp(name, "uiIndex") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curActionItems.uiIndex = (UINT16) atol(pData->szCharData);
+ }
+ else if(strcmp(name, "Name") == 0 )
+ {
+ pData->curElement = ELEMENT;
+
+ MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curActionItems.szName, sizeof(pData->curActionItems.szName)/sizeof(pData->curActionItems.szName[0]) );
+ pData->curActionItems.szName[sizeof(pData->curActionItems.szName)/sizeof(pData->curActionItems.szName[0]) - 1] = '\0';
+ }
+ else if(strcmp(name, "ActionID") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curActionItems.ActionID = (UINT8) atol(pData->szCharData);
+ }
+ else if(strcmp(name, "Blow_up") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curActionItems.BlowUp = (UINT8) atol(pData->szCharData);
+ }
+ else if(strcmp(name, "BombItem") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curActionItems.BombItem = (UINT32) atol(pData->szCharData);
+ }
+ pData->maxReadDepth--;
+ }
+ pData->currentDepth--;
+}
+
+
+
+
+BOOLEAN ReadInActionItems(STR fileName, BOOLEAN localizedVersion)
+{
+ HWFILE hFile;
+ UINT32 uiBytesRead;
+ UINT32 uiFSize;
+ CHAR8 * lpcBuffer;
+ XML_Parser parser = XML_ParserCreate(NULL);
+
+ actionItemsParseData pData;
+
+ DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading ActionItems.xml" );
+
+ ActionItems_TextOnly = localizedVersion;
+
+ // Open file
+ hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
+ if ( !hFile )
+ return( localizedVersion );
+
+ uiFSize = FileGetSize(hFile);
+ lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
+
+ //Read in block
+ if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
+ {
+ MemFree(lpcBuffer);
+ return( FALSE );
+ }
+
+ lpcBuffer[uiFSize] = 0; //add a null terminator
+
+ FileClose( hFile );
+
+
+ XML_SetElementHandler(parser, actionItemsStartElementHandle, actionItemsEndElementHandle);
+ XML_SetCharacterDataHandler(parser, actionItemsCharacterDataHandle);
+
+
+ memset(&pData,0,sizeof(pData));
+ XML_SetUserData(parser, &pData);
+
+
+ if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
+ {
+ CHAR8 errorBuf[511];
+
+ sprintf(errorBuf, "XML Parser Error in ActionItems.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
+ LiveMessage(errorBuf);
+
+ MemFree(lpcBuffer);
+ return FALSE;
+ }
+
+ MemFree(lpcBuffer);
+
+
+ XML_ParserFree(parser);
+
+
+ return( TRUE );
+}
+
+BOOLEAN WriteInActionItems( STR fileName)
+{
+ HWFILE hFile;
+
+ //Debug code; make sure that what we got from the file is the same as what's there
+ // Open a new file
+ hFile = FileOpen( fileName, FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
+ if ( !hFile )
+ return( FALSE );
+
+ {
+ UINT32 cnt;
+
+ FilePrintf(hFile,"\r\n");
+ for(cnt = 0;cnt < 501;cnt++)
+ {
+ FilePrintf(hFile,"\t\r\n");
+ FilePrintf(hFile,"\t\t%d\r\n", cnt);
+ FilePrintf(hFile,"\t\tEmpty action\r\n");
+ FilePrintf(hFile,"\t\t%d\r\n", ActionItemsValues[cnt].ActionID);
+ FilePrintf(hFile,"\t\t%d\r\n", ActionItemsValues[cnt].BlowUp);
+ FilePrintf(hFile,"\t\r\n");
+ }
+ FilePrintf(hFile,"\r\n");
+ }
+ FileClose( hFile );
+
+ return( TRUE );
+}
diff --git a/GameInitOptionsScreen.cpp b/GameInitOptionsScreen.cpp
index 041c5ce7..14b366c0 100644
--- a/GameInitOptionsScreen.cpp
+++ b/GameInitOptionsScreen.cpp
@@ -28,11 +28,21 @@
#include "connect.h"
#include "saveloadscreen.h"
+#ifdef JA2UB
+ #include "ub_config.h"
+#endif
+
#include
#include
#include
#include
+#ifdef JA2UB
+
+// *********************************
+// Unfinished Business: Initial Game Screen
+// *********************************
+
//////////////////////////////////////////////////////////////
// SANDRO - the start-new-game screen has been changed a lot
//////////////////////////////////////////////////////////////
@@ -91,6 +101,7 @@
#define GIO_IRON_MAN_SETTING_Y GIO_GAME_SETTING_Y + 67
#define GIO_IRON_MAN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+// Tex and Jon
#define GIO_TERRORISTS_SETTING_X GIO_TRAITS_SETTING_X
#define GIO_TERRORISTS_SETTING_Y GIO_IRON_MAN_SETTING_Y + 67
#define GIO_TERRORISTS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
@@ -99,12 +110,12 @@
#define GIO_BR_SETTING_Y GIO_DIF_SETTING_Y
#define GIO_BR_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
-#define GIO_PROGRESS_SETTING_X GIO_BR_SETTING_X
-#define GIO_PROGRESS_SETTING_Y GIO_BR_SETTING_Y + 63
-#define GIO_PROGRESS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define GIO_SQUAD_SIZE_SETTING_X GIO_BR_SETTING_X
+#define GIO_SQUAD_SIZE_SETTING_Y GIO_BR_SETTING_Y + 63
+#define GIO_SQUAD_SIZE_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
-#define GIO_INV_SETTING_X GIO_PROGRESS_SETTING_X
-#define GIO_INV_SETTING_Y GIO_PROGRESS_SETTING_Y + 63
+#define GIO_INV_SETTING_X GIO_SQUAD_SIZE_SETTING_X
+#define GIO_INV_SETTING_Y GIO_SQUAD_SIZE_SETTING_Y + 63
#define GIO_INV_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
#define GIO_DROPALL_SETTING_X GIO_INV_SETTING_X + 36
@@ -123,6 +134,11 @@
#define GIO_TIMED_TURN_SETTING_Y GIO_IRON_MAN_SETTING_Y
#define GIO_TIMED_TURN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define GIO_PROGRESS_SETTING_X GIO_SQUAD_SIZE_SETTING_X
+#define GIO_PROGRESS_SETTING_Y GIO_TERRORISTS_SETTING_Y + 13
+#define GIO_PROGRESS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+
+
// INI File
#define JA2SP_INI_FILENAME "ja2_sp.ini"
@@ -142,7 +158,2446 @@
#define JA2SP_AVAILABLE_ARSENAL "AVAILABLE_ARSENAL"
#define JA2SP_NUMBER_OF_TERRORISTS "NUMBER_OF_TERRORISTS"
#define JA2SP_SECRET_WEAPON_CACHES "SECRET_WEAPON_CACHES"
+#define JA2SP_SQUAD_SIZE "SQUAD_SIZE"
+// Exclusive UB
+#define JA2SP_UB_RPC_TEX_AND_JOHN "RPC_TEX_AND_JOHN"
+#define JA2SP_UB_RANDOM_MANUEL_TEXT "RANDOM_MANUEL_TEXT"
+
+
+//Difficulty settings
+enum
+{
+ GIO_DIFF_EASY,
+ GIO_DIFF_MED,
+ GIO_DIFF_HARD,
+ GIO_DIFF_INSANE,
+
+ NUM_DIFF_SETTINGS,
+};
+
+enum
+{
+ GIO_TRAITS_OLD,
+ GIO_TRAITS_NEW,
+
+ NUM_TRAIT_OPTIONS,
+};
+
+// Game Settings options
+enum
+{
+ GIO_TEXT_OFF,
+ GIO_TEXT_ON,
+
+ NUM_TEXT_STYLES,
+};
+
+enum
+{
+ GIO_REALISTIC,
+ GIO_SCI_FI,
+
+ NUM_GAME_STYLES,
+};
+
+
+// Iron man mode
+enum
+{
+ GIO_CAN_SAVE,
+ GIO_IRON_MAN,
+
+ NUM_SAVE_OPTIONS,
+};
+
+enum
+{
+ GIO_TEX_JOHN_RANDOM,
+ GIO_TEX_AND_JOHN,
+
+ NUM_RPC_UB_OPTIONS,
+};
+
+// BR options
+enum
+{
+ GIO_BR_GOOD,
+ GIO_BR_GREAT,
+ GIO_BR_EXCELLENT,
+ GIO_BR_AWESOME,
+
+ NUM_BR_OPTIONS,
+};
+
+enum
+{
+ GIO_PROGRESS_VERY_SLOW,
+ GIO_PROGRESS_SLOW,
+ GIO_PROGRESS_NORMAL,
+ GIO_PROGRESS_FAST,
+ GIO_PROGRESS_VERY_FAST,
+
+ NUM_PROGRESS_OPTIONS,
+};
+
+// New inventory options
+enum
+{
+ GIO_INV_OLD,
+ GIO_INV_NEW,
+ GIO_INV_NEW_NAS, // WANNE: Added NAS to the start new game screen
+
+ NUM_INV_OPTIONS,
+};
+
+enum
+{
+ GIO_SQUAD_SIZE_6,
+ GIO_SQUAD_SIZE_8,
+ GIO_SQUAD_SIZE_10,
+
+ NUM_SQUAD_SIZE_OPTIONS,
+};
+
+enum
+{
+ GIO_DROPALL_OFF,
+ GIO_DROPALL_ON,
+
+ NUM_DROPALL_OPTIONS,
+};
+
+// Gun options
+enum
+{
+ GIO_REDUCED_GUNS,
+ GIO_GUN_NUT,
+
+ NUM_GUN_OPTIONS,
+};
+
+enum
+{
+ GIO_CACHES_RANDOM,
+ GIO_CACHES_ALL,
+
+ NUM_CACHES_OPTIONS,
+};
+
+
+// Timed turns setting (Multiplayer exclusive)
+enum
+{
+ GIO_NO_TIMED_TURNS,
+ GIO_TIMED_TURNS,
+
+ GIO_NUM_TIMED_TURN_OPTIONS,
+};
+
+
+//enum for different states of game
+enum
+{
+ GIO_NOTHING,
+ GIO_CANCEL,
+ GIO_EXIT,
+ GIO_IRON_MAN_MODE,
+ MP_LOAD
+};
+
+////////////////////////////////////////////
+//
+// Global Variables
+//
+///////////////////////////////////////////
+
+BOOLEAN gfGIOScreenEntry = TRUE;
+BOOLEAN gfGIOScreenExit = FALSE;
+BOOLEAN gfReRenderGIOScreen=TRUE;
+BOOLEAN gfGIOButtonsAllocated = FALSE;
+
+UINT8 gubGameOptionScreenHandler=GIO_NOTHING;
+
+UINT32 gubGIOExitScreen = GAME_INIT_OPTIONS_SCREEN;
+
+UINT32 guiGIOMainBackGroundImage;
+
+INT32 giGioMessageBox = -1;
+
+INT8 iCurrentDifficulty;
+INT8 iCurrentBRSetting;
+INT8 iCurrentIMPNumberSetting;
+INT8 iCurrentProgressSetting;
+INT8 iCurrentInventorySetting;
+INT8 iCurrentSquadSize;
+
+
+UINT32 guiGIOSMALLFRAME;
+
+// Done Button
+void BtnGIODoneCallback(GUI_BUTTON *btn,INT32 reason);
+UINT32 guiGIODoneButton;
+INT32 giGIODoneBtnImage;
+
+// Cancel Button
+void BtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason);
+UINT32 guiGIOCancelButton;
+INT32 giGIOCancelBtnImage;
+
+// MP LOAD Button
+void MPBtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason);
+UINT32 MPguiGIOCancelButton;
+INT32 MPgiGIOCancelBtnImage;
+
+UINT32 giGIODifficultyButton[ 2 ];
+INT32 giGIODifficultyButtonImage[ 2 ];
+void BtnGIODifficultySelectionLeftCallback( GUI_BUTTON *btn,INT32 reason );
+void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason );
+
+UINT32 giGIOIMPNumberButton[ 2 ];
+INT32 giGIOIMPNumberButtonImage[ 2 ];
+void BtnGIOIMPNumberSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason );
+void BtnGIOIMPNumberSelectionRightCallback( GUI_BUTTON *btn,INT32 reason );
+
+UINT32 giGIOBRSettingButton[ 2 ];
+INT32 giGIOBRSettingButtonImage[ 2 ];
+void BtnGIOBRSettingLeftCallback( GUI_BUTTON *btn,INT32 reason );
+void BtnGIOBRSettingRightCallback( GUI_BUTTON *btn,INT32 reason );
+
+UINT32 giGIOProgressSettingButton[ 2 ];
+INT32 giGIOProgressSettingButtonImage[ 2 ];
+void BtnGIOProgressSettingLeftCallback( GUI_BUTTON *btn,INT32 reason );
+void BtnGIOProgressSettingRightCallback( GUI_BUTTON *btn,INT32 reason );
+
+UINT32 giGIOInventorySettingButton [ 2 ];
+INT32 giGIOInventorySettingButtonImage [ 2 ];
+void BtnGIOInventorySettingLeftCallback( GUI_BUTTON *btn,INT32 reason );
+void BtnGIOInventorySettingRightCallback( GUI_BUTTON *btn,INT32 reason );
+
+UINT32 guiTraitsOptionTogglesImage[ NUM_TRAIT_OPTIONS ];
+UINT32 guiTraitsOptionToggles[ NUM_TRAIT_OPTIONS ];
+void BtnGIOOldTraitsCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIONewTraitsCallback(GUI_BUTTON *btn,INT32 reason);
+void NewTraitsNotPossibleMessageBoxCallBack( UINT8 bExitValue );
+
+//checkbox to toggle Game style
+UINT32 guiGameTextTogglesImage[ NUM_TEXT_STYLES ];
+UINT32 guiGameTextToggles[ NUM_TEXT_STYLES ];
+
+UINT32 guiGameStyleTogglesImage[ NUM_GAME_STYLES ];
+UINT32 guiGameStyleToggles[ NUM_GAME_STYLES ];
+
+void BtnGIOOffStyleCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIOOnStyleCallback(GUI_BUTTON *btn,INT32 reason);
+
+//checkbox to toggle Save style
+UINT32 guiGameSaveTogglesImage[ NUM_SAVE_OPTIONS ];
+UINT32 guiGameSaveToggles[ NUM_SAVE_OPTIONS ];
+void BtnGIOIronManOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIOIronManOnCallback(GUI_BUTTON *btn,INT32 reason);
+
+UINT32 guiRpcOptionTogglesImage[ NUM_RPC_UB_OPTIONS ];
+UINT32 guiRpcOptionToggles[ NUM_RPC_UB_OPTIONS ];
+
+void BtnGIORpcRandomCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIORpcAllCallback(GUI_BUTTON *btn,INT32 reason);
+
+UINT32 guiDropAllOptionTogglesImage[ NUM_DROPALL_OPTIONS ];
+UINT32 guiDropAllOptionToggles[ NUM_DROPALL_OPTIONS ];
+void BtnGIODropAllOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIODropAllOnCallback(GUI_BUTTON *btn,INT32 reason);
+
+//checkbox to toggle Gun options
+UINT32 guiGunOptionTogglesImage[ NUM_GUN_OPTIONS ];
+UINT32 guiGunOptionToggles[ NUM_GUN_OPTIONS ];
+void BtnGIOGunSettingReducedCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIOGunSettingToGCallback(GUI_BUTTON *btn,INT32 reason);
+
+
+UINT32 giGIOSquadSizeButton[ 2 ];
+INT32 giGIOSquadSizeButtonImage[ 2 ];
+void BtnGIOSquadSizeSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason );
+void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason );
+
+
+UINT32 guiTimedTurnToggles[ GIO_NUM_TIMED_TURN_OPTIONS ];
+void BtnTimedTurnsTogglesCallback(GUI_BUTTON *btn,INT32 reason);
+
+void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY);
+
+////////////////////////////////////////////
+//
+// Local Function Prototypes
+//
+///////////////////////////////////////////
+
+extern void ClearMainMenu();
+
+BOOLEAN EnterGIOScreen();
+BOOLEAN ExitGIOScreen();
+void HandleGIOScreen();
+BOOLEAN RenderGIOScreen();
+void GetGIOScreenUserInput();
+UINT8 GetCurrentGunButtonSetting();
+// JA2Gold: added save (iron man) button setting
+UINT8 GetCurrentGameSaveButtonSetting();
+
+UINT8 GetCurrentTextStyleButtonSetting();
+
+// SANDRO - added following
+UINT8 GetCurrentTraitsOptionButtonSetting();
+UINT8 GetCurrentDropAllButtonSetting();
+UINT8 GetCurrentTexAndJohnButtonSetting();
+
+void DoneFadeOutForExitGameInitOptionScreen( void );
+void DoneFadeInForExitGameInitOptionScreen( void );
+UINT8 GetCurrentTimedTurnsButtonSetting();
+BOOLEAN DoGioMessageBox( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback );
+void DisplayMessageToUserAboutGameDifficulty();
+void ConfirmGioDifSettingMessageBoxCallBack( UINT8 bExitValue );
+BOOLEAN DisplayMessageToUserAboutIronManMode();
+BOOLEAN DisplayMessageToUserAboutOIVandNASincompatibility();
+void ConfirmGioIronManMessageBoxCallBack( UINT8 bExitValue );
+
+BOOLEAN SpIniExists()
+{
+ BOOLEAN exists = TRUE;
+
+ if(!getVFS()->fileExists(JA2SP_INI_FILENAME))
+ exists = FALSE;
+
+ return exists;
+}
+
+UINT32 GameInitOptionsScreenInit( void )
+{
+ memset( &gGameOptions, 0, sizeof( GAME_OPTIONS ) );
+
+ // WANNE: Read initial game settings from ja2_sp.ini
+ vfs::PropertyContainer props;
+
+ if (SpIniExists())
+ props.initFromIniFile(JA2SP_INI_FILENAME);
+
+ // Difficulty Level (Default: Experienced = 1)
+ gGameOptions.ubDifficultyLevel = ((UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_DIFFICULTY_LEVEL, 1)) + 1;
+
+ // Bobby Ray's Selection (Default: Great = 1)
+ UINT8 ubBobbyRay = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_BOBBY_RAY_SELECTION, 1);
+ switch (ubBobbyRay)
+ {
+ // Normal
+ case 0:
+ gGameOptions.ubBobbyRay = BR_GOOD;
+ break;
+ // Great
+ case 1:
+ gGameOptions.ubBobbyRay = BR_GREAT;
+ break;
+ // Excellent
+ case 2:
+ gGameOptions.ubBobbyRay = BR_EXCELLENT;
+ break;
+ // Awesome
+ case 3:
+ gGameOptions.ubBobbyRay = BR_AWESOME;
+ break;
+ }
+
+ // Max. IMP Characters
+ UINT8 maxIMPCharacterCount = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_MAX_IMP_CHARACTERS, 1);
+ gGameOptions.ubMaxIMPCharacters = min( (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount), ( max( 1, maxIMPCharacterCount) ));
+
+ // Progress Speed of Item Choices (Default: Normal)
+ gGameOptions.ubProgressSpeedOfItemsChoices = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_PROGRESS_SPEED_OF_ITEM_CHOICES, ITEM_PROGRESS_NORMAL);
+
+ // Skill Traits
+ UINT8 ubTraitSystem = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SKILL_TRAITS, 0);
+ if (!gGameExternalOptions.fReadProfileDataFromXML)
+ ubTraitSystem = 0;
+
+ gGameOptions.fNewTraitSystem = ubTraitSystem;
+
+ // Inventory Attachments (Default: New/New = 2)
+ UINT8 ubInventoryAttachmentSystem = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_INVENTORY_ATTACHMENTS, 0);
+
+ // NIV is not allowed
+ if (!IsNIVModeValid(true))
+ ubInventoryAttachmentSystem = 0;
+
+ switch (ubInventoryAttachmentSystem)
+ {
+ // Old / Old
+ case 0:
+ gGameOptions.ubInventorySystem = INVENTORY_OLD;
+ gGameOptions.ubAttachmentSystem = ATTACHMENT_OLD;
+ break;
+ // New / Old
+ case 1:
+ gGameOptions.ubInventorySystem = INVENTORY_NEW;
+ gGameOptions.ubAttachmentSystem = ATTACHMENT_OLD;
+ break;
+ // New / New
+ case 2:
+ gGameOptions.ubInventorySystem = INVENTORY_NEW;
+ gGameOptions.ubAttachmentSystem = ATTACHMENT_NEW;
+ break;
+ }
+
+ // Game Style (Default: Realistic = 0)
+ gGameOptions.ubGameStyle = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_GAME_STYLE, STYLE_REALISTIC);
+
+ // Enemies Drop All Items (Default: Off = 0)
+ gGameOptions.fEnemiesDropAllItems = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_ENEMIES_DROP_ALL_ITEMS, 0);
+
+ // Extra Difficulty (Default: Save Anytime = 0)
+ gGameOptions.fIronManMode = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_EXTRA_DIFFICULTY, 0);
+
+
+ // Available Arsenal (Default: Tons of Guns = 1)
+ gGameOptions.fGunNut = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_AVAILABLE_ARSENAL, 1);
+
+ // tex and john
+ gGameUBOptions.fTexAndJohn = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_UB_RPC_TEX_AND_JOHN, 0);
+
+ // Random Manuel Text
+ gGameUBOptions.fRandomManuelText = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_UB_RANDOM_MANUEL_TEXT, 0);
+
+ // Squad size (Default: 6)
+ UINT8 ubSquadSize = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SQUAD_SIZE, 6);
+
+ if (iResolution == 0)
+ ubSquadSize = 6;
+
+ gGameOptions.ubSquadSize = ubSquadSize;
+
+ // Secret Weapon Caches (Default: Random = 0)
+ gGameOptions.fEnableAllWeaponCaches = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SECRET_WEAPON_CACHES, 0);
+
+ gGameOptions.fAirStrikes = FALSE;
+ gGameOptions.fTurnTimeLimit = FALSE;
+
+ return (1);
+}
+
+UINT32 GameInitOptionsScreenHandle( void )
+{
+ StartFrameBufferRender();
+
+ if( gfGIOScreenEntry )
+ {
+ GameInitOptionsScreenInit();
+
+ EnterGIOScreen();
+ gfGIOScreenEntry = FALSE;
+ gfGIOScreenExit = FALSE;
+ InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
+ }
+
+ GetGIOScreenUserInput();
+
+ HandleGIOScreen();
+
+ // render buttons marked dirty
+ MarkButtonsDirty( );
+ RenderButtons( );
+
+ ExecuteBaseDirtyRectQueue();
+ EndFrameBufferRender();
+
+ if ( HandleFadeOutCallback( ) )
+ {
+ ClearMainMenu();
+ return( gubGIOExitScreen );
+ }
+
+ if ( HandleBeginFadeOut( gubGIOExitScreen ) )
+ {
+ return( gubGIOExitScreen );
+ }
+
+ if( gfGIOScreenExit )
+ {
+ ExitGIOScreen();
+ }
+
+ if ( HandleFadeInCallback( ) )
+ {
+ // Re-render the scene!
+ RenderGIOScreen();
+ }
+
+ if ( HandleBeginFadeIn( gubGIOExitScreen ) )
+ {
+ }
+
+ return( gubGIOExitScreen );
+}
+
+
+UINT32 GameInitOptionsScreenShutdown( void )
+{
+ return( 1 );
+}
+
+
+BOOLEAN EnterGIOScreen()
+{
+ VOBJECT_DESC VObjectDesc, VObjectDesc2;
+
+ if( gfGIOButtonsAllocated )
+ return( TRUE );
+
+ SetCurrentCursorFromDatabase( CURSOR_NORMAL );
+
+ // load the Main trade screen backgroiund image
+ VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
+
+ if (iResolution == 0)
+ {
+ FilenameForBPP("INTERFACE\\OptionsScreenBackGround.sti", VObjectDesc.ImageFile);
+ }
+ else if (iResolution == 1)
+ {
+ FilenameForBPP("INTERFACE\\OptionsScreenBackGround_800x600.sti", VObjectDesc.ImageFile);
+ }
+ else if (iResolution == 2)
+ {
+ FilenameForBPP("INTERFACE\\OptionsScreenBackGround_1024x768.sti", VObjectDesc.ImageFile);
+ }
+
+ CHECKF(AddVideoObject(&VObjectDesc, &guiGIOMainBackGroundImage ));
+
+ VObjectDesc2.fCreateFlags=VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("INTERFACE\\GIOSmallFrame.sti", VObjectDesc2.ImageFile);
+ CHECKF(AddVideoObject(&VObjectDesc2, &guiGIOSMALLFRAME));
+
+ //Ok button
+ giGIODoneBtnImage = LoadButtonImage("INTERFACE\\PreferencesButtons.sti", -1,0,-1,2,-1 );
+ guiGIODoneButton = CreateIconAndTextButton( giGIODoneBtnImage, gzGIOScreenText[GIO_START_TEXT], OPT_BUTTON_FONT,
+ OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
+ OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
+ TEXT_CJUSTIFIED,
+ GIO_BTN_START_X, GIO_BTN_START_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIODoneCallback);
+
+ SpecifyButtonSoundScheme( guiGIODoneButton, BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyDisabledButtonStyle( guiGIODoneButton, DISABLED_STYLE_NONE );
+
+ //Cancel button
+ giGIOCancelBtnImage = UseLoadedButtonImage( giGIODoneBtnImage, -1,1,-1,3,-1 );
+ guiGIOCancelButton = CreateIconAndTextButton( giGIOCancelBtnImage, gzGIOScreenText[GIO_CANCEL_TEXT], OPT_BUTTON_FONT,
+ OPT_BUTTON_ON_COLOR, DEFAULT_SHADOW,
+ OPT_BUTTON_OFF_COLOR, DEFAULT_SHADOW,
+ TEXT_CJUSTIFIED,
+ GIO_CANCEL_X, GIO_BTN_START_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOCancelCallback );
+ SpecifyButtonSoundScheme( guiGIOCancelButton, BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // DIFFICULTY SETTING
+
+ giGIODifficultyButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,0,-1,1,-1 );
+ giGIODifficultyButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,2,-1,3,-1 );
+
+ // left button - decrement difficulty level
+ giGIODifficultyButton[ 0 ] = QuickCreateButton( giGIODifficultyButtonImage[ 0 ], GIO_DIF_SETTING_X + 39, GIO_DIF_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIODifficultySelectionLeftCallback );
+
+ // right button - increment difficulty level
+ giGIODifficultyButton[ 1 ] = QuickCreateButton( giGIODifficultyButtonImage[ 1 ], GIO_DIF_SETTING_X + 158, GIO_DIF_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIODifficultySelectionRightCallback );
+
+ // set user data
+ MSYS_SetBtnUserData(giGIODifficultyButton[0],0, 0 );
+ MSYS_SetBtnUserData(giGIODifficultyButton[1],0, 1 );
+
+ iCurrentDifficulty = max( 0, gGameOptions.ubDifficultyLevel - 1);
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // MAX IMP NUMBER SETTING
+
+ giGIOIMPNumberButtonImage[ 0 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 0 ],-1,0,-1,1,-1 );
+ giGIOIMPNumberButtonImage[ 1 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 1 ],-1,2,-1,3,-1 );
+
+ // left button - decrement difficulty level
+ giGIOIMPNumberButton[ 0 ] = QuickCreateButton( giGIOIMPNumberButtonImage[ 0 ], GIO_IMP_SETTING_X + 39, GIO_IMP_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOIMPNumberSelectionLeftCallback );
+
+ // right button - increment difficulty level
+ giGIOIMPNumberButton[ 1 ] = QuickCreateButton( giGIOIMPNumberButtonImage[ 1 ], GIO_IMP_SETTING_X + 158, GIO_IMP_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOIMPNumberSelectionRightCallback );
+
+ // set user data
+ MSYS_SetBtnUserData(giGIOIMPNumberButton[0],0, 0 );
+ MSYS_SetBtnUserData(giGIOIMPNumberButton[1],0, 1 );
+
+ iCurrentIMPNumberSetting = gGameOptions.ubMaxIMPCharacters;
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // OLD/NEW TARITS SETTING
+
+ guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ] = LoadButtonImage( "INTERFACE\\GIOCheckButton.sti" ,-1,0,-1,2,-1 );
+ guiTraitsOptionToggles[ GIO_TRAITS_OLD ] = CreateIconAndTextButton( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], gzGIOScreenText[ GIO_TRAITS_OLD_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_TRAITS_SETTING_X + 74), (GIO_TRAITS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOOldTraitsCallback);
+
+ guiTraitsOptionTogglesImage[ GIO_TRAITS_NEW ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiTraitsOptionToggles[ GIO_TRAITS_NEW ] = CreateIconAndTextButton( guiTraitsOptionTogglesImage[ GIO_TRAITS_NEW ], gzGIOScreenText[ GIO_TRAITS_NEW_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_TRAITS_SETTING_X), (GIO_TRAITS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIONewTraitsCallback );
+
+ SpecifyButtonSoundScheme( guiTraitsOptionToggles[ GIO_TRAITS_OLD ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiTraitsOptionToggles[ GIO_TRAITS_NEW ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiTraitsOptionToggles[ GIO_TRAITS_OLD ],0, 0 );
+ MSYS_SetBtnUserData(guiTraitsOptionToggles[ GIO_TRAITS_NEW ],0, 1 );
+
+ if( gGameOptions.fNewTraitSystem )
+ ButtonList[ guiTraitsOptionToggles[ GIO_TRAITS_NEW ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiTraitsOptionToggles[ GIO_TRAITS_OLD ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // GAME SETTING ( realistic, sci fi )
+
+
+ guiGameTextTogglesImage[ GIO_TEXT_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiGameTextToggles[ GIO_TEXT_OFF ] = CreateIconAndTextButton( guiGameTextTogglesImage[ GIO_TEXT_OFF ], gzGIOScreenText[ GIO_REALISTIC_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_GAME_SETTING_X + 74), (GIO_GAME_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOOffStyleCallback);
+
+ guiGameTextTogglesImage[ GIO_TEXT_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiGameTextToggles[ GIO_TEXT_ON ] = CreateIconAndTextButton( guiGameTextTogglesImage[ GIO_TEXT_ON ], gzGIOScreenText[ GIO_SCI_FI_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_GAME_SETTING_X), (GIO_GAME_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOOnStyleCallback );
+
+ SpecifyButtonSoundScheme( guiGameTextToggles[ GIO_TEXT_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiGameTextToggles[ GIO_TEXT_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiGameTextToggles[ GIO_TEXT_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiGameTextToggles[ GIO_TEXT_ON ],0, 1 );
+
+ if( gGameUBOptions.fRandomManuelText )
+ ButtonList[ guiGameTextToggles[ GIO_TEXT_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiGameTextToggles[ GIO_TEXT_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // IRON MAN SETTING
+
+ guiGameSaveTogglesImage[ GIO_CAN_SAVE ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiGameSaveToggles[ GIO_CAN_SAVE ] = CreateIconAndTextButton( guiGameSaveTogglesImage[ GIO_CAN_SAVE ], gzGIOScreenText[ GIO_SAVE_ANYWHERE_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_IRON_MAN_SETTING_X), (GIO_IRON_MAN_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOIronManOffCallback);
+
+ guiGameSaveTogglesImage[ GIO_IRON_MAN ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiGameSaveToggles[ GIO_IRON_MAN ] = CreateIconAndTextButton( guiGameSaveTogglesImage[ GIO_IRON_MAN ], gzGIOScreenText[ GIO_IRON_MAN_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_IRON_MAN_SETTING_X + 74), (GIO_IRON_MAN_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOIronManOnCallback );
+
+ SpecifyButtonSoundScheme( guiGameSaveToggles[ GIO_CAN_SAVE ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiGameSaveToggles[ GIO_IRON_MAN ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiGameSaveToggles[ GIO_CAN_SAVE ],0, 0 );
+ MSYS_SetBtnUserData(guiGameSaveToggles[ GIO_IRON_MAN ],0, 1 );
+
+ if( gGameOptions.fIronManMode )
+ ButtonList[ guiGameSaveToggles[ GIO_IRON_MAN ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiGameSaveToggles[ GIO_CAN_SAVE ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // NUMBER OF TERRORISTS SETTING
+
+ guiRpcOptionTogglesImage[ GIO_TEX_JOHN_RANDOM ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ] = CreateIconAndTextButton( guiRpcOptionTogglesImage[ GIO_TEX_JOHN_RANDOM ], gzGIOScreenText[ GIO_TERRORISTS_RANDOM_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_TERRORISTS_SETTING_X), (GIO_TERRORISTS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIORpcRandomCallback);
+
+ guiRpcOptionTogglesImage[ GIO_TEX_AND_JOHN ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiRpcOptionToggles[ GIO_TEX_AND_JOHN ] = CreateIconAndTextButton( guiRpcOptionTogglesImage[ GIO_TEX_AND_JOHN ], gzGIOScreenText[ GIO_TERRORISTS_ALL_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_TERRORISTS_SETTING_X + 74), (GIO_TERRORISTS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIORpcAllCallback );
+
+ SpecifyButtonSoundScheme( guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiRpcOptionToggles[ GIO_TEX_AND_JOHN ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ],0, 0 );
+ MSYS_SetBtnUserData(guiRpcOptionToggles[ GIO_TEX_AND_JOHN ],0, 1 );
+
+ if( gGameUBOptions.fTexAndJohn )
+ ButtonList[ guiRpcOptionToggles[ GIO_TEX_AND_JOHN ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // BOBBY RAY SETTING
+
+ giGIOBRSettingButtonImage[ 0 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 0 ], -1,0,-1,1,-1 );
+ giGIOBRSettingButtonImage[ 1 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 1 ], -1,2,-1,3,-1 );
+
+ // left button - decrement BR level
+ giGIOBRSettingButton[ 0 ] = QuickCreateButton( giGIOBRSettingButtonImage[ 0 ], GIO_BR_SETTING_X + 39, GIO_BR_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOBRSettingLeftCallback );
+
+ // right button - increment BR level
+ giGIOBRSettingButton[ 1 ] = QuickCreateButton( giGIOBRSettingButtonImage[ 1 ], GIO_BR_SETTING_X + 158, GIO_BR_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOBRSettingRightCallback );
+
+ // set user data
+ MSYS_SetBtnUserData(giGIOBRSettingButton[0],0, 0 );
+ MSYS_SetBtnUserData(giGIOBRSettingButton[1],0, 1 );
+
+ // set initial value
+ switch ( gGameOptions.ubBobbyRay )
+ {
+ case BR_GOOD:
+ iCurrentBRSetting = GIO_BR_GOOD;
+ break;
+ case BR_GREAT:
+ iCurrentBRSetting = GIO_BR_GREAT;
+ break;
+ case BR_EXCELLENT:
+ iCurrentBRSetting = GIO_BR_EXCELLENT;
+ break;
+ case BR_AWESOME:
+ iCurrentBRSetting = GIO_BR_AWESOME;
+ break;
+ default:
+ iCurrentBRSetting = GIO_BR_GOOD; // optimistically assume, we have selected the normal one
+ break;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // ITEM PROGRESS SETTING
+
+ giGIOProgressSettingButtonImage[ 0 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 0 ], -1,0,-1,1,-1 );
+ giGIOProgressSettingButtonImage[ 1 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 1 ], -1,2,-1,3,-1 );
+
+ // left button - decrement BR level
+ giGIOProgressSettingButton[ 0 ] = QuickCreateButton( giGIOProgressSettingButtonImage[ 0 ], GIO_PROGRESS_SETTING_X + 39, GIO_PROGRESS_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOProgressSettingLeftCallback );
+
+ // right button - increment BR level
+ giGIOProgressSettingButton[ 1 ] = QuickCreateButton( giGIOProgressSettingButtonImage[ 1 ], GIO_PROGRESS_SETTING_X + 158, GIO_PROGRESS_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOProgressSettingRightCallback );
+
+ // set user data
+ MSYS_SetBtnUserData(giGIOProgressSettingButton[0],0, 0 );
+ MSYS_SetBtnUserData(giGIOProgressSettingButton[1],0, 1 );
+
+ // set initial value
+ iCurrentProgressSetting = gGameOptions.ubProgressSpeedOfItemsChoices;
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // OLD/NEW INVENTORY SETTING
+
+ if (IsNIVModeValid(true) == TRUE )
+ {
+ giGIOInventorySettingButtonImage[ 0 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 0 ],-1,0,-1,1,-1 );
+ giGIOInventorySettingButtonImage[ 1 ]= UseLoadedButtonImage( giGIODifficultyButtonImage[ 1 ],-1,2,-1,3,-1 );
+
+ // left button - decrement difficulty level
+ giGIOInventorySettingButton[ 0 ] = QuickCreateButton( giGIOInventorySettingButtonImage[ 0 ], GIO_INV_SETTING_X + 39, GIO_INV_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOInventorySettingLeftCallback );
+
+ // right button - increment difficulty level
+ giGIOInventorySettingButton[ 1 ] = QuickCreateButton( giGIOInventorySettingButtonImage[ 1 ], GIO_INV_SETTING_X + 158, GIO_INV_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOInventorySettingRightCallback );
+
+
+ // set user data
+ MSYS_SetBtnUserData(giGIOInventorySettingButton[0],0, 0 );
+ MSYS_SetBtnUserData(giGIOInventorySettingButton[1],0, 1 );
+
+ if (UsingNewInventorySystem()==true &&
+ UsingNewAttachmentSystem()==true)
+ {
+ iCurrentInventorySetting = GIO_INV_NEW_NAS;
+ }
+ else
+ {
+ // set initial value
+ switch ( gGameOptions.ubInventorySystem )
+ {
+ case INVENTORY_OLD:
+ iCurrentInventorySetting = GIO_INV_OLD;
+ break;
+ case INVENTORY_NEW:
+ iCurrentInventorySetting = GIO_INV_NEW;
+ break;
+ }
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // DROP ALL ON/OFF SETTING
+
+ guiDropAllOptionTogglesImage[ GIO_DROPALL_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiDropAllOptionToggles[ GIO_DROPALL_OFF ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_DROPALL_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_DROPALL_SETTING_X), (GIO_DROPALL_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIODropAllOffCallback);
+
+ guiDropAllOptionTogglesImage[ GIO_DROPALL_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiDropAllOptionToggles[ GIO_DROPALL_ON ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_DROPALL_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_DROPALL_SETTING_X + 74), (GIO_DROPALL_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIODropAllOnCallback );
+
+ SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_DROPALL_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_DROPALL_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_DROPALL_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_DROPALL_ON ],0, 1 );
+
+ if( gGameOptions.fEnemiesDropAllItems )
+ ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // GUN SETTING
+
+ guiGunOptionTogglesImage[ GIO_REDUCED_GUNS ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiGunOptionToggles[ GIO_REDUCED_GUNS ] = CreateIconAndTextButton( guiGunOptionTogglesImage[ GIO_REDUCED_GUNS ], gzGIOScreenText[ GIO_REDUCED_GUNS_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_GUN_SETTING_X + 74), (GIO_GUN_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOGunSettingReducedCallback);
+
+ guiGunOptionTogglesImage[ GIO_GUN_NUT ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiGunOptionToggles[ GIO_GUN_NUT ] = CreateIconAndTextButton( guiGunOptionTogglesImage[ GIO_GUN_NUT ], gzGIOScreenText[ GIO_GUN_NUT_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_GUN_SETTING_X), (GIO_GUN_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOGunSettingToGCallback );
+
+ SpecifyButtonSoundScheme( guiGunOptionToggles[ GIO_REDUCED_GUNS ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiGunOptionToggles[ GIO_GUN_NUT ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiGunOptionToggles[ GIO_REDUCED_GUNS ],0, 0 );
+ MSYS_SetBtnUserData(guiGunOptionToggles[ GIO_GUN_NUT ],0, 1 );
+
+ if( gGameOptions.fGunNut )
+ ButtonList[ guiGunOptionToggles[ GIO_GUN_NUT ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiGunOptionToggles[ GIO_REDUCED_GUNS ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // SQUAD SIZE
+ if (iResolution > 0)
+ {
+ giGIOSquadSizeButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,0,-1,1,-1 );
+ giGIOSquadSizeButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,2,-1,3,-1 );
+
+ // left button - decrement difficulty level
+ giGIOSquadSizeButton[ 0 ] = QuickCreateButton( giGIOSquadSizeButtonImage[ 0 ], GIO_SQUAD_SIZE_SETTING_X + 39, GIO_SQUAD_SIZE_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOSquadSizeSelectionLeftCallback );
+
+ // right button - increment difficulty level
+ giGIOSquadSizeButton[ 1 ] = QuickCreateButton( giGIOSquadSizeButtonImage[ 1 ], GIO_SQUAD_SIZE_SETTING_X + 158, GIO_SQUAD_SIZE_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOSquadSizeSelectionRightCallback );
+
+ // set user data
+ MSYS_SetBtnUserData(giGIOSquadSizeButton[0],0, 0 );
+ MSYS_SetBtnUserData(giGIOSquadSizeButton[1],0, 1 );
+
+ switch (gGameOptions.ubSquadSize)
+ {
+ case 6:
+ iCurrentSquadSize = GIO_SQUAD_SIZE_6;
+ break;
+ case 8:
+ iCurrentSquadSize = GIO_SQUAD_SIZE_8;
+ break;
+ case 10:
+ iCurrentSquadSize = GIO_SQUAD_SIZE_10;
+ break;
+ }
+ }
+
+
+ //Reset the exit screen
+ gubGIOExitScreen = GAME_INIT_OPTIONS_SCREEN;
+
+ //REnder the screen once so we can blt ot to ths save buffer
+ RenderGIOScreen();
+
+ BlitBufferToBuffer(guiRENDERBUFFER, guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
+
+ gfGIOButtonsAllocated = TRUE;
+
+ return( TRUE );
+}
+
+void BtnGIODifficultySelectionLeftCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentDifficulty > 0 )
+ {
+ PlayButtonSound( giGIODifficultyButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentDifficulty--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIODifficultyButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentDifficulty > 0 )
+ {
+ PlayButtonSound( giGIODifficultyButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentDifficulty--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIODifficultyButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIODifficultySelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentDifficulty < 2 )
+ {
+ PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentDifficulty++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentDifficulty < 2 )
+ {
+ PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentDifficulty++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIODifficultyButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOBRSettingLeftCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentBRSetting > 0 )
+ {
+ PlayButtonSound( giGIOBRSettingButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentBRSetting--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOBRSettingButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentBRSetting > 0 )
+ {
+ PlayButtonSound( giGIOBRSettingButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentBRSetting--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOBRSettingButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOBRSettingRightCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentBRSetting < 3 )
+ {
+ PlayButtonSound( giGIOBRSettingButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentBRSetting++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOBRSettingButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentBRSetting < 3 )
+ {
+ PlayButtonSound( giGIOBRSettingButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentBRSetting++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOBRSettingButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOIMPNumberSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentIMPNumberSetting > 1 )
+ {
+ PlayButtonSound( giGIOBRSettingButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentIMPNumberSetting--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOBRSettingButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentIMPNumberSetting > 1 )
+ {
+ PlayButtonSound( giGIOBRSettingButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentIMPNumberSetting--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOBRSettingButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOIMPNumberSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentIMPNumberSetting < (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount) )
+ {
+ PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentIMPNumberSetting++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentIMPNumberSetting < (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount) )
+ {
+ PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentIMPNumberSetting++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOInventorySettingLeftCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentInventorySetting > GIO_INV_OLD )
+ {
+ PlayButtonSound( giGIOInventorySettingButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentInventorySetting--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOInventorySettingButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentInventorySetting > GIO_INV_OLD )
+ {
+ PlayButtonSound( giGIOInventorySettingButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentInventorySetting--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOInventorySettingButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOInventorySettingRightCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentInventorySetting < GIO_INV_NEW_NAS )
+ {
+ PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentInventorySetting++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOInventorySettingButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentInventorySetting < GIO_INV_NEW_NAS )
+ {
+ PlayButtonSound( giGIOInventorySettingButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentInventorySetting++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOInventorySettingButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOProgressSettingLeftCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentProgressSetting > 0 )
+ {
+ PlayButtonSound( giGIOProgressSettingButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentProgressSetting--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOProgressSettingButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentProgressSetting > 0 )
+ {
+ PlayButtonSound( giGIOProgressSettingButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentProgressSetting--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOProgressSettingButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOProgressSettingRightCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentProgressSetting < GIO_PROGRESS_VERY_FAST )
+ {
+ PlayButtonSound( giGIOProgressSettingButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentProgressSetting++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOProgressSettingButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentProgressSetting < GIO_PROGRESS_VERY_FAST )
+ {
+ PlayButtonSound( giGIOProgressSettingButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentProgressSetting++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOProgressSettingButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOOldTraitsCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_TRAITS_SETTING_X), (GIO_TRAITS_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiTraitsOptionToggles[ GIO_TRAITS_NEW ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiTraitsOptionToggles[ GIO_TRAITS_OLD ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIONewTraitsCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ if (!gGameExternalOptions.fReadProfileDataFromXML)
+ {
+ PlayButtonSound( guiTraitsOptionToggles[ GIO_TRAITS_NEW ], BUTTON_SOUND_DISABLED_CLICK );
+
+ DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioNewTraitsImpossibleText[0], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_OK, NewTraitsNotPossibleMessageBoxCallBack );
+ }
+ else
+ {
+ RestoreExternBackgroundRect( (GIO_TRAITS_SETTING_X), (GIO_TRAITS_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiTraitsOptionToggles[ GIO_TRAITS_OLD ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiTraitsOptionToggles[ GIO_TRAITS_NEW ], BUTTON_SOUND_CLICKED_ON );
+ }
+ }
+}
+
+void NewTraitsNotPossibleMessageBoxCallBack( UINT8 bExitValue )
+{
+ /*if( bExitValue == MSG_BOX_RETURN_YES )
+ {
+ gubGameOptionScreenHandler = GIO_NOTHING;
+ }*/
+}
+
+void BtnGIOOffStyleCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_GAME_SETTING_X), (GIO_GAME_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiGameTextToggles[ GIO_TEXT_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiGameTextToggles[ GIO_TEXT_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIOOnStyleCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_GAME_SETTING_X), (GIO_GAME_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiGameTextToggles[ GIO_TEXT_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiGameTextToggles[ GIO_TEXT_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIOIronManOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_IRON_MAN_SETTING_X), (GIO_IRON_MAN_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiGameSaveToggles[ GIO_IRON_MAN ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiGameStyleToggles[ GIO_CAN_SAVE ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIOIronManOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_IRON_MAN_SETTING_X), (GIO_IRON_MAN_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiGameSaveToggles[ GIO_CAN_SAVE ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiGameStyleToggles[ GIO_IRON_MAN ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIORpcRandomCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_TERRORISTS_SETTING_X), (GIO_TERRORISTS_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiRpcOptionToggles[ GIO_TEX_AND_JOHN ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIORpcAllCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_TERRORISTS_SETTING_X), (GIO_TERRORISTS_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiRpcOptionToggles[ GIO_TEX_JOHN_RANDOM ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiRpcOptionToggles[ GIO_TEX_AND_JOHN ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIODropAllOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_DROPALL_SETTING_X), (GIO_DROPALL_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiDropAllOptionToggles[ GIO_DROPALL_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIODropAllOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_DROPALL_SETTING_X), (GIO_DROPALL_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiDropAllOptionToggles[ GIO_DROPALL_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIOGunSettingReducedCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_GUN_SETTING_X), (GIO_GUN_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiGunOptionToggles[ GIO_GUN_NUT ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiGunOptionToggles[ GIO_REDUCED_GUNS ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIOGunSettingToGCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_GUN_SETTING_X), (GIO_GUN_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiGunOptionToggles[ GIO_REDUCED_GUNS ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiGunOptionToggles[ GIO_GUN_NUT ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIOSquadSizeSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentSquadSize > GIO_SQUAD_SIZE_6 )
+ {
+ PlayButtonSound( giGIOSquadSizeButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentSquadSize--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOSquadSizeButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentSquadSize > GIO_SQUAD_SIZE_6 )
+ {
+ PlayButtonSound( giGIOSquadSizeButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentSquadSize--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOSquadSizeButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
+ if (iResolution == 1)
+ maxSquadSize = GIO_SQUAD_SIZE_8;
+
+ if ( iCurrentSquadSize < maxSquadSize )
+ {
+ PlayButtonSound( giGIOSquadSizeButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentSquadSize++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOSquadSizeButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
+ if (iResolution == 1)
+ maxSquadSize = GIO_SQUAD_SIZE_8;
+
+ if ( iCurrentSquadSize < maxSquadSize )
+ {
+ PlayButtonSound( giGIOSquadSizeButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentSquadSize++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOSquadSizeButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+BOOLEAN ExitGIOScreen()
+{
+ UINT16 cnt;
+
+ if( !gfGIOButtonsAllocated )
+ return( TRUE );
+
+ //Delete the main options screen background
+ DeleteVideoObjectFromIndex( guiGIOMainBackGroundImage );
+
+ DeleteVideoObjectFromIndex( guiGIOSMALLFRAME );
+
+ // Destroy Basic buttons
+ RemoveButton( guiGIOCancelButton );
+ RemoveButton( guiGIODoneButton );
+ UnloadButtonImage( giGIOCancelBtnImage );
+ UnloadButtonImage( giGIODoneBtnImage );
+
+ // Destroy Difficulty setting buttons
+ RemoveButton( giGIODifficultyButton[0] );
+ RemoveButton( giGIODifficultyButton[1] );
+ UnloadButtonImage( giGIODifficultyButtonImage[0] );
+ UnloadButtonImage( giGIODifficultyButtonImage[1] );
+
+ // Destroy IMP Number setting buttons
+ RemoveButton( giGIOIMPNumberButton[0] );
+ RemoveButton( giGIOIMPNumberButton[1] );
+ UnloadButtonImage( giGIOIMPNumberButtonImage[0] );
+ UnloadButtonImage( giGIOIMPNumberButtonImage[1] );
+
+ // Destroy BR setting buttons
+ RemoveButton( giGIOBRSettingButton[0] );
+ RemoveButton( giGIOBRSettingButton[1] );
+ UnloadButtonImage( giGIOBRSettingButtonImage[0] );
+ UnloadButtonImage( giGIOBRSettingButtonImage[1] );
+
+ // Destroy Progress setting buttons
+ RemoveButton( giGIOProgressSettingButton[0] );
+ RemoveButton( giGIOProgressSettingButton[1] );
+ UnloadButtonImage( giGIOProgressSettingButtonImage[0] );
+ UnloadButtonImage( giGIOProgressSettingButtonImage[1] );
+
+ // Destroy Traits setting buttons
+ for( cnt=0; cnt 0)
+ {
+ RemoveButton( giGIOSquadSizeButton[0] );
+ RemoveButton( giGIOSquadSizeButton[1] );
+ UnloadButtonImage( giGIOSquadSizeButtonImage[0] );
+ UnloadButtonImage( giGIOSquadSizeButtonImage[1] );
+ }
+
+ gfGIOButtonsAllocated = FALSE;
+
+ //If we are starting the game stop playing the music
+ if( gubGameOptionScreenHandler == GIO_EXIT )
+ SetMusicMode( MUSIC_NONE );
+
+ gfGIOScreenExit = FALSE;
+ gfGIOScreenEntry = TRUE;
+
+ return( TRUE );
+}
+
+
+void HandleGIOScreen()
+{
+ if( gubGameOptionScreenHandler != GIO_NOTHING )
+ {
+ switch( gubGameOptionScreenHandler )
+ {
+ case GIO_CANCEL:
+ gubGIOExitScreen = MAINMENU_SCREEN;
+ gfGIOScreenExit = TRUE;
+ break;
+
+ case MP_LOAD:
+ gubGIOExitScreen = SAVE_LOAD_SCREEN;
+ gfSaveGame = FALSE;
+ gfGIOScreenExit = TRUE;
+ guiPreviousOptionScreen = GAME_INIT_OPTIONS_SCREEN;
+ break;
+
+ case GIO_EXIT:
+ {
+ //if we are already fading out, get out of here
+ if( gFadeOutDoneCallback != DoneFadeOutForExitGameInitOptionScreen )
+ {
+ //Disable the ok button
+ DisableButton( guiGIODoneButton );
+
+ gFadeOutDoneCallback = DoneFadeOutForExitGameInitOptionScreen;
+
+ FadeOutNextFrame( );
+ }
+ break;
+ }
+
+ case GIO_IRON_MAN_MODE:
+ DisplayMessageToUserAboutGameDifficulty();
+ break;
+ }
+
+ gubGameOptionScreenHandler = GIO_NOTHING;
+ }
+
+
+ if( gfReRenderGIOScreen )
+ {
+ RenderGIOScreen();
+ gfReRenderGIOScreen = FALSE;
+ }
+}
+
+
+BOOLEAN RenderGIOScreen()
+{
+ HVOBJECT hPixHandle;
+
+ RestoreExternBackgroundRect( GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_DIF_SETTING_Y-3, 120, 20 );
+ RestoreExternBackgroundRect( GIO_IMP_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_IMP_SETTING_Y-3, 120, 20 );
+ RestoreExternBackgroundRect( GIO_BR_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_BR_SETTING_Y-3, 120, 20 );
+ RestoreExternBackgroundRect( GIO_PROGRESS_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_PROGRESS_SETTING_Y-3, 120, 20 );
+ RestoreExternBackgroundRect( GIO_INV_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_INV_SETTING_Y-3, 120, 20 );
+ RestoreExternBackgroundRect( GIO_SQUAD_SIZE_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_SQUAD_SIZE_SETTING_Y-3, 120, 20 );
+
+ //Get the main background screen graphic and blt it
+ GetVideoObject(&hPixHandle, guiGIOMainBackGroundImage );
+ BltVideoObject(FRAME_BUFFER, hPixHandle, 0,0,0, VO_BLT_SRCTRANSPARENCY,NULL);
+
+ //Shade the background
+ ShadowVideoSurfaceRect( FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, iScreenWidthOffset + 640, iScreenHeightOffset + 480 );
+
+ //Display the title
+ DrawTextToScreen( gzGIOScreenText[ GIO_INITIAL_GAME_SETTINGS ], GIO_MAIN_TITLE_X, GIO_MAIN_TITLE_Y, GIO_MAIN_TITLE_WIDTH, GIO_TITLE_FONT, GIO_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ //Display the Dif Settings Title Text
+ RenderGIOSmallSelectionFrame( (GIO_DIF_SETTING_X + 36), (GIO_DIF_SETTING_Y - 3) );
+ DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_DIF_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_DIF_LEVEL_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ DisplayWrappedString( (UINT16)(GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_DIF_SETTING_Y+6), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentDifficulty + 9 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ //Display the IMP number Title Text
+ RenderGIOSmallSelectionFrame( (GIO_IMP_SETTING_X + 36), (GIO_IMP_SETTING_Y - 3) );
+ DisplayWrappedString( (UINT16)(GIO_IMP_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_IMP_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_DIF_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_IMP_NUMBER_TITLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ if ( iCurrentIMPNumberSetting <= 6 )
+ {
+ DisplayWrappedString( (UINT16)(GIO_IMP_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_IMP_SETTING_Y+6), GIO_IMP_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentIMPNumberSetting + 32 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ }
+ else
+ {
+ CHAR16 sStartLevelString[16];
+ swprintf(sStartLevelString, L"%i", iCurrentIMPNumberSetting );
+ DisplayWrappedString( (UINT16)(GIO_IMP_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_IMP_SETTING_Y+6), GIO_IMP_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, sStartLevelString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ }
+ // Display BR Setting texts
+ RenderGIOSmallSelectionFrame( (GIO_BR_SETTING_X + 36), (GIO_BR_SETTING_Y - 3) );
+ DisplayWrappedString( (UINT16)(GIO_BR_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_BR_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_BR_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_BR_QUALITY_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ DisplayWrappedString( (UINT16)(GIO_BR_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_BR_SETTING_Y+6), GIO_BR_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentBRSetting + 20 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ // Display Progress Setting texts
+ RenderGIOSmallSelectionFrame( (GIO_PROGRESS_SETTING_X + 36), (GIO_PROGRESS_SETTING_Y - 3) );
+ DisplayWrappedString( (UINT16)(GIO_PROGRESS_SETTING_X+GIO_OFFSET_TO_TEXT - 6), (UINT16)(GIO_PROGRESS_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_PROGRESS_SETTING_WIDTH + 14, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_PROGRESS_TITLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ DisplayWrappedString( (UINT16)(GIO_PROGRESS_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_PROGRESS_SETTING_Y+6), GIO_PROGRESS_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentProgressSetting + 49 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ // Old/new traits system
+ DisplayWrappedString( (GIO_TRAITS_SETTING_X - 6), (UINT16)(GIO_TRAITS_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE), GIO_TRAITS_SETTING_WIDTH + 14, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_TRAITS_TEXT], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ //Display the Game Settings Title Text
+ DisplayWrappedString( (GIO_GAME_SETTING_X - 6), (UINT16)(GIO_GAME_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE), GIO_GAME_SETTING_WIDTH + 14, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_GAME_STYLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ // JA2Gold: Display the iron man Settings Title Text
+ DisplayWrappedString( (GIO_IRON_MAN_SETTING_X - 6), (UINT16)(GIO_IRON_MAN_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE), GIO_IRON_MAN_SETTING_WIDTH + 14, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_GAME_SAVE_STYLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ //Display the Terrorists Settings Title Text
+ DisplayWrappedString( (GIO_TERRORISTS_SETTING_X - 6), (UINT16)(GIO_TERRORISTS_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE), GIO_TERRORISTS_SETTING_WIDTH + 14, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_TERRORISTS_TITLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ // Display Inventory Settings text
+ RenderGIOSmallSelectionFrame( (GIO_INV_SETTING_X + 36), (GIO_INV_SETTING_Y - 3) );
+ DisplayWrappedString( (UINT16)(GIO_INV_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_INV_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_INV_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_INV_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ DisplayWrappedString( (UINT16)(GIO_INV_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_INV_SETTING_Y+5), GIO_INV_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentInventorySetting + 54 ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ //Display the Drop All Settings Title Text
+ DisplayWrappedString( (GIO_DROPALL_SETTING_X - 6), (UINT16)(GIO_DROPALL_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE), GIO_DROPALL_SETTING_WIDTH + 14, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_DROPALL_TITLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ //Display the Gun Settings Title Text
+ DisplayWrappedString( (GIO_GUN_SETTING_X - 6), (UINT16)(GIO_GUN_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE), GIO_GUN_SETTING_WIDTH + 14, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_GUN_OPTIONS_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ //Display the Squad size Title Text
+ RenderGIOSmallSelectionFrame( (GIO_SQUAD_SIZE_SETTING_X + 36), (GIO_SQUAD_SIZE_SETTING_Y - 3) );
+ DisplayWrappedString( (UINT16)(GIO_SQUAD_SIZE_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_SQUAD_SIZE_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_SQUAD_SIZE_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_SQUAD_SIZE_TITLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ DisplayWrappedString( (UINT16)(GIO_SQUAD_SIZE_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_SQUAD_SIZE_SETTING_Y+6), GIO_SQUAD_SIZE_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentSquadSize + (GIO_SQUAD_SIZE_TITLE_TEXT + 1) ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
+ return( TRUE );
+}
+
+
+void GetGIOScreenUserInput()
+{
+ InputAtom Event;
+
+ while( DequeueEvent( &Event ) )
+ {
+ if( Event.usEvent == KEY_DOWN )
+ {
+ switch( Event.usParam )
+ {
+
+ case ESC:
+ //Exit out of the screen
+ gubGameOptionScreenHandler = GIO_CANCEL;
+ break;
+
+#ifdef JA2TESTVERSION
+ case 'r':
+ gfReRenderGIOScreen=TRUE;
+ break;
+
+ case 'i':
+ InvalidateRegion( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
+ break;
+#endif
+
+ case ENTER:
+ gubGameOptionScreenHandler = GIO_EXIT;
+ break;
+ }
+ }
+ }
+}
+
+
+void BtnGIODoneCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags |= BUTTON_CLICKED_ON;
+ InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
+ }
+ if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ btn->uiFlags &= (~BUTTON_CLICKED_ON );
+
+ //if the user doesnt have IRON MAN mode selected
+ if( !DisplayMessageToUserAboutIronManMode() )
+ {
+ //Confirm the difficulty setting
+ DisplayMessageToUserAboutGameDifficulty();
+ }
+
+ InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
+ }
+}
+
+void BtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags |= BUTTON_CLICKED_ON;
+ InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
+ }
+ if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ btn->uiFlags &= (~BUTTON_CLICKED_ON );
+
+ gubGameOptionScreenHandler = GIO_CANCEL;
+
+ InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
+ }
+}
+
+void MPBtnGIOCancelCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags |= BUTTON_CLICKED_ON;
+ InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
+ }
+ if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ btn->uiFlags &= (~BUTTON_CLICKED_ON );
+
+ gubGameOptionScreenHandler = MP_LOAD;
+
+ InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
+ }
+}
+
+UINT8 GetCurrentTraitsOptionButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentTextStyleButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentGameSaveButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentTexAndJohnButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentDropAllButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentGunButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentTimedTurnsButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+void DoneFadeOutForExitGameInitOptionScreen( void )
+{
+ // loop through and get the status of all the buttons
+ gGameOptions.fGunNut = GetCurrentGunButtonSetting();
+
+ gGameOptions.ubGameStyle = FALSE;
+ gGameUBOptions.fRandomManuelText = GetCurrentTextStyleButtonSetting();
+
+ gGameOptions.ubDifficultyLevel = min( NUM_DIFF_SETTINGS-1, ( max( 1, (iCurrentDifficulty + 1)) ));
+
+ gGameOptions.fTurnTimeLimit = FALSE;
+
+ // iron man
+ gGameOptions.fIronManMode = GetCurrentGameSaveButtonSetting();
+
+ switch ( iCurrentBRSetting )
+ {
+ case GIO_BR_GOOD:
+ gGameOptions.ubBobbyRay = BR_GOOD;
+ break;
+ case GIO_BR_GREAT:
+ gGameOptions.ubBobbyRay = BR_GREAT;
+ break;
+ case GIO_BR_EXCELLENT:
+ gGameOptions.ubBobbyRay = BR_EXCELLENT;
+ break;
+ case GIO_BR_AWESOME:
+ gGameOptions.ubBobbyRay = BR_AWESOME;
+ break;
+ }
+
+ // CHRISL:
+ if(IsNIVModeValid(true) == TRUE)
+ {
+ switch ( iCurrentInventorySetting)
+ {
+ case GIO_INV_OLD:
+ gGameOptions.ubInventorySystem = INVENTORY_OLD;
+ gGameOptions.ubAttachmentSystem = ATTACHMENT_OLD;
+ break;
+ case GIO_INV_NEW:
+ gGameOptions.ubInventorySystem = INVENTORY_NEW;
+ gGameOptions.ubAttachmentSystem = ATTACHMENT_OLD;
+ break;
+ case GIO_INV_NEW_NAS:
+ gGameOptions.ubInventorySystem = INVENTORY_NEW;
+ gGameOptions.ubAttachmentSystem = ATTACHMENT_NEW;
+ }
+ }
+
+ // Squad size
+ switch (iCurrentSquadSize)
+ {
+ case GIO_SQUAD_SIZE_6:
+ gGameOptions.ubSquadSize = 6;
+ break;
+ case GIO_SQUAD_SIZE_8:
+ gGameOptions.ubSquadSize = 8;
+ break;
+ case GIO_SQUAD_SIZE_10:
+ gGameOptions.ubSquadSize = 10;
+ break;
+ }
+
+
+ // WANNE: Not needed
+ /*if (gGameOptions.ubSquadSize > 6)
+ gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs = gGameOptions.ubSquadSize;*/
+
+ // SANDRO - added following:
+ gGameOptions.ubMaxIMPCharacters = min( (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount), ( max( 1, iCurrentIMPNumberSetting) ));
+ gGameOptions.fNewTraitSystem = GetCurrentTraitsOptionButtonSetting();
+
+ gGameUBOptions.fTexAndJohn = GetCurrentTexAndJohnButtonSetting();
+
+ gGameOptions.fEnemiesDropAllItems = GetCurrentDropAllButtonSetting();
+ gGameOptions.fEnableAllWeaponCaches = FALSE;
+ gGameOptions.ubProgressSpeedOfItemsChoices = min( GIO_PROGRESS_VERY_FAST, iCurrentProgressSetting );
+
+ gubGIOExitScreen = INIT_SCREEN;
+
+ //set the fact that we should do the intro videos
+// gbIntroScreenMode = INTRO_BEGINNING;
+#ifdef JA2TESTVERSION
+ if( gfKeyState[ ALT ] )
+ {
+ if( gfKeyState[ CTRL ] )
+ {
+ gMercProfiles[ MIGUEL ].bMercStatus = MERC_IS_DEAD;
+ gMercProfiles[ SKYRIDER ].bMercStatus = MERC_IS_DEAD;
+ }
+
+ SetIntroType( INTRO_ENDING );
+ }
+ else
+#endif
+
+ ExitGIOScreen();
+
+ gFadeInDoneCallback = DoneFadeInForExitGameInitOptionScreen;
+ FadeInNextFrame( );
+
+ SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
+}
+
+void DoneFadeInForExitGameInitOptionScreen( void )
+{
+ SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
+}
+
+BOOLEAN DoGioMessageBox( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback )
+{
+ SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 };
+
+ // do message box and return
+ giGioMessageBox = DoMessageBox( ubStyle, zString, uiExitScreen, ( UINT16 ) ( usFlags| MSG_BOX_FLAG_USE_CENTERING_RECT ), ReturnCallback, &CenteringRect );
+
+ // send back return state
+ return( ( giGioMessageBox != -1 ) );
+}
+
+void DisplayMessageToUserAboutGameDifficulty()
+{
+ UINT8 ubDiffLevel = iCurrentDifficulty;
+
+ switch( ubDiffLevel )
+ {
+ case 0:
+ DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_NOVICE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
+ break;
+ case 1:
+ DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_EXPERIENCED], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
+ break;
+ case 2:
+ DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_EXPERT], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
+ break;
+ case 3:
+ DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_INSANE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack );
+ break;
+ }
+}
+
+
+void ConfirmGioDifSettingMessageBoxCallBack( UINT8 bExitValue )
+{
+ if( bExitValue == MSG_BOX_RETURN_YES )
+ {
+ gubGameOptionScreenHandler = GIO_EXIT;
+ }
+}
+
+BOOLEAN DisplayMessageToUserAboutIronManMode()
+{
+ // Madd
+ UINT8 ubIronManMode = GetCurrentGameSaveButtonSetting(); //FALSE;
+
+ //if the user has selected IRON MAN mode
+ if( ubIronManMode )
+ {
+ DoGioMessageBox( MSG_BOX_BASIC_STYLE, gzIronManModeWarningText[ IMM__IRON_MAN_MODE_WARNING_TEXT ], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioIronManMessageBoxCallBack );
+
+ return( TRUE );
+ }
+
+ return( FALSE );
+}
+
+void ConfirmGioIronManMessageBoxCallBack( UINT8 bExitValue )
+{
+ if( bExitValue == MSG_BOX_RETURN_YES )
+ {
+ gubGameOptionScreenHandler = GIO_IRON_MAN_MODE;
+ }
+ else
+ {
+ ButtonList[ guiGameSaveToggles[ GIO_IRON_MAN ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ ButtonList[ guiGameSaveToggles[ GIO_CAN_SAVE ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ }
+}
+
+void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY)
+{
+
+ HVOBJECT hHandle;
+
+ // get the video object
+ GetVideoObject(&hHandle, guiGIOSMALLFRAME);
+
+ // blt to sX, sY relative to upper left corner
+ BltVideoObject(FRAME_BUFFER, hHandle, 0, sX, sY , VO_BLT_SRCTRANSPARENCY,NULL);
+
+ return;
+}
+
+#else
+
+// *********************************
+// JA2 - 1.13: Initial Game Screen
+// *********************************
+
+//////////////////////////////////////////////////////////////
+// SANDRO - the start-new-game screen has been changed a lot
+//////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////
+//
+// Global Defines
+//
+///////////////////////////////////////////
+
+#define GIO_TITLE_FONT FONT14ARIAL
+#define GIO_TITLE_COLOR FONT_MCOLOR_WHITE
+
+#define GIO_TOGGLE_TEXT_FONT FONT10ARIAL
+#define GIO_TOGGLE_TEXT_COLOR FONT_MCOLOR_WHITE
+
+//buttons
+#define GIO_CANCEL_X iScreenWidthOffset + ((320 - 115) / 2)
+
+#define GIO_BTN_START_X iScreenWidthOffset + 320 + 105
+#define GIO_BTN_START_Y iScreenHeightOffset + 435
+
+
+//main title
+#define GIO_MAIN_TITLE_X 0
+#define GIO_MAIN_TITLE_Y iScreenHeightOffset + 10
+#define GIO_MAIN_TITLE_WIDTH SCREEN_WIDTH
+
+//radio box locations
+#define GIO_GAP_BN_SETTINGS 35
+#define GIO_OFFSET_TO_TEXT 36
+#define GIO_OFFSET_TO_TOGGLE_BOX 180
+#define GIO_OFFSET_TO_TOGGLE_BOX_Y 9
+
+#define GIO_TITLE_DISTANCE 30 // higher means closer
+
+#define GIO_OFFSET_TO_TEXT 36
+#define GIO_OFFSET_TO_TOGGLE_BOX 180
+
+// ---------------------------------
+// Y-Offset for Combo-Controls
+#define COMBO_Y_OFFSET 63
+// Y-Offset for Check-Controls
+#define CHECK_Y_OFFSET 50
+
+#define CORRECTION_Y_OFFSET (COMBO_Y_OFFSET - CHECK_Y_OFFSET)
+
+// X-Offset for Checkbox-Controls
+#define CHECK_X_OFFSET 36
+#define COMBO_X_OFFSET 0
+
+#define CHECK_WIDTH (GIO_OFFSET_TO_TOGGLE_BOX - GIO_OFFSET_TO_TEXT)
+#define COMBO_WIDTH (GIO_OFFSET_TO_TOGGLE_BOX - GIO_OFFSET_TO_TEXT)
+
+
+/*********************************
+ FIRST COLUMN
+**********************************/
+
+#define FIRST_COLUMN_X iScreenWidthOffset + 10
+#define FIRST_COLUMN_Y iScreenHeightOffset + 75
+
+#define GIO_DIF_SETTING_X FIRST_COLUMN_X + COMBO_X_OFFSET
+#define GIO_DIF_SETTING_Y FIRST_COLUMN_Y
+#define GIO_DIF_SETTING_WIDTH COMBO_WIDTH
+
+#define GIO_IMP_SETTING_X FIRST_COLUMN_X + COMBO_X_OFFSET
+#define GIO_IMP_SETTING_Y GIO_DIF_SETTING_Y + COMBO_Y_OFFSET
+#define GIO_IMP_SETTING_WIDTH COMBO_WIDTH
+
+#define GIO_TRAITS_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
+#define GIO_TRAITS_SETTING_Y GIO_IMP_SETTING_Y + CHECK_Y_OFFSET
+#define GIO_TRAITS_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_GAME_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
+#define GIO_GAME_SETTING_Y GIO_TRAITS_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_GAME_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_IRON_MAN_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
+#define GIO_IRON_MAN_SETTING_Y GIO_GAME_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_IRON_MAN_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_TERRORISTS_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
+#define GIO_TERRORISTS_SETTING_Y GIO_IRON_MAN_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_TERRORISTS_SETTING_WIDTH CHECK_WIDTH
+
+
+/*********************************
+ SECOND COLUMN
+**********************************/
+
+#define SECOND_COLUMN_X iScreenWidthOffset + 210
+#define SECOND_COLUMN_Y FIRST_COLUMN_Y
+
+#define GIO_BR_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
+#define GIO_BR_SETTING_Y SECOND_COLUMN_Y
+#define GIO_BR_SETTING_WIDTH COMBO_WIDTH
+
+#define GIO_PROGRESS_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
+#define GIO_PROGRESS_SETTING_Y GIO_BR_SETTING_Y + COMBO_Y_OFFSET
+#define GIO_PROGRESS_SETTING_WIDTH COMBO_WIDTH
+
+#define GIO_INV_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
+#define GIO_INV_SETTING_Y GIO_PROGRESS_SETTING_Y + COMBO_Y_OFFSET
+#define GIO_INV_SETTING_WIDTH COMBO_WIDTH
+
+#define GIO_DROPALL_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
+#define GIO_DROPALL_SETTING_Y GIO_INV_SETTING_Y + CHECK_Y_OFFSET
+#define GIO_DROPALL_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_GUN_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
+#define GIO_GUN_SETTING_Y GIO_DROPALL_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_GUN_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_CACHES_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
+#define GIO_CACHES_SETTING_Y GIO_GUN_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_CACHES_SETTING_WIDTH CHECK_WIDTH
+
+/*********************************
+ THIRD COLUMN
+**********************************/
+
+#define THIRD_COLUMN_X iScreenWidthOffset + 413
+#define THIRD_COLUMN_Y FIRST_COLUMN_Y
+
+#define GIO_SQUAD_SIZE_SETTING_X THIRD_COLUMN_X + COMBO_X_OFFSET
+#define GIO_SQUAD_SIZE_SETTING_Y THIRD_COLUMN_Y
+#define GIO_SQUAD_SIZE_SETTING_WIDTH COMBO_WIDTH
+
+
+
+
+
+// INI File
+#define JA2SP_INI_FILENAME "ja2_sp.ini"
+
+// INI Section
+#define JA2SP_INI_INITIAL_SECTION "JA2 Singleplayer Initial Settings"
+
+// INI Properties
+#define JA2SP_DIFFICULTY_LEVEL "DIFFICULTY_LEVEL"
+#define JA2SP_BOBBY_RAY_SELECTION "BOBBY_RAY_SELECTION"
+#define JA2SP_MAX_IMP_CHARACTERS "MAX_IMP_CHARACTERS"
+#define JA2SP_PROGRESS_SPEED_OF_ITEM_CHOICES "PROGRESS_SPEED_OF_ITEM_CHOICES"
+#define JA2SP_SKILL_TRAITS "SKILL_TRAITS"
+#define JA2SP_INVENTORY_ATTACHMENTS "INVENTORY_ATTACHMENTS"
+#define JA2SP_GAME_STYLE "GAME_STYLE"
+#define JA2SP_ENEMIES_DROP_ALL_ITEMS "ENEMIES_DROP_ALL_ITEMS"
+#define JA2SP_EXTRA_DIFFICULTY "EXTRA_DIFFICULTY"
+#define JA2SP_AVAILABLE_ARSENAL "AVAILABLE_ARSENAL"
+#define JA2SP_NUMBER_OF_TERRORISTS "NUMBER_OF_TERRORISTS"
+#define JA2SP_SECRET_WEAPON_CACHES "SECRET_WEAPON_CACHES"
+#define JA2SP_SQUAD_SIZE "SQUAD_SIZE"
//Difficulty settings
@@ -222,6 +2677,15 @@ enum
NUM_INV_OPTIONS,
};
+enum
+{
+ GIO_SQUAD_SIZE_6,
+ GIO_SQUAD_SIZE_8,
+ GIO_SQUAD_SIZE_10,
+
+ NUM_SQUAD_SIZE_OPTIONS,
+};
+
enum
{
GIO_DROPALL_OFF,
@@ -292,6 +2756,7 @@ INT8 iCurrentBRSetting;
INT8 iCurrentIMPNumberSetting;
INT8 iCurrentProgressSetting;
INT8 iCurrentInventorySetting;
+INT8 iCurrentSquadSize;
UINT32 guiGIOSMALLFRAME;
@@ -375,6 +2840,12 @@ UINT32 guiWeaponCachesOptionToggles[ NUM_CACHES_OPTIONS ];
void BtnGIOWeaponCachesRandomCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIOWeaponCachesAllCallback(GUI_BUTTON *btn,INT32 reason);
+UINT32 giGIOSquadSizeButton[ 2 ];
+INT32 giGIOSquadSizeButtonImage[ 2 ];
+void BtnGIOSquadSizeSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason );
+void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason );
+
+
UINT32 guiTimedTurnToggles[ GIO_NUM_TIMED_TURN_OPTIONS ];
void BtnTimedTurnsTogglesCallback(GUI_BUTTON *btn,INT32 reason);
@@ -518,7 +2989,18 @@ UINT32 GameInitOptionsScreenInit( void )
// Secret Weapon Caches (Default: Random = 0)
gGameOptions.fEnableAllWeaponCaches = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SECRET_WEAPON_CACHES, 0);
+ // Squad size (Default: 8)
+ UINT8 ubSquadSize = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SQUAD_SIZE, 8);
+
+ if (iResolution == 0)
+ ubSquadSize = 6;
+
+ gGameOptions.ubSquadSize = ubSquadSize;
+
+ // Air strikes
gGameOptions.fAirStrikes = FALSE;
+
+ // Turn limit
gGameOptions.fTurnTimeLimit = FALSE;
return (1);
@@ -994,6 +3476,41 @@ BOOLEAN EnterGIOScreen()
ButtonList[ guiWeaponCachesOptionToggles[ GIO_CACHES_RANDOM ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // SQUAD SIZE
+ if (iResolution > 0)
+ {
+ giGIOSquadSizeButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,0,-1,1,-1 );
+ giGIOSquadSizeButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,2,-1,3,-1 );
+
+ // left button - decrement difficulty level
+ giGIOSquadSizeButton[ 0 ] = QuickCreateButton( giGIOSquadSizeButtonImage[ 0 ], GIO_SQUAD_SIZE_SETTING_X + 39, GIO_SQUAD_SIZE_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOSquadSizeSelectionLeftCallback );
+
+ // right button - increment difficulty level
+ giGIOSquadSizeButton[ 1 ] = QuickCreateButton( giGIOSquadSizeButtonImage[ 1 ], GIO_SQUAD_SIZE_SETTING_X + 158, GIO_SQUAD_SIZE_SETTING_Y ,
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
+ BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnGIOSquadSizeSelectionRightCallback );
+
+ // set user data
+ MSYS_SetBtnUserData(giGIOSquadSizeButton[0],0, 0 );
+ MSYS_SetBtnUserData(giGIOSquadSizeButton[1],0, 1 );
+
+ switch (gGameOptions.ubSquadSize)
+ {
+ case 6:
+ iCurrentSquadSize = GIO_SQUAD_SIZE_6;
+ break;
+ case 8:
+ iCurrentSquadSize = GIO_SQUAD_SIZE_8;
+ break;
+ case 10:
+ iCurrentSquadSize = GIO_SQUAD_SIZE_10;
+ break;
+ }
+ }
+
//Reset the exit screen
gubGIOExitScreen = GAME_INIT_OPTIONS_SCREEN;
@@ -1681,6 +4198,102 @@ void BtnGIOWeaponCachesAllCallback(GUI_BUTTON *btn,INT32 reason)
}
}
+void BtnGIOSquadSizeSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ if ( iCurrentSquadSize > GIO_SQUAD_SIZE_6 )
+ {
+ PlayButtonSound( giGIOSquadSizeButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentSquadSize--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOSquadSizeButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ if ( iCurrentSquadSize > GIO_SQUAD_SIZE_6 )
+ {
+ PlayButtonSound( giGIOSquadSizeButton[0], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentSquadSize--;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOSquadSizeButton[0], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
+void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
+ if (iResolution == 1)
+ maxSquadSize = GIO_SQUAD_SIZE_8;
+
+ if ( iCurrentSquadSize < maxSquadSize )
+ {
+ PlayButtonSound( giGIOSquadSizeButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentSquadSize++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOSquadSizeButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
+ if (iResolution == 1)
+ maxSquadSize = GIO_SQUAD_SIZE_8;
+
+ if ( iCurrentSquadSize < maxSquadSize )
+ {
+ PlayButtonSound( giGIOSquadSizeButton[1], BUTTON_SOUND_CLICKED_ON );
+
+ iCurrentSquadSize++;
+ gfReRenderGIOScreen =TRUE;
+ }
+ else
+ {
+ PlayButtonSound( giGIOSquadSizeButton[1], BUTTON_SOUND_DISABLED_CLICK );
+ }
+ }
+ else if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
+ {
+ if (btn->uiFlags & BUTTON_CLICKED_ON)
+ {
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ }
+ }
+}
+
BOOLEAN ExitGIOScreen()
{
UINT16 cnt;
@@ -1782,6 +4395,15 @@ BOOLEAN ExitGIOScreen()
UnloadButtonImage( guiWeaponCachesOptionTogglesImage[ cnt ] );
}
+ // Destroy Squad size setting buttons
+ if (iResolution > 0)
+ {
+ RemoveButton( giGIOSquadSizeButton[0] );
+ RemoveButton( giGIOSquadSizeButton[1] );
+ UnloadButtonImage( giGIOSquadSizeButtonImage[0] );
+ UnloadButtonImage( giGIOSquadSizeButtonImage[1] );
+ }
+
gfGIOButtonsAllocated = FALSE;
//If we are starting the game stop playing the music
@@ -1852,9 +4474,9 @@ BOOLEAN RenderGIOScreen()
RestoreExternBackgroundRect( GIO_DIF_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_DIF_SETTING_Y-3, 120, 20 );
RestoreExternBackgroundRect( GIO_IMP_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_IMP_SETTING_Y-3, 120, 20 );
RestoreExternBackgroundRect( GIO_BR_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_BR_SETTING_Y-3, 120, 20 );
- RestoreExternBackgroundRect( GIO_PROGRESS_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_PROGRESS_SETTING_Y-3, 120, 20 );
-
+ RestoreExternBackgroundRect( GIO_PROGRESS_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_PROGRESS_SETTING_Y-3, 120, 20 );
RestoreExternBackgroundRect( GIO_INV_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_INV_SETTING_Y-3, 120, 20 );
+ RestoreExternBackgroundRect( GIO_SQUAD_SIZE_SETTING_X+GIO_OFFSET_TO_TEXT + 20, GIO_SQUAD_SIZE_SETTING_Y-3, 120, 20 );
//Get the main background screen graphic and blt it
GetVideoObject(&hPixHandle, guiGIOMainBackGroundImage );
@@ -1920,6 +4542,11 @@ BOOLEAN RenderGIOScreen()
//Display the Weapon Caches Settings Title Text
DisplayWrappedString( (GIO_CACHES_SETTING_X - 6), (UINT16)(GIO_CACHES_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE), GIO_CACHES_SETTING_WIDTH + 14, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_CACHES_TITLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ //Display the Squad size Title Text
+ RenderGIOSmallSelectionFrame( (GIO_SQUAD_SIZE_SETTING_X + 36), (GIO_SQUAD_SIZE_SETTING_Y - 3) );
+ DisplayWrappedString( (UINT16)(GIO_SQUAD_SIZE_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (UINT16)(GIO_SQUAD_SIZE_SETTING_Y-GIO_GAP_BN_SETTINGS + GIO_TITLE_DISTANCE - 12), GIO_SQUAD_SIZE_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ GIO_SQUAD_SIZE_TITLE_TEXT ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+ DisplayWrappedString( (UINT16)(GIO_SQUAD_SIZE_SETTING_X+GIO_OFFSET_TO_TEXT + 1), (GIO_SQUAD_SIZE_SETTING_Y+6), GIO_SQUAD_SIZE_SETTING_WIDTH, 2, GIO_TOGGLE_TEXT_FONT, GIO_TOGGLE_TEXT_COLOR, gzGIOScreenText[ iCurrentSquadSize + (GIO_SQUAD_SIZE_TITLE_TEXT + 1) ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
+
return( TRUE );
}
@@ -2174,6 +4801,21 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
}
}
+ // Squad size
+ switch (iCurrentSquadSize)
+ {
+ case GIO_SQUAD_SIZE_6:
+ gGameOptions.ubSquadSize = 6;
+ break;
+ case GIO_SQUAD_SIZE_8:
+ gGameOptions.ubSquadSize = 8;
+ break;
+ case GIO_SQUAD_SIZE_10:
+ gGameOptions.ubSquadSize = 10;
+ break;
+ }
+
+
// SANDRO - added following:
gGameOptions.ubMaxIMPCharacters = min( (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount), ( max( 1, iCurrentIMPNumberSetting) ));
gGameOptions.fNewTraitSystem = GetCurrentTraitsOptionButtonSetting();
@@ -2292,4 +4934,7 @@ void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY)
BltVideoObject(FRAME_BUFFER, hHandle, 0, sX, sY , VO_BLT_SRCTRANSPARENCY,NULL);
return;
-}
\ No newline at end of file
+}
+
+#endif
+
diff --git a/GameSettings.cpp b/GameSettings.cpp
index 2ec5900f..9730a535 100644
--- a/GameSettings.cpp
+++ b/GameSettings.cpp
@@ -49,8 +49,6 @@
#define GAME_SETTINGS_FILE "Ja2_Settings.INI"
-#define GAME_INI_FILE "..\\Ja2.ini"
-
#define GAME_EXTERNAL_OPTIONS_FILE "Ja2_Options.ini"
#define AP_BP_CONSTANTS_FILE "APBPConstants.ini"
@@ -75,7 +73,6 @@ extern INT16 APBPConstants[TOTAL_APBP_VALUES];
void InitGameSettings();
-
BOOLEAN GetCdromLocationFromIniFile( STR pRootOfCdromDrive );
extern BOOLEAN DoJA2FilesExistsOnDrive( CHAR8 *zCdLocation );
@@ -136,7 +133,7 @@ BOOLEAN LoadGameSettings()
{
CIniReader iniReader(GAME_SETTINGS_FILE, TRUE); // force path even for non existing files
- gGameSettings.bLastSavedGameSlot = iniReader.ReadInteger("JA2 Game Settings","bLastSavedGameSlot" , -1 , -1 , NUM_SLOT );
+ gGameSettings.bLastSavedGameSlot = iniReader.ReadInteger("JA2 Game Settings","bLastSavedGameSlot" , -1 , -1 , 255 );
gGameSettings.ubMusicVolumeSetting = iniReader.ReadInteger("JA2 Game Settings","ubMusicVolumeSetting" , MIDVOLUME , 0 , HIGHVOLUME );
gGameSettings.ubSoundEffectsVolume = iniReader.ReadInteger("JA2 Game Settings","ubSoundEffectsVolume" , MIDVOLUME , 0 , HIGHVOLUME );
gGameSettings.ubSpeechVolume = iniReader.ReadInteger("JA2 Game Settings","ubSpeechVolume" , MIDVOLUME , 0 , HIGHVOLUME );
@@ -296,137 +293,137 @@ BOOLEAN SaveGameSettings()
{
if (!is_networked)
{
- //Record the current settings into the game settins structure
- gGameSettings.ubSoundEffectsVolume = (UINT8)GetSoundEffectsVolume( );
- gGameSettings.ubSpeechVolume = (UINT8)GetSpeechVolume( );
- gGameSettings.ubMusicVolumeSetting = (UINT8)MusicGetVolume( );
+ //Record the current settings into the game settins structure
+ gGameSettings.ubSoundEffectsVolume = (UINT8)GetSoundEffectsVolume( );
+ gGameSettings.ubSpeechVolume = (UINT8)GetSpeechVolume( );
+ gGameSettings.ubMusicVolumeSetting = (UINT8)MusicGetVolume( );
- std::stringstream settings;
- const char endl[] = "\r\n";
- settings << ";******************************************************************************************************************************" << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << "; Jagged Alliance 2 --Settings File-- " << endl;
- settings << "; " << endl;
- settings << "; Please note that this file is automatically generated by the game. " << endl;
- settings << "; " << endl;
- settings << "; While it is safe to change things from within this file, not all values are acceptable. Some may break the game, " << endl;
- settings << "; some may be ignored, but most likely they will be acceptable or reset to a default value. " << endl;
- settings << "; " << endl;
- settings << "; Please note, This file and its contents are in a beta phase. Expect changes, however they should be minimal and automated." << endl;
- settings << "; " << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << endl;
- settings << "; The Current Game Setting Struct is defined as : " << endl;
- settings << ";" << endl;
- settings << "; typedef struct" << endl;
- settings << "; {" << endl;
- settings << "; INT8 bLastSavedGameSlot; // The last saved game number goes in here" << endl;
- settings << "; UINT8 ubMusicVolumeSetting; // Volume Setting" << endl;
- settings << "; UINT8 ubSoundEffectsVolume; // Volume Setting" << endl;
- settings << "; UINT8 ubSpeechVolume; // Volume Setting" << endl;
- settings << "; UINT8 fOptions[ NUM_ALL_GAME_OPTIONS ]; // Toggle Options (Speech, Subtitles, Show Tree Tops, etc.. )" << endl;
- settings << "; UINT32 uiMeanwhileScenesSeenFlags; // Bit Vector describing seen 'mean whiles..'" << endl;
- settings << "; BOOLEAN fHideHelpInAllScreens; // Controls Help \"do not show help again\" checkbox" << endl;
- //settings << "; UINT8 ubSizeOfDisplayCover; // The number of grids the player designates thru [Delete + ( = or - )]" << endl;
- //settings << "; UINT8 ubSizeOfLOS; // The number of grids the player designates thru [End + ( = or - )]" << endl;
- settings << "; } GAME_SETTINGS" << endl;
- settings << ";" << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << endl << endl;
- settings << "[JA2 Game Settings]" << endl;
+ std::stringstream settings;
+ const char endl[] = "\r\n";
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << "; Jagged Alliance 2 --Settings File-- " << endl;
+ settings << "; " << endl;
+ settings << "; Please note that this file is automatically generated by the game. " << endl;
+ settings << "; " << endl;
+ settings << "; While it is safe to change things from within this file, not all values are acceptable. Some may break the game, " << endl;
+ settings << "; some may be ignored, but most likely they will be acceptable or reset to a default value. " << endl;
+ settings << "; " << endl;
+ settings << "; Please note, This file and its contents are in a beta phase. Expect changes, however they should be minimal and automated." << endl;
+ settings << "; " << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << endl;
+ settings << "; The Current Game Setting Struct is defined as : " << endl;
+ settings << ";" << endl;
+ settings << "; typedef struct" << endl;
+ settings << "; {" << endl;
+ settings << "; INT8 bLastSavedGameSlot; // The last saved game number goes in here" << endl;
+ settings << "; UINT8 ubMusicVolumeSetting; // Volume Setting" << endl;
+ settings << "; UINT8 ubSoundEffectsVolume; // Volume Setting" << endl;
+ settings << "; UINT8 ubSpeechVolume; // Volume Setting" << endl;
+ settings << "; UINT8 fOptions[ NUM_ALL_GAME_OPTIONS ]; // Toggle Options (Speech, Subtitles, Show Tree Tops, etc.. )" << endl;
+ settings << "; UINT32 uiMeanwhileScenesSeenFlags; // Bit Vector describing seen 'mean whiles..'" << endl;
+ settings << "; BOOLEAN fHideHelpInAllScreens; // Controls Help \"do not show help again\" checkbox" << endl;
+ //settings << "; UINT8 ubSizeOfDisplayCover; // The number of grids the player designates thru [Delete + ( = or - )]" << endl;
+ //settings << "; UINT8 ubSizeOfLOS; // The number of grids the player designates thru [End + ( = or - )]" << endl;
+ settings << "; } GAME_SETTINGS" << endl;
+ settings << ";" << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << endl << endl;
+ settings << "[JA2 Game Settings]" << endl;
- settings << "bLastSavedGameSlot = " << (int)gGameSettings.bLastSavedGameSlot << endl;
- settings << "ubMusicVolumeSetting = " << (int)gGameSettings.ubMusicVolumeSetting << endl;
- settings << "ubSoundEffectsVolume = " << (int)gGameSettings.ubSoundEffectsVolume << endl;
- settings << "ubSpeechVolume = " << (int)gGameSettings.ubSpeechVolume << endl;
- settings << "uiMeanwhileScenesSeenFlags = " << gGameSettings.uiMeanwhileScenesSeenFlags << endl;
- settings << "fHideHelpInAllScreens = " << (gGameSettings.fHideHelpInAllScreens ? "TRUE" : "FALSE" ) << endl;
- //settings << "ubSizeOfDisplayCover = " << (int)gGameSettings.ubSizeOfDisplayCover << endl;
- //settings << "ubSizeOfLOS = " << (int)gGameSettings.ubSizeOfLOS << endl;
- settings << "TOPTION_SPEECH = " << (gGameSettings.fOptions[TOPTION_SPEECH] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_MUTE_CONFIRMATIONS = " << (gGameSettings.fOptions[TOPTION_MUTE_CONFIRMATIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SUBTITLES = " << (gGameSettings.fOptions[TOPTION_SUBTITLES] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_KEY_ADVANCE_SPEECH = " << (gGameSettings.fOptions[TOPTION_KEY_ADVANCE_SPEECH] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ANIMATE_SMOKE = " << (gGameSettings.fOptions[TOPTION_ANIMATE_SMOKE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_BLOOD_N_GORE = " << (gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DONT_MOVE_MOUSE = " << (gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_OLD_SELECTION_METHOD = " << (gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALWAYS_SHOW_MOVEMENT_PATH = " << (gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_MISSES = " << (gGameSettings.fOptions[TOPTION_SHOW_MISSES] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RTCONFIRM = " << (gGameSettings.fOptions[TOPTION_RTCONFIRM] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SLEEPWAKE_NOTIFICATION = " << (gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_USE_METRIC_SYSTEM = " << (gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_MERC_ALWAYS_LIGHT_UP = " << (gGameSettings.fOptions[TOPTION_MERC_ALWAYS_LIGHT_UP] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SMART_CURSOR = " << (gGameSettings.fOptions[TOPTION_SMART_CURSOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SNAP_CURSOR_TO_DOOR = " << (gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_GLOW_ITEMS = " << (gGameSettings.fOptions[TOPTION_GLOW_ITEMS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TOGGLE_TREE_TOPS = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TOGGLE_WIREFRAME = " << (gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_3D_CURSOR = " << (gGameSettings.fOptions[TOPTION_3D_CURSOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_CTH_CURSOR = " << (gGameSettings.fOptions[TOPTION_CTH_CURSOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_GL_BURST_CURSOR = " << (gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALLOW_TAUNTS = " << (gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] ? "TRUE" : "FALSE" ) << endl; // changed from drop all - SANDRO
- settings << "TOPTION_GL_HIGH_ANGLE = " << (gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALLOW_REAL_TIME_SNEAK = " << (gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] ? "TRUE" : "FALSE" ) << endl; // changed from restrict aim levels - SANDRO
- settings << "TOPTION_SPACE_SELECTS_NEXT_SQUAD = " << (gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_ITEM_SHADOW = " << (gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_WEAPON_RANGE_IN_TILES = " << (gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TRACERS_FOR_SINGLE_FIRE = " << (gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RAIN_SOUND = " << (gGameSettings.fOptions[TOPTION_RAIN_SOUND] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALLOW_CROWS = " << (gGameSettings.fOptions[TOPTION_ALLOW_CROWS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALLOW_SOLDIER_TOOLTIPS = " << (gGameSettings.fOptions[TOPTION_ALLOW_SOLDIER_TOOLTIPS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_USE_AUTO_SAVE = " << (gGameSettings.fOptions[TOPTION_USE_AUTO_SAVE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SILENT_SKYRIDER = " << (gGameSettings.fOptions[TOPTION_SILENT_SKYRIDER] ? "TRUE" : "FALSE" ) << endl;
- //settings << "TOPTION_LOW_CPU_USAGE = " << (gGameSettings.fOptions[TOPTION_LOW_CPU_USAGE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ENHANCED_DESC_BOX = " << (gGameSettings.fOptions[TOPTION_ENHANCED_DESC_BOX] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TOGGLE_TURN_MODE = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_STAT_PROGRESS_BARS = " << (gGameSettings.fOptions[TOPTION_STAT_PROGRESS_BARS] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 3.6: Progress Bars
- settings << "TOPTION_ALT_MAP_COLOR = " << (gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Alt Map Colors
- settings << "TOPTION_ALTERNATE_BULLET_GRAPHICS = " << (gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_USE_NCTH = " << (gGameSettings.fOptions[TOPTION_USE_NCTH] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_TACTICAL_FACE_GEAR = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_GEAR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_TACTICAL_FACE_ICONS = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_ICONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DISABLE_CURSOR_SWAP = " << (gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_FORCE_BOBBY_RAY_SHIPMENTS = " << (gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_CHEAT_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DEBUG_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_REPORT_MISS_MARGIN = " << (gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Shot offset report
- settings << "TOPTION_SHOW_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_SHOW_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE = " << (gGameSettings.fOptions[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RENDER_MOUSE_REGIONS = " << (gGameSettings.fOptions[TOPTION_RENDER_MOUSE_REGIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DEBUG_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << "; Options beyond this point are Code derived options, DO NOT CHANGE THESE UNLESS YOU KNOW WHAT YOUR ARE DOING." << endl;
- settings << "; They are only included here for complete transparency for all GameSettings content. " << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << "TOPTION_LAST_OPTION = " << (gGameSettings.fOptions[TOPTION_LAST_OPTION] ? "TRUE" : "FALSE" ) << endl;
- settings << "NUM_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_MERC_CASTS_LIGHT = " << (gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_HIDE_BULLETS = " << (gGameSettings.fOptions[TOPTION_HIDE_BULLETS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TRACKING_MODE = " << (gGameSettings.fOptions[TOPTION_TRACKING_MODE] ? "TRUE" : "FALSE" ) << endl;
- settings << "NUM_ALL_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_ALL_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "bLastSavedGameSlot = " << (int)gGameSettings.bLastSavedGameSlot << endl;
+ settings << "ubMusicVolumeSetting = " << (int)gGameSettings.ubMusicVolumeSetting << endl;
+ settings << "ubSoundEffectsVolume = " << (int)gGameSettings.ubSoundEffectsVolume << endl;
+ settings << "ubSpeechVolume = " << (int)gGameSettings.ubSpeechVolume << endl;
+ settings << "uiMeanwhileScenesSeenFlags = " << gGameSettings.uiMeanwhileScenesSeenFlags << endl;
+ settings << "fHideHelpInAllScreens = " << (gGameSettings.fHideHelpInAllScreens ? "TRUE" : "FALSE" ) << endl;
+ //settings << "ubSizeOfDisplayCover = " << (int)gGameSettings.ubSizeOfDisplayCover << endl;
+ //settings << "ubSizeOfLOS = " << (int)gGameSettings.ubSizeOfLOS << endl;
+ settings << "TOPTION_SPEECH = " << (gGameSettings.fOptions[TOPTION_SPEECH] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_MUTE_CONFIRMATIONS = " << (gGameSettings.fOptions[TOPTION_MUTE_CONFIRMATIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SUBTITLES = " << (gGameSettings.fOptions[TOPTION_SUBTITLES] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_KEY_ADVANCE_SPEECH = " << (gGameSettings.fOptions[TOPTION_KEY_ADVANCE_SPEECH] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ANIMATE_SMOKE = " << (gGameSettings.fOptions[TOPTION_ANIMATE_SMOKE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_BLOOD_N_GORE = " << (gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DONT_MOVE_MOUSE = " << (gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_OLD_SELECTION_METHOD = " << (gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALWAYS_SHOW_MOVEMENT_PATH = " << (gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_MISSES = " << (gGameSettings.fOptions[TOPTION_SHOW_MISSES] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RTCONFIRM = " << (gGameSettings.fOptions[TOPTION_RTCONFIRM] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SLEEPWAKE_NOTIFICATION = " << (gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_USE_METRIC_SYSTEM = " << (gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_MERC_ALWAYS_LIGHT_UP = " << (gGameSettings.fOptions[TOPTION_MERC_ALWAYS_LIGHT_UP] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SMART_CURSOR = " << (gGameSettings.fOptions[TOPTION_SMART_CURSOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SNAP_CURSOR_TO_DOOR = " << (gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_GLOW_ITEMS = " << (gGameSettings.fOptions[TOPTION_GLOW_ITEMS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TOGGLE_TREE_TOPS = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TOGGLE_WIREFRAME = " << (gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_3D_CURSOR = " << (gGameSettings.fOptions[TOPTION_3D_CURSOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_CTH_CURSOR = " << (gGameSettings.fOptions[TOPTION_CTH_CURSOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_GL_BURST_CURSOR = " << (gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALLOW_TAUNTS = " << (gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] ? "TRUE" : "FALSE" ) << endl; // changed from drop all - SANDRO
+ settings << "TOPTION_GL_HIGH_ANGLE = " << (gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALLOW_REAL_TIME_SNEAK = " << (gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] ? "TRUE" : "FALSE" ) << endl; // changed from restrict aim levels - SANDRO
+ settings << "TOPTION_SPACE_SELECTS_NEXT_SQUAD = " << (gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_ITEM_SHADOW = " << (gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_WEAPON_RANGE_IN_TILES = " << (gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TRACERS_FOR_SINGLE_FIRE = " << (gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RAIN_SOUND = " << (gGameSettings.fOptions[TOPTION_RAIN_SOUND] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALLOW_CROWS = " << (gGameSettings.fOptions[TOPTION_ALLOW_CROWS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALLOW_SOLDIER_TOOLTIPS = " << (gGameSettings.fOptions[TOPTION_ALLOW_SOLDIER_TOOLTIPS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_USE_AUTO_SAVE = " << (gGameSettings.fOptions[TOPTION_USE_AUTO_SAVE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SILENT_SKYRIDER = " << (gGameSettings.fOptions[TOPTION_SILENT_SKYRIDER] ? "TRUE" : "FALSE" ) << endl;
+ //settings << "TOPTION_LOW_CPU_USAGE = " << (gGameSettings.fOptions[TOPTION_LOW_CPU_USAGE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ENHANCED_DESC_BOX = " << (gGameSettings.fOptions[TOPTION_ENHANCED_DESC_BOX] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TOGGLE_TURN_MODE = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_STAT_PROGRESS_BARS = " << (gGameSettings.fOptions[TOPTION_STAT_PROGRESS_BARS] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 3.6: Progress Bars
+ settings << "TOPTION_ALT_MAP_COLOR = " << (gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Alt Map Colors
+ settings << "TOPTION_ALTERNATE_BULLET_GRAPHICS = " << (gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_USE_NCTH = " << (gGameSettings.fOptions[TOPTION_USE_NCTH] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_TACTICAL_FACE_GEAR = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_GEAR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_TACTICAL_FACE_ICONS = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_ICONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DISABLE_CURSOR_SWAP = " << (gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_FORCE_BOBBY_RAY_SHIPMENTS = " << (gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_CHEAT_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DEBUG_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_REPORT_MISS_MARGIN = " << (gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Shot offset report
+ settings << "TOPTION_SHOW_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_SHOW_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE = " << (gGameSettings.fOptions[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RENDER_MOUSE_REGIONS = " << (gGameSettings.fOptions[TOPTION_RENDER_MOUSE_REGIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DEBUG_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << "; Options beyond this point are Code derived options, DO NOT CHANGE THESE UNLESS YOU KNOW WHAT YOUR ARE DOING." << endl;
+ settings << "; They are only included here for complete transparency for all GameSettings content. " << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << "TOPTION_LAST_OPTION = " << (gGameSettings.fOptions[TOPTION_LAST_OPTION] ? "TRUE" : "FALSE" ) << endl;
+ settings << "NUM_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_MERC_CASTS_LIGHT = " << (gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_HIDE_BULLETS = " << (gGameSettings.fOptions[TOPTION_HIDE_BULLETS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TRACKING_MODE = " << (gGameSettings.fOptions[TOPTION_TRACKING_MODE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "NUM_ALL_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_ALL_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
- try
+ try
+ {
+ vfs::COpenWriteFile wfile(GAME_SETTINGS_FILE,true,true);
+ wfile->write(settings.str().c_str(), settings.str().length());
+ }
+ catch(vfs::Exception& ex)
+ {
+ SGP_WARNING(ex.what());
+ vfs::CFile file(GAME_SETTINGS_FILE);
+ if(file.openWrite(true,true))
{
- vfs::COpenWriteFile wfile(GAME_SETTINGS_FILE,true,true);
- wfile->write(settings.str().c_str(), settings.str().length());
- }
- catch(vfs::Exception& ex)
- {
- SGP_WARNING(ex.what());
- vfs::CFile file(GAME_SETTINGS_FILE);
- if(file.openWrite(true,true))
- {
- vfs::COpenWriteFile wfile( vfs::tWritableFile::cast(&file));
- SGP_TRYCATCH_RETHROW(file.write(settings.str().c_str(), settings.str().length()),L"");
- }
+ vfs::COpenWriteFile wfile( vfs::tWritableFile::cast(&file));
+ SGP_TRYCATCH_RETHROW(file.write(settings.str().c_str(), settings.str().length()),L"");
}
}
+ }
return( TRUE );
}
@@ -900,16 +897,17 @@ void LoadGameExternalOptions()
break;
}
- // WANNE: Moved to options screen
- //legion by Jazz
- /*gGameExternalOptions.fShowTacticalFaceGear = iniReader.ReadBoolean("Tactical Interface Settings","SHOW_TACTICAL_FACE_GEAR",FALSE);
- gGameExternalOptions.fShowTacticalFaceIcons = iniReader.ReadBoolean("Tactical Interface Settings","SHOW_TACTICAL_FACE_ICONS",FALSE);*/
-
gGameExternalOptions.bTacticalFaceIconStyle = iniReader.ReadInteger("Tactical Interface Settings","TACTICAL_FACE_ICON_STYLE", 0, 0, 3);
// Camo portraits by Jazz
gGameExternalOptions.fShowCamouflageFaces = iniReader.ReadBoolean("Tactical Interface Settings","SHOW_CAMOUFLAGE_FACES", FALSE);
+ // WANNE: Hide the health text when hovering over a enemy
+ gGameExternalOptions.fHideEnemyHealthText = iniReader.ReadBoolean("Tactical Interface Settings","HIDE_ENEMY_HEALTH_TEXT", FALSE);
+
+ // WANNE: Hide the hit count when enemy gets hit
+ gGameExternalOptions.ubEnemyHitCount = iniReader.ReadInteger("Tactical Interface Settings","ENEMY_HIT_COUNT", 0, 0, 2);
+
//################# Tactical Difficulty Settings #################
// Enemy AP settings
@@ -1037,6 +1035,8 @@ void LoadGameExternalOptions()
//################# Tactical Gameplay Settings ##################
+ gGameExternalOptions.fAllowWalkingWithWeaponRaised = iniReader.ReadBoolean("Tactical Gameplay Settings","ALLOW_WALKING_WITH_WEAPON_RAISED", TRUE);
+
// WANNE: Externalized grid number of new merc when they arrive with the helicopter (by Jazz)
gGameExternalOptions.iInitialMercArrivalLocation = iniReader.ReadInteger("Tactical Gameplay Settings","INITIAL_MERC_ARRIVAL_LOCATION", 4870 );
@@ -1134,7 +1134,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.bAimedBurstEnabled = iniReader.ReadBoolean("Tactical Interface Settings","USE_AIMED_BURST",FALSE);
// Penalcy for aimed burst
- gGameExternalOptions.uAimedBurstPenalty = iniReader.ReadInteger("Tactical Interface Settings","AIMING_BURST_PENALTY",2);
+ gGameExternalOptions.uAimedBurstPenalty = iniReader.ReadInteger("Tactical Interface Settings","AIMING_BURST_PENALTY",2, 0, 10);
// We could see all what can see militia
gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa = iniReader.ReadBoolean("Tactical Interface Settings","WE_SEE_WHAT_MILITIA_SEES_AND_VICE_VERSA",TRUE);
@@ -1168,7 +1168,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.fCamoRemoving = iniReader.ReadBoolean("Tactical Gameplay Settings", "CAMO_REMOVING", TRUE);
// SANDRO - Enhanced close combat system
- gGameExternalOptions.fEnhancedCloseCombatSystem = iniReader.ReadBoolean("Tactical Gameplay Settings", "ENHANCED_CLOSE_COMBAT_SYSTEM", FALSE);
+ gGameExternalOptions.fEnhancedCloseCombatSystem = iniReader.ReadBoolean("Tactical Gameplay Settings", "ENHANCED_CLOSE_COMBAT_SYSTEM", TRUE);
// SANDRO - give special Exp for completing quests
gGameExternalOptions.usAwardSpecialExpForQuests = iniReader.ReadInteger("Tactical Gameplay Settings", "AWARD_SPECIAL_EXP_POINTS_FOR_COMPLETING_QUESTS", 100, 0, 5000);
@@ -1176,6 +1176,14 @@ void LoadGameExternalOptions()
//tais: soldiers always wear any armour..
gGameExternalOptions.fSoldiersWearAnyArmour = iniReader.ReadBoolean("Tactical Gameplay Settings", "SOLDIERS_ALWAYS_WEAR_ANY_ARMOR", FALSE);
+ // improved Interrupt System (info: multiplayer game ALWAYS use the old interrupt system, because the new one causes crashes, no problem so far)
+ gGameExternalOptions.fImprovedInterruptSystem = iniReader.ReadBoolean("Tactical Gameplay Settings", "IMPROVED_INTERRUPT_SYSTEM", TRUE);
+ gGameExternalOptions.ubBasicPercentRegisterValueIIS = iniReader.ReadInteger("Tactical Gameplay Settings", "BASIC_PERCENTAGE_APS_REGISTERED", 60, 0, 250);
+ gGameExternalOptions.ubPercentRegisterValuePerLevelIIS = iniReader.ReadInteger("Tactical Gameplay Settings", "PERCENTAGE_APS_REGISTERED_PER_EXP_LEVEL", 4, 0, 100);
+ gGameExternalOptions.ubBasicReactionTimeLengthIIS = iniReader.ReadInteger("Tactical Gameplay Settings", "BASIC_REACTION_TIME_LENGTH", 25, 5, 100);
+ gGameExternalOptions.fAllowCollectiveInterrupts = iniReader.ReadBoolean("Tactical Gameplay Settings", "ALLOW_COLLECTIVE_INTERRUPTS", TRUE);
+ gGameExternalOptions.fAllowInstantInterruptsOnSight = iniReader.ReadBoolean("Tactical Gameplay Settings", "ALLOW_INSTANT_INTERRUPTS_ON_SPOTTING", FALSE);
+
//################# Tactical Cover System Settings ##################
// CPT: Cover System Settings
@@ -1394,11 +1402,12 @@ void LoadGameExternalOptions()
//################# Laptop Settings ##################
+ gGameExternalOptions.gBriefingRoom = iniReader.ReadBoolean("Laptop Settings", "BRIEFING_ROOM", FALSE);
+ gGameExternalOptions.gEncyclopedia = iniReader.ReadBoolean("Laptop Settings", "ENCYCLOPEDIA", FALSE);
gGameExternalOptions.fDisableLaptopTransition = iniReader.ReadBoolean("Laptop Settings", "DISABLE_LAPTOP_TRANSITION", FALSE);
gGameExternalOptions.fFastWWWSitesLoading = iniReader.ReadBoolean("Laptop Settings", "FAST_WWW_SITES_LOADING", FALSE);
-
//################# Bobby Ray Settings ##################
@@ -1676,7 +1685,8 @@ void LoadGameExternalOptions()
//SaveGame slot by Jazz
// WANNE: No need to make it external to switch between old/new. We always use the new save/load screen with more save slots
//gGameExternalOptions.fSaveGameSlot = iniReader.ReadBoolean("Extension","SAVE_GAMES_SLOT",FALSE);
- gGameExternalOptions.fSaveGameSlot = TRUE;
+ gGameExternalOptions.fSaveGameSlot = TRUE;
+
// WANNE: This is just a debug setting. Only in debug version we set that property to TRUE.
// In Release version this should always be set to FALSE
@@ -1697,6 +1707,12 @@ void LoadSkillTraitsExternalSettings()
gSkillTraitValues.ubMaxNumberOfTraits = iniReader.ReadInteger("Generic Traits Settings","MAX_NUMBER_OF_TRAITS", 3, 2, 30);
gSkillTraitValues.ubNumberOfMajorTraitsAllowed = iniReader.ReadInteger("Generic Traits Settings","NUMBER_OF_MAJOR_TRAITS_ALLOWED", 2, 2, 20);
+ // Allow an exception in number of traits for Dr.Q?
+ gSkillTraitValues.fAllowDrQTraitsException = iniReader.ReadBoolean("Generic Traits Settings","ALLOW_EXCEPTION_FOR_DR_Q", TRUE);
+
+ // Allow traits prerequisities for attributes?
+ gSkillTraitValues.fAllowAttributePrereq = iniReader.ReadBoolean("Generic Traits Settings","SET_MINIMUM_ATTRIBUTES_FOR_TRAITS", TRUE);
+
// GENERIC SETTINGS
gSkillTraitValues.bCtHModifierAssaultRifles = iniReader.ReadInteger("Generic Traits Settings","ASSAULT_RIFLES_CTH_MODIFIER", -5, -100, 100);
gSkillTraitValues.bCtHModifierSniperRifles = iniReader.ReadInteger("Generic Traits Settings","SNIPER_RIFLES_CTH_MODIFIER", -10, -100, 100);
@@ -1805,6 +1821,7 @@ void LoadSkillTraitsExternalSettings()
gSkillTraitValues.ubMAAPsChangeStanceReduction = iniReader.ReadInteger("Martial Arts","APS_CHANGE_STANCE_REDUCTION", 25, 0, 100);
gSkillTraitValues.ubMAApsTurnAroundReduction = iniReader.ReadInteger("Martial Arts","APS_TURN_AROUND_REDUCTION", 25, 0, 100);
gSkillTraitValues.ubMAAPsClimbOrJumpReduction = iniReader.ReadInteger("Martial Arts","APS_CLIMB_OR_JUMP_REDUCTION", 25, 0, 100);
+ gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving = iniReader.ReadInteger("Martial Arts","REDUCED_CHANCE_TO_BE_INTERRUPTED_WHEN_MOVING", 35, 0, 100);
gSkillTraitValues.ubMAChanceToCkickDoors = iniReader.ReadInteger("Martial Arts","CHANCE_KICK_DOORS_BONUS", 25, 0, 250);
gSkillTraitValues.fPermitExtraAnimationsOnlyToMA = iniReader.ReadBoolean("Martial Arts","PERMIT_EXTRA_ANIMATIONS_TO_EXPERT_MARTIAL_ARTS_ONLY", TRUE);
@@ -1815,7 +1832,8 @@ void LoadSkillTraitsExternalSettings()
gSkillTraitValues.ubSLMaxBonuses = iniReader.ReadInteger("Squadleader","MAX_STACKABLE_BONUSES", 3, 1, 30);
gSkillTraitValues.ubSLBonusAPsPercent = iniReader.ReadInteger("Squadleader","BONUS_APS_PERCENT_IN_RADIUS", 5, 0, 100);
gSkillTraitValues.ubSLEffectiveLevelInRadius = iniReader.ReadInteger("Squadleader","EFFECTIVE_LEVEL_OF_OTHERS_IN_RADIUS", 1, 0, 10);
- gSkillTraitValues.ubSLEffectiveLevelAsStandby = iniReader.ReadInteger("Squadleader","EFFECTIVE_LEVEL_AS_STANDBY", 1, 0, 10);
+ gSkillTraitValues.ubSLEffectiveLevelAsStandby = iniReader.ReadInteger("Squadleader","EFFECTIVE_LEVEL_AS_STANDBY", 1, 0, 10);
+ gSkillTraitValues.ubSLCollectiveInterruptsBonus = iniReader.ReadInteger("Squadleader","TRIGGER_COLLECTIVE_INTERRUPTS_BONUS", 20, 0, 100);
gSkillTraitValues.ubSLOverallSuppresionBonusPercent = iniReader.ReadInteger("Squadleader","OVERALL_SUPRESSION_BONUS_PERCENT", 20, 0, 100);
gSkillTraitValues.ubSLMoraleGainBonus = iniReader.ReadInteger("Squadleader","MORALE_GAIN_BONUS", 1, 0, 20);
gSkillTraitValues.ubSLMoraleLossReduction = iniReader.ReadInteger("Squadleader","MORALE_LOSS_REDUCTION", 1, 0, 20);
@@ -1895,6 +1913,7 @@ void LoadSkillTraitsExternalSettings()
gSkillTraitValues.ubSTStealthModeSpeedBonus = iniReader.ReadInteger("Stealthy","STEALTH_MODE_SPEED_BONUS", 50, 0, 100);
gSkillTraitValues.ubSTBonusToMoveQuietly = iniReader.ReadInteger("Stealthy","BONUS_TO_MOVE_STEALTHILY", 40, 0, 250);
gSkillTraitValues.ubSTStealthBonus = iniReader.ReadInteger("Stealthy","STEALTH_BONUS", 25, 0, 200);
+ gSkillTraitValues.ubSTReducedAPsRegistered = iniReader.ReadInteger("Stealthy","REDUCED_CHANCE_TO_BE_INTERRUPTED", 30, 0, 100);
gSkillTraitValues.ubSTStealthPenaltyForMovingReduction = iniReader.ReadInteger("Stealthy","CHANCE_TO_BE_SPOTTED_FOR_MOVING_REDUCTION", 25, 0, 100);
// ATHLETICS
@@ -2001,6 +2020,7 @@ void LoadGameAPBPConstants()
APBPConstants[AP_MODIFIER_SWAT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MODIFIER_SWAT",0),0);
APBPConstants[AP_MODIFIER_CRAWL] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MODIFIER_CRAWL",4),4);
APBPConstants[AP_MODIFIER_PACK] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MODIFIER_PACK",4),4);
+ APBPConstants[AP_MODIFIER_READY] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_MODIFIER_WEAPON_READY",1),4);
APBPConstants[AP_CHANGE_FACING] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_CHANGE_FACING",4),4);
APBPConstants[AP_CHANGE_TARGET] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_CHANGE_TARGET",2),2);
APBPConstants[AP_TOSS_ITEM] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_TOSS_ITEM",32),32);
@@ -2101,6 +2121,7 @@ void LoadGameAPBPConstants()
APBPConstants[BP_MOVEMENT_SHORE] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_SHORE",50);
APBPConstants[BP_MOVEMENT_LAKE] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_LAKE",75);
APBPConstants[BP_MOVEMENT_OCEAN] = iniReader.ReadInteger("BPConstants","BP_MOVEMENT_OCEAN",100);
+ APBPConstants[BP_MOVEMENT_READY] = iniReader.ReadInteger("BPConstants","BP_MODIFIER_WEAPON_READY",30);
APBPConstants[BP_CROUCH] = iniReader.ReadInteger("BPConstants","BP_CROUCH",10);
APBPConstants[BP_PRONE] = iniReader.ReadInteger("BPConstants","BP_PRONE",10);
APBPConstants[BP_CLIMBROOF] = iniReader.ReadInteger("BPConstants","BP_CLIMBROOF",500);
@@ -2295,9 +2316,13 @@ BOOLEAN GetCDLocation( )
CHAR8 zCdLocation[ SGPFILENAME_LEN ];
UINT32 uiRetVal=0;
- //Do a crude check to make sure the Ja2.ini file is the right on
+ //Do a crude check to make sure the GAME_INI_FILE file is the right on
- uiRetVal = GetPrivateProfileString( "Ja2 Settings","CD", "", zCdLocation, SGPFILENAME_LEN, GAME_INI_FILE );
+ STRING512 ja2INIfile;
+ strcat(ja2INIfile, "..\\");
+ strcat(ja2INIfile, GAME_INI_FILE);
+
+ uiRetVal = GetPrivateProfileString( "Ja2 Settings","CD", "", zCdLocation, SGPFILENAME_LEN, ja2INIfile );
if( uiRetVal == 0 || !IsDriveLetterACDromDrive( zCdLocation ) )
{
// the user most likely doesnt have the file, or the user has messed with the file
@@ -2322,10 +2347,10 @@ BOOLEAN GetCDLocation( )
sprintf( zCdLocation, "c" );
}
- //Now create a new file
- WritePrivateProfileString( "Ja2 Settings", "CD", zCdLocation, GAME_INI_FILE );
+ //Now create a new file
+ WritePrivateProfileString( "Ja2 Settings", "CD", zCdLocation, ja2INIfile );
- GetPrivateProfileString( "Ja2 Settings","CD", "", zCdLocation, SGPFILENAME_LEN, GAME_INI_FILE );
+ GetPrivateProfileString( "Ja2 Settings","CD", "", zCdLocation, SGPFILENAME_LEN, ja2INIfile );
}
uiStrngLength = strlen( zCdLocation );
@@ -2518,9 +2543,13 @@ BOOLEAN GetCdromLocationFromIniFile( STR pRootOfCdromDrive )
{
UINT32 uiRetVal=0;
- //Do a crude check to make sure the Ja2.ini file is the right on
+ //Do a crude check to make sure the GAME_INI_FILE file is the right on
- uiRetVal = GetPrivateProfileString( "Ja2 Settings","CD", "", pRootOfCdromDrive, SGPFILENAME_LEN, GAME_INI_FILE );
+ STRING512 ja2INIfile;
+ strcat(ja2INIfile, "..\\");
+ strcat(ja2INIfile, GAME_INI_FILE);
+
+ uiRetVal = GetPrivateProfileString( "Ja2 Settings","CD", "", pRootOfCdromDrive, SGPFILENAME_LEN, ja2INIfile );
if( uiRetVal == 0 )
{
pRootOfCdromDrive[0] = '\0';
diff --git a/GameSettings.h b/GameSettings.h
index 71686728..57a7c0b1 100644
--- a/GameSettings.h
+++ b/GameSettings.h
@@ -3,6 +3,12 @@
#include "Types.h"
+#ifdef JA2UB
+ #define GAME_INI_FILE "Ja2_UB.ini"
+#else
+ #define GAME_INI_FILE "Ja2.ini"
+#endif
+
//If you add any options, MAKE sure you add the corresponding string to the Options Screen string array.
// look up : zOptionsScreenHelpText , zOptionsToggleText
@@ -125,9 +131,17 @@ typedef struct
BOOLEAN fHideHelpInAllScreens; // Controls Help "do not show help again" checkbox
+#ifdef JA2UB
+ //JA25UB
+ BOOLEAN fPlayerFinishedTheGame;
+#endif
+
UINT8 ubSizeOfDisplayCover; // The number of grids the player designates thru "Delete + '=' or '-'"
UINT8 ubSizeOfLOS; // The number of grids the player designates thru "End + '=' or '-'"
-
+ // The number of grids the player designates thru "End + '=' or '-'"
+#ifdef JA2UB
+ UINT8 ubFiller[17];
+#endif
} GAME_SETTINGS;
// CHRISL: New Enums to track inventory system
@@ -192,6 +206,7 @@ typedef struct
UINT8 ubBobbyRay;
UINT8 ubInventorySystem;
UINT8 ubAttachmentSystem;
+ UINT8 ubSquadSize;
// SANDRO - added variables
UINT8 ubMaxIMPCharacters;
BOOLEAN fNewTraitSystem;
@@ -199,7 +214,8 @@ typedef struct
BOOLEAN fEnemiesDropAllItems;
UINT8 ubProgressSpeedOfItemsChoices;
BOOLEAN fEnableAllWeaponCaches;
- //UINT8 ubFiller[];
+
+ UINT8 ubFiller[500]; // WANNE: Decrease this filler by 1, for each new UINT8 variable!
} GAME_OPTIONS;
@@ -302,7 +318,16 @@ typedef struct
BOOLEAN fCamoRemoving;
BOOLEAN fEnhancedCloseCombatSystem;
+ BOOLEAN fImprovedInterruptSystem;
+ UINT8 ubBasicPercentRegisterValueIIS;
+ UINT8 ubPercentRegisterValuePerLevelIIS;
+ UINT8 ubBasicReactionTimeLengthIIS;
+ BOOLEAN fAllowCollectiveInterrupts;
+ BOOLEAN fAllowInstantInterruptsOnSight;
+
UINT16 usAwardSpecialExpForQuests;
+
+ BOOLEAN fAllowWalkingWithWeaponRaised;
////////////////////////////////////
// Kaiden: Vehicle Inventory change - Added for INI Option
@@ -997,6 +1022,10 @@ typedef struct
BOOLEAN fShowCamouflageFaces;
+ BOOLEAN fHideEnemyHealthText;
+
+ UINT8 ubEnemyHitCount;
+
FLOAT gMercLevelUpSalaryIncreasePercentage;
UINT8 ubChanceTonyAvailable; // silversurfer/SANDRO
@@ -1005,6 +1034,11 @@ typedef struct
INT32 iInitialMercArrivalLocation;
+ BOOLEAN gBriefingRoom;
+ BOOLEAN gEncyclopedia;
+
+
+
} GAME_EXTERNAL_OPTIONS;
typedef struct
@@ -1012,6 +1046,10 @@ typedef struct
UINT8 ubMaxNumberOfTraits;
UINT8 ubNumberOfMajorTraitsAllowed;
+ BOOLEAN fAllowDrQTraitsException;
+
+ BOOLEAN fAllowAttributePrereq;
+
// GENERIC SETTINGS
INT8 bCtHModifierAssaultRifles;
INT8 bCtHModifierSniperRifles;
@@ -1120,6 +1158,7 @@ typedef struct
UINT8 ubMAAPsChangeStanceReduction;
UINT8 ubMAApsTurnAroundReduction;
UINT8 ubMAAPsClimbOrJumpReduction;
+ UINT8 ubMAReducedAPsRegisteredWhenMoving;
UINT8 ubMAChanceToCkickDoors;
BOOLEAN fPermitExtraAnimationsOnlyToMA;
@@ -1130,6 +1169,7 @@ typedef struct
UINT8 ubSLBonusAPsPercent;
UINT8 ubSLEffectiveLevelInRadius;
UINT8 ubSLEffectiveLevelAsStandby;
+ UINT8 ubSLCollectiveInterruptsBonus;
UINT8 ubSLOverallSuppresionBonusPercent;
UINT8 ubSLMoraleGainBonus;
UINT8 ubSLMoraleLossReduction;
@@ -1208,6 +1248,7 @@ typedef struct
UINT8 ubSTStealthModeSpeedBonus;
UINT8 ubSTBonusToMoveQuietly;
UINT8 ubSTStealthBonus;
+ UINT8 ubSTReducedAPsRegistered;
UINT8 ubSTStealthPenaltyForMovingReduction;
// ATHLETICS
diff --git a/GameVersion.cpp b/GameVersion.cpp
index 5ffb9dde..90304a23 100644
--- a/GameVersion.cpp
+++ b/GameVersion.cpp
@@ -13,11 +13,15 @@
#ifdef JA2EDITOR
//MAP EDITOR BUILD VERSION
-CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.4870 (Official Release)" };
+#ifdef JA2UB
+CHAR16 zVersionLabel[256] = { L"Unfinished Business Map Editor v1.13.4882 (Official Release)" };
+#else
+CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.4882 (Official Release)" };
+#endif
#elif defined JA2BETAVERSION
//BETA/TEST BUILD VERSION
-CHAR16 zVersionLabel[256] = { L"Debug v1.13.4870 (Official Release)" };
+CHAR16 zVersionLabel[256] = { L"Debug v1.13.4882 (Official Release)" };
#elif defined CRIPPLED_VERSION
//RELEASE BUILD VERSION s
@@ -26,10 +30,15 @@ CHAR16 zVersionLabel[256] = { L"Beta v. 0.98" };
#else
//RELEASE BUILD VERSION
- CHAR16 zVersionLabel[256] = { L"Release v1.13.4870 (Official Release)" };
+ #ifdef JA2UB
+ CHAR16 zVersionLabel[256] = { L"Release Unfinished Business v1.13.4882 (Official Release)" };
+ #else
+ CHAR16 zVersionLabel[256] = { L"Release v1.13.4882 (Official Release)" };
+ #endif
+
#endif
-CHAR8 czVersionNumber[16] = { "Build 11.12.28" }; //YY.MM.DD
+CHAR8 czVersionNumber[16] = { "Build 12.01.18" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" };
diff --git a/GameVersion.h b/GameVersion.h
index 970b00d7..5b7e232d 100644
--- a/GameVersion.h
+++ b/GameVersion.h
@@ -20,10 +20,16 @@ extern CHAR16 zTrackingNumber[16];
//
// Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file
-#define SAVE_GAME_VERSION 123 //114 //113 //112 //111 //110 //109 //108 //107 //106 //105 //104 //103 //102 //101 //100 // 99
-
-#define CURRENT_SAVEGAME_DATATYPE_VERSION 123
+#define SAVE_GAME_VERSION 131 //125 //124 //114 //113 //112 //111 //110 //109 //108 //107 //106 //105 //104 //103 //102 //101 //100 // 99
+#define JA25_UB_INTEGRATION 131 // Before this, the JA25 Unfinished Business code was not integrated (see "Builddefines.h" JA2UB)
+#define IMPROVED_INTERRUPT_SYSTEM 130
+#define ENCYCLOPEDIA_SAVEGAME_CHANGE 129 // Added encyclopedia
+#define HIDDENTOWN_DATATYPE_CHANGE 128
+#define NEW_EMAIL_SAVE_GAME 127
+#define NEW_SAVE_GAME_GENERAL_SAVE_INFO_DATA 126
+#define QUESTS_DATATYPE_CHANGE 125 // Before this, we had a maximum number of 30 quests (JA2 default) (by Jazz)
+#define VEHICLES_DATATYPE_CHANGE 124 // Before this, vehicles were not externalized (by Jazz)
#define FIXED_MERC_NOT_AVAILABLE_ON_MERC_WEBSITE 123 // Before this, only Bubba was available on MERC website
#define FIXED_CREPITUS_IN_REALISTIC_GAME_MODE 122 // Before this, there was an initializing problem in GameInit.lua on startup, in which we could meet crepitus in Tixa underground map
#define FIXED_NPC_QUOTE_BUG 121 // Before this, we need to reload all npc quote information because it was not being saved and loaded correctly.
diff --git a/Init.cpp b/Init.cpp
index 6c928610..1f1369ab 100644
--- a/Init.cpp
+++ b/Init.cpp
@@ -71,10 +71,21 @@
#include "Strategic Town Loyalty.h"
#include "Soldier Profile.h"
#include "aim.h"
+#include "mainmenuscreen.h"
+#include "email.h"
+
+#ifdef JA2UB
+#include "Ja25_Tactical.h"
+#endif
+
+#include "ub_config.h"
+
#include "Civ Quotes.h"
#include "Sector Summary.h"
#include "LuaInitNPCs.h"
+#include "Encyclopedia_Data.h"
+#include "Encyclopedia.h"
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
extern INT16 gubMaxActionPoints[28];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
@@ -389,11 +400,21 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
}
#endif
+#ifdef JA2UB
+
+ strcpy(fileName, directoryName);
+ strcat(fileName, MERCSTARTINGGEAR25FILENAME);
+ SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName),MERCSTARTINGGEAR25FILENAME);
+
+#else
+
// CHRISL:
strcpy(fileName, directoryName);
strcat(fileName, MERCSTARTINGGEARFILENAME);
SGP_THROW_IFFALSE(ReadInMercStartingGearStats(fileName),MERCSTARTINGGEARFILENAME);
+#endif
+
strcpy(fileName, directoryName);
strcat(fileName, WEAPONSFILENAME);
SGP_THROW_IFFALSE(ReadInWeaponStats(fileName),WEAPONSFILENAME);
@@ -427,10 +448,29 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
strcat(fileName, TONYINVENTORYFILENAME);
SGP_THROW_IFFALSE(ReadInInventoryStats(gTonyInventory,fileName),TONYINVENTORYFILENAME);
+#ifdef JA2UB
+//ja25 ub Biggins
+
+ strcpy(fileName, directoryName);
+ strcat(fileName, BETTYINVENTORYFILENAME);
+ SGP_THROW_IFFALSE(ReadInInventoryStats(gBettyInventory,fileName),BETTYINVENTORYFILENAME);
+
+ //UB
+ strcpy(fileName, directoryName);
+ strcat(fileName, RAULINVENTORYFILENAME);
+ SGP_THROW_IFFALSE(ReadInInventoryStats(gRaulInventory,fileName),RAULINVENTORYFILENAME);
+
+#else
strcpy(fileName, directoryName);
strcat(fileName, DEVININVENTORYFILENAME);
SGP_THROW_IFFALSE(ReadInInventoryStats(gDevinInventory,fileName),DEVININVENTORYFILENAME);
+ strcpy(fileName, directoryName);
+ strcat(fileName, PERKOINVENTORYFILENAME);
+ SGP_THROW_IFFALSE(ReadInInventoryStats(gPerkoInventory,fileName),PERKOINVENTORYFILENAME);
+
+#endif
+
strcpy(fileName, directoryName);
strcat(fileName, FRANZINVENTORYFILENAME);
SGP_THROW_IFFALSE(ReadInInventoryStats(gFranzInventory,fileName),FRANZINVENTORYFILENAME);
@@ -491,10 +531,6 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
strcat(fileName, ARNIEINVENTORYFILENAME);
SGP_THROW_IFFALSE(ReadInInventoryStats(gArnieInventory,fileName),ARNIEINVENTORYFILENAME);
- strcpy(fileName, directoryName);
- strcat(fileName, PERKOINVENTORYFILENAME);
- SGP_THROW_IFFALSE(ReadInInventoryStats(gPerkoInventory,fileName),PERKOINVENTORYFILENAME);
-
strcpy(fileName, directoryName);
strcat(fileName, FREDOINVENTORYFILENAME);
SGP_THROW_IFFALSE(ReadInInventoryStats(gFredoInventory,fileName),FREDOINVENTORYFILENAME);
@@ -527,14 +563,21 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
strcat(fileName, SAMSITESFILENAME);
SGP_THROW_IFFALSE(ReadInSAMInfo(fileName),SAMSITESFILENAME);
- // Lesh: army externalization
- strcpy(fileName, directoryName);
- strcat(fileName, GARRISONFILENAME);
- SGP_THROW_IFFALSE(ReadInGarrisonInfo(fileName),GARRISONFILENAME);
+#ifdef JA2UB
+ if ( gGameUBOptions.EnemyXML == TRUE )
+ {
+#endif
+ // Lesh: army externalization
+ strcpy(fileName, directoryName);
+ strcat(fileName, GARRISONFILENAME);
+ SGP_THROW_IFFALSE(ReadInGarrisonInfo(fileName),GARRISONFILENAME);
- strcpy(fileName, directoryName);
- strcat(fileName, PATROLFILENAME);
- SGP_THROW_IFFALSE(ReadInPatrolInfo(fileName),PATROLFILENAME);
+ strcpy(fileName, directoryName);
+ strcat(fileName, PATROLFILENAME);
+ SGP_THROW_IFFALSE(ReadInPatrolInfo(fileName),PATROLFILENAME);
+#ifdef JA2UB
+ }
+#endif
strcpy(fileName, directoryName);
strcat(fileName, COMPOSITIONFILENAME);
@@ -616,6 +659,36 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
// SANDRO - always initialize those files, we need it on game start
if (gGameExternalOptions.fReadProfileDataFromXML)
{
+#ifdef JA2UB
+ // UB25
+ strcpy(fileName, directoryName);
+ strcat(fileName, MERCPROFILESFILENAME25);
+
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInMercProfiles(fileName, FALSE), MERCPROFILESFILENAME25);
+
+ #ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ if(!ReadInMercProfiles(fileName,TRUE))
+ return FALSE;
+ }
+ #endif
+ }
+
+ strcpy(fileName, directoryName);
+ strcat(fileName, MERCOPINIONSFILENAME25);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInMercOpinions(fileName), MERCOPINIONSFILENAME25);
+ }
+#else
+
// HEADROCK PROFEX: Read in Merc Profile data to replace PROF.DAT data
strcpy(fileName, directoryName);
strcat(fileName, MERCPROFILESFILENAME);
@@ -636,8 +709,9 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
strcat(fileName, MERCOPINIONSFILENAME);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
SGP_THROW_IFFALSE(ReadInMercOpinions(fileName), MERCOPINIONSFILENAME);
+#endif
}
-
+
// HEADROCK HAM 3.6: Read in customized Bloodcat Placements
strcpy(fileName, directoryName);
strcat(fileName, BLOODCATPLACEMENTSFILENAME);
@@ -710,9 +784,9 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
// Sender Name List by Jazz
strcpy(fileName, directoryName);
- strcat(fileName, SENDERNAMELISTFILENAME);
+ strcat(fileName, EMAILSENDERNAMELIST);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
- SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), SENDERNAMELISTFILENAME);
+ SGP_THROW_IFFALSE(ReadInSenderNameList(fileName,FALSE), EMAILSENDERNAMELIST);
#ifndef ENGLISH
AddLanguagePrefix(fileName);
@@ -811,6 +885,186 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
}
#endif
+ //Main Menu by Jazz
+ strcpy(fileName, directoryName);
+ strcat(fileName, LAYOUTMAINMENU);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInMainMenu(gMainMenulayout,fileName), LAYOUTMAINMENU);
+
+ strcpy(fileName, directoryName);
+ strcat(fileName, ACTIONITEMSFILENAME);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInActionItems(fileName,FALSE), ACTIONITEMSFILENAME);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ if(!ReadInActionItems(fileName,TRUE))
+ return FALSE;
+ }
+#endif
+
+if ( ReadXMLEmail == TRUE )
+{
+ // EMAIL MERC AVAILABLE by Jazz
+ strcpy(fileName, directoryName);
+ strcat(fileName, EMAILMERCAVAILABLE);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ if(!ReadInEmailMercAvailable(fileName,TRUE))
+ return FALSE;
+ }
+#endif
+
+ // EMAIL MERC LEVEL UP by Jazz
+ strcpy(fileName, directoryName);
+ strcat(fileName, EMAILMERCLEVELUP);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ if(!ReadInEmailMercLevelUp(fileName,TRUE))
+ return FALSE;
+ }
+#endif
+}
+/*
+ // EMAIL OTHER by Jazz
+ strcpy(fileName, directoryName);
+ strcat(fileName, EMAILOTHER);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ if(!ReadInEmailOther(fileName,TRUE))
+ return FALSE;
+ }
+#endif
+*/
+ //new vehicles by Jazz
+
+ InitNewVehicles ();
+
+ strcpy(fileName, directoryName);
+ strcat(fileName, VEHICLESFILENAME);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInNewVehicles(fileName,FALSE), VEHICLESFILENAME);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ if(!ReadInNewVehicles(fileName,TRUE))
+ return FALSE;
+ }
+#endif
+
+// WANNE: The file "TableData/Text/TacticalMessages.xml" is not yet used
+#if 0
+ strcpy(fileName, directoryName);
+ strcat(fileName, TEXTFILENAME);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInLanguageLocation(fileName,FALSE,zlanguageText,0), TEXTFILENAME);
+#endif
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ if(!ReadInLanguageLocation(fileName,TRUE,zlanguageText,0))
+ return FALSE;
+ }
+#endif
+
+ //encyklopedia
+ strcpy(fileName, directoryName);
+ strcat(fileName, ENCYCLOPEDIALOCATIONFILENAME);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,FALSE,gEncyclopediaLocationData, 0), ENCYCLOPEDIALOCATIONFILENAME);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,TRUE,gEncyclopediaLocationData, 0), fileName);
+ }
+#endif
+
+ strcpy(fileName, directoryName);
+ strcat(fileName, ENCYCLOPEDIAPROFILEFILENAME);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,FALSE,gEncyclopediaProfilesData, 1), ENCYCLOPEDIAPROFILEFILENAME);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,TRUE,gEncyclopediaProfilesData, 1), fileName);
+ }
+#endif
+
+ strcpy(fileName, directoryName);
+ strcat(fileName, ENCYCLOPEDIAINVENTORYFILENAME);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,FALSE,gEncyclopediaInventoryData, 2), ENCYCLOPEDIAINVENTORYFILENAME);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,TRUE,gEncyclopediaInventoryData, 2), ENCYCLOPEDIAINVENTORYFILENAME);
+ }
+#endif
+
+ strcpy(fileName, directoryName);
+ strcat(fileName, ENCYCLOPEDIAQUESTSFILENAME);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,FALSE,gEncyclopediaQuestsData, 3), ENCYCLOPEDIAQUESTSFILENAME);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,TRUE,gEncyclopediaQuestsData, 3), fileName);
+ }
+#endif
+
+ strcpy(fileName, directoryName);
+ strcat(fileName, BRIEFINGROOMFILENAME);
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,FALSE,gBriefingRoomData, 4), BRIEFINGROOMFILENAME);
+
+#ifndef ENGLISH
+ AddLanguagePrefix(fileName);
+ if ( FileExists(fileName) )
+ {
+ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
+ SGP_THROW_IFFALSE(ReadInEncyclopediaLocation(fileName,TRUE,gBriefingRoomData, 4), fileName);
+ }
+#endif
+
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
g_luaUnderground.LoadScript(GetLanguagePrefix());
// load Lua for Strategic Mines initialization
@@ -830,6 +1084,10 @@ UINT32 InitializeJA2(void)
HandleJA2CDCheck( );
gfWorldLoaded = FALSE;
+
+#ifdef JA2UB
+ useOldJA2Inventory = FALSE;
+#endif
//Load external game mechanic data
//if ( !LoadExternalGameplayData(TABLEDATA_DIRECTORY))
@@ -961,8 +1219,40 @@ UINT32 InitializeJA2(void)
}
#endif
+#ifdef JA2UB
+ // run old UB inventory Data-UB\Addons\Data-Old-UB-Inventory
+ if( _stricmp( gzCommandLine, "-OLDUBINVENTORY" ) )
+ {
+ useOldJA2Inventory = TRUE;
+ }
+
+ // Ignore the old UB Inventory, because it is not working
+ useOldJA2Inventory = FALSE;
+
+#endif
+
#ifdef JA2BETAVERSION
#ifdef JA2EDITOR
+ #ifdef JA2UB
+ // CHECK COMMANDLINE FOR SPECIAL UTILITY
+ if( !strcmp( gzCommandLine, "-OLDUBINVENTORYEDITORAUTO" ) )
+ {
+ OutputDebugString( "Beginning JA2 using -EDITORAUTO commandline argument...\n" );
+ //For editor purposes, need to know the default map file.
+ sprintf( gubFilename, "none");
+ //also set the sector
+ gWorldSectorX = 0;
+ gWorldSectorY = 0;
+ gfAutoLoadA9 = FALSE;
+ gfIntendOnEnteringEditor = TRUE;
+ gGameOptions.fGunNut = TRUE;
+ gGameOptions.fAirStrikes = FALSE;
+
+ useOldJA2Inventory = TRUE;
+ return( GAME_SCREEN );
+ }
+ #endif
+
// CHECK COMMANDLINE FOR SPECIAL UTILITY
if( !strcmp( gzCommandLine, "-EDITORAUTO" ) )
{
@@ -1012,6 +1302,17 @@ UINT32 InitializeJA2(void)
#endif
#endif
+#ifdef JA2UB
+ InitGridNoUB();
+#endif
+
+#ifdef JA2UB
+ if ( useOldJA2Inventory == TRUE )
+ Old_UB_Inventory ();
+ else
+ New_UB_Inventory ();
+#endif
+
//Lua
IniLuaGlobal();
diff --git a/Init.h b/Init.h
index d4053278..e3121a09 100644
--- a/Init.h
+++ b/Init.h
@@ -38,6 +38,7 @@ AP_MODIFIER_WALK,
AP_MODIFIER_SWAT,
AP_MODIFIER_CRAWL,
AP_MODIFIER_PACK,
+AP_MODIFIER_READY,
AP_CHANGE_FACING,
AP_CHANGE_TARGET,
AP_TOSS_ITEM,
@@ -134,6 +135,7 @@ BP_MOVEMENT_RUBBLE,
BP_MOVEMENT_SHORE,
BP_MOVEMENT_LAKE,
BP_MOVEMENT_OCEAN,
+BP_MOVEMENT_READY,
BP_CROUCH,
BP_PRONE,
BP_CLIMBROOF,
diff --git a/Intro.cpp b/Intro.cpp
index da095c97..11d33b37 100644
--- a/Intro.cpp
+++ b/Intro.cpp
@@ -38,13 +38,23 @@
#include
#include "Luaglobal.h"
+#ifdef JA2UB
+#include "strategicmap.h"
+#include "Map Screen Interface Map.h"
+#include "Map Screen Interface.h"
+#include "End Game.h"
+#include "Cinematics Bink.h"
+#endif
+
#include "LuaInitNPCs.h"
#include "XML.h"
BOOLEAN Style_JA = TRUE;
extern INT8 Test = 0;
+INTRO_NAMES_VALUES zVideoFile[255];
UINT32 iStringToUseLua = -1;
+
// BF
class VideoPlayer
{
@@ -241,6 +251,13 @@ enum EGameVideos
INTRO_SPLASH_SCREEN,
INTRO_SPLASH_TALONSOFT,
+#ifdef JA2UB
+
+ INTRO_HELI_CRASH_SCENE_1,
+ INTRO_END_SCENE_1,
+
+#endif
+
//there are no more videos shown for the endgame
INTRO_LAST_END_GAME,
@@ -317,6 +334,13 @@ UINT32 IntroScreenInit( void )
s_VFN[INTRO_SPLASH_SCREEN] = inireader.ReadString("INTRO_SPLASH","INTRO_SPLASH_SCREEN", no_defaults ? "" : "INTRO\\SplashScreen");
s_VFN[INTRO_SPLASH_TALONSOFT] = inireader.ReadString("INTRO_SPLASH","INTRO_SPLASH_TALONSOFT", no_defaults ? "" : "INTRO\\TalonSoftid_endhold");
+ //UB
+#ifdef JA2UB
+ s_VFN[INTRO_HELI_CRASH_SCENE_1] = inireader.ReadString("INTRO_BEGINNING","INTRO_HELI_CRASH_SCENE", no_defaults ? "" : "INTRO\\Intro");
+ s_VFN[INTRO_END_SCENE_1] = inireader.ReadString("INTRO_ENDING","INTRO_END_SCENE", no_defaults ? "" : "INTRO\\MissileEnding");
+#endif
+
+
//there are no more videos shown for the endgame
return( 1 );
diff --git a/Intro.h b/Intro.h
index 26afc036..27c51ca7 100644
--- a/Intro.h
+++ b/Intro.h
@@ -12,6 +12,9 @@ void StopIntroVideo();
//enums used for when the intro screen can come up, used with 'gbIntroScreenMode'
enum EIntroType
{
+#ifdef JA2UB
+ INTRO_HELI_CRASH,
+#endif
INTRO_BEGINNING, //set when viewing the intro at the begining of the game
INTRO_ENDING, //set when viewing the end game video.
@@ -28,4 +31,15 @@ extern UINT32 guiIntroExitScreen;
extern BOOLEAN gfIntroScreenExit;
extern INT8 gbIntroScreenMode;
+#define MAX_VIDEO_NAMES_CHARS 128
+
+typedef struct
+{
+ UINT16 uiIndex;
+ CHAR16 szFile[MAX_VIDEO_NAMES_CHARS];
+
+} INTRO_NAMES_VALUES;
+
+extern INTRO_NAMES_VALUES zVideoFile[255];
+
#endif
\ No newline at end of file
diff --git a/Ja25Update.cpp b/Ja25Update.cpp
new file mode 100644
index 00000000..94c676e2
--- /dev/null
+++ b/Ja25Update.cpp
@@ -0,0 +1,131 @@
+#ifdef PRECOMPILEDHEADERS
+#include "Tactical All.h"
+#else
+#include "builddefines.h"
+#include
+#include
+#include
+#include "wcheck.h"
+#include "Render Fun.h"
+#include "stdlib.h"
+#include "debug.h"
+#include "MemMan.h"
+#include "Overhead Types.h"
+//#include "Soldier Control.h"
+#include "Animation Cache.h"
+#include "Animation Data.h"
+#include "Animation Control.h"
+#include "container.h"
+#include
+#include "pathai.h"
+#include "Random.h"
+#include "worldman.h"
+#include "Isometric Utils.h"
+#include "Render Dirty.h"
+#include "renderworld.h"
+#include "sys globals.h"
+#include "video.h"
+#include "points.h"
+#include "Win util.h"
+#include "Sound Control.h"
+#include "weapons.h"
+#include "vobject_blitters.h"
+#include "Handle UI.h"
+#include "soldier ani.h"
+#include "Event pump.h"
+#include "opplist.h"
+#include "ai.h"
+#include "interface.h"
+#include "lighting.h"
+#include "faces.h"
+#include "Soldier Profile.h"
+#include "gap.h"
+#include "interface panels.h"
+#include "campaign.h"
+#include "soldier macros.h"
+#include "english.h"
+#include "Squads.h"
+
+#ifdef NETWORKED
+#include "Networking.h"
+#include "NetworkEvent.h"
+#endif
+#include "structure wrap.h"
+#include "items.h"
+#include "Soundman.h"
+#include "utilities.h"
+#include "Strategic.h"
+#include "soldier tile.h"
+#include "Smell.h"
+#include "Keys.h"
+#include "dialogue control.h"
+#include "soldier functions.h"
+#include "rt time defines.h"
+#include "Exit Grids.h"
+#include "gamescreen.h"
+#include "Quests.h"
+#include "message.h"
+#include "NPC.h"
+#include "SkillCheck.h"
+#include "handle doors.h"
+#include "interface dialogue.h"
+#include "smokeeffects.h"
+#include "GameSettings.h"
+#include "tile animation.h"
+#include "ShopKeeper Interface.h"
+#include "Arms Dealer Init.h"
+#include "vehicles.h"
+#include "rotting corpses.h"
+#include "Interface Control.h"
+#include "strategicmap.h"
+#include "morale.h"
+#include "meanwhile.h"
+#include "drugs and alcohol.h"
+#include "SkillCheck.h"
+#include "boxing.h"
+#include "overhead map.h"
+#include "Map Information.h"
+#include "environment.h"
+#include "Game Clock.h"
+#include "Explosion Control.h"
+#include "Buildings.h"
+#include "Text.h"
+#include "Strategic Merc Handler.h"
+#include "Campaign Types.h"
+#include "Strategic Status.h"
+#include "civ quotes.h"
+#include "Strategic Pathing.h"
+#include "Debug Control.h"
+#endif
+
+#ifdef JA2UB
+
+#include "Ja25_Tactical.h"
+#include "Ja25 Strategic Ai.h"
+
+INT16 JA2_5_START_SECTOR_X;
+INT16 JA2_5_START_SECTOR_Y;
+
+//** Defines *******************************************************************
+
+//Starting money
+#define JA2_5_STARTING_MONEY_EASY 40000
+#define JA2_5_STARTING_MONEY_MEDIUM 35000
+#define JA2_5_STARTING_MONEY_HARD 30000
+
+
+#define JA2SAVE_CONV_FILENAME "..\\SavedGames\\Ja2.dts"
+
+typedef struct
+{
+ INT8 bMercID;
+ INT8 bPercentStatIncrease;
+} STAT_CHANGE;
+
+#define NUM_MERCS_TO_USE_IN_PERCENT_STAT_INCREASE 6
+
+#define MAX_STAT_INCREASE 30
+
+#endif
+
+//******************************************************************************
\ No newline at end of file
diff --git a/Ja25Update.h b/Ja25Update.h
new file mode 100644
index 00000000..a2edef1c
--- /dev/null
+++ b/Ja25Update.h
@@ -0,0 +1,34 @@
+#ifndef JA25UPDATE__C_
+#define JA25UPDATE__C_
+
+#include "Types.h"
+
+#ifdef JA2UB
+
+//Used in the editor to compensate for the 2_