mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
MERGED source code from development trunk revision 4545 up to latest current revision 4882
Development Trunk: https://ja2svn.dyndns.org/source/ja2/branches/Wanne/JA2%201.13%20MP A detailed list of all the features (changes) is visible in the history log of the development trunk: INFO: The source code for the official 2011 release (4870) has been branched here: https://ja2svn.dyndns.org/source/ja2/branches/JA2_rev.4870_2011 This commit contains the following features: *** Externalized Vehicles *** o Now with this feature we can add/remove vehicles o New XML File: TableData\Vehicles.xml o Added a new function parameter to lua file Scripts\Overhead lua to set up the helicopter in method: SetUpHelicopterForPlayer() o Added example mini (Docs\Externalized Vehicles Example.zip) mod which adds 2 additional vehicles (hummer and ice-cream truck to sector A9) *** Up to 255 save slots *** - There is a "Next" and "Prev" button where you can scroll through the save slots - It is now possible to load the automatic save (SAVE_EVERY_N_HOURS) from the load screen. This is the first slot after the quickload slot - Added the 2 alternate players end turn saves (which can be enabled/disabled in option screen) to the save/load game form *** New Feature: Externalized emails from Emails.edt to XML*** o This feature can be enabled/disabled in the Source: --> See email.cpp: If "ReadXMLEmail" == FALSE, then normal way (read from Email.edt) otherwise read from XML files o 2 new XML files: TableData\Email\EmailMercAvailable.xml and EmailMercLevelUp.xml o Renamed SenderNamesList.xml to EmailSenderNamesList.xml and moved from TableData folder to TableData\Email folder o Names for mercenaries are get from the file MercProfiles.xml and different names get from the file EmailSenderNamesList.xml *** Externalized Hidden Towns (Tixa, Orta) *** o Now it is possible to add new hidden towns (locations) o See file: TableData/Map/Cities.xml o New variable in TableData/Map/Cities.xml - hiddenTown: 0 = show on strategy map, 1 = Hide on strategy map - townIcon: 1 = on, 0 = off (This is the icon you see on the strategy map) - szIconFile: The path to the sti icon file (eg: interface\prison.sti, interface\my_icon.sti) - iconPosition: The x,y position of the icon on the strategy map *** Encyclopedia and Briefing Room, reachable from the laptop *** o 2 new ja2_options.ini properties: BRIEFING_ROOM, ENCYCLOPEDIA o demonstration video: http://www.youtube.com/watch?v=7CIXdXWLrAo o Added Example usage of the Briefing Room - Extract it in your JA2 1.13 folder and use the latest development executable - The briefing room can be reached from the laptop. Enter SN5631 for the code and then click the "Exit" button - See "Info_BriefingRoom.txt" and "BriefingRoom_Mission1.png" *** Improved interrupt system (IIS) *** o This system changes the way interrupts work. See: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=290787#Post290787 o Option system (see ja2_options.ini: IMPROVED_INTERRUPT_SYSTEM) o A few more settings for the interrupt system in ja2_options.ini o INFO: Multiplayer games always use the "old" interrupt system, not matter what the user selects in the ja2_options.ini *** Walking and sidestepping with weapon raised *** o Enable/disable the walking/sidestepping with raised weapon in ja2_options.ini: ALLOW_WALKING_WITH_WEAPON_RAISED o You can set an AP/BP modifier when walking/sidestepping with weapon raised in APBPConstants.ini: AP_MODIFIER_WEAPON_READY o The following feature apply when you walk/sidestep with weapon raised: -> limited angle of view, but you can see more farther when the weapon has a scope -> better change for interrupts if you see an enemy -> less APs and BPs when shooting, because the weapon is already raised -> It should cost more APs when walking. Maybe you can export the additional AP and BP modifier to the APBPConstants.ini *** Increase squad size to 8 (800x600) and 8 and 10 (1024x768) *** o Squad sizes (dependend on the screen resolution) can be selected in the start new game screen o In a multiplayer game, the squad size will always be 6, because it does not work with more soldiers/squad *** Added UB-1.13 source code *** o Merged the UB-1.13 source code (Revision: 4721) from svn: http://subversion.assembla.com/svn/ub-source113 o If you want to build UB-EXE or UB-MapEditor, just enable the 2 defines (JA2UB and JA2UBMAPS) in "builddefines.h" o The UB-Verion reads from "ja2_UB.ini" instead of "ja2.ini" o There are 2 new XML files - Layout\LayoutMainMenu.xml - MapAction\ActionItems.xml o There are 2 new LUA-Script files - Scripts\ExplosionControl.lua - Scripts\InterfaceDialogue.lua *** Hide enemy health text / enemy hit count *** o ja2_options.ini: HIDE_ENEMY_HEALTH_TEXT, HIDE_ENEMY_HIT_COUNT o both new settings only have effect in a singleplayer game o see: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=128840&page=1 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4885 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -552,6 +552,10 @@
|
||||
RelativePath=".\Smoothing Utils.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_ActionItems.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
|
||||
@@ -551,6 +551,10 @@
|
||||
RelativePath="Smoothing Utils.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_ActionItems.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
<ClCompile Include="SmartMethod.cpp" />
|
||||
<ClCompile Include="smooth.cpp" />
|
||||
<ClCompile Include="Smoothing Utils.cpp" />
|
||||
<ClCompile Include="XML_ActionItems.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{23EA0500-038A-4EB8-B753-0C709B25470D}</ProjectGuid>
|
||||
|
||||
@@ -167,5 +167,8 @@
|
||||
<ClCompile Include="Smoothing Utils.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XML_ActionItems.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+135
-1
@@ -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 )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,"<ACTION_ITEM_LIST>\r\n");
|
||||
for(cnt = 0;cnt < 501;cnt++)
|
||||
{
|
||||
FilePrintf(hFile,"\t<ACTION_ITEM>\r\n");
|
||||
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt);
|
||||
FilePrintf(hFile,"\t\t<Name>Empty action</Name>\r\n");
|
||||
FilePrintf(hFile,"\t\t<ActionID>%d</ActionID>\r\n", ActionItemsValues[cnt].ActionID);
|
||||
FilePrintf(hFile,"\t\t<Blow_Up>%d</Blow_Up>\r\n", ActionItemsValues[cnt].BlowUp);
|
||||
FilePrintf(hFile,"\t</ACTION_ITEM>\r\n");
|
||||
}
|
||||
FilePrintf(hFile,"</ACTION_ITEM_LIST>\r\n");
|
||||
}
|
||||
FileClose( hFile );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
+2651
-6
File diff suppressed because it is too large
Load Diff
+172
-143
@@ -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 ##################
|
||||
|
||||
|
||||
@@ -1678,6 +1687,7 @@ void LoadGameExternalOptions()
|
||||
//gGameExternalOptions.fSaveGameSlot = iniReader.ReadBoolean("Extension","SAVE_GAMES_SLOT",FALSE);
|
||||
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
|
||||
// dnl ch51 081009 JA2 Debug Settings
|
||||
@@ -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);
|
||||
|
||||
@@ -1816,6 +1833,7 @@ void LoadSkillTraitsExternalSettings()
|
||||
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.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
|
||||
@@ -2323,9 +2348,9 @@ BOOLEAN GetCDLocation( )
|
||||
}
|
||||
|
||||
//Now create a new file
|
||||
WritePrivateProfileString( "Ja2 Settings", "CD", zCdLocation, GAME_INI_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';
|
||||
|
||||
+43
-2
@@ -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
|
||||
|
||||
+13
-4
@@ -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" };
|
||||
|
||||
|
||||
|
||||
+9
-3
@@ -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.
|
||||
|
||||
@@ -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,6 +709,7 @@ 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
|
||||
@@ -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
|
||||
@@ -831,6 +1085,10 @@ UINT32 InitializeJA2(void)
|
||||
|
||||
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();
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -38,13 +38,23 @@
|
||||
#include <vfs/Core/vfs.h>
|
||||
|
||||
#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 );
|
||||
|
||||
@@ -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
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <wchar.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#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 <math.h>
|
||||
#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
|
||||
|
||||
//******************************************************************************
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef JA25UPDATE__C_
|
||||
#define JA25UPDATE__C_
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
|
||||
//Used in the editor to compensate for the 2_<map name>
|
||||
#define JA25_EXP_MAP_NAME_PREFIX L""
|
||||
#define JA25_EXP_MAP_NAME_SIZE_OFFSET 0
|
||||
|
||||
|
||||
//The starting sector of the Expanion pack
|
||||
extern INT16 JA2_5_START_SECTOR_X;
|
||||
extern INT16 JA2_5_START_SECTOR_Y;
|
||||
//#define JA2_5_START_SECTOR_X 7
|
||||
//#define JA2_5_START_SECTOR_Y 8
|
||||
|
||||
#define JA25_PROF_DAT "BINARYDATA\\Ja25Prof.dat"
|
||||
|
||||
/*
|
||||
BOOLEAN ConvertJa2SaveToJa2_5();
|
||||
|
||||
BOOLEAN ImportOldProfilesAndProcessThem();
|
||||
|
||||
void GivePlayerStartingJa25Money();
|
||||
|
||||
UINT32 HandleDifficultyModifierForImportedGames();
|
||||
|
||||
BOOLEAN DoesJa25ImportSaveExistAndSeemValid();
|
||||
*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+106
-4
@@ -11,6 +11,10 @@
|
||||
#include "Multi Language Graphic Utils.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#define AIM_LINK_TITLE_FONT FONT14ARIAL
|
||||
#define AIM_LINK_TITLE_COLOR AIM_GREEN
|
||||
|
||||
@@ -42,7 +46,9 @@
|
||||
#define AIM_LINK_LINK_TEXT_3_Y AIM_LINK_INSURANCE_LINK_Y + 45
|
||||
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
INT16 LinkID = 3;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -68,28 +74,80 @@ BOOLEAN EnterAimLinks()
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
UINT16 usPosY;
|
||||
INT16 i;
|
||||
|
||||
InitAimDefaults();
|
||||
InitAimMenuBar();
|
||||
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkBobby == TRUE )
|
||||
{
|
||||
#endif
|
||||
// load the Bobby link graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
GetMLGFilename( VObjectDesc.ImageFile, MLG_BOBBYRAYLINK );
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiBobbyLink));
|
||||
#ifdef JA2UB
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
|
||||
{
|
||||
#endif
|
||||
// load the Funeral graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
GetMLGFilename( VObjectDesc.ImageFile, MLG_MORTUARYLINK );
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiFuneralLink));
|
||||
#ifdef JA2UB
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
{
|
||||
#endif
|
||||
// load the Insurance graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
GetMLGFilename( VObjectDesc.ImageFile, MLG_INSURANCELINK );
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiInsuranceLink));
|
||||
#ifdef JA2UB
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
usPosY = AIM_LINK_BOBBY_LINK_Y;
|
||||
if (gGameUBOptions.LaptopLinkBobby == TRUE )
|
||||
{
|
||||
MSYS_DefineRegion( &gSelectedLinkRegion[0], AIM_LINK_BOBBY_LINK_X, usPosY , AIM_LINK_BOBBY_LINK_X + AIM_LINK_LINK_WIDTH, (UINT16)(usPosY + AIM_LINK_LINK_HEIGHT), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectLinkRegionCallBack );
|
||||
MSYS_AddRegion(&gSelectedLinkRegion[0]);
|
||||
MSYS_SetRegionUserData( &gSelectedLinkRegion[0], 0, gubLinkPages[0]);
|
||||
//usPosY += AIM_LINK_LINK_OFFSET_Y;
|
||||
}
|
||||
|
||||
usPosY = AIM_LINK_FUNERAL_LINK_Y;
|
||||
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
|
||||
{
|
||||
MSYS_DefineRegion( &gSelectedLinkRegion[1], AIM_LINK_FUNERAL_LINK_X, usPosY , AIM_LINK_FUNERAL_LINK_X + AIM_LINK_LINK_WIDTH, (UINT16)(usPosY + AIM_LINK_LINK_HEIGHT), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectLinkRegionCallBack );
|
||||
MSYS_AddRegion(&gSelectedLinkRegion[1]);
|
||||
MSYS_SetRegionUserData( &gSelectedLinkRegion[1], 0, gubLinkPages[1]);
|
||||
//usPosY += AIM_LINK_LINK_OFFSET_Y;
|
||||
}
|
||||
|
||||
usPosY = AIM_LINK_INSURANCE_LINK_Y;
|
||||
if (gGameUBOptions.LaptopLinkInsurance== TRUE )
|
||||
{
|
||||
MSYS_DefineRegion( &gSelectedLinkRegion[2], AIM_LINK_INSURANCE_LINK_X, usPosY , AIM_LINK_INSURANCE_LINK_X + AIM_LINK_LINK_WIDTH, (UINT16)(usPosY + AIM_LINK_LINK_HEIGHT), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectLinkRegionCallBack );
|
||||
MSYS_AddRegion(&gSelectedLinkRegion[2]);
|
||||
MSYS_SetRegionUserData( &gSelectedLinkRegion[2], 0, gubLinkPages[2]);
|
||||
usPosY += AIM_LINK_LINK_OFFSET_Y;
|
||||
}
|
||||
|
||||
#else
|
||||
usPosY = AIM_LINK_BOBBY_LINK_Y;
|
||||
for(i=0; i<AIM_LINK_NUM_LINKS; i++)
|
||||
for(UINT8 i=0; i<AIM_LINK_NUM_LINKS; i++)
|
||||
{
|
||||
MSYS_DefineRegion( &gSelectedLinkRegion[i], AIM_LINK_BOBBY_LINK_X, usPosY , AIM_LINK_BOBBY_LINK_X + AIM_LINK_LINK_WIDTH, (UINT16)(usPosY + AIM_LINK_LINK_HEIGHT), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectLinkRegionCallBack );
|
||||
@@ -97,7 +155,7 @@ BOOLEAN EnterAimLinks()
|
||||
MSYS_SetRegionUserData( &gSelectedLinkRegion[i], 0, gubLinkPages[i]);
|
||||
usPosY += AIM_LINK_LINK_OFFSET_Y;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
RenderAimLinks();
|
||||
return(TRUE);
|
||||
@@ -109,12 +167,35 @@ void ExitAimLinks()
|
||||
|
||||
RemoveAimDefaults();
|
||||
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkBobby == TRUE )
|
||||
DeleteVideoObjectFromIndex(guiBobbyLink);
|
||||
|
||||
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
|
||||
DeleteVideoObjectFromIndex(guiFuneralLink);
|
||||
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
DeleteVideoObjectFromIndex(guiInsuranceLink);
|
||||
|
||||
if (gGameUBOptions.LaptopLinkBobby == TRUE )
|
||||
MSYS_RemoveRegion( &gSelectedLinkRegion[0]);
|
||||
|
||||
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
|
||||
MSYS_RemoveRegion( &gSelectedLinkRegion[1]);
|
||||
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
MSYS_RemoveRegion( &gSelectedLinkRegion[2]);
|
||||
|
||||
#else
|
||||
|
||||
DeleteVideoObjectFromIndex(guiBobbyLink);
|
||||
DeleteVideoObjectFromIndex(guiFuneralLink);
|
||||
DeleteVideoObjectFromIndex(guiInsuranceLink);
|
||||
|
||||
for(i=0; i<AIM_LINK_NUM_LINKS; i++)
|
||||
MSYS_RemoveRegion( &gSelectedLinkRegion[i]);
|
||||
#endif
|
||||
|
||||
|
||||
ExitAimMenuBar();
|
||||
|
||||
@@ -132,16 +213,37 @@ void RenderAimLinks()
|
||||
DrawAimDefaults();
|
||||
DisableAimButton();
|
||||
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkBobby == TRUE )
|
||||
{
|
||||
#endif
|
||||
GetVideoObject(&hPixHandle, guiBobbyLink);
|
||||
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, AIM_LINK_BOBBY_LINK_X, AIM_LINK_BOBBY_LINK_Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
#ifdef JA2UB
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
|
||||
{
|
||||
#endif
|
||||
GetVideoObject(&hPixHandle, guiFuneralLink);
|
||||
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, AIM_LINK_FUNERAL_LINK_X, AIM_LINK_FUNERAL_LINK_Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
// DrawTextToScreen(AimLinkText[AIM_LINK_FUNERAL], AIM_LINK_BOBBY_LINK_X, AIM_LINK_LINK_TEXT_2_Y, AIM_LINK_LINK_WIDTH, AIM_LINK_FONT, AIM_LINK_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
#ifdef JA2UB
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
{
|
||||
#endif
|
||||
GetVideoObject(&hPixHandle, guiInsuranceLink);
|
||||
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, AIM_LINK_INSURANCE_LINK_X, AIM_LINK_INSURANCE_LINK_Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
// DrawTextToScreen(AimLinkText[AIM_LINK_LISTENING], AIM_LINK_BOBBY_LINK_X, AIM_LINK_LINK_TEXT_3_Y, AIM_LINK_LINK_WIDTH, AIM_LINK_FONT, AIM_LINK_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
#ifdef JA2UB
|
||||
}
|
||||
#endif
|
||||
|
||||
//Draw Link Title
|
||||
DrawTextToScreen(AimLinkText[AIM_LINK_TITLE], AIM_LINK_TITLE_X, AIM_LINK_TITLE_Y, AIM_LINK_TITLE_WIDTH, AIM_LINK_TITLE_FONT, AIM_LINK_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
|
||||
@@ -722,6 +722,7 @@ UINT8 GetStatColor( INT8 bStat );
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
BOOLEAN QuickHireMerc();
|
||||
void TempHandleAimMemberKeyBoardInput();
|
||||
extern void SetFlagToForceHireMerc( BOOLEAN fForceHire );
|
||||
#endif
|
||||
|
||||
@@ -5060,13 +5061,13 @@ void HandleAimMemberKeyBoardInput()
|
||||
// contact only if merc alive
|
||||
if( !IsMercDead( gbCurrentSoldier ) )
|
||||
{
|
||||
if( !gubVideoConferencingMode)
|
||||
{
|
||||
gubVideoConferencingMode = AIM_VIDEO_POPUP_MODE;
|
||||
//gubVideoConferencingMode = AIM_VIDEO_INIT_MODE;
|
||||
gfFirstTimeInContactScreen = TRUE;
|
||||
}
|
||||
InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0);
|
||||
if( !gubVideoConferencingMode)
|
||||
{
|
||||
gubVideoConferencingMode = AIM_VIDEO_POPUP_MODE;
|
||||
//gubVideoConferencingMode = AIM_VIDEO_INIT_MODE;
|
||||
gfFirstTimeInContactScreen = TRUE;
|
||||
}
|
||||
InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
#ifdef JA2TESTVERSION
|
||||
|
||||
@@ -0,0 +1,596 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Laptop All.h"
|
||||
#else
|
||||
#include "Laptop All.h"
|
||||
#include "Utilities.h"
|
||||
#include "WCheck.h"
|
||||
#include "timer control.h"
|
||||
#include "Debug.h"
|
||||
#include "WordWrap.h"
|
||||
#include "Encrypted File.h"
|
||||
#include "email.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Text.h"
|
||||
#include "LaptopSave.h"
|
||||
#include "Multi Language Graphic Utils.h"
|
||||
#include "soldier profile type.h"
|
||||
#endif
|
||||
|
||||
#include "Encyclopedia_Data.h"
|
||||
#include "Encyclopedia.h"
|
||||
#include "BriefingRoom.h"
|
||||
|
||||
// Link Images
|
||||
#define BRIEFINGROOM_BUTTON_SIZE_X 205
|
||||
#define BRIEFINGROOM_BUTTON_SIZE_Y 19
|
||||
|
||||
#define BRIEFINGROOM_COPYRIGHT_X iScreenWidthOffset + 160
|
||||
#define BRIEFINGROOM_COPYRIGHT_Y iScreenHeightOffset + 415 // + LAPTOP_SCREEN_WEB_DELTA_Y
|
||||
#define BRIEFINGROOM_COPYRIGHT_WIDTH 400
|
||||
#define BRIEFINGROOM_COPYRIGHT_GAP 9
|
||||
|
||||
#define IMAGE_OFFSET_X LAPTOP_SCREEN_UL_X
|
||||
#define IMAGE_OFFSET_Y LAPTOP_SCREEN_WEB_UL_Y
|
||||
|
||||
|
||||
//262, 28
|
||||
|
||||
// RustBackGround
|
||||
#define RUSTBACKGROUND_SIZE_X 125
|
||||
#define RUSTBACKGROUND_SIZE_Y 100
|
||||
|
||||
#define RUSTBACKGROUND_1_X IMAGE_OFFSET_X
|
||||
#define RUSTBACKGROUND_1_Y IMAGE_OFFSET_Y
|
||||
|
||||
#define BRIEFINGROOM_FONT12ARIAL FONT12ARIAL
|
||||
#define BRIEFINGROOM_FONT_MCOLOR_WHITE FONT_MCOLOR_WHITE
|
||||
|
||||
#define BRIEFINGROOM_BUTTONS_DEF 1
|
||||
#define BRIEFINGROOM_SUBTITLE_Y iScreenHeightOffset + 150 + LAPTOP_SCREEN_WEB_DELTA_Y
|
||||
#define BRIEFINGROOM_CONTENTBUTTON_X iScreenWidthOffset + 259
|
||||
#define BRIEFINGROOM_CONTENTBUTTON_Y BRIEFINGROOM_SUBTITLE_Y
|
||||
#define BRIEFINGROOM_TOC_X BRIEFINGROOM_CONTENTBUTTON_X
|
||||
#define BRIEFINGROOM_TOC_Y 5
|
||||
#define BRIEFINGROOM_TOC_GAP_Y 25
|
||||
|
||||
UINT32 guiRustBriefingRoomBackGround;
|
||||
UINT32 guiRustBriefingRoomLogoAim;
|
||||
|
||||
MOUSE_REGION gSelectedBriefingRoomTocMenuRegion[ 6 ];
|
||||
UINT32 guiContentButtonBriefingRoom;
|
||||
|
||||
UINT32 guiBRIEFINGROOMACTIVATIONINDENT;
|
||||
|
||||
void SelectBriefingRoomLocationButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void SelectBriefingRoomCharacterButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void SelectBriefingRoomQuestsButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void SelectBriefingRoomInentoryButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
void LaptopInitBriefingRoom();
|
||||
|
||||
BOOLEAN fFirstTimeInBriefingRoom = TRUE;
|
||||
|
||||
BOOLEAN DrawBriefingRoomLogoAim();
|
||||
|
||||
//------------
|
||||
void DisplayPlayerActivationBriefingRoomString( void );
|
||||
void ProcessPlayerInputActivationBriefingRoomString( void );
|
||||
void GetPlayerKeyBoardInputForBriefingRoomHomePage( void );
|
||||
void HandleBriefingRoomTextEvent( UINT32 uiKey );
|
||||
void DisplayActivationBriefingRoomStringCursor( void );
|
||||
|
||||
INT32 BriefingRoomGlowColorsList[][3] ={
|
||||
{ 0,0,0 },
|
||||
{ 0,25,0 },
|
||||
{ 0,50,0 },
|
||||
{ 0,75,0 },
|
||||
{ 0,100,0 },
|
||||
{ 0,125,0 },
|
||||
{ 0,150,0 },
|
||||
{ 0,175,0 },
|
||||
{ 0,200,0 },
|
||||
{ 0,225,0 },
|
||||
{ 0,255,0 },
|
||||
};
|
||||
|
||||
// btn callbacks
|
||||
void BtnBriefingRoomAboutUsCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
|
||||
void ResetActivationBriefingRoomStringTextBox(void);
|
||||
|
||||
// position defines
|
||||
#define IMP_PLAYER_ACTIVATION_STRING_X LAPTOP_SCREEN_UL_X + 203//261
|
||||
#define IMP_PLAYER_ACTIVATION_STRING_Y LAPTOP_SCREEN_WEB_UL_Y + 266 //336
|
||||
#define CURSOR_Y IMP_PLAYER_ACTIVATION_STRING_Y - 5
|
||||
#define CURSOR_HEIGHT GetFontHeight( FONT14ARIAL ) + 6
|
||||
|
||||
|
||||
// the player activation string
|
||||
CHAR16 pPlayerBriefingRoomActivationString[32];
|
||||
|
||||
// position within player activation string
|
||||
INT32 iStringBriefingRoomPos = 0;
|
||||
UINT16 uiCursorBriefingRoomPosition = IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
|
||||
|
||||
// has a new char been added or deleted?
|
||||
BOOLEAN fNewCharInActivationBriefingRoomString = FALSE;
|
||||
//------------
|
||||
|
||||
void GameInitBriefingRoom()
|
||||
{
|
||||
LaptopInitBriefingRoom();
|
||||
}
|
||||
|
||||
BOOLEAN EnterBriefingRoom()
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
//-----------------------------------------
|
||||
// upon entry to Imp home page
|
||||
memset(pPlayerBriefingRoomActivationString, 0, sizeof(pPlayerBriefingRoomActivationString));
|
||||
|
||||
// reset string position
|
||||
iStringBriefingRoomPos =0;
|
||||
|
||||
// reset activation cursor position
|
||||
uiCursorBriefingRoomPosition = IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
|
||||
// we have now vsisited IMP, reset fact we haven't
|
||||
fNotVistedImpYet = FALSE;
|
||||
//------------------------
|
||||
|
||||
LaptopInitBriefingRoom();
|
||||
|
||||
InitBriefingRoomDefaults();
|
||||
|
||||
// load the Rust bacground graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
|
||||
FilenameForBPP("BriefingRoom\\aimlogo_big.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomLogoAim));
|
||||
/*
|
||||
// load the MemberShipcard graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("BriefingRoom\\CONTENTBUTTON.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiContentButtonBriefingRoom));
|
||||
*/
|
||||
// this procedure will load the activation indent into memory
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("LAPTOP\\ActivationIndent.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiBRIEFINGROOMACTIVATIONINDENT));
|
||||
|
||||
//** Mouse Regions **
|
||||
/*
|
||||
usPosY = BRIEFINGROOM_CONTENTBUTTON_Y + 120;
|
||||
for(i=0; i<BRIEFINGROOM_BUTTONS_DEF; i++)
|
||||
{
|
||||
if ( i == 0 )
|
||||
MSYS_DefineRegion( &gSelectedBriefingRoomTocMenuRegion[i], BRIEFINGROOM_TOC_X, usPosY, (UINT16)(BRIEFINGROOM_TOC_X + BRIEFINGROOM_BUTTON_SIZE_X), (UINT16)(usPosY + BRIEFINGROOM_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectBriefingRoomLocationButton);
|
||||
|
||||
MSYS_AddRegion(&gSelectedBriefingRoomTocMenuRegion[i]);
|
||||
|
||||
usPosY += BRIEFINGROOM_TOC_GAP_Y;
|
||||
}
|
||||
*/
|
||||
fFirstTimeInBriefingRoom = FALSE;
|
||||
|
||||
RenderBriefingRoom();
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
void LaptopInitBriefingRoom()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ExitBriefingRoom()
|
||||
{
|
||||
RemoveBriefingRoomDefaults();
|
||||
|
||||
//DeleteVideoObjectFromIndex(guiContentButtonBriefingRoom);
|
||||
DeleteVideoObjectFromIndex(guiRustBriefingRoomLogoAim);
|
||||
|
||||
// remove activation indent symbol
|
||||
DeleteVideoObjectFromIndex( guiBRIEFINGROOMACTIVATIONINDENT );
|
||||
}
|
||||
|
||||
void HandleBriefingRoom()
|
||||
{
|
||||
// handle keyboard input for this screen
|
||||
GetPlayerKeyBoardInputForBriefingRoomHomePage( );
|
||||
|
||||
// has a new char been added to activation string
|
||||
if( fNewCharInActivationBriefingRoomString )
|
||||
{
|
||||
// display string
|
||||
DisplayPlayerActivationBriefingRoomString( );
|
||||
}
|
||||
|
||||
// render the cursor
|
||||
DisplayActivationBriefingRoomStringCursor( );
|
||||
}
|
||||
|
||||
void RenderBriefingRoom()
|
||||
{
|
||||
UINT16 usWidth=0;
|
||||
|
||||
HVOBJECT hHandle;
|
||||
|
||||
DrawBriefingRoomDefaults();
|
||||
|
||||
DrawBriefingRoomLogoAim();
|
||||
|
||||
// get the video object
|
||||
GetVideoObject(&hHandle, guiBRIEFINGROOMACTIVATIONINDENT);
|
||||
// blt to sX, sY relative to upper left corner
|
||||
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + 200, LAPTOP_SCREEN_WEB_UL_Y + 260 , VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
DisplayBriefingRoomSlogan();
|
||||
|
||||
DisplayBriefingRoomCopyright();
|
||||
|
||||
RenderWWWProgramTitleBar( );
|
||||
|
||||
// render the activation string
|
||||
//-------------
|
||||
DisplayPlayerActivationBriefingRoomString( );
|
||||
//-------------
|
||||
|
||||
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
|
||||
}
|
||||
|
||||
void SelectBriefingRoomLocationButton(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
|
||||
}
|
||||
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
{
|
||||
bEncyclopediaLocation = FALSE;
|
||||
bEncyclopediaCharacter = FALSE;
|
||||
bEncyclopediaInventory = FALSE;
|
||||
bEncyclopediaQuests = FALSE;
|
||||
bBriefingRoom = TRUE;
|
||||
if(!fFirstTimeInBriefingRoom) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM;
|
||||
}
|
||||
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN InitBriefingRoomDefaults()
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
// load the Rust bacground graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
|
||||
FilenameForBPP("BriefingRoom\\background.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomBackGround));
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN RemoveBriefingRoomDefaults()
|
||||
{
|
||||
DeleteVideoObjectFromIndex(guiRustBriefingRoomBackGround);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DrawBriefingRoomLogoAim()
|
||||
{
|
||||
HVOBJECT hLogoEncyklopedia;
|
||||
|
||||
GetVideoObject(&hLogoEncyklopedia, guiRustBriefingRoomLogoAim);
|
||||
BltVideoObject(FRAME_BUFFER, hLogoEncyklopedia, 0,BRIEFINGROOM_TOC_X, RUSTBACKGROUND_1_Y + 40, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DrawBriefingRoomDefaults()
|
||||
{
|
||||
HVOBJECT hRustBackGroundHandle;
|
||||
|
||||
// Blt the rust background
|
||||
GetVideoObject(&hRustBackGroundHandle, guiRustBriefingRoomBackGround);
|
||||
BltVideoObject(FRAME_BUFFER, hRustBackGroundHandle, 0,RUSTBACKGROUND_1_X, RUSTBACKGROUND_1_Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DisplayBriefingRoomSlogan()
|
||||
{
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DisplayBriefingRoomCopyright()
|
||||
{
|
||||
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
||||
void DisplayPlayerActivationBriefingRoomString( void )
|
||||
{
|
||||
|
||||
HVOBJECT hHandle;
|
||||
|
||||
// this function will grab the string that the player will enter for activation
|
||||
|
||||
// player gone too far, move back
|
||||
if(iStringBriefingRoomPos > 64)
|
||||
{
|
||||
iStringBriefingRoomPos = 64;
|
||||
}
|
||||
|
||||
// restore background
|
||||
//RenderActivationIndent( 257, 328 );
|
||||
// get the video object
|
||||
GetVideoObject(&hHandle, guiBRIEFINGROOMACTIVATIONINDENT);
|
||||
|
||||
// blt to sX, sY relative to upper left corner
|
||||
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + 200, LAPTOP_SCREEN_WEB_UL_Y + 260 , VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
// setup the font stuff
|
||||
SetFont( FONT14ARIAL );
|
||||
SetFontForeground( 184 );
|
||||
SetFontBackground(FONT_BLACK);
|
||||
|
||||
|
||||
// reset shadow
|
||||
SetFontShadow(DEFAULT_SHADOW);
|
||||
mprintf(IMP_PLAYER_ACTIVATION_STRING_X, IMP_PLAYER_ACTIVATION_STRING_Y, pPlayerBriefingRoomActivationString);
|
||||
|
||||
|
||||
fNewCharInActivationBriefingRoomString = FALSE;
|
||||
fReDrawScreenFlag = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
void DisplayActivationBriefingRoomStringCursor( void )
|
||||
{
|
||||
// this procdure will draw the activation string cursor on the screen at position cursorx cursory
|
||||
UINT32 uiDestPitchBYTES;
|
||||
static UINT32 uiBaseTime = 0;
|
||||
UINT32 uiDeltaTime = 0;
|
||||
UINT8 *pDestBuf;
|
||||
static UINT32 iCurrentState = 0;
|
||||
static BOOLEAN fIncrement = TRUE;
|
||||
|
||||
if(uiBaseTime == 0)
|
||||
{
|
||||
uiBaseTime = GetJA2Clock();
|
||||
}
|
||||
|
||||
// get difference
|
||||
uiDeltaTime = GetJA2Clock() - uiBaseTime;
|
||||
|
||||
// if difference is long enough, rotate colors
|
||||
if(uiDeltaTime > MIN_GLOW_DELTA)
|
||||
{
|
||||
if( iCurrentState == 10)
|
||||
{
|
||||
// start rotating downward
|
||||
fIncrement = FALSE;
|
||||
}
|
||||
if( iCurrentState == 0)
|
||||
{
|
||||
// rotate colors upward
|
||||
fIncrement = TRUE;
|
||||
}
|
||||
// if increment upward, increment iCurrentState
|
||||
if(fIncrement)
|
||||
{
|
||||
iCurrentState++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// else downwards
|
||||
iCurrentState--;
|
||||
}
|
||||
// reset basetime to current clock
|
||||
uiBaseTime = GetJA2Clock( );
|
||||
}
|
||||
|
||||
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
|
||||
|
||||
// draw line in current state
|
||||
LineDraw(TRUE, (UINT16) uiCursorBriefingRoomPosition, CURSOR_Y, (UINT16)uiCursorBriefingRoomPosition, CURSOR_Y + CURSOR_HEIGHT, Get16BPPColor( FROMRGB( BriefingRoomGlowColorsList[ iCurrentState ][ 0 ], BriefingRoomGlowColorsList[ iCurrentState ][ 1 ], BriefingRoomGlowColorsList[ iCurrentState ][ 2 ] ) ),
|
||||
pDestBuf );
|
||||
|
||||
// unlock frame buffer
|
||||
UnLockVideoSurface( FRAME_BUFFER );
|
||||
|
||||
InvalidateRegion((UINT16) uiCursorBriefingRoomPosition , CURSOR_Y , (UINT16)uiCursorBriefingRoomPosition + 1, CURSOR_Y + CURSOR_HEIGHT + 1);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GetPlayerKeyBoardInputForBriefingRoomHomePage( void )
|
||||
{
|
||||
InputAtom InputEvent;
|
||||
POINT MousePos;
|
||||
|
||||
GetCursorPos(&MousePos);
|
||||
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
||||
|
||||
while (DequeueEvent(&InputEvent) == TRUE)
|
||||
{
|
||||
// HOOK INTO MOUSE HOOKS
|
||||
/*
|
||||
switch(InputEvent.usEvent)
|
||||
{
|
||||
case LEFT_BUTTON_DOWN:
|
||||
MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
|
||||
break;
|
||||
case LEFT_BUTTON_UP:
|
||||
MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
|
||||
break;
|
||||
case RIGHT_BUTTON_DOWN:
|
||||
MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
|
||||
break;
|
||||
case RIGHT_BUTTON_UP:
|
||||
MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) )
|
||||
{
|
||||
switch( InputEvent.usParam )
|
||||
{
|
||||
case (( ENTER ) ):
|
||||
if(( InputEvent.usEvent == KEY_UP ) )
|
||||
{
|
||||
// return hit, check to see if current player activation string is a valid one
|
||||
ProcessPlayerInputActivationBriefingRoomString( );
|
||||
|
||||
fNewCharInActivationBriefingRoomString = TRUE;
|
||||
}
|
||||
break;
|
||||
case (( ESC )):
|
||||
HandleLapTopESCKey(); // WANNE: Fix for proper closing of the IMP laptop page
|
||||
LeaveLapTopScreen( );
|
||||
break;
|
||||
default:
|
||||
if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT )
|
||||
{
|
||||
HandleBriefingRoomTextEvent( InputEvent.usParam );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void HandleBriefingRoomTextEvent( UINT32 uiKey )
|
||||
{
|
||||
// this function checks to see if a letter or a backspace was pressed, if so, either put char to screen
|
||||
// or delete it
|
||||
switch( uiKey )
|
||||
{
|
||||
case ( BACKSPACE ):
|
||||
|
||||
if( iStringBriefingRoomPos >= 0 )
|
||||
{
|
||||
|
||||
if( iStringBriefingRoomPos > 0 )
|
||||
{
|
||||
// decrement iStringBriefingRoomPosition
|
||||
iStringBriefingRoomPos-=1;
|
||||
}
|
||||
|
||||
// null out char
|
||||
pPlayerBriefingRoomActivationString[iStringBriefingRoomPos ] = 0;
|
||||
|
||||
// move back cursor
|
||||
uiCursorBriefingRoomPosition = StringPixLength( pPlayerBriefingRoomActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
|
||||
|
||||
|
||||
// string has been altered, redisplay
|
||||
fNewCharInActivationBriefingRoomString = TRUE;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
if( uiKey >= 'A' && uiKey <= 'Z' ||
|
||||
uiKey >= 'a' && uiKey <= 'z' ||
|
||||
uiKey >= '0' && uiKey <= '9' ||
|
||||
uiKey == '_' || uiKey == '.' || uiKey ==' ')
|
||||
{
|
||||
// if the current string position is at max or great, do nothing
|
||||
if( iStringBriefingRoomPos >= 8 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(iStringBriefingRoomPos < 0 )
|
||||
{
|
||||
iStringBriefingRoomPos = 0;
|
||||
}
|
||||
// valid char, capture and convert to CHAR16
|
||||
pPlayerBriefingRoomActivationString[iStringBriefingRoomPos] = ( CHAR16 )uiKey;
|
||||
|
||||
// null out next char position
|
||||
pPlayerBriefingRoomActivationString[iStringBriefingRoomPos + 1] = 0;
|
||||
|
||||
// move cursor position ahead
|
||||
uiCursorBriefingRoomPosition = StringPixLength( pPlayerBriefingRoomActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
|
||||
// increment string position
|
||||
iStringBriefingRoomPos +=1;
|
||||
|
||||
// string has been altered, redisplay
|
||||
fNewCharInActivationBriefingRoomString = TRUE;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void ProcessPlayerInputActivationBriefingRoomString( void )
|
||||
{
|
||||
// prcess string to see if it matches activation string
|
||||
char charPlayerActivationString[32];
|
||||
wcstombs(charPlayerActivationString,pPlayerBriefingRoomActivationString,32);
|
||||
|
||||
if( ( ( wcscmp(pPlayerBriefingRoomActivationString, L"SN5631") == 0 ) || ( wcscmp(pPlayerBriefingRoomActivationString, L"sn5631") == 0 ) ) ) //&&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
|
||||
{
|
||||
|
||||
//bEncyclopediaLocation = FALSE;
|
||||
//bEncyclopediaCharacter = FALSE;
|
||||
//bEncyclopediaInventory = FALSE;
|
||||
//bEncyclopediaQuests = FALSE;
|
||||
//bBriefingRoom = FALSE;
|
||||
//bBriefingRoomSpecialMission = TRUE;
|
||||
|
||||
ResetTemp();
|
||||
CopyToTemp (gBriefingRoomData, TRUE, 0 , -1, FALSE );
|
||||
|
||||
if(!fFirstTimeInBriefingRoom) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;
|
||||
|
||||
// DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_MAX_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void ResetActivationBriefingRoomStringTextBox(void)
|
||||
{
|
||||
// Reset activation text box
|
||||
for (int i = 0; i < iStringBriefingRoomPos; i++)
|
||||
{
|
||||
pPlayerBriefingRoomActivationString[i] = 0;
|
||||
}
|
||||
|
||||
iStringBriefingRoomPos = 0;
|
||||
|
||||
uiCursorBriefingRoomPosition = StringPixLength( pPlayerBriefingRoomActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
DisplayPlayerActivationBriefingRoomString();
|
||||
DisplayActivationBriefingRoomStringCursor();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef __BRIEFINGROOM_H
|
||||
#define __BRIEFINGROOM_H
|
||||
|
||||
#include "Cursors.h"
|
||||
#include "soldier profile type.h"
|
||||
|
||||
void GameInitBriefingRoom();
|
||||
BOOLEAN EnterBriefingRoom();
|
||||
void ExitBriefingRoom();
|
||||
void HandleBriefingRoom();
|
||||
void RenderBriefingRoom();
|
||||
|
||||
BOOLEAN RemoveBriefingRoomDefaults();
|
||||
BOOLEAN InitBriefingRoomDefaults();
|
||||
BOOLEAN DrawBriefingRoomDefaults();
|
||||
|
||||
BOOLEAN DisplayBriefingRoomSlogan();
|
||||
BOOLEAN DisplayBriefingRoomCopyright();
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,665 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Laptop All.h"
|
||||
#else
|
||||
#include "Laptop All.h"
|
||||
#include "Utilities.h"
|
||||
#include "WCheck.h"
|
||||
#include "timer control.h"
|
||||
#include "Debug.h"
|
||||
#include "WordWrap.h"
|
||||
#include "Encrypted File.h"
|
||||
#include "email.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Text.h"
|
||||
#include "LaptopSave.h"
|
||||
#include "Multi Language Graphic Utils.h"
|
||||
#include "soldier profile type.h"
|
||||
#endif
|
||||
|
||||
#include "Encyclopedia_Data.h"
|
||||
#include "Encyclopedia.h"
|
||||
#include "BriefingRoomM.h"
|
||||
|
||||
// Link Images
|
||||
#define BRIEFINGROOM_MISSION_BUTTON_SIZE_X 121
|
||||
#define BRIEFINGROOM_MISSION_BUTTON_SIZE_Y 42
|
||||
|
||||
#define BRIEFINGROOM_MISSION_COPYRIGHT_X iScreenWidthOffset + 160
|
||||
#define BRIEFINGROOM_MISSION_COPYRIGHT_Y iScreenHeightOffset + 415 // + LAPTOP_SCREEN_WEB_DELTA_Y
|
||||
#define BRIEFINGROOM_MISSION_COPYRIGHT_WIDTH 400
|
||||
#define BRIEFINGROOM_MISSION_COPYRIGHT_GAP 9
|
||||
|
||||
#define IMAGE_OFFSET_X LAPTOP_SCREEN_UL_X
|
||||
#define IMAGE_OFFSET_Y LAPTOP_SCREEN_WEB_UL_Y
|
||||
|
||||
|
||||
//262, 28
|
||||
|
||||
// RustBackGround
|
||||
#define RUSTBACKGROUND_SIZE_X 125
|
||||
#define RUSTBACKGROUND_SIZE_Y 100
|
||||
|
||||
#define RUSTBACKGROUND_1_X IMAGE_OFFSET_X
|
||||
#define RUSTBACKGROUND_1_Y IMAGE_OFFSET_Y
|
||||
|
||||
#define BRIEFINGROOM_MISSION_FONT12ARIAL FONT12ARIAL
|
||||
#define BRIEFINGROOM_MISSION_FONT_MCOLOR_WHITE FONT_MCOLOR_WHITE
|
||||
|
||||
#define BRIEFINGROOM_MISSION_BUTTONS_DEF 1
|
||||
#define BRIEFINGROOM_MISSION_SUBTITLE_Y iScreenHeightOffset + 150 + LAPTOP_SCREEN_WEB_DELTA_Y
|
||||
#define BRIEFINGROOM_MISSION_CONTENTBUTTON_X iScreenWidthOffset + 259
|
||||
#define BRIEFINGROOM_MISSION_CONTENTBUTTON_Y BRIEFINGROOM_MISSION_SUBTITLE_Y
|
||||
#define BRIEFINGROOM_MISSION_TOC_X BRIEFINGROOM_MISSION_CONTENTBUTTON_X
|
||||
#define BRIEFINGROOM_MISSION_TOC_Y 5
|
||||
#define BRIEFINGROOM_MISSION_TOC_GAP_Y 25
|
||||
|
||||
#define BRIEFINGROOM_MISSION_LOCATION_BOX_X LAPTOP_SCREEN_UL_X + (500-BRIEFINGROOM_MISSION_LOCATION_BOX_WIDTH)/2
|
||||
#define BRIEFINGROOM_MISSION_LOCATION_BOX_Y iScreenHeightOffset + 260 + LAPTOP_SCREEN_WEB_DELTA_Y
|
||||
#define EBRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP 4
|
||||
#define BRIEFINGROOM_MISSION_LOCATION_BOX_WIDTH 400//309
|
||||
#define BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP 4
|
||||
|
||||
#define BRIEFINGROOM_MISSION_BOX_FONT FONT10ARIAL
|
||||
#define BRIEFINGROOM_MISSION_BOX_COLOR FONT_MCOLOR_WHITE
|
||||
#define BRIEFINGROOM_MISSION_PAGE_FONT FONT10ARIAL
|
||||
#define BRIEFINGROOM_MISSION_BOX_X LAPTOP_SCREEN_UL_X + (500-BRIEFINGROOM_MISSION_BOX_WIDTH)/2
|
||||
#define BRIEFINGROOM_MISSION_BOX_Y iScreenHeightOffset + 260 + LAPTOP_SCREEN_WEB_DELTA_Y
|
||||
#define BRIEFINGROOM_MISSION_BOX_WIDTH 400
|
||||
#define BRIEFINGROOM_MISSION_BOX_TEXT_WIDTH 250
|
||||
#define BRIEFINGROOM_MISSION_BOX_DESC_X BRIEFINGROOM_MISSION_BOX_X + 8
|
||||
#define BRIEFINGROOM_MISSION_BOX_DESC_Y BRIEFINGROOM_MISSION_PANEL_Y + BRIEFINGROOM_MISSION_PANEL_HEIGHT + 5
|
||||
#define BRIEFINGROOM_MISSION_PANEL_HEIGHT 0
|
||||
#define BRIEFINGROOM_MISSION_PANEL_Y BRIEFINGROOM_MISSION_BOX_Y + 6
|
||||
|
||||
UINT32 guiRustBriefingRoomEnterBackGround;
|
||||
UINT32 guiRustBriefingRoomEnterLogoAim;
|
||||
|
||||
MOUSE_REGION gSelectedBriefingRoomEnterTocMenuRegion[ 6 ];
|
||||
UINT32 guiContentButtonBriefingRoomEnter;
|
||||
|
||||
UINT32 guiBRIEFINGROOM_MISSIONACTIVATIONINDENT;
|
||||
|
||||
void SelectBriefingRoomEnterLocationButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void SelectBriefingRoomEnterCharacterButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void SelectBriefingRoomEnterQuestsButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void SelectBriefingRoomEnterInentoryButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
void LaptopInitBriefingRoomEnter();
|
||||
|
||||
BOOLEAN fFirstTimeInBriefingRoomEnter = TRUE;
|
||||
|
||||
BOOLEAN DrawBriefingRoomEnterLogoAim();
|
||||
|
||||
//------------
|
||||
void DisplayPlayerActivationBriefingRoomEnterString( void );
|
||||
void ProcessPlayerInputActivationBriefingRoomEnterString( void );
|
||||
void GetPlayerKeyBoardInputForBriefingRoomEnterHomePage( void );
|
||||
void HandleBriefingRoomEnterTextEvent( UINT32 uiKey );
|
||||
void DisplayActivationBriefingRoomEnterStringCursor( void );
|
||||
|
||||
INT32 BriefingRoomEnterGlowColorsList[][3] ={
|
||||
{ 0,0,0 },
|
||||
{ 0,25,0 },
|
||||
{ 0,50,0 },
|
||||
{ 0,75,0 },
|
||||
{ 0,100,0 },
|
||||
{ 0,125,0 },
|
||||
{ 0,150,0 },
|
||||
{ 0,175,0 },
|
||||
{ 0,200,0 },
|
||||
{ 0,225,0 },
|
||||
{ 0,255,0 },
|
||||
};
|
||||
|
||||
// btn callbacks
|
||||
void BtnBriefingRoomEnterAboutUsCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
|
||||
void ResetActivationBriefingRoomEnterStringTextBox(void);
|
||||
|
||||
// position defines
|
||||
#define IMP_PLAYER_ACTIVATION_STRING_X LAPTOP_SCREEN_UL_X + 103//261
|
||||
#define IMP_PLAYER_ACTIVATION_STRING_Y LAPTOP_SCREEN_WEB_UL_Y + 246 //336
|
||||
#define CURSOR_Y IMP_PLAYER_ACTIVATION_STRING_Y - 5
|
||||
#define CURSOR_HEIGHT GetFontHeight( FONT14ARIAL ) + 6
|
||||
|
||||
|
||||
// the player activation string
|
||||
CHAR16 pPlayerBriefingRoomEnterActivationString[32];
|
||||
|
||||
// position within player activation string
|
||||
INT32 iStringBriefingRoomEnterPos = 0;
|
||||
UINT16 uiCursorBriefingRoomEnterPosition = IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
|
||||
|
||||
// has a new char been added or deleted?
|
||||
BOOLEAN fNewCharInActivationBriefingRoomEnterString = FALSE;
|
||||
//------------
|
||||
|
||||
void GameInitBriefingRoomEnter()
|
||||
{
|
||||
LaptopInitBriefingRoomEnter();
|
||||
}
|
||||
|
||||
BOOLEAN EnterBriefingRoomEnter()
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
UINT16 i, usPosY;
|
||||
|
||||
//-----------------------------------------
|
||||
// upon entry to Imp home page
|
||||
memset(pPlayerBriefingRoomEnterActivationString, 0, sizeof(pPlayerBriefingRoomEnterActivationString));
|
||||
|
||||
// reset string position
|
||||
iStringBriefingRoomEnterPos =0;
|
||||
|
||||
// reset activation cursor position
|
||||
uiCursorBriefingRoomEnterPosition = IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
|
||||
// we have now vsisited IMP, reset fact we haven't
|
||||
fNotVistedImpYet = FALSE;
|
||||
//------------------------
|
||||
|
||||
LaptopInitBriefingRoomEnter();
|
||||
|
||||
InitBriefingRoomEnterDefaults();
|
||||
|
||||
// load the Rust bacground graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
|
||||
FilenameForBPP("BriefingRoom\\aimlogo.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomEnterLogoAim));
|
||||
|
||||
// load the MemberShipcard graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("BriefingRoom\\BUTTONS.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiContentButtonBriefingRoomEnter));
|
||||
|
||||
// this procedure will load the activation indent into memory
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("LAPTOP\\ActivationIndent.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiBRIEFINGROOM_MISSIONACTIVATIONINDENT));
|
||||
|
||||
//** Mouse Regions **
|
||||
|
||||
usPosY = BRIEFINGROOM_MISSION_CONTENTBUTTON_Y + 120;
|
||||
for(i=0; i<BRIEFINGROOM_MISSION_BUTTONS_DEF; i++)
|
||||
{
|
||||
if ( i == 0 )
|
||||
MSYS_DefineRegion( &gSelectedBriefingRoomEnterTocMenuRegion[i], BRIEFINGROOM_MISSION_TOC_X+120, usPosY, (UINT16)(BRIEFINGROOM_MISSION_TOC_X+120 + BRIEFINGROOM_MISSION_BUTTON_SIZE_X), (UINT16)(usPosY + BRIEFINGROOM_MISSION_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectBriefingRoomEnterLocationButton);
|
||||
|
||||
MSYS_AddRegion(&gSelectedBriefingRoomEnterTocMenuRegion[i]);
|
||||
|
||||
usPosY += BRIEFINGROOM_MISSION_TOC_GAP_Y;
|
||||
}
|
||||
|
||||
fFirstTimeInBriefingRoomEnter = FALSE;
|
||||
|
||||
RenderBriefingRoomEnter();
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
void LaptopInitBriefingRoomEnter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ExitBriefingRoomEnter()
|
||||
{
|
||||
UINT16 i;
|
||||
|
||||
RemoveBriefingRoomEnterDefaults();
|
||||
|
||||
DeleteVideoObjectFromIndex(guiContentButtonBriefingRoomEnter);
|
||||
DeleteVideoObjectFromIndex(guiRustBriefingRoomEnterLogoAim);
|
||||
|
||||
|
||||
// Remove Mouse Regions
|
||||
for(i=0; i<BRIEFINGROOM_MISSION_BUTTONS_DEF; i++)
|
||||
MSYS_RemoveRegion( &gSelectedBriefingRoomEnterTocMenuRegion[i]);
|
||||
|
||||
// remove activation indent symbol
|
||||
DeleteVideoObjectFromIndex( guiBRIEFINGROOM_MISSIONACTIVATIONINDENT );
|
||||
|
||||
}
|
||||
|
||||
void HandleBriefingRoomEnter()
|
||||
{
|
||||
// handle keyboard input for this screen
|
||||
GetPlayerKeyBoardInputForBriefingRoomEnterHomePage( );
|
||||
|
||||
// has a new char been added to activation string
|
||||
if( fNewCharInActivationBriefingRoomEnterString )
|
||||
{
|
||||
// display string
|
||||
DisplayPlayerActivationBriefingRoomEnterString( );
|
||||
}
|
||||
|
||||
// render the cursor
|
||||
DisplayActivationBriefingRoomEnterStringCursor( );
|
||||
}
|
||||
|
||||
void RenderBriefingRoomEnter()
|
||||
{
|
||||
UINT16 i, idText, usPosY;
|
||||
UINT16 usHeight;
|
||||
HVOBJECT hContentButtonHandle;
|
||||
UINT16 usWidth=0;
|
||||
|
||||
HVOBJECT hHandle;
|
||||
|
||||
DrawBriefingRoomEnterDefaults();
|
||||
|
||||
DrawBriefingRoomEnterLogoAim();
|
||||
|
||||
ShadowVideoSurfaceRect( FRAME_BUFFER, BRIEFINGROOM_MISSION_LOCATION_BOX_X+BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP+150, BRIEFINGROOM_MISSION_LOCATION_BOX_Y + 13 + BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP - 227 , BRIEFINGROOM_MISSION_LOCATION_BOX_X + 400 + BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP, BRIEFINGROOM_MISSION_LOCATION_BOX_Y + BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP-42);
|
||||
|
||||
DisplayWrappedString(BRIEFINGROOM_MISSION_BOX_DESC_X + 150, BRIEFINGROOM_MISSION_BOX_DESC_Y - 210, BRIEFINGROOM_MISSION_BOX_TEXT_WIDTH, 6, BRIEFINGROOM_MISSION_BOX_FONT, BRIEFINGROOM_MISSION_BOX_COLOR, L"Test box!", FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||
|
||||
|
||||
|
||||
GetVideoObject(&hContentButtonHandle, guiContentButtonBriefingRoomEnter);
|
||||
|
||||
usHeight = GetFontHeight(BRIEFINGROOM_MISSION_FONT12ARIAL);
|
||||
usPosY = BRIEFINGROOM_MISSION_CONTENTBUTTON_Y + 120;
|
||||
for(i=0; i<BRIEFINGROOM_MISSION_BUTTONS_DEF; i++)
|
||||
{
|
||||
|
||||
idText = i + 16;
|
||||
BltVideoObject(FRAME_BUFFER, hContentButtonHandle, 0,BRIEFINGROOM_MISSION_TOC_X+120, usPosY, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
usWidth = StringPixLength(pMenuStrings[idText], BRIEFINGROOM_MISSION_FONT12ARIAL);
|
||||
DrawTextToScreen(pMenuStrings[idText], BRIEFINGROOM_MISSION_TOC_X+120, (UINT16)(usPosY + BRIEFINGROOM_MISSION_TOC_Y+10), BRIEFINGROOM_MISSION_BUTTON_SIZE_X, BRIEFINGROOM_MISSION_FONT12ARIAL, BRIEFINGROOM_MISSION_FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
|
||||
usPosY += BRIEFINGROOM_MISSION_TOC_GAP_Y;
|
||||
}
|
||||
|
||||
// get the video object
|
||||
GetVideoObject(&hHandle, guiBRIEFINGROOM_MISSIONACTIVATIONINDENT);
|
||||
// blt to sX, sY relative to upper left corner
|
||||
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + 100, LAPTOP_SCREEN_WEB_UL_Y + 240 , VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
DisplayBriefingRoomEnterSlogan();
|
||||
|
||||
DisplayBriefingRoomEnterCopyright();
|
||||
|
||||
RenderWWWProgramTitleBar( );
|
||||
|
||||
|
||||
// render the activation string
|
||||
//-------------
|
||||
DisplayPlayerActivationBriefingRoomEnterString( );
|
||||
//-------------
|
||||
|
||||
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
|
||||
}
|
||||
|
||||
void SelectBriefingRoomEnterLocationButton(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
|
||||
}
|
||||
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
{
|
||||
|
||||
if ( gBriefingRoomData[0].Hidden == TRUE )
|
||||
{
|
||||
bEncyclopediaLocation = FALSE;
|
||||
bEncyclopediaCharacter = FALSE;
|
||||
bEncyclopediaInventory = FALSE;
|
||||
bEncyclopediaQuests = FALSE;
|
||||
bBriefingRoomSpecialMission = FALSE;
|
||||
bBriefingRoom = TRUE;
|
||||
|
||||
ResetVal = FALSE;
|
||||
|
||||
IDPageEncyData = PAGEBRIEFINGROOM;
|
||||
|
||||
if(!fFirstTimeInBriefingRoomEnter) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM;
|
||||
}
|
||||
else
|
||||
{
|
||||
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, pSectorPageText[ 5 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
|
||||
}
|
||||
}
|
||||
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN InitBriefingRoomEnterDefaults()
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
// load the Rust bacground graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
|
||||
FilenameForBPP("BriefingRoom\\background.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomEnterBackGround));
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN RemoveBriefingRoomEnterDefaults()
|
||||
{
|
||||
DeleteVideoObjectFromIndex(guiRustBriefingRoomEnterBackGround);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DrawBriefingRoomEnterLogoAim()
|
||||
{
|
||||
HVOBJECT hLogoEncyklopedia;
|
||||
|
||||
GetVideoObject(&hLogoEncyklopedia, guiRustBriefingRoomEnterLogoAim);
|
||||
BltVideoObject(FRAME_BUFFER, hLogoEncyklopedia, 0,BRIEFINGROOM_MISSION_TOC_X-120, RUSTBACKGROUND_1_Y + 20, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DrawBriefingRoomEnterDefaults()
|
||||
{
|
||||
HVOBJECT hRustBackGroundHandle;
|
||||
|
||||
// Blt the rust background
|
||||
GetVideoObject(&hRustBackGroundHandle, guiRustBriefingRoomEnterBackGround);
|
||||
BltVideoObject(FRAME_BUFFER, hRustBackGroundHandle, 0,RUSTBACKGROUND_1_X, RUSTBACKGROUND_1_Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DisplayBriefingRoomEnterSlogan()
|
||||
{
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DisplayBriefingRoomEnterCopyright()
|
||||
{
|
||||
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
||||
void DisplayPlayerActivationBriefingRoomEnterString( void )
|
||||
{
|
||||
|
||||
HVOBJECT hHandle;
|
||||
|
||||
// this function will grab the string that the player will enter for activation
|
||||
|
||||
// player gone too far, move back
|
||||
if(iStringBriefingRoomEnterPos > 64)
|
||||
{
|
||||
iStringBriefingRoomEnterPos = 64;
|
||||
}
|
||||
|
||||
// restore background
|
||||
//RenderActivationIndent( 257, 328 );
|
||||
// get the video object
|
||||
GetVideoObject(&hHandle, guiBRIEFINGROOM_MISSIONACTIVATIONINDENT);
|
||||
|
||||
// blt to sX, sY relative to upper left corner
|
||||
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + 100, LAPTOP_SCREEN_WEB_UL_Y + 240 , VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
// setup the font stuff
|
||||
SetFont( FONT14ARIAL );
|
||||
SetFontForeground( 184 );
|
||||
SetFontBackground(FONT_BLACK);
|
||||
|
||||
|
||||
// reset shadow
|
||||
SetFontShadow(DEFAULT_SHADOW);
|
||||
mprintf(IMP_PLAYER_ACTIVATION_STRING_X, IMP_PLAYER_ACTIVATION_STRING_Y, pPlayerBriefingRoomEnterActivationString);
|
||||
|
||||
|
||||
fNewCharInActivationBriefingRoomEnterString = FALSE;
|
||||
fReDrawScreenFlag = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
void DisplayActivationBriefingRoomEnterStringCursor( void )
|
||||
{
|
||||
// this procdure will draw the activation string cursor on the screen at position cursorx cursory
|
||||
UINT32 uiDestPitchBYTES;
|
||||
static UINT32 uiBaseTime = 0;
|
||||
UINT32 uiDeltaTime = 0;
|
||||
UINT8 *pDestBuf;
|
||||
static UINT32 iCurrentState = 0;
|
||||
static BOOLEAN fIncrement = TRUE;
|
||||
|
||||
if(uiBaseTime == 0)
|
||||
{
|
||||
uiBaseTime = GetJA2Clock();
|
||||
}
|
||||
|
||||
// get difference
|
||||
uiDeltaTime = GetJA2Clock() - uiBaseTime;
|
||||
|
||||
// if difference is long enough, rotate colors
|
||||
if(uiDeltaTime > MIN_GLOW_DELTA)
|
||||
{
|
||||
if( iCurrentState == 10)
|
||||
{
|
||||
// start rotating downward
|
||||
fIncrement = FALSE;
|
||||
}
|
||||
if( iCurrentState == 0)
|
||||
{
|
||||
// rotate colors upward
|
||||
fIncrement = TRUE;
|
||||
}
|
||||
// if increment upward, increment iCurrentState
|
||||
if(fIncrement)
|
||||
{
|
||||
iCurrentState++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// else downwards
|
||||
iCurrentState--;
|
||||
}
|
||||
// reset basetime to current clock
|
||||
uiBaseTime = GetJA2Clock( );
|
||||
}
|
||||
|
||||
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
|
||||
|
||||
// draw line in current state
|
||||
LineDraw(TRUE, (UINT16) uiCursorBriefingRoomEnterPosition, CURSOR_Y, (UINT16)uiCursorBriefingRoomEnterPosition, CURSOR_Y + CURSOR_HEIGHT, Get16BPPColor( FROMRGB( BriefingRoomEnterGlowColorsList[ iCurrentState ][ 0 ], BriefingRoomEnterGlowColorsList[ iCurrentState ][ 1 ], BriefingRoomEnterGlowColorsList[ iCurrentState ][ 2 ] ) ),
|
||||
pDestBuf );
|
||||
|
||||
// unlock frame buffer
|
||||
UnLockVideoSurface( FRAME_BUFFER );
|
||||
|
||||
InvalidateRegion((UINT16) uiCursorBriefingRoomEnterPosition , CURSOR_Y , (UINT16)uiCursorBriefingRoomEnterPosition + 1, CURSOR_Y + CURSOR_HEIGHT + 1);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GetPlayerKeyBoardInputForBriefingRoomEnterHomePage( void )
|
||||
{
|
||||
InputAtom InputEvent;
|
||||
POINT MousePos;
|
||||
|
||||
GetCursorPos(&MousePos);
|
||||
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
||||
|
||||
while (DequeueEvent(&InputEvent) == TRUE)
|
||||
{
|
||||
// HOOK INTO MOUSE HOOKS
|
||||
/*
|
||||
switch(InputEvent.usEvent)
|
||||
{
|
||||
case LEFT_BUTTON_DOWN:
|
||||
MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
|
||||
break;
|
||||
case LEFT_BUTTON_UP:
|
||||
MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
|
||||
break;
|
||||
case RIGHT_BUTTON_DOWN:
|
||||
MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
|
||||
break;
|
||||
case RIGHT_BUTTON_UP:
|
||||
MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) )
|
||||
{
|
||||
switch( InputEvent.usParam )
|
||||
{
|
||||
case (( ENTER ) ):
|
||||
if(( InputEvent.usEvent == KEY_UP ) )
|
||||
{
|
||||
// return hit, check to see if current player activation string is a valid one
|
||||
ProcessPlayerInputActivationBriefingRoomEnterString( );
|
||||
|
||||
fNewCharInActivationBriefingRoomEnterString = TRUE;
|
||||
}
|
||||
break;
|
||||
case (( ESC )):
|
||||
HandleLapTopESCKey(); // WANNE: Fix for proper closing of the IMP laptop page
|
||||
LeaveLapTopScreen( );
|
||||
break;
|
||||
default:
|
||||
if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT )
|
||||
{
|
||||
HandleBriefingRoomEnterTextEvent( InputEvent.usParam );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void HandleBriefingRoomEnterTextEvent( UINT32 uiKey )
|
||||
{
|
||||
// this function checks to see if a letter or a backspace was pressed, if so, either put char to screen
|
||||
// or delete it
|
||||
switch( uiKey )
|
||||
{
|
||||
case ( BACKSPACE ):
|
||||
|
||||
if( iStringBriefingRoomEnterPos >= 0 )
|
||||
{
|
||||
|
||||
if( iStringBriefingRoomEnterPos > 0 )
|
||||
{
|
||||
// decrement iStringBriefingRoomEnterPosition
|
||||
iStringBriefingRoomEnterPos-=1;
|
||||
}
|
||||
|
||||
// null out char
|
||||
pPlayerBriefingRoomEnterActivationString[iStringBriefingRoomEnterPos ] = 0;
|
||||
|
||||
// move back cursor
|
||||
uiCursorBriefingRoomEnterPosition = StringPixLength( pPlayerBriefingRoomEnterActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
|
||||
|
||||
|
||||
// string has been altered, redisplay
|
||||
fNewCharInActivationBriefingRoomEnterString = TRUE;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
if( uiKey >= 'A' && uiKey <= 'Z' ||
|
||||
uiKey >= 'a' && uiKey <= 'z' ||
|
||||
uiKey >= '0' && uiKey <= '9' ||
|
||||
uiKey == '_' || uiKey == '.' || uiKey ==' ')
|
||||
{
|
||||
// if the current string position is at max or great, do nothing
|
||||
if( iStringBriefingRoomEnterPos >= 8 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(iStringBriefingRoomEnterPos < 0 )
|
||||
{
|
||||
iStringBriefingRoomEnterPos = 0;
|
||||
}
|
||||
// valid char, capture and convert to CHAR16
|
||||
pPlayerBriefingRoomEnterActivationString[iStringBriefingRoomEnterPos] = ( CHAR16 )uiKey;
|
||||
|
||||
// null out next char position
|
||||
pPlayerBriefingRoomEnterActivationString[iStringBriefingRoomEnterPos + 1] = 0;
|
||||
|
||||
// move cursor position ahead
|
||||
uiCursorBriefingRoomEnterPosition = StringPixLength( pPlayerBriefingRoomEnterActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
|
||||
// increment string position
|
||||
iStringBriefingRoomEnterPos +=1;
|
||||
|
||||
// string has been altered, redisplay
|
||||
fNewCharInActivationBriefingRoomEnterString = TRUE;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void ProcessPlayerInputActivationBriefingRoomEnterString( void )
|
||||
{
|
||||
// prcess string to see if it matches activation string
|
||||
char charPlayerActivationString[32];
|
||||
wcstombs(charPlayerActivationString,pPlayerBriefingRoomEnterActivationString,32);
|
||||
|
||||
if( ( ( wcscmp(pPlayerBriefingRoomEnterActivationString, L"SN5631") == 0 ) || ( wcscmp(pPlayerBriefingRoomEnterActivationString, L"sn5631") == 0 ) ) ) //&&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
|
||||
{
|
||||
|
||||
/*
|
||||
bEncyclopediaLocation = FALSE;
|
||||
bEncyclopediaCharacter = FALSE;
|
||||
bEncyclopediaInventory = FALSE;
|
||||
bEncyclopediaQuests = FALSE;
|
||||
bBriefingRoom = FALSE;
|
||||
bBriefingRoomSpecialMission = TRUE;
|
||||
|
||||
ResetVal = FALSE;
|
||||
|
||||
IDPageEncyData = PAGEBRIEFINGROOMSPECIALMISSION;
|
||||
|
||||
if(!fFirstTimeInBriefingRoomEnter) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void ResetActivationBriefingRoomEnterStringTextBox(void)
|
||||
{
|
||||
// Reset activation text box
|
||||
for (int i = 0; i < iStringBriefingRoomEnterPos; i++)
|
||||
{
|
||||
pPlayerBriefingRoomEnterActivationString[i] = 0;
|
||||
}
|
||||
|
||||
iStringBriefingRoomEnterPos = 0;
|
||||
|
||||
uiCursorBriefingRoomEnterPosition = StringPixLength( pPlayerBriefingRoomEnterActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
|
||||
DisplayPlayerActivationBriefingRoomEnterString();
|
||||
DisplayActivationBriefingRoomEnterStringCursor();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef __BRIEFINGROOMM_H
|
||||
#define __BRIEFINGROOMM_H
|
||||
|
||||
#include "Cursors.h"
|
||||
#include "soldier profile type.h"
|
||||
|
||||
void GameInitBriefingRoomEnter();
|
||||
BOOLEAN EnterBriefingRoomEnter();
|
||||
void ExitBriefingRoomEnter();
|
||||
void HandleBriefingRoomEnter();
|
||||
void RenderBriefingRoomEnter();
|
||||
|
||||
BOOLEAN RemoveBriefingRoomEnterDefaults();
|
||||
BOOLEAN InitBriefingRoomEnterDefaults();
|
||||
BOOLEAN DrawBriefingRoomEnterDefaults();
|
||||
|
||||
BOOLEAN DisplayBriefingRoomEnterSlogan();
|
||||
BOOLEAN DisplayBriefingRoomEnterCopyright();
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,390 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Laptop All.h"
|
||||
#else
|
||||
#include "Laptop All.h"
|
||||
#include "Utilities.h"
|
||||
#include "WCheck.h"
|
||||
#include "timer control.h"
|
||||
#include "Debug.h"
|
||||
#include "WordWrap.h"
|
||||
#include "Encrypted File.h"
|
||||
#include "email.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Text.h"
|
||||
#include "LaptopSave.h"
|
||||
#include "Multi Language Graphic Utils.h"
|
||||
#include "soldier profile type.h"
|
||||
#endif
|
||||
|
||||
#include "Encyclopedia_Data.h"
|
||||
#include "Encyclopedia.h"
|
||||
|
||||
// Link Images
|
||||
#define ENCYCLOPEDIA_BUTTON_SIZE_X 205
|
||||
#define ENCYCLOPEDIA_BUTTON_SIZE_Y 19
|
||||
|
||||
#define ENCYCLOPEDIA_COPYRIGHT_X iScreenWidthOffset + 160
|
||||
#define ENCYCLOPEDIA_COPYRIGHT_Y iScreenHeightOffset + 415 // + LAPTOP_SCREEN_WEB_DELTA_Y
|
||||
#define ENCYCLOPEDIA_COPYRIGHT_WIDTH 400
|
||||
#define ENCYCLOPEDIA_COPYRIGHT_GAP 9
|
||||
|
||||
#define IMAGE_OFFSET_X LAPTOP_SCREEN_UL_X
|
||||
#define IMAGE_OFFSET_Y LAPTOP_SCREEN_WEB_UL_Y
|
||||
|
||||
|
||||
//262, 28
|
||||
|
||||
// RustBackGround
|
||||
#define RUSTBACKGROUND_SIZE_X 125
|
||||
#define RUSTBACKGROUND_SIZE_Y 100
|
||||
|
||||
#define RUSTBACKGROUND_1_X IMAGE_OFFSET_X
|
||||
#define RUSTBACKGROUND_1_Y IMAGE_OFFSET_Y
|
||||
|
||||
#define ENCYCLOPEDIA_FONT12ARIAL FONT12ARIAL
|
||||
#define ENCYCLOPEDIA_FONT_MCOLOR_WHITE FONT_MCOLOR_WHITE
|
||||
|
||||
#define ENCYCLOPEDIA_BUTTONS_DEF 4
|
||||
#define ENCYCLOPEDIA_SUBTITLE_Y iScreenHeightOffset + 150 + LAPTOP_SCREEN_WEB_DELTA_Y
|
||||
#define ENCYCLOPEDIA_CONTENTBUTTON_X iScreenWidthOffset + 259
|
||||
#define ENCYCLOPEDIA_CONTENTBUTTON_Y ENCYCLOPEDIA_SUBTITLE_Y
|
||||
#define ENCYCLOPEDIA_TOC_X ENCYCLOPEDIA_CONTENTBUTTON_X
|
||||
#define ENCYCLOPEDIA_TOC_Y 5
|
||||
#define ENCYCLOPEDIA_TOC_GAP_Y 25
|
||||
|
||||
UINT32 guiRustEncyclopediaBackGround;
|
||||
UINT32 guiRustEncyclopediaLogoAim;
|
||||
|
||||
MOUSE_REGION gSelectedEncyclopediaTocMenuRegion[ 6 ];
|
||||
UINT32 guiContentButtonEncy;
|
||||
|
||||
void SelectEncyclopediaLocationButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void SelectEncyclopediaCharacterButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void SelectEncyclopediaQuestsButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void SelectEncyclopediaInentoryButton(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
void LaptopInitEncyclopedia();
|
||||
void InitEncyklopediaBool();
|
||||
|
||||
BOOLEAN fFirstTimeInEncyclopedia = TRUE;
|
||||
|
||||
BOOLEAN DrawEncyclopediaLogoAim();
|
||||
|
||||
ENCYCLOPEDIA_LOCATION gEncyclopediaLocationData[ NUM_SECTOR ];
|
||||
ENCYCLOPEDIA_LOCATION gEncyclopediaDataTemp[ NUM_MAX_TEMP ];
|
||||
ENCYCLOPEDIA_LOCATION gEncyclopediaProfilesData[ NUM_PROFILES ];
|
||||
ENCYCLOPEDIA_LOCATION gEncyclopediaInventoryData[ MAXITEMS ];
|
||||
ENCYCLOPEDIA_LOCATION gEncyclopediaOldProfilesData[ NUM_PROFILES ];
|
||||
ENCYCLOPEDIA_LOCATION gEncyclopediaQuestsData[ MAX_QUESTS ];
|
||||
ENCYCLOPEDIA_LOCATION gBriefingRoomData[ NUM_SECTOR ];
|
||||
ENCYCLOPEDIA_LOCATION gBriefingRoomSpecialMissionData[ NUM_SECTOR ];
|
||||
|
||||
BOOLEAN saveEncyclopediaLocationData[ NUM_SECTOR ];
|
||||
ENCYCLOPEDIA_PROF_SAVE saveEncyclopediaProfilesData[ NUM_PROFILES ];
|
||||
BOOLEAN saveEncyclopediaInventoryData[ MAXITEMS ];
|
||||
BOOLEAN saveEncyclopediaOldProfilesData[ NUM_PROFILES ];
|
||||
BOOLEAN saveEncyclopediaQuestsData[ MAX_QUESTS ];
|
||||
MISSION_SAVE saveBriefingRoomData[ NUM_SECTOR ];
|
||||
MISSION_SAVE saveBriefingRoomSpecialMissionData[ NUM_SECTOR ];
|
||||
|
||||
MISSION_SAVE saveMissionData[ NUM_SECTOR ];
|
||||
|
||||
void GameInitEncyclopedia()
|
||||
{
|
||||
LaptopInitEncyclopedia();
|
||||
}
|
||||
|
||||
BOOLEAN EnterEncyclopedia()
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
UINT16 i, usPosY;
|
||||
|
||||
LaptopInitEncyclopedia();
|
||||
|
||||
InitEncyclopediaDefaults();
|
||||
|
||||
// load the Rust bacground graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
|
||||
FilenameForBPP("ENCYCLOPEDIA\\encyclopedialogoaim.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiRustEncyclopediaLogoAim));
|
||||
|
||||
// load the MemberShipcard graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("Encyclopedia\\CONTENTBUTTON.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiContentButtonEncy));
|
||||
|
||||
//** Mouse Regions **
|
||||
|
||||
usPosY = ENCYCLOPEDIA_CONTENTBUTTON_Y + 120;
|
||||
for(i=0; i<ENCYCLOPEDIA_BUTTONS_DEF; i++)
|
||||
{
|
||||
if ( i == 0 )
|
||||
MSYS_DefineRegion( &gSelectedEncyclopediaTocMenuRegion[i], ENCYCLOPEDIA_TOC_X, usPosY, (UINT16)(ENCYCLOPEDIA_TOC_X + ENCYCLOPEDIA_BUTTON_SIZE_X), (UINT16)(usPosY + ENCYCLOPEDIA_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectEncyclopediaLocationButton);
|
||||
else if ( i == 1 )
|
||||
MSYS_DefineRegion( &gSelectedEncyclopediaTocMenuRegion[i], ENCYCLOPEDIA_TOC_X, usPosY, (UINT16)(ENCYCLOPEDIA_TOC_X + ENCYCLOPEDIA_BUTTON_SIZE_X), (UINT16)(usPosY + ENCYCLOPEDIA_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectEncyclopediaCharacterButton);
|
||||
else if ( i == 2 )
|
||||
MSYS_DefineRegion( &gSelectedEncyclopediaTocMenuRegion[i], ENCYCLOPEDIA_TOC_X, usPosY, (UINT16)(ENCYCLOPEDIA_TOC_X + ENCYCLOPEDIA_BUTTON_SIZE_X), (UINT16)(usPosY + ENCYCLOPEDIA_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectEncyclopediaInentoryButton);
|
||||
else if ( i == 3 )
|
||||
MSYS_DefineRegion( &gSelectedEncyclopediaTocMenuRegion[i], ENCYCLOPEDIA_TOC_X, usPosY, (UINT16)(ENCYCLOPEDIA_TOC_X + ENCYCLOPEDIA_BUTTON_SIZE_X), (UINT16)(usPosY + ENCYCLOPEDIA_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
|
||||
CURSOR_WWW, MSYS_NO_CALLBACK, SelectEncyclopediaQuestsButton);
|
||||
|
||||
MSYS_AddRegion(&gSelectedEncyclopediaTocMenuRegion[i]);
|
||||
|
||||
usPosY += ENCYCLOPEDIA_TOC_GAP_Y;
|
||||
}
|
||||
|
||||
fFirstTimeInEncyclopedia = FALSE;
|
||||
|
||||
RenderEncyclopedia();
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
void LaptopInitEncyclopedia()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void InitEncyklopediaBool()
|
||||
{
|
||||
bEncyclopediaLocation = FALSE;
|
||||
bEncyclopediaCharacter = FALSE;
|
||||
bEncyclopediaInventory = FALSE;
|
||||
bEncyclopediaQuests = FALSE;
|
||||
bBriefingRoom = FALSE;
|
||||
bBriefingRoomSpecialMission = FALSE;
|
||||
}
|
||||
|
||||
void ExitEncyclopedia()
|
||||
{
|
||||
UINT16 i;
|
||||
|
||||
//InitEncyklopediaBool();
|
||||
|
||||
RemoveEncyclopediaDefaults();
|
||||
|
||||
DeleteVideoObjectFromIndex(guiContentButtonEncy);
|
||||
DeleteVideoObjectFromIndex(guiRustEncyclopediaLogoAim);
|
||||
|
||||
// Remove Mouse Regions
|
||||
for(i=0; i<ENCYCLOPEDIA_BUTTONS_DEF; i++)
|
||||
MSYS_RemoveRegion( &gSelectedEncyclopediaTocMenuRegion[i]);
|
||||
|
||||
//guiCurrentLaptopMode = LAPTOP_MODE_NONE;
|
||||
}
|
||||
|
||||
void HandleEncyclopedia()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RenderEncyclopedia()
|
||||
{
|
||||
UINT16 i, usPosY;
|
||||
UINT16 usHeight;
|
||||
HVOBJECT hContentButtonHandle;
|
||||
UINT16 usWidth=0;
|
||||
|
||||
DrawEncyclopediaDefaults();
|
||||
|
||||
DrawEncyclopediaLogoAim();
|
||||
|
||||
GetVideoObject(&hContentButtonHandle, guiContentButtonEncy);
|
||||
|
||||
usHeight = GetFontHeight(ENCYCLOPEDIA_FONT12ARIAL);
|
||||
usPosY = ENCYCLOPEDIA_CONTENTBUTTON_Y + 120;
|
||||
for(i=0; i<ENCYCLOPEDIA_BUTTONS_DEF; i++)
|
||||
{
|
||||
BltVideoObject(FRAME_BUFFER, hContentButtonHandle, 0,ENCYCLOPEDIA_TOC_X, usPosY, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
usWidth = StringPixLength(pMenuStrings[i], ENCYCLOPEDIA_FONT12ARIAL);
|
||||
DrawTextToScreen(pMenuStrings[i], ENCYCLOPEDIA_TOC_X, (UINT16)(usPosY + ENCYCLOPEDIA_TOC_Y), ENCYCLOPEDIA_BUTTON_SIZE_X, ENCYCLOPEDIA_FONT12ARIAL, ENCYCLOPEDIA_FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
|
||||
usPosY += ENCYCLOPEDIA_TOC_GAP_Y;
|
||||
}
|
||||
|
||||
DisplayEncyclopediaSlogan();
|
||||
|
||||
DisplayEncyclopediaCopyright();
|
||||
|
||||
RenderWWWProgramTitleBar( );
|
||||
|
||||
//InitEncyklopediaBool();
|
||||
|
||||
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
|
||||
}
|
||||
|
||||
void SelectEncyclopediaLocationButton(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
|
||||
}
|
||||
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
{
|
||||
bEncyclopediaLocation = TRUE;
|
||||
bEncyclopediaCharacter = FALSE;
|
||||
bEncyclopediaInventory = FALSE;
|
||||
bEncyclopediaQuests = FALSE;
|
||||
bBriefingRoom = FALSE;
|
||||
bBriefingRoomSpecialMission = FALSE;
|
||||
|
||||
ResetVal = TRUE;
|
||||
|
||||
IDPageEncyData = PAGEENCYCLOPEDIALOCATION;
|
||||
|
||||
if(!fFirstTimeInEncyclopedia) guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA_LOCATION;
|
||||
}
|
||||
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void SelectEncyclopediaCharacterButton(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
|
||||
}
|
||||
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
{
|
||||
bEncyclopediaLocation = FALSE;
|
||||
bEncyclopediaCharacter = TRUE;
|
||||
bEncyclopediaInventory = FALSE;
|
||||
bEncyclopediaQuests = FALSE;
|
||||
bBriefingRoom = FALSE;
|
||||
bBriefingRoomSpecialMission = FALSE;
|
||||
|
||||
ResetVal = TRUE;
|
||||
|
||||
IDPageEncyData = PAGEENCYCLOPEDIACHARACTER;
|
||||
|
||||
if(!fFirstTimeInEncyclopedia) guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA_LOCATION;
|
||||
}
|
||||
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void SelectEncyclopediaQuestsButton(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
}
|
||||
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
{
|
||||
bEncyclopediaLocation = FALSE;
|
||||
bEncyclopediaCharacter = FALSE;
|
||||
bEncyclopediaInventory = FALSE;
|
||||
bEncyclopediaQuests = TRUE;
|
||||
bBriefingRoom = FALSE;
|
||||
bBriefingRoomSpecialMission = FALSE;
|
||||
|
||||
ResetVal = FALSE;
|
||||
|
||||
IDPageEncyData = PAGEENCYCLOPEDIAQUESTS;
|
||||
|
||||
if(!fFirstTimeInEncyclopedia) guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA_LOCATION;
|
||||
}
|
||||
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void SelectEncyclopediaInentoryButton(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||
{
|
||||
}
|
||||
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
{
|
||||
bEncyclopediaLocation = FALSE;
|
||||
bEncyclopediaCharacter = FALSE;
|
||||
bEncyclopediaInventory = TRUE;
|
||||
bEncyclopediaQuests = FALSE;
|
||||
bBriefingRoom = FALSE;
|
||||
bBriefingRoomSpecialMission = FALSE;
|
||||
|
||||
ResetVal = FALSE;
|
||||
|
||||
IDPageEncyData = PAGEENCYCLOPEDIAINVENTORY;
|
||||
|
||||
if(!fFirstTimeInEncyclopedia) guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA_LOCATION;
|
||||
}
|
||||
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN InitEncyclopediaDefaults()
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
// load the Rust bacground graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
|
||||
FilenameForBPP("ENCYCLOPEDIA\\encyclopediabackground.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiRustEncyclopediaBackGround));
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN RemoveEncyclopediaDefaults()
|
||||
{
|
||||
DeleteVideoObjectFromIndex(guiRustEncyclopediaBackGround);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN DrawEncyclopediaLogoAim()
|
||||
{
|
||||
HVOBJECT hLogoEncyklopedia;
|
||||
// UINT16 x,y, uiPosX, uiPosY;
|
||||
|
||||
GetVideoObject(&hLogoEncyklopedia, guiRustEncyclopediaLogoAim);
|
||||
BltVideoObject(FRAME_BUFFER, hLogoEncyklopedia, 0,ENCYCLOPEDIA_TOC_X, RUSTBACKGROUND_1_Y + 40, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DrawEncyclopediaDefaults()
|
||||
{
|
||||
HVOBJECT hRustBackGroundHandle;
|
||||
// UINT16 x,y, uiPosX, uiPosY;
|
||||
|
||||
// Blt the rust background
|
||||
GetVideoObject(&hRustBackGroundHandle, guiRustEncyclopediaBackGround);
|
||||
BltVideoObject(FRAME_BUFFER, hRustBackGroundHandle, 0,RUSTBACKGROUND_1_X, RUSTBACKGROUND_1_Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
/*
|
||||
uiPosY = RUSTBACKGROUND_1_Y;
|
||||
for(y=0; y<4; y++)
|
||||
{
|
||||
uiPosX = RUSTBACKGROUND_1_X;
|
||||
for(x=0; x<4; x++)
|
||||
{
|
||||
BltVideoObject(FRAME_BUFFER, hRustBackGroundHandle, 0,uiPosX, uiPosY, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
uiPosX += RUSTBACKGROUND_SIZE_X;
|
||||
}
|
||||
uiPosY += RUSTBACKGROUND_SIZE_Y;
|
||||
}
|
||||
*/
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DisplayEncyclopediaSlogan()
|
||||
{
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN DisplayEncyclopediaCopyright()
|
||||
{
|
||||
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
#ifndef __ENCYCLOPEDIA_H
|
||||
#define __ENCYCLOPEDIA_H
|
||||
|
||||
#include "Cursors.h"
|
||||
#include "soldier profile type.h"
|
||||
#include "Quests.h"
|
||||
enum
|
||||
{
|
||||
ENCYCLOPEDIA_SLOGAN,
|
||||
ENCYCLOPEDIA_WARNING_1,
|
||||
ENCYCLOPEDIA_WARNING_2,
|
||||
ENCYCLOPEDIA_COPYRIGHT_1,
|
||||
ENCYCLOPEDIA_COPYRIGHT_2,
|
||||
ENCYCLOPEDIA_COPYRIGHT_3
|
||||
};
|
||||
|
||||
void GameInitEncyclopedia();
|
||||
BOOLEAN EnterEncyclopedia();
|
||||
void ExitEncyclopedia();
|
||||
void HandleEncyclopedia();
|
||||
void RenderEncyclopedia();
|
||||
|
||||
BOOLEAN RemoveEncyclopediaDefaults();
|
||||
BOOLEAN InitEncyclopediaDefaults();
|
||||
BOOLEAN DrawEncyclopediaDefaults();
|
||||
|
||||
BOOLEAN DisplayEncyclopediaSlogan();
|
||||
BOOLEAN DisplayEncyclopediaCopyright();
|
||||
|
||||
#define ENCYCLOPEDIA_DECRIPTION_SIZE 1120
|
||||
#define ENCYCLOPEDIA_NAME_SIZE 160
|
||||
#define NUM_SECTOR 4*255
|
||||
#define MAX_ENCYCLOPEDIA_CHARS 500
|
||||
|
||||
#define NUM_MAX_TEMP 10000
|
||||
|
||||
#define TEXT_NUM_ENC TEXT_NUM_ENCYCLOPEDIA_HELP_TEXT
|
||||
|
||||
enum
|
||||
{
|
||||
//Locations
|
||||
NONE_NONE = 0,
|
||||
LOCATION_CITIES,
|
||||
LOCATION_SAM,
|
||||
LOCATION_OTHER,
|
||||
LOCATION_MINES,
|
||||
LOCATION_MILITARY,
|
||||
LOCATION_LABORATORY,
|
||||
LOCATION_FACTORY,
|
||||
LOCATION_HOSPITAL,
|
||||
LOCATION_PRISON,
|
||||
LOCATION_AIRPORT,
|
||||
|
||||
TEXT_NUM_ENCYCLOPEDIA_HELP_TEXT
|
||||
};
|
||||
|
||||
//Profiles
|
||||
enum
|
||||
{
|
||||
|
||||
PROFIL = 0,
|
||||
PROFIL_AIM,
|
||||
PROFIL_MERC,
|
||||
PROFIL_RPC,
|
||||
PROFIL_NPC,
|
||||
PROFIL_VEHICLES,
|
||||
PROFIL_IMP,
|
||||
};
|
||||
|
||||
//SubGroup
|
||||
enum
|
||||
{
|
||||
PROFIL_NONE = 0,
|
||||
PROFIL_EPC = 1,
|
||||
// PROFIL_TERRORIS,
|
||||
// PROFIL_DEIDRANNA_SOLDIER,
|
||||
// PROFIL_HICK,
|
||||
// PROFIL_KINGPIN,
|
||||
// PROFIL_KINGPIN,
|
||||
};
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
//Profiles/Locations
|
||||
UINT32 uiIndex;
|
||||
CHAR8 szFile[MAX_ENCYCLOPEDIA_CHARS];
|
||||
CHAR8 szFile2[MAX_ENCYCLOPEDIA_CHARS];
|
||||
CHAR8 szFile3[MAX_ENCYCLOPEDIA_CHARS];
|
||||
CHAR8 szFile4[MAX_ENCYCLOPEDIA_CHARS];
|
||||
|
||||
CHAR16 Name[ENCYCLOPEDIA_NAME_SIZE];
|
||||
|
||||
CHAR16 sDesc1[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc2[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc3[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc4[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc5[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc6[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc7[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc8[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc9[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc10[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc11[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc12[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc13[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc14[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc15[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc16[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc17[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc18[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc19[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
CHAR16 sDesc20[ENCYCLOPEDIA_DECRIPTION_SIZE];
|
||||
|
||||
BOOLEAN Hidden;
|
||||
|
||||
CHAR16 sImageDesc1[150];
|
||||
CHAR16 sImageDesc2[150];
|
||||
CHAR16 sImageDesc3[150];
|
||||
CHAR16 sImageDesc4[150];
|
||||
|
||||
|
||||
UINT32 sImagePositionX[4];
|
||||
UINT32 sImagePositionY[4];
|
||||
/*
|
||||
UINT32 sImagePosition1X;
|
||||
UINT32 sImagePosition1Y;
|
||||
UINT32 sImagePosition2X;
|
||||
UINT32 sImagePosition2Y;
|
||||
UINT32 sImagePosition3X;
|
||||
UINT32 sImagePosition3Y;
|
||||
UINT32 sImagePosition4X;
|
||||
UINT32 sImagePosition4Y;
|
||||
*/
|
||||
|
||||
UINT32 MaxPages;
|
||||
INT32 MaxImages;
|
||||
|
||||
//Only locations
|
||||
INT32 LocType;
|
||||
INT16 SectorX;
|
||||
INT16 SectorY;
|
||||
INT16 SectorZ;
|
||||
|
||||
//Only profiles
|
||||
INT32 IDProfile;
|
||||
INT32 subGroup1;
|
||||
INT32 subCivGroup;
|
||||
|
||||
INT32 InventoryClass;
|
||||
|
||||
BOOLEAN Filtr;
|
||||
|
||||
BOOLEAN enableDesc;
|
||||
|
||||
BOOLEAN bvisible;
|
||||
|
||||
CHAR16 sCode[150];
|
||||
|
||||
CHAR8 sSounds[MAX_ENCYCLOPEDIA_CHARS];
|
||||
|
||||
//Quests
|
||||
INT32 QuestID;
|
||||
INT32 pQuests;
|
||||
BOOLEAN SpecialQuestImage;
|
||||
CHAR8 BeforeImage[MAX_ENCYCLOPEDIA_CHARS];
|
||||
CHAR8 AfterImage[MAX_ENCYCLOPEDIA_CHARS];
|
||||
UINT32 ImagePositionQX[10];
|
||||
UINT32 ImagePositionQY[10];
|
||||
CHAR16 ImageDescBefore[150];
|
||||
CHAR16 ImageDescAfter[150];
|
||||
|
||||
INT32 NextMission;
|
||||
UINT32 MissionID;
|
||||
INT32 CheckMission;
|
||||
|
||||
//Inventory
|
||||
|
||||
} ENCYCLOPEDIA_LOCATION;
|
||||
|
||||
#define MAX_IMAGES 4
|
||||
#define MAX_PAGES 4
|
||||
|
||||
#define MISSIONNOSTARTED 0
|
||||
#define MISSIONSTART 1
|
||||
#define MISSIONEND 2
|
||||
|
||||
extern ENCYCLOPEDIA_LOCATION gEncyclopediaLocationData[ NUM_SECTOR ];
|
||||
extern ENCYCLOPEDIA_LOCATION gEncyclopediaProfilesData[ NUM_PROFILES ];
|
||||
extern ENCYCLOPEDIA_LOCATION gEncyclopediaDataTemp[ NUM_MAX_TEMP ];
|
||||
extern ENCYCLOPEDIA_LOCATION gEncyclopediaInventoryData[ MAXITEMS ];
|
||||
extern ENCYCLOPEDIA_LOCATION gEncyclopediaOldProfilesData[ NUM_PROFILES ];
|
||||
extern ENCYCLOPEDIA_LOCATION gEncyclopediaQuestsData[ MAX_QUESTS ];
|
||||
|
||||
extern ENCYCLOPEDIA_LOCATION gBriefingRoomData[ NUM_SECTOR ];
|
||||
extern ENCYCLOPEDIA_LOCATION gBriefingRoomSpecialMissionData[ NUM_SECTOR ];
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT32 uiIndex;
|
||||
BOOLEAN Hidden;
|
||||
BOOLEAN bvisible;
|
||||
} ENCYCLOPEDIA_PROF_SAVE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT32 uiIndex;
|
||||
BOOLEAN Hidden;
|
||||
INT32 CheckMission;
|
||||
} MISSION_SAVE;
|
||||
|
||||
//extern MISSION_SAVE saveMissionData[ NUM_SECTOR ];
|
||||
|
||||
extern BOOLEAN saveEncyclopediaLocationData[ NUM_SECTOR ];
|
||||
extern ENCYCLOPEDIA_PROF_SAVE saveEncyclopediaProfilesData[ NUM_PROFILES ];
|
||||
extern BOOLEAN saveEncyclopediaInventoryData[ MAXITEMS ];
|
||||
extern BOOLEAN saveEncyclopediaOldProfilesData[ NUM_PROFILES ];
|
||||
extern BOOLEAN saveEncyclopediaQuestsData[ MAX_QUESTS ];
|
||||
extern MISSION_SAVE saveBriefingRoomData[ NUM_SECTOR ];
|
||||
extern MISSION_SAVE saveBriefingRoomSpecialMissionData[ NUM_SECTOR ];
|
||||
|
||||
extern void InitEncyklopediaBool();
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
#ifndef __Encyclopedia_Data_H
|
||||
#define __Encyclopedia_Data_H
|
||||
|
||||
#include "Encyclopedia.h"
|
||||
#include "Encyclopedia_Data.h"
|
||||
|
||||
void GameInitEncyclopediaLocation();
|
||||
BOOLEAN EnterEncyclopediaLocation();
|
||||
void ExitEncyclopediaLocation();
|
||||
void HandleEncyclopediaLocation();
|
||||
void RenderEncyclopediaLocation(BOOLEAN bHidden);
|
||||
|
||||
extern BOOLEAN bEncyclopediaLocation;
|
||||
extern BOOLEAN bEncyclopediaCharacter;
|
||||
extern BOOLEAN bEncyclopediaInventory;
|
||||
extern BOOLEAN bEncyclopediaQuests;
|
||||
extern BOOLEAN bBriefingRoom;
|
||||
extern BOOLEAN bBriefingRoomSpecialMission;
|
||||
|
||||
extern UINT32 IDPageEncyData;
|
||||
extern void InitData ( BOOLEAN bInit);
|
||||
extern void UnLoadMenuButtons ();
|
||||
extern BOOLEAN ResetVal;
|
||||
|
||||
extern void CopyToTemp ( ENCYCLOPEDIA_LOCATION *Ency, BOOLEAN bFiltr, INT32 sort, INT32 TypFiltr, BOOLEAN ShowBox );
|
||||
extern void ResetTemp();
|
||||
|
||||
extern BOOLEAN LoadEncyclopediaFromLoadGameFile( HWFILE hFile );
|
||||
extern BOOLEAN SaveEncyclopediaToSaveGameFile( HWFILE hFile );
|
||||
|
||||
#define PAGENONE 0
|
||||
#define PAGEENCYCLOPEDIALOCATION 1
|
||||
#define PAGEENCYCLOPEDIACHARACTER 2
|
||||
#define PAGEENCYCLOPEDIAINVENTORY 3
|
||||
#define PAGEENCYCLOPEDIAQUESTS 4
|
||||
#define PAGEBRIEFINGROOM 5
|
||||
#define PAGEBRIEFINGROOMSPECIALMISSION 6
|
||||
|
||||
|
||||
#endif
|
||||
@@ -613,79 +613,79 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
switch( iStatToIncrement )
|
||||
{
|
||||
case( STRENGTH_ATTRIBUTE ):
|
||||
if( iCurrentStrength > iMaxAttribute -1 )
|
||||
if( iCurrentStrength > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentStrength++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( DEXTERITY_ATTRIBUTE ):
|
||||
if( iCurrentDexterity > iMaxAttribute -1 )
|
||||
case( DEXTERITY_ATTRIBUTE ):
|
||||
if( iCurrentDexterity > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentDexterity++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( AGILITY_ATTRIBUTE ):
|
||||
if( iCurrentAgility > iMaxAttribute -1 )
|
||||
if( iCurrentAgility > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentAgility++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( WISDOM_ATTRIBUTE ):
|
||||
if( iCurrentWisdom > iMaxAttribute -1 )
|
||||
if( iCurrentWisdom > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentWisdom++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( HEALTH_ATTRIBUTE ):
|
||||
if( iCurrentHealth > iMaxAttribute -1 )
|
||||
case( HEALTH_ATTRIBUTE ):
|
||||
if( iCurrentHealth > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentHealth++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( LEADERSHIP_ATTRIBUTE ):
|
||||
if( iCurrentLeaderShip > iMaxAttribute -1 )
|
||||
if( iCurrentLeaderShip > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if( iCurrentLeaderShip == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentLeaderShip+=iLeaderShipMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentLeaderShip+=iLeaderShipMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -695,25 +695,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentLeaderShip++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentLeaderShip++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case( MARKSMANSHIP_SKILL ):
|
||||
if( iCurrentMarkmanship > iMaxAttribute -1 )
|
||||
if( iCurrentMarkmanship > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iCurrentMarkmanship == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentMarkmanship+=iMarkmanshipMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentMarkmanship+=iMarkmanshipMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -723,25 +723,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentMarkmanship++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentMarkmanship++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case( MECHANICAL_SKILL ):
|
||||
if( iCurrentMechanical > iMaxAttribute -1 )
|
||||
if( iCurrentMechanical > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iCurrentMechanical == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentMechanical+=iMechanicalMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentMechanical+=iMechanicalMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -751,25 +751,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentMechanical++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentMechanical++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case( MEDICAL_SKILL ):
|
||||
if( iCurrentMedical > iMaxAttribute -1 )
|
||||
if( iCurrentMedical > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iCurrentMedical == 0)
|
||||
if( iCurrentMedical == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentMedical+=iMedicalMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentMedical+=iMedicalMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -779,25 +779,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentMedical++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentMedical++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case( EXPLOSIVE_SKILL ):
|
||||
if( iCurrentExplosives > iMaxAttribute -1 )
|
||||
if( iCurrentExplosives > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iCurrentExplosives == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentExplosives+=iExplosivesMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentExplosives+=iExplosivesMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -807,8 +807,8 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentExplosives++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentExplosives++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -114,9 +114,6 @@ void RenderGender( void );
|
||||
void DecrementTextEnterMode( void );
|
||||
void Print8CharacterOnlyString( void );
|
||||
BOOLEAN CheckCharacterInputForEgg( void );
|
||||
UINT32 GetCyrillicUnicodeChar( UINT32 uiKey );
|
||||
UINT32 TranslateKey( UINT32 uiKey, unsigned char* translationTable );
|
||||
BOOLEAN CheckIsKeyValid( UINT32 uiKey );
|
||||
|
||||
// mouse region callbacks
|
||||
void SelectFullNameRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
@@ -589,29 +586,18 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
|
||||
break;
|
||||
default:
|
||||
//Heinz (18.01.2009): Russian layout
|
||||
// ViSoR (07.01.2012) : Russian and Belarussian layouts
|
||||
//
|
||||
#if defined(RUSSIAN) || defined(BELARUSSIAN)
|
||||
if( ( (DWORD)GetKeyboardLayout(0) & 0xFFFF ) == 0x419) // Russian
|
||||
#if defined(RUSSIAN)
|
||||
if( ( (DWORD)GetKeyboardLayout(0) & 0xFFFF ) == 0x419)
|
||||
{
|
||||
unsigned char TranslationTable[] =
|
||||
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ##ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨";
|
||||
|
||||
uiKey = TranslateKey( uiKey, TranslationTable );
|
||||
uiKey = GetCyrillicUnicodeChar( uiKey );
|
||||
unsigned char RussianTranslationTable[] =
|
||||
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ##ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨";
|
||||
if(uiKey >= ' ' && uiKey <= '~') uiKey = RussianTranslationTable[uiKey-' '];
|
||||
else uiKey = '#';
|
||||
}
|
||||
else if ( ( (DWORD)GetKeyboardLayout(0) & 0xFFFF ) == 0x423) // Belarussian
|
||||
{
|
||||
unsigned char TranslationTable[] =
|
||||
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ##Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨";
|
||||
|
||||
uiKey = TranslateKey( uiKey, TranslationTable );
|
||||
uiKey = GetCyrillicUnicodeChar( uiKey );
|
||||
}
|
||||
else if( !CheckIsKeyValid( uiKey ) )
|
||||
uiKey = '#';
|
||||
|
||||
if( uiKey != '#')
|
||||
else if( !(uiKey >= 'A' && uiKey <= 'Z' || uiKey >= 'a' && uiKey <= 'z' || uiKey >= '0' && uiKey <= '9' ||
|
||||
uiKey == '_' || uiKey == '.' || uiKey == ' ') ) uiKey = '#';
|
||||
if(uiKey != '#')
|
||||
#else
|
||||
#ifndef USE_CODE_PAGE
|
||||
if( uiKey >= 'A' && uiKey <= 'Z' ||
|
||||
@@ -702,61 +688,7 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
|
||||
return;
|
||||
}
|
||||
|
||||
UINT32 GetCyrillicUnicodeChar( UINT32 uiKey )
|
||||
{
|
||||
// À - ÿ
|
||||
if (uiKey >= 192 && uiKey <= 255)
|
||||
uiKey += 0x0350;
|
||||
|
||||
// ¨
|
||||
if (uiKey == 168)
|
||||
uiKey = 0x0401;
|
||||
|
||||
// ¸
|
||||
if (uiKey == 184)
|
||||
uiKey = 0x0451;
|
||||
|
||||
// ¡
|
||||
if (uiKey == 161)
|
||||
uiKey = 0x040E;
|
||||
|
||||
// ¢
|
||||
if (uiKey == 162)
|
||||
uiKey = 0x045E;
|
||||
|
||||
// ²
|
||||
if (uiKey == 178)
|
||||
uiKey = 0x0406;
|
||||
|
||||
// ³
|
||||
if (uiKey == 179)
|
||||
uiKey = 0x0456;
|
||||
|
||||
return uiKey;
|
||||
}
|
||||
|
||||
BOOLEAN CheckIsKeyValid( UINT32 uiKey )
|
||||
{
|
||||
if( uiKey >= 'A' && uiKey <= 'Z' ||
|
||||
uiKey >= 'a' && uiKey <= 'z' ||
|
||||
uiKey >= '0' && uiKey <= '9' ||
|
||||
uiKey == '_' ||
|
||||
uiKey == '.' ||
|
||||
uiKey == ' ')
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
UINT32 TranslateKey( UINT32 uiKey, unsigned char* translationTable )
|
||||
{
|
||||
if( uiKey >= ' ' && uiKey <= '~' )
|
||||
uiKey = translationTable[uiKey-' '];
|
||||
else
|
||||
uiKey = '#';
|
||||
|
||||
return uiKey;
|
||||
}
|
||||
|
||||
void DisplayFullNameStringCursor( void )
|
||||
{
|
||||
|
||||
@@ -364,13 +364,13 @@ void BtnIMPConfirmYes(GUI_BUTTON *btn,INT32 reason)
|
||||
//Kaiden: Below is the Imp personality E-mail as it was.
|
||||
/*
|
||||
// send email notice
|
||||
//AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ) );
|
||||
//AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ),TYPE_EMAIL_NONE );
|
||||
AddFutureDayStrategicEvent( EVENT_DAY2_ADD_EMAIL_FROM_IMP, 60 * 7, 0, 2 );
|
||||
*/
|
||||
|
||||
//Kaiden: And here is my Answer to the IMP E-mails only
|
||||
// profiling the last IMP made. You get the results immediately
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 );
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1, TYPE_EMAIL_EMAIL_EDT);
|
||||
|
||||
//RenderCharProfile( );
|
||||
|
||||
|
||||
+14
-3
@@ -30,6 +30,10 @@
|
||||
#include "Squads.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
void GetPlayerKeyBoardInputForIMPHomePage( void );
|
||||
void DisplayPlayerActivationString( void );
|
||||
void ProcessPlayerInputActivationString( void );
|
||||
@@ -403,9 +407,12 @@ void ProcessPlayerInputActivationString( void )
|
||||
{
|
||||
freeMercSlot = FALSE;
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
if( ( ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) || ( ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"GP97SL") == 0 ) || ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"gp97sl") == 0 ) ) && ( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
|
||||
#else
|
||||
//Madd multiple imps if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) )&&( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
|
||||
if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
|
||||
#endif
|
||||
{
|
||||
// WANNE: Check total number of hired mercs
|
||||
if( freeMercSlot == FALSE )
|
||||
@@ -444,7 +451,7 @@ void ProcessPlayerInputActivationString( void )
|
||||
ResetActivationStringTextBox();
|
||||
|
||||
//DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 11 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 );
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 , TYPE_EMAIL_EMAIL_EDT);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -470,7 +477,7 @@ void ProcessPlayerInputActivationString( void )
|
||||
ResetActivationStringTextBox();
|
||||
|
||||
//DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 11 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 );
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 , TYPE_EMAIL_EMAIL_EDT);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -480,7 +487,11 @@ void ProcessPlayerInputActivationString( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef JA2UB
|
||||
if( ( ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"XEP624") != 0 ) && ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"xep624") != 0 ) ) || ( ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"GP97SL") != 0 ) && ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"gp97sl") != 0 ) ) )
|
||||
#else
|
||||
if( ( ( wcscmp(pPlayerActivationString, L"XEP624") != 0 ) && ( wcscmp(pPlayerActivationString, L"xep624") != 0 ) ) )
|
||||
#endif
|
||||
{
|
||||
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 0 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
|
||||
}
|
||||
|
||||
@@ -775,7 +775,7 @@ INT8 GetLastSelectedMinorTrait( void )
|
||||
UINT8 StrengthRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -799,7 +799,7 @@ UINT8 StrengthRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
UINT8 DexterityRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -852,7 +852,7 @@ UINT8 DexterityRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
UINT8 AgilityRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -905,7 +905,7 @@ UINT8 AgilityRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
UINT8 HealthRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -930,7 +930,7 @@ UINT8 HealthRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
UINT8 WisdomRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -983,7 +983,7 @@ UINT8 WisdomRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
UINT8 LeaderShipRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1022,6 +1022,12 @@ UINT8 MedicalRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
}
|
||||
UINT8 ExplosivesRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_DEMOLITIONS ] )
|
||||
{
|
||||
// 60 is minimum, +10 is addition to other preset requirements
|
||||
@@ -1249,6 +1255,11 @@ void AssignMinorTraitHelpText( UINT8 ubNumber )
|
||||
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[2], gSkillTraitValues.ubSTStealthBonus, L"%");
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubSTReducedAPsRegistered != 0 && gGameExternalOptions.fImprovedInterruptSystem )
|
||||
{
|
||||
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[4], gSkillTraitValues.ubSTReducedAPsRegistered, L"%");
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubSTStealthPenaltyForMovingReduction != 0 )
|
||||
{
|
||||
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[3], gSkillTraitValues.ubSTStealthPenaltyForMovingReduction, L"%");
|
||||
|
||||
+20
-10
@@ -1312,7 +1312,7 @@ INT8 GetLastSelectedSkill( void )
|
||||
INT32 StrengthRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1358,7 +1358,7 @@ INT32 StrengthRequiredDueToMajorSkills( void )
|
||||
INT32 AgilityRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1404,7 +1404,7 @@ INT32 AgilityRequiredDueToMajorSkills( void )
|
||||
INT32 DexterityRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1494,7 +1494,7 @@ INT32 DexterityRequiredDueToMajorSkills( void )
|
||||
INT32 HealthRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1540,7 +1540,7 @@ INT32 HealthRequiredDueToMajorSkills( void )
|
||||
INT32 LeadershipRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1575,7 +1575,7 @@ INT32 LeadershipRequiredDueToMajorSkills( void )
|
||||
INT32 WisdomRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1643,7 +1643,7 @@ INT32 WisdomRequiredDueToMajorSkills( void )
|
||||
INT32 MarksmanshipRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1700,7 +1700,7 @@ INT32 MarksmanshipRequiredDueToMajorSkills( void )
|
||||
INT32 MechanicalRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1724,7 +1724,7 @@ INT32 MechanicalRequiredDueToMajorSkills( void )
|
||||
INT32 MedicalRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1748,7 +1748,7 @@ INT32 MedicalRequiredDueToMajorSkills( void )
|
||||
INT32 ExplosivesRequiredDueToMajorSkills( void )
|
||||
{
|
||||
// Only for new trait system
|
||||
if (!gGameOptions.fNewTraitSystem)
|
||||
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -2148,6 +2148,11 @@ void AssignSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLevel )
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
}
|
||||
if( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving != 0 && gGameExternalOptions.fImprovedInterruptSystem )
|
||||
{
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[27], ( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving * (fExpertLevel ? 2 : 1)), L"%");
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubMAChanceToCkickDoors != 0 )
|
||||
{
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[25], ( gSkillTraitValues.ubMAChanceToCkickDoors * (fExpertLevel ? 2 : 1)), L"%");
|
||||
@@ -2180,6 +2185,11 @@ void AssignSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLevel )
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[2], ( gSkillTraitValues.ubSLEffectiveLevelAsStandby * (fExpertLevel ? 2 : 1)));
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubSLCollectiveInterruptsBonus != 0 && gGameExternalOptions.fImprovedInterruptSystem )
|
||||
{
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[11], ( gSkillTraitValues.ubSLCollectiveInterruptsBonus * (fExpertLevel ? 2 : 1)), L"%");
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubSLOverallSuppresionBonusPercent != 0 )
|
||||
{
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[3], ( gSkillTraitValues.ubSLOverallSuppresionBonusPercent * (fExpertLevel ? 2 : 1)), L"%", (fExpertLevel ? gzIMPSkillTraitsTextNewMajor[ubTraitNumber + 11] : gzIMPSkillTraitsTextNewMajor[ubTraitNumber]));
|
||||
|
||||
@@ -17,6 +17,32 @@
|
||||
#include "GameSettings.h"
|
||||
#include "Text.h"
|
||||
#include "_Ja25Englishtext.h"
|
||||
#ifdef JA2UB
|
||||
#include "laptop.h"
|
||||
#include "email.h"
|
||||
#include "Utilities.h"
|
||||
#include "WCheck.h"
|
||||
#include "Debug.h"
|
||||
#include "WordWrap.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "Encrypted File.h"
|
||||
#include "cursors.h"
|
||||
#include "soldier profile.h"
|
||||
#include "IMP Compile Character.h"
|
||||
#include "IMP Voices.h"
|
||||
#include "IMP Portraits.h"
|
||||
#include "Game Clock.h"
|
||||
#include "environment.h"
|
||||
#include "AimMembers.h"
|
||||
#include "Random.h"
|
||||
#include "Text.h"
|
||||
#include "LaptopSave.h"
|
||||
#include "finances.h"
|
||||
#include "PostalService.h"
|
||||
#include "faces.h"
|
||||
#include "GameSettings.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define IMP_SEEK_AMOUNT 5 * 80 * 2
|
||||
@@ -46,8 +72,10 @@ void OffSetQuestionForFemaleSpecificQuestions( INT32 *iCurrentOffset );
|
||||
#define QTN_FIRST_COLUMN_X iScreenWidthOffset + 80
|
||||
#define QTN_SECOND_COLUMN_X iScreenWidthOffset + 320
|
||||
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
#define IMPTEXT_EDT_FILE_JA25 "BINARYDATA\\IMPText25.edt"
|
||||
#define IMPTEXT_EDT_FILE_JA2 "BINARYDATA\\IMPText.edt"
|
||||
#endif
|
||||
|
||||
void LoadAndDisplayIMPText( INT16 sStartX, INT16 sStartY, INT16 sLineLength, INT16 sIMPTextRecordNumber, UINT32 uiFont, UINT8 ubColor, BOOLEAN fShadow, UINT32 uiFlags)
|
||||
{
|
||||
@@ -62,7 +90,18 @@ void LoadAndDisplayIMPText( INT16 sStartX, INT16 sStartY, INT16 sLineLength, INT
|
||||
}
|
||||
|
||||
// load the string
|
||||
#ifdef JA2UB
|
||||
if (FileExists(IMPTEXT_EDT_FILE_JA25))
|
||||
{
|
||||
LoadEncryptedDataFromFile(IMPTEXT_EDT_FILE_JA25, sString, ( UINT32 ) ( ( sIMPTextRecordNumber ) * IMP_SEEK_AMOUNT ), IMP_SEEK_AMOUNT);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadEncryptedDataFromFile(IMPTEXT_EDT_FILE_JA2, sString, ( UINT32 ) ( ( sIMPTextRecordNumber ) * IMP_SEEK_AMOUNT ), IMP_SEEK_AMOUNT);
|
||||
}
|
||||
#else
|
||||
LoadEncryptedDataFromFile("BINARYDATA\\IMPText.EDT", sString, ( UINT32 ) ( ( sIMPTextRecordNumber ) * IMP_SEEK_AMOUNT ), IMP_SEEK_AMOUNT);
|
||||
#endif
|
||||
|
||||
// null put last char
|
||||
sString[ wcslen( sString) ] = 0;
|
||||
|
||||
@@ -402,6 +402,14 @@
|
||||
RelativePath=".\BobbyRUsed.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BriefingRoom.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BriefingRoomM.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BrokenLink.h"
|
||||
>
|
||||
@@ -414,6 +422,14 @@
|
||||
RelativePath=".\email.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Encyclopedia.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Encyclopedia_Data.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\files.h"
|
||||
>
|
||||
@@ -680,6 +696,14 @@
|
||||
RelativePath=".\BobbyRUsed.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BriefingRoom.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BriefingRoomM.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BrokenLink.cpp"
|
||||
>
|
||||
@@ -692,6 +716,14 @@
|
||||
RelativePath=".\email.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Encyclopedia.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Encyclopedia_Data.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\files.cpp"
|
||||
>
|
||||
@@ -880,6 +912,22 @@
|
||||
RelativePath=".\XML_DeliveryMethods.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_Email.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_EmailMercAvailable.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_EmailMercLevelUp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_EncyclopediaLocation.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_IMPPortraits.cpp"
|
||||
>
|
||||
|
||||
@@ -403,6 +403,14 @@
|
||||
RelativePath="BobbyRUsed.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BriefingRoom.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BriefingRoomM.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="BrokenLink.h"
|
||||
>
|
||||
@@ -415,6 +423,14 @@
|
||||
RelativePath="email.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Encyclopedia.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Encyclopedia_Data.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="files.h"
|
||||
>
|
||||
@@ -679,6 +695,14 @@
|
||||
RelativePath="BobbyRUsed.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BriefingRoom.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BriefingRoomM.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="BrokenLink.cpp"
|
||||
>
|
||||
@@ -691,6 +715,14 @@
|
||||
RelativePath="email.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Encyclopedia.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Encyclopedia_Data.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="files.cpp"
|
||||
>
|
||||
@@ -883,6 +915,22 @@
|
||||
RelativePath=".\XML_DeliveryMethods.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_Email.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_EmailMercAvailable.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_EmailMercLevelUp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_EncyclopediaLocation.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_IMPPortraits.cpp"
|
||||
>
|
||||
|
||||
@@ -39,9 +39,13 @@
|
||||
<ClInclude Include="BobbyRMisc.h" />
|
||||
<ClInclude Include="BobbyRShipments.h" />
|
||||
<ClInclude Include="BobbyRUsed.h" />
|
||||
<ClInclude Include="BriefingRoom.h" />
|
||||
<ClInclude Include="BriefingRoomM.h" />
|
||||
<ClInclude Include="BrokenLink.h" />
|
||||
<ClInclude Include="CharProfile.h" />
|
||||
<ClInclude Include="email.h" />
|
||||
<ClInclude Include="Encyclopedia.h" />
|
||||
<ClInclude Include="Encyclopedia_Data.h" />
|
||||
<ClInclude Include="files.h" />
|
||||
<ClInclude Include="finances.h" />
|
||||
<ClInclude Include="florist Cards.h" />
|
||||
@@ -109,9 +113,13 @@
|
||||
<ClCompile Include="BobbyRMisc.cpp" />
|
||||
<ClCompile Include="BobbyRShipments.cpp" />
|
||||
<ClCompile Include="BobbyRUsed.cpp" />
|
||||
<ClCompile Include="BriefingRoom.cpp" />
|
||||
<ClCompile Include="BriefingRoomM.cpp" />
|
||||
<ClCompile Include="BrokenLink.cpp" />
|
||||
<ClCompile Include="CharProfile.cpp" />
|
||||
<ClCompile Include="email.cpp" />
|
||||
<ClCompile Include="Encyclopedia.cpp" />
|
||||
<ClCompile Include="Encyclopedia_Data.cpp" />
|
||||
<ClCompile Include="files.cpp" />
|
||||
<ClCompile Include="finances.cpp" />
|
||||
<ClCompile Include="florist Cards.cpp" />
|
||||
@@ -160,6 +168,10 @@
|
||||
<ClCompile Include="XML_AIMAvailability.cpp" />
|
||||
<ClCompile Include="XML_ConditionsForMercAvailability.cpp" />
|
||||
<ClCompile Include="XML_DeliveryMethods.cpp" />
|
||||
<ClCompile Include="XML_Email.cpp" />
|
||||
<ClCompile Include="XML_EmailMercAvailable.cpp" />
|
||||
<ClCompile Include="XML_EmailMercLevelUp.cpp" />
|
||||
<ClCompile Include="XML_EncyclopediaLocation.cpp" />
|
||||
<ClCompile Include="XML_IMPPortraits.cpp" />
|
||||
<ClCompile Include="XML_ShippingDestinations.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -213,6 +213,18 @@
|
||||
<ClInclude Include="Store Inventory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BriefingRoom.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BriefingRoomM.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Encyclopedia.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Encyclopedia_Data.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="aim.cpp">
|
||||
@@ -422,5 +434,29 @@
|
||||
<ClCompile Include="XML_ConditionsForMercAvailability.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XML_EmailMercAvailable.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XML_EmailMercLevelUp.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BriefingRoom.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BriefingRoomM.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Encyclopedia.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Encyclopedia_Data.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XML_EncyclopediaLocation.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XML_Email.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -19,6 +19,10 @@
|
||||
#include "connect.h"
|
||||
#include "Strategic Event Handler.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
/************************************************************************************/
|
||||
@@ -526,14 +530,29 @@ BOOLEAN CPostalService::DeliverShipment(UINT16 usShipmentID)
|
||||
// WANNE - MP: Do not send email notification from Bobby Ray in a multiplayer game
|
||||
if (!is_networked)
|
||||
{
|
||||
StopTimeCompression();
|
||||
|
||||
StopTimeCompression();
|
||||
#ifdef JA2UB
|
||||
|
||||
//no UB
|
||||
if ( gGameUBOptions.fBobbyRSite == TRUE )
|
||||
{
|
||||
// Shipment from Bobby Ray
|
||||
if (shs.sSenderID == BOBBYR_SENDER_ID)
|
||||
AddBobbyREmailJA2( 198, 4, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_BOBBY_R_EMAIL_JA2_EDT);
|
||||
// Shipment from John Kulba
|
||||
//else
|
||||
// AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
|
||||
}
|
||||
#else
|
||||
|
||||
// Shipment from Bobby Ray
|
||||
if (shs.sSenderID == BOBBYR_SENDER_ID)
|
||||
AddEmail( BOBBYR_SHIPMENT_ARRIVED, BOBBYR_SHIPMENT_ARRIVED_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID);
|
||||
AddEmail( BOBBYR_SHIPMENT_ARRIVED, BOBBYR_SHIPMENT_ARRIVED_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
|
||||
// Shipment from John Kulba
|
||||
else
|
||||
AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID);
|
||||
AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
|
||||
#endif
|
||||
}
|
||||
|
||||
shs.ShipmentPackages.clear();
|
||||
|
||||
@@ -2,6 +2,156 @@
|
||||
#define _SPECK_QUOTES_H_
|
||||
|
||||
//Enum,s for all of specks quotes
|
||||
#ifdef JA2UB
|
||||
enum
|
||||
{
|
||||
/*
|
||||
Ja25: no longer in game
|
||||
SPECK_QUOTE_FIRST_TIME_IN_0, //0
|
||||
SPECK_QUOTE_FIRST_TIME_IN_1,
|
||||
SPECK_QUOTE_FIRST_TIME_IN_2,
|
||||
SPECK_QUOTE_FIRST_TIME_IN_3,
|
||||
SPECK_QUOTE_FIRST_TIME_IN_4,
|
||||
SPECK_QUOTE_FIRST_TIME_IN_5,
|
||||
SPECK_QUOTE_FIRST_TIME_IN_6,
|
||||
SPECK_QUOTE_FIRST_TIME_IN_7,
|
||||
SPECK_QUOTE_FIRST_TIME_IN_8,
|
||||
SPECK_QUOTE_THANK_PLAYER_FOR_OPENING_ACCOUNT,
|
||||
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_1_TOUGH_START, //10
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_2_BUSINESS_BAD,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_3_BUSINESS_GOOD,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_4_TRYING_TO_RECRUIT,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_5_PLAYER_OWES_SPECK_ACCOUNT_SUSPENDED,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_6_PLAYER_OWES_SPECK_ALMOST_BANKRUPT_1,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_6_PLAYER_OWES_SPECK_ALMOST_BANKRUPT_2,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_7_PLAYER_ACCOUNT_OK,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_8_MADE_PARTIAL_PAYMENT,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_9_FIRST_VISIT_SINCE_SERVER_WENT_DOWN,
|
||||
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_10_GENERIC_OPENING, //20
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_10_TAG_FOR_20,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_11_NEW_MERCS_AVAILABLE,
|
||||
*/
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_12_PLAYERS_LOST_MERCS =23,
|
||||
/*
|
||||
Ja25: no longer in game
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_PLAYER_OWES_MONEY,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_PLAYER_CLEARED_DEBT,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_PLAYER_CLEARED_OVERDUE_ACCOUNT,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_FIRST_MERC_DIES,
|
||||
*/
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_BIFF_IS_DEAD =28,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_HAYWIRE_IS_DEAD,
|
||||
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_GASKET_IS_DEAD, //30
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_RAZOR_IS_DEAD,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_FLO_IS_DEAD_BIFF_ALIVE,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_FLO_IS_DEAD_BIFF_IS_DEAD,
|
||||
/*
|
||||
Ja25: no longer in game
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_FLO_MARRIED_A_COUSIN_BIFF_IS_ALIVE,
|
||||
*/
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_GUMPY_IS_DEAD =35,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_LARRY_IS_DEAD,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_LARRY_RELAPSED,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_COUGER_IS_DEAD,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_NUMB_IS_DEAD,
|
||||
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_BUBBA_IS_DEAD, //40
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_ON_AFTER_OTHER_TAGS_1,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_ON_AFTER_OTHER_TAGS_2,
|
||||
/*
|
||||
Ja25: no longer in game
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_ON_AFTER_OTHER_TAGS_3,
|
||||
SPECK_QUOTE_ALTERNATE_OPENING_TAG_ON_AFTER_OTHER_TAGS_4,
|
||||
SPECK_QUOTE_PLAYER_MAKES_FULL_PAYMENT,
|
||||
SPECK_QUOTE_PLAYER_MAKES_PARTIAL_PAYMENT,
|
||||
*/
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_BIFF =47,
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_HAYWIRE,
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_GASKET,
|
||||
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_RAZOR, //50
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_FLO,
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_GUMPY,
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_LARRY,
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_COUGER,
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_NUMB,
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_BUBBA,
|
||||
/*
|
||||
Ja25: no longer in game
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_TAG_GETTING_MORE_MERCS,
|
||||
*/
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_AIM_SLANDER_1=58,
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_AIM_SLANDER_2,
|
||||
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_AIM_SLANDER_3, //60
|
||||
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_AIM_SLANDER_4,
|
||||
SPECK_QUOTE_BIFF_UNAVALIABLE,
|
||||
SPECK_QUOTE_PLAYERS_HIRES_BIFF_SPECK_PLUGS_LARRY,
|
||||
SPECK_QUOTE_PLAYERS_HIRES_BIFF_SPECK_PLUGS_FLO,
|
||||
SPECK_QUOTE_PLAYERS_HIRES_HAYWIRE_SPECK_PLUGS_RAZOR,
|
||||
SPECK_QUOTE_PLAYERS_HIRES_RAZOR_SPECK_PLUGS_HAYWIRE,
|
||||
SPECK_QUOTE_PLAYERS_HIRES_FLO_SPECK_PLUGS_BIFF,
|
||||
SPECK_QUOTE_PLAYERS_HIRES_LARRY_SPECK_PLUGS_BIFF,
|
||||
SPECK_QUOTE_GENERIC_THANKS_FOR_HIRING_MERCS_1,
|
||||
|
||||
SPECK_QUOTE_GENERIC_THANKS_FOR_HIRING_MERCS_2, //70
|
||||
SPECK_QUOTE_PLAYER_TRIES_TO_HIRE_ALREADY_HIRED_MERC,
|
||||
SPECK_QUOTE_GOOD_BYE_1,
|
||||
SPECK_QUOTE_GOOD_BYE_2,
|
||||
SPECK_QUOTE_GOOD_BYE_3,
|
||||
/*
|
||||
Ja25: no longer in game
|
||||
SPECK_QUOTE_GOOD_BYE_TAG_PLAYER_OWES_MONEY,
|
||||
*/
|
||||
|
||||
//New Quotes
|
||||
|
||||
SPECK_QUOTE_NEW_INTRO_1=76,
|
||||
SPECK_QUOTE_NEW_INTRO_2,
|
||||
SPECK_QUOTE_NEW_INTRO_3,
|
||||
SPECK_QUOTE_NEW_INTRO_4,
|
||||
|
||||
SPECK_QUOTE_NEW_INTRO_5,//80
|
||||
SPECK_QUOTE_NEW_INTRO_6,
|
||||
SPECK_QUOTE_NEW_INTRO_7,
|
||||
SPECK_QUOTE_DEFAULT_INTRO_HAVENT_HIRED_MERCS,
|
||||
SPECK_QUOTE_DEFAULT_INTRO_HAVE_HIRED_MERCS,
|
||||
SPECK_QUOTE_BETTER_STARTING_EQPMNT_TAG_ON,
|
||||
SPECK_QUOTE_PLAYER_CANT_AFFORD_TO_HIRE_MERC,
|
||||
SPECK_QUOTE_ENCOURAGE_SHOP_TAG_ON,
|
||||
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_1,
|
||||
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_2,
|
||||
|
||||
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_3, //90
|
||||
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_4,
|
||||
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_5,
|
||||
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_6,
|
||||
SPECK_QUOTE_ADVERTISE_GASTON,
|
||||
SPECK_QUOTE_ADVERTISE_STOGIE,
|
||||
SPECK_QUOTE_GASTON_DEAD,
|
||||
SPECK_QUOTE_STOGIE_DEAD,
|
||||
SPECK_QUOTE_PLAYER_HIRES_GASTON,
|
||||
SPECK_QUOTE_PLAYER_HIRES_STOGIE,
|
||||
|
||||
SPECK_QUOTE_RANDOM_CHIT_CHAT_1, //100
|
||||
SPECK_QUOTE_RANDOM_CHIT_CHAT_2,
|
||||
SPECK_QUOTE_RANDOM_CHIT_CHAT_3,
|
||||
SPECK_QUOTE_BIFF_DEAD_WHEN_IMPORTING,
|
||||
|
||||
/*
|
||||
SPECK_QUOTE_,
|
||||
SPECK_QUOTE_,
|
||||
SPECK_QUOTE_,
|
||||
SPECK_QUOTE_,
|
||||
SPECK_QUOTE_,
|
||||
SPECK_QUOTE_,
|
||||
|
||||
*/
|
||||
};
|
||||
#else
|
||||
enum
|
||||
{
|
||||
SPECK_QUOTE_FIRST_TIME_IN_0, //0
|
||||
@@ -115,5 +265,6 @@ enum
|
||||
SPECK_QUOTE_,
|
||||
*/
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,301 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#include "Editor All.h"
|
||||
#include "LuaInitNPCs.h"
|
||||
#else
|
||||
#include "sgp.h"
|
||||
#include "Debug Control.h"
|
||||
#include "expat.h"
|
||||
#include "XML.h"
|
||||
#include "Interface.h"
|
||||
#include "Item Statistics.h"
|
||||
#include "LuaInitNPCs.h"
|
||||
#include "email.h"
|
||||
#endif
|
||||
|
||||
struct
|
||||
{
|
||||
PARSE_STAGE curElement;
|
||||
|
||||
CHAR8 szCharData[MAIL_STRING_SIZE+1];
|
||||
EMAIL_OTHER_VALUES curEmailOther;
|
||||
|
||||
UINT32 maxArraySize;
|
||||
UINT32 curIndex;
|
||||
UINT32 currentDepth;
|
||||
UINT32 maxReadDepth;
|
||||
}
|
||||
|
||||
typedef EmailOtherParseData;
|
||||
|
||||
BOOLEAN EmailOther_TextOnly;
|
||||
|
||||
static void XMLCALL
|
||||
EmailOtherStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
||||
{
|
||||
if(strcmp(name, "NEW_EMAIL") == 0 && pData->curElement == ELEMENT_NONE)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "EMAIL") == 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, "Subject") == 0 ||
|
||||
strcmp(name, "Message0") == 0 ||
|
||||
strcmp(name, "Message1") == 0 ||
|
||||
strcmp(name, "Message2") == 0 ||
|
||||
strcmp(name, "Message3") == 0 ||
|
||||
strcmp(name, "Message4") == 0 ||
|
||||
strcmp(name, "Message5") == 0 ||
|
||||
strcmp(name, "Message6") == 0 ||
|
||||
strcmp(name, "Message7") == 0 ||
|
||||
strcmp(name, "Message8") == 0 ||
|
||||
strcmp(name, "Message9") == 0 ||
|
||||
strcmp(name, "Message10") == 0 ||
|
||||
strcmp(name, "Message11") == 0 ||
|
||||
strcmp(name, "Message12") == 0 ||
|
||||
strcmp(name, "Message13") == 0 ||
|
||||
strcmp(name, "Message14") == 0 ||
|
||||
strcmp(name, "Message15") == 0 ||
|
||||
strcmp(name, "Message16") == 0 ||
|
||||
strcmp(name, "Message17") == 0 ||
|
||||
strcmp(name, "Message18") == 0 ||
|
||||
strcmp(name, "Message19") == 0 ||
|
||||
strcmp(name, "Message20") == 0 ||
|
||||
strcmp(name, "Message21") == 0 ||
|
||||
strcmp(name, "Message22") == 0 ||
|
||||
strcmp(name, "Message23") == 0 ||
|
||||
strcmp(name, "Message24") == 0 ||
|
||||
strcmp(name, "Message25") == 0 ||
|
||||
strcmp(name, "Message26") == 0 ||
|
||||
strcmp(name, "Message27") == 0 ||
|
||||
strcmp(name, "Message28") == 0 ||
|
||||
strcmp(name, "Message29") == 0 ))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
|
||||
pData->szCharData[0] = '\0';
|
||||
}
|
||||
|
||||
pData->currentDepth++;
|
||||
|
||||
}
|
||||
|
||||
static void XMLCALL
|
||||
EmailOtherCharacterDataHandle(void *userData, const XML_Char *str, int len)
|
||||
{
|
||||
EmailOtherParseData * pData = (EmailOtherParseData *)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
|
||||
EmailOtherEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth)
|
||||
{
|
||||
if(strcmp(name, "NEW_EMAIL") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_NONE;
|
||||
}
|
||||
else if(strcmp(name, "EMAIL") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
if (!EmailOther_TextOnly)
|
||||
{
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szSubject, pData->curEmailOther.szSubject);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[0], L"1. sdssdsfs dfg fdgd fgffdsf test" ); //pData->curEmailOther.szMessage[0]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], L"2. sdssdsfs dfg fgfgffdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], L"3. sdssdsfsd gdfg fdfgfdg ffdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], L"4. sdssdsf dgdfg dgsffdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], L"5. sdssdsfdgdfg dgfd gsffdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], L"6. sdssdsfsffdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], L"7. sdssdsfsffdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], L"8. sdssdsfsfdgdgfgfdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], L"9. sdssdsfsff dg dfgdg fg dfg dsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], L"10. sdssdsfsfgdsgdfgfdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], L"11. sdssdsfsff dgdf fgfdg dfgd dsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], L"12. sdssdsfsf dfg dfgf gdfg dsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], L"13. sdssdsfsf dfgdfgdf gdfg gfdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], L"14. sdssdsf dgdf gsffdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], L"15. sdssdsf dgdf dfg d gdf ffdsf test" );
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], L"16. sdssdsfs dgdfg fdg dgdfg gffdsf test" );
|
||||
|
||||
/*
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], pData->curEmailOther.szMessage[1]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], pData->curEmailOther.szMessage[2]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], pData->curEmailOther.szMessage[3]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], pData->curEmailOther.szMessage[4]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], pData->curEmailOther.szMessage[5]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], pData->curEmailOther.szMessage[6]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], pData->curEmailOther.szMessage[7]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], pData->curEmailOther.szMessage[8]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], pData->curEmailOther.szMessage[9]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], pData->curEmailOther.szMessage[10]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], pData->curEmailOther.szMessage[11]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], pData->curEmailOther.szMessage[12]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], pData->curEmailOther.szMessage[13]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], pData->curEmailOther.szMessage[14]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], pData->curEmailOther.szMessage[15]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[16], pData->curEmailOther.szMessage[16]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[17], pData->curEmailOther.szMessage[17]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[18], pData->curEmailOther.szMessage[18]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[19], pData->curEmailOther.szMessage[19]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[20], pData->curEmailOther.szMessage[20]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[21], pData->curEmailOther.szMessage[21]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[22], pData->curEmailOther.szMessage[22]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[23], pData->curEmailOther.szMessage[23]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[24], pData->curEmailOther.szMessage[24]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[25], pData->curEmailOther.szMessage[25]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[26], pData->curEmailOther.szMessage[26]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[27], pData->curEmailOther.szMessage[27]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[28], pData->curEmailOther.szMessage[28]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[29], pData->curEmailOther.szMessage[29]);
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szSubject, pData->curEmailOther.szSubject);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[0], L"sdssdsfsffdsf test" ); //pData->curEmailOther.szMessage[0]);
|
||||
/*
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], pData->curEmailOther.szMessage[1]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], pData->curEmailOther.szMessage[2]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], pData->curEmailOther.szMessage[3]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], pData->curEmailOther.szMessage[4]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], pData->curEmailOther.szMessage[5]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], pData->curEmailOther.szMessage[6]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], pData->curEmailOther.szMessage[7]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], pData->curEmailOther.szMessage[8]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], pData->curEmailOther.szMessage[9]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], pData->curEmailOther.szMessage[10]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], pData->curEmailOther.szMessage[11]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], pData->curEmailOther.szMessage[12]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], pData->curEmailOther.szMessage[13]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], pData->curEmailOther.szMessage[14]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], pData->curEmailOther.szMessage[15]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[16], pData->curEmailOther.szMessage[16]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[17], pData->curEmailOther.szMessage[17]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[18], pData->curEmailOther.szMessage[18]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[19], pData->curEmailOther.szMessage[19]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[20], pData->curEmailOther.szMessage[20]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[21], pData->curEmailOther.szMessage[21]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[22], pData->curEmailOther.szMessage[22]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[23], pData->curEmailOther.szMessage[23]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[24], pData->curEmailOther.szMessage[24]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[25], pData->curEmailOther.szMessage[25]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[26], pData->curEmailOther.szMessage[26]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[27], pData->curEmailOther.szMessage[27]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[28], pData->curEmailOther.szMessage[28]);
|
||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[29], pData->curEmailOther.szMessage[29]);
|
||||
*/
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "uiIndex") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curEmailOther.uiIndex = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "Subject") == 0 )
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailOther.szSubject, sizeof(pData->curEmailOther.szSubject)/sizeof(pData->curEmailOther.szSubject[0]) );
|
||||
pData->curEmailOther.szSubject[sizeof(pData->curEmailOther.szSubject)/sizeof(pData->curEmailOther.szSubject[0]) - 1] = '\0';
|
||||
}
|
||||
/*
|
||||
else if(strcmp(name, "Message0") == 0 )
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailOther.szMessage[0], sizeof(pData->curEmailOther.szMessage[0])/sizeof(pData->curEmailOther.szMessage[0]) );
|
||||
pData->curEmailOther.szMessage[sizeof(pData->curEmailOther.szMessage[0])/sizeof(pData->curEmailOther.szMessage[0]) - 1][0] = '\0';
|
||||
}
|
||||
*/
|
||||
pData->maxReadDepth--;
|
||||
}
|
||||
pData->currentDepth--;
|
||||
}
|
||||
|
||||
BOOLEAN ReadInEmailOther(STR fileName, BOOLEAN localizedVersion)
|
||||
{
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead;
|
||||
UINT32 uiFSize;
|
||||
CHAR8 * lpcBuffer;
|
||||
XML_Parser parser = XML_ParserCreate(NULL);
|
||||
|
||||
EmailOtherParseData pData;
|
||||
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EmailOther.xml" );
|
||||
|
||||
EmailOther_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, EmailOtherStartElementHandle, EmailOtherEndElementHandle);
|
||||
XML_SetCharacterDataHandler(parser, EmailOtherCharacterDataHandle);
|
||||
|
||||
|
||||
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 EmailOther.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 );
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#include "Editor All.h"
|
||||
#include "LuaInitNPCs.h"
|
||||
#else
|
||||
#include "sgp.h"
|
||||
#include "Debug Control.h"
|
||||
#include "expat.h"
|
||||
#include "XML.h"
|
||||
#include "Interface.h"
|
||||
#include "Item Statistics.h"
|
||||
#include "LuaInitNPCs.h"
|
||||
#include "email.h"
|
||||
#endif
|
||||
|
||||
struct
|
||||
{
|
||||
PARSE_STAGE curElement;
|
||||
|
||||
CHAR8 szCharData[MAIL_STRING_SIZE+1];
|
||||
EMAIL_MERC_AVAILABLE_VALUES curEmailMercAvailable;
|
||||
|
||||
UINT32 maxArraySize;
|
||||
UINT32 curIndex;
|
||||
UINT32 currentDepth;
|
||||
UINT32 maxReadDepth;
|
||||
}
|
||||
|
||||
typedef emailMercAvailableParseData;
|
||||
|
||||
BOOLEAN EmailMercAvailable_TextOnly;
|
||||
|
||||
static void XMLCALL
|
||||
emailMercAvailableStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
emailMercAvailableParseData * pData = (emailMercAvailableParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
||||
{
|
||||
if(strcmp(name, "EMAIL_MERC_AVAILABLE") == 0 && pData->curElement == ELEMENT_NONE)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "EMAIL") == 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, "Subject") == 0 ||
|
||||
strcmp(name, "Message") == 0 ))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
|
||||
pData->szCharData[0] = '\0';
|
||||
}
|
||||
|
||||
pData->currentDepth++;
|
||||
|
||||
}
|
||||
|
||||
static void XMLCALL
|
||||
emailMercAvailableCharacterDataHandle(void *userData, const XML_Char *str, int len)
|
||||
{
|
||||
emailMercAvailableParseData * pData = (emailMercAvailableParseData *)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
|
||||
emailMercAvailableEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
emailMercAvailableParseData * pData = (emailMercAvailableParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth)
|
||||
{
|
||||
if(strcmp(name, "EMAIL_MERC_AVAILABLE") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_NONE;
|
||||
}
|
||||
else if(strcmp(name, "EMAIL") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
if (!EmailMercAvailable_TextOnly)
|
||||
{
|
||||
wcscpy(EmailMercAvailableText[pData->curEmailMercAvailable.uiIndex].szSubject, pData->curEmailMercAvailable.szSubject);
|
||||
wcscpy(EmailMercAvailableText[pData->curEmailMercAvailable.uiIndex].szMessage, pData->curEmailMercAvailable.szMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
wcscpy(EmailMercAvailableText[pData->curEmailMercAvailable.uiIndex].szSubject, pData->curEmailMercAvailable.szSubject);
|
||||
wcscpy(EmailMercAvailableText[pData->curEmailMercAvailable.uiIndex].szMessage, pData->curEmailMercAvailable.szMessage);
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "uiIndex") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curEmailMercAvailable.uiIndex = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "Subject") == 0 )
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailMercAvailable.szSubject, sizeof(pData->curEmailMercAvailable.szSubject)/sizeof(pData->curEmailMercAvailable.szSubject[0]) );
|
||||
pData->curEmailMercAvailable.szSubject[sizeof(pData->curEmailMercAvailable.szSubject)/sizeof(pData->curEmailMercAvailable.szSubject[0]) - 1] = '\0';
|
||||
}
|
||||
else if(strcmp(name, "Message") == 0 )
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailMercAvailable.szMessage, sizeof(pData->curEmailMercAvailable.szMessage)/sizeof(pData->curEmailMercAvailable.szMessage[0]) );
|
||||
pData->curEmailMercAvailable.szMessage[sizeof(pData->curEmailMercAvailable.szMessage)/sizeof(pData->curEmailMercAvailable.szMessage[0]) - 1] = '\0';
|
||||
}
|
||||
pData->maxReadDepth--;
|
||||
}
|
||||
pData->currentDepth--;
|
||||
}
|
||||
|
||||
BOOLEAN ReadInEmailMercAvailable(STR fileName, BOOLEAN localizedVersion)
|
||||
{
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead;
|
||||
UINT32 uiFSize;
|
||||
CHAR8 * lpcBuffer;
|
||||
XML_Parser parser = XML_ParserCreate(NULL);
|
||||
|
||||
emailMercAvailableParseData pData;
|
||||
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EmailMercAvailable.xml" );
|
||||
|
||||
EmailMercAvailable_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, emailMercAvailableStartElementHandle, emailMercAvailableEndElementHandle);
|
||||
XML_SetCharacterDataHandler(parser, emailMercAvailableCharacterDataHandle);
|
||||
|
||||
|
||||
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 EmailMercAvailable.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 );
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#include "Editor All.h"
|
||||
#include "LuaInitNPCs.h"
|
||||
#else
|
||||
#include "sgp.h"
|
||||
#include "Debug Control.h"
|
||||
#include "expat.h"
|
||||
#include "XML.h"
|
||||
#include "Interface.h"
|
||||
#include "Item Statistics.h"
|
||||
#include "LuaInitNPCs.h"
|
||||
#include "email.h"
|
||||
#endif
|
||||
|
||||
struct
|
||||
{
|
||||
PARSE_STAGE curElement;
|
||||
|
||||
CHAR8 szCharData[MAIL_STRING_SIZE+1];
|
||||
EMAIL_MERC_LEVEL_UP_VALUES curEmailMercLevelUp;
|
||||
|
||||
UINT32 maxArraySize;
|
||||
UINT32 curIndex;
|
||||
UINT32 currentDepth;
|
||||
UINT32 maxReadDepth;
|
||||
}
|
||||
|
||||
typedef emailMercLevelUpParseData;
|
||||
|
||||
BOOLEAN EmailMercLevelUp_TextOnly;
|
||||
|
||||
static void XMLCALL
|
||||
emailMercLevelUpStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
emailMercLevelUpParseData * pData = (emailMercLevelUpParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
||||
{
|
||||
if(strcmp(name, "EMAIL_MERC_LEVEL_UP") == 0 && pData->curElement == ELEMENT_NONE)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "EMAIL") == 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, "Subject") == 0 ||
|
||||
strcmp(name, "Message") == 0 ))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
|
||||
pData->szCharData[0] = '\0';
|
||||
}
|
||||
|
||||
pData->currentDepth++;
|
||||
|
||||
}
|
||||
|
||||
static void XMLCALL
|
||||
emailMercLevelUpCharacterDataHandle(void *userData, const XML_Char *str, int len)
|
||||
{
|
||||
emailMercLevelUpParseData * pData = (emailMercLevelUpParseData *)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
|
||||
emailMercLevelUpEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
emailMercLevelUpParseData * pData = (emailMercLevelUpParseData *)userData;
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth)
|
||||
{
|
||||
if(strcmp(name, "EMAIL_MERC_LEVEL_UP") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_NONE;
|
||||
}
|
||||
else if(strcmp(name, "EMAIL") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
if (!EmailMercLevelUp_TextOnly)
|
||||
{
|
||||
wcscpy(EmailMercLevelUpText[pData->curEmailMercLevelUp.uiIndex].szSubject, pData->curEmailMercLevelUp.szSubject);
|
||||
wcscpy(EmailMercLevelUpText[pData->curEmailMercLevelUp.uiIndex].szMessage, pData->curEmailMercLevelUp.szMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
wcscpy(EmailMercLevelUpText[pData->curEmailMercLevelUp.uiIndex].szSubject, pData->curEmailMercLevelUp.szSubject);
|
||||
wcscpy(EmailMercLevelUpText[pData->curEmailMercLevelUp.uiIndex].szMessage, pData->curEmailMercLevelUp.szMessage);
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "uiIndex") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->curEmailMercLevelUp.uiIndex = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "Subject") == 0 )
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailMercLevelUp.szSubject, sizeof(pData->curEmailMercLevelUp.szSubject)/sizeof(pData->curEmailMercLevelUp.szSubject[0]) );
|
||||
pData->curEmailMercLevelUp.szSubject[sizeof(pData->curEmailMercLevelUp.szSubject)/sizeof(pData->curEmailMercLevelUp.szSubject[0]) - 1] = '\0';
|
||||
}
|
||||
else if(strcmp(name, "Message") == 0 )
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailMercLevelUp.szMessage, sizeof(pData->curEmailMercLevelUp.szMessage)/sizeof(pData->curEmailMercLevelUp.szMessage[0]) );
|
||||
pData->curEmailMercLevelUp.szMessage[sizeof(pData->curEmailMercLevelUp.szMessage)/sizeof(pData->curEmailMercLevelUp.szMessage[0]) - 1] = '\0';
|
||||
}
|
||||
pData->maxReadDepth--;
|
||||
}
|
||||
pData->currentDepth--;
|
||||
}
|
||||
|
||||
BOOLEAN ReadInEmailMercLevelUp(STR fileName, BOOLEAN localizedVersion)
|
||||
{
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead;
|
||||
UINT32 uiFSize;
|
||||
CHAR8 * lpcBuffer;
|
||||
XML_Parser parser = XML_ParserCreate(NULL);
|
||||
|
||||
emailMercLevelUpParseData pData;
|
||||
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EmailMercLevelUp.xml" );
|
||||
|
||||
EmailMercLevelUp_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, emailMercLevelUpStartElementHandle, emailMercLevelUpEndElementHandle);
|
||||
XML_SetCharacterDataHandler(parser, emailMercLevelUpCharacterDataHandle);
|
||||
|
||||
|
||||
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 EmailMercLevelUp.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 );
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+871
-96
File diff suppressed because it is too large
Load Diff
+353
-6
@@ -2,12 +2,231 @@
|
||||
#define __EMAIL_H
|
||||
|
||||
#include "types.h"
|
||||
#include "soldier profile type.h"
|
||||
|
||||
// defines
|
||||
#define MAX_EMAIL_LINES 10 //max number of lines can be shown in a message
|
||||
#define MAX_MESSAGES_PAGE 18 // max number of messages per page
|
||||
|
||||
//---ja25 ub
|
||||
#ifdef JA2UB
|
||||
|
||||
#define EMAIL_INSURANCE_L1 170
|
||||
#define EMAIL_INSURANCE_L2 211
|
||||
#define EMAIL_INSURANCE_L3 170
|
||||
#define EMAIL_INSURANCE_L4 173
|
||||
#define EMAIL_INSURANCE_L5 179
|
||||
#define EMAIL_INSURANCE_L6 176
|
||||
|
||||
#define EMAIL_BOBBY_R_L1 198
|
||||
|
||||
#define EMAIL_AIM_L1 206
|
||||
#define EMAIL_AIM_L2 27
|
||||
#define EMAIL_AIM_L3 217
|
||||
#define EMAIL_AIM_L4 214
|
||||
|
||||
|
||||
|
||||
//JA25: New emails
|
||||
// email # 1
|
||||
#define EMAIL_STARTGAME 0
|
||||
#define EMAIL_STARTGAME_LENGTH 8
|
||||
// email # 2
|
||||
#define EMAIL_PILOTMISSING (EMAIL_STARTGAME + EMAIL_STARTGAME_LENGTH)
|
||||
#define EMAIL_PILOTMISSING_LENGTH 2
|
||||
|
||||
// email # 3
|
||||
#define EMAIL_MAKECONTACT (EMAIL_PILOTMISSING + EMAIL_PILOTMISSING_LENGTH)
|
||||
#define EMAIL_MAKECONTACT_LENGTH 3
|
||||
|
||||
// email # 4
|
||||
#define EMAIL_MANUEL (EMAIL_MAKECONTACT + EMAIL_MAKECONTACT_LENGTH)
|
||||
#define EMAIL_MANUEL_LENGTH 4
|
||||
|
||||
// # email # 5 - only if Miguel is alive!
|
||||
#define EMAIL_MIGUELHELLO (EMAIL_MANUEL + EMAIL_MANUEL_LENGTH)
|
||||
#define EMAIL_MIGUELHELLO_LENGTH 3
|
||||
|
||||
// email # 6 - player not advancing fast enough
|
||||
#define EMAIL_CONCERNED (EMAIL_MIGUELHELLO + EMAIL_MIGUELHELLO_LENGTH)
|
||||
#define EMAIL_CONCERNED_LENGTH 2
|
||||
|
||||
// email # 7 - player still not advancing fast enough
|
||||
#define EMAIL_URGENT (EMAIL_CONCERNED + EMAIL_CONCERNED_LENGTH)
|
||||
#define EMAIL_URGENT_LENGTH 3
|
||||
|
||||
// email # 8a - from Miguel
|
||||
#define EMAIL_MIGUELSORRY (EMAIL_URGENT + EMAIL_URGENT_LENGTH)
|
||||
#define EMAIL_MIGUELSORRY_LENGTH 3
|
||||
|
||||
// email # 8b - from Miguel, mentioning Manuel
|
||||
#define EMAIL_MIGUELMANUEL (EMAIL_MIGUELSORRY + EMAIL_MIGUELSORRY_LENGTH)
|
||||
#define EMAIL_MIGUELMANUEL_LENGTH 4
|
||||
|
||||
// email # 9 - Miguel sick
|
||||
#define EMAIL_MIGUELSICK (EMAIL_MIGUELMANUEL + EMAIL_MIGUELMANUEL_LENGTH)
|
||||
#define EMAIL_MIGUELSICK_LENGTH 3
|
||||
|
||||
// email # 10a
|
||||
#define EMAIL_UNDERSTANDING (EMAIL_MIGUELSICK + EMAIL_MIGUELSICK_LENGTH)
|
||||
#define EMAIL_UNDERSTANDING_LENGTH 3
|
||||
|
||||
// email # 10b - if we need extra cash
|
||||
#define EMAIL_EXTRACASH (EMAIL_UNDERSTANDING + EMAIL_UNDERSTANDING_LENGTH)
|
||||
#define EMAIL_EXTRACASH_LENGTH 4
|
||||
|
||||
// email # 11
|
||||
#define EMAIL_PILOTFOUND (EMAIL_EXTRACASH + EMAIL_EXTRACASH_LENGTH)
|
||||
#define EMAIL_PILOTFOUND_LENGTH 2
|
||||
|
||||
// email # 12a - Miguel dead, Manuel never recruited
|
||||
#define EMAIL_CONGRATS (EMAIL_PILOTFOUND + EMAIL_PILOTFOUND_LENGTH)
|
||||
#define EMAIL_CONGRATS_LENGTH 4
|
||||
|
||||
// email # 12b - Miguel alive, Manuel never recruited
|
||||
#define EMAIL_CONGRATSICK (EMAIL_CONGRATS + EMAIL_CONGRATS_LENGTH)
|
||||
#define EMAIL_CONGRATSICK_LENGTH 5
|
||||
|
||||
// email # 12c - Miguel alive, Manuel dead
|
||||
#define EMAIL_CONGRATMIGMANUELDEAD (EMAIL_CONGRATSICK + EMAIL_CONGRATSICK_LENGTH)
|
||||
#define EMAIL_CONGRATMIGMANUELDEAD_LENGTH 6
|
||||
|
||||
// email # 12d - Miguel alive, Manuel recruited and alive
|
||||
#define EMAIL_CONGRATMIGMANUELALIVE (EMAIL_CONGRATMIGMANUELDEAD + EMAIL_CONGRATMIGMANUELDEAD_LENGTH)
|
||||
#define EMAIL_CONGRATMIGMANUELALIVE_LENGTH 6
|
||||
|
||||
// email # 12e - Miguel dead, Manuel dead
|
||||
#define EMAIL_CONGRATMANUELDEAD (EMAIL_CONGRATMIGMANUELALIVE + EMAIL_CONGRATMIGMANUELALIVE_LENGTH)
|
||||
#define EMAIL_CONGRATMANUELDEAD_LENGTH 5
|
||||
|
||||
// email # 12f - Miguel dead, Manuel recruited and alive
|
||||
#define EMAIL_CONGRATMANUELALIVE (EMAIL_CONGRATMANUELDEAD + EMAIL_CONGRATMANUELDEAD_LENGTH)
|
||||
#define EMAIL_CONGRATMANUELALIVE_LENGTH 5
|
||||
|
||||
// email # 13 - original AIM email
|
||||
#define EMAIL_AIMDISCOUNT (EMAIL_CONGRATMANUELALIVE + EMAIL_CONGRATMANUELALIVE_LENGTH)
|
||||
#define EMAIL_AIMDISCOUNT_LENGTH 7
|
||||
|
||||
#define MANUEL_AT_HOME_NOT_USED ( EMAIL_AIMDISCOUNT + EMAIL_AIMDISCOUNT_LENGTH )
|
||||
#define MANUEL_AT_HOME_NOT_USED_LENGTH 1
|
||||
|
||||
//Email #14 Initial IMP email
|
||||
#define IMP_EMAIL_INTRO (MANUEL_AT_HOME_NOT_USED + MANUEL_AT_HOME_NOT_USED_LENGTH )
|
||||
#define IMP_EMAIL_INTRO_LENGTH 10
|
||||
|
||||
//Email #15 Imp follow up
|
||||
#define IMP_EMAIL_AGAIN (IMP_EMAIL_INTRO + IMP_EMAIL_INTRO_LENGTH)
|
||||
#define IMP_EMAIL_AGAIN_LENGTH 5
|
||||
|
||||
|
||||
|
||||
// Email #16 - ?? merc left-me-a-message-and-now-I'm-back emails
|
||||
#define AIM_REPLY_BARRY ( IMP_EMAIL_AGAIN + IMP_EMAIL_AGAIN_LENGTH )
|
||||
#define AIM_REPLY_LENGTH_BARRY 2
|
||||
|
||||
#define AIM_REPLY_MELTDOWN (AIM_REPLY_BARRY + ( 39 * AIM_REPLY_LENGTH_BARRY ))
|
||||
#define AIM_REPLY_LENGTH_MELTDOWN AIM_REPLY_LENGTH_BARRY
|
||||
|
||||
|
||||
#define AIM_REFUND ( AIM_REPLY_MELTDOWN + AIM_REPLY_LENGTH_MELTDOWN )
|
||||
#define AIM_REFUND_LENGTH 3
|
||||
|
||||
#define MERC_REFUND ( AIM_REFUND + AIM_REFUND_LENGTH )
|
||||
#define MERC_REFUND_LENGTH 3
|
||||
|
||||
|
||||
|
||||
#define EMAIL_AIM_PROMOTION_1 ( MERC_REFUND + MERC_REFUND_LENGTH )
|
||||
#define EMAIL_AIM_PROMOTION_1_LENGTH 4
|
||||
|
||||
#define EMAIL_MERC_PROMOTION_1 ( EMAIL_AIM_PROMOTION_1 + EMAIL_AIM_PROMOTION_1_LENGTH )
|
||||
#define EMAIL_MERC_PROMOTION_1_LENGTH 5
|
||||
|
||||
#define EMAIL_AIM_PROMOTION_2 ( EMAIL_MERC_PROMOTION_1 + EMAIL_MERC_PROMOTION_1_LENGTH )
|
||||
#define EMAIL_AIM_PROMOTION_2_LENGTH 5
|
||||
|
||||
|
||||
#define IMP_EMAIL_PROFILE_RESULTS ( EMAIL_AIM_PROMOTION_2 + EMAIL_AIM_PROMOTION_2_LENGTH )
|
||||
#define IMP_EMAIL_PROFILE_RESULTS_LENGTH 1
|
||||
|
||||
#define IMP_EMAIL_INTRO2 0
|
||||
#define IMP_EMAIL_INTRO_LENGTH2 10
|
||||
#define ENRICO_CONGRATS2 (IMP_EMAIL_INTRO2 + IMP_EMAIL_INTRO_LENGTH2)
|
||||
#define ENRICO_CONGRATS_LENGTH2 3
|
||||
#define IMP_EMAIL_AGAIN2 (ENRICO_CONGRATS2 + ENRICO_CONGRATS_LENGTH2)
|
||||
#define IMP_EMAIL_AGAIN_LENGTH2 6
|
||||
#define MERC_INTRO2 (IMP_EMAIL_AGAIN2 + IMP_EMAIL_AGAIN_LENGTH2)
|
||||
#define MERC_INTRO_LENGTH2 5
|
||||
#define MERC_NEW_SITE_ADDRESS2 ( MERC_INTRO2 + MERC_INTRO_LENGTH2 )
|
||||
#define MERC_NEW_SITE_ADDRESS_LENGTH2 2
|
||||
#define AIM_MEDICAL_DEPOSIT_REFUND2 ( MERC_NEW_SITE_ADDRESS2 + MERC_NEW_SITE_ADDRESS_LENGTH2 )
|
||||
#define AIM_MEDICAL_DEPOSIT_REFUND_LENGTH2 3
|
||||
#define IMP_EMAIL_PROFILE_RESULTS2 ( AIM_MEDICAL_DEPOSIT_REFUND2 + AIM_MEDICAL_DEPOSIT_REFUND_LENGTH2 )
|
||||
#define IMP_EMAIL_PROFILE_RESULTS_LENGTH2 1
|
||||
#define MERC_WARNING2 ( IMP_EMAIL_PROFILE_RESULTS_LENGTH2 + IMP_EMAIL_PROFILE_RESULTS2 )
|
||||
#define MERC_WARNING_LENGTH2 2
|
||||
#define MERC_INVALID2 ( MERC_WARNING2 + MERC_WARNING_LENGTH2 )
|
||||
#define MERC_INVALID_LENGTH2 2
|
||||
#define NEW_MERCS_AT_MERC ( MERC_INVALID2 + MERC_INVALID_LENGTH2 )
|
||||
#define NEW_MERCS_AT_MERC_LENGTH 2
|
||||
|
||||
//Jagged Alliance 2
|
||||
|
||||
// insurance company emails
|
||||
#define INSUR_PAYMENT 200
|
||||
#define INSUR_PAYMENT_LENGTH 3
|
||||
#define INSUR_SUSPIC 201
|
||||
#define INSUR_SUSPIC_LENGTH 3
|
||||
#define INSUR_INVEST_OVER 202
|
||||
#define INSUR_INVEST_OVER_LENGTH 3
|
||||
#define INSUR_SUSPIC_2 203
|
||||
#define INSUR_SUSPIC_2_LENGTH 3
|
||||
|
||||
#define BOBBYR_NOW_OPEN 204
|
||||
#define BOBBYR_NOW_OPEN_LENGTH 3
|
||||
|
||||
#define KING_PIN_LETTER 205
|
||||
#define KING_PIN_LETTER_LENGTH 4
|
||||
|
||||
#define LACK_PLAYER_PROGRESS_1 206
|
||||
#define LACK_PLAYER_PROGRESS_1_LENGTH 3
|
||||
|
||||
#define LACK_PLAYER_PROGRESS_2 207
|
||||
#define LACK_PLAYER_PROGRESS_2_LENGTH 3
|
||||
|
||||
#define LACK_PLAYER_PROGRESS_3 208
|
||||
#define LACK_PLAYER_PROGRESS_3_LENGTH 3
|
||||
|
||||
//A package from bobby r has arrived in Drassen
|
||||
#define BOBBYR_SHIPMENT_ARRIVED 199
|
||||
#define BOBBYR_SHIPMENT_ARRIVED_LENGTH 4
|
||||
|
||||
// John Kulba has left the gifts for theplayers in drassen
|
||||
#define JOHN_KULBA_GIFT_IN_DRASSEN 209
|
||||
#define JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH 4
|
||||
|
||||
//when a merc dies on ANOTHER assignment ( ie not with the player )
|
||||
#define MERC_DIED_ON_OTHER_ASSIGNMENT 210
|
||||
#define MERC_DIED_ON_OTHER_ASSIGNMENT_LENGTH 5
|
||||
|
||||
#define INSUR_1HOUR_FRAUD 211
|
||||
#define INSUR_1HOUR_FRAUD_LENGTH 3
|
||||
|
||||
//when a merc is fired, and is injured
|
||||
#define AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND 212
|
||||
#define AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH 3
|
||||
|
||||
//when a merc is fired, and is dead
|
||||
#define AIM_MEDICAL_DEPOSIT_NO_REFUND 213
|
||||
#define AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH 3
|
||||
|
||||
#define BOBBY_R_MEDUNA_SHIPMENT 214
|
||||
#define BOBBY_R_MEDUNA_SHIPMENT_LENGTH 4
|
||||
|
||||
#define AIM_MEDICAL_DEPOSIT_REFUND 215
|
||||
#define AIM_MEDICAL_DEPOSIT_REFUND_LENGTH 3
|
||||
|
||||
#else
|
||||
#define IMP_EMAIL_INTRO 0
|
||||
#define IMP_EMAIL_INTRO_LENGTH 10
|
||||
#define ENRICO_CONGRATS (IMP_EMAIL_INTRO + IMP_EMAIL_INTRO_LENGTH)
|
||||
@@ -133,7 +352,7 @@
|
||||
|
||||
#define BOBBY_R_MEDUNA_SHIPMENT ( AIM_MEDICAL_DEPOSIT_NO_REFUND + AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH )
|
||||
#define BOBBY_R_MEDUNA_SHIPMENT_LENGTH 4
|
||||
|
||||
#endif
|
||||
// WANNE: New 1.13 MERC merc mail text for level up that Speck sends
|
||||
//#define MERC_UP_LEVEL_GASTON (BOBBY_R_MEDUNA_SHIPMENT + BOBBY_R_MEDUNA_SHIPMENT_LENGTH)
|
||||
//#define MERC_UP_LEVEL_GASTON_LENGTH 2
|
||||
@@ -182,6 +401,10 @@ struct email
|
||||
// So we know which analyse email belongs to the imp
|
||||
INT32 iCurrentIMPPosition;
|
||||
|
||||
UINT8 EmailVersion;
|
||||
|
||||
UINT32 EmailType;
|
||||
|
||||
// WANNE.MAIL: Fix
|
||||
INT16 iCurrentShipmentDestinationID;
|
||||
|
||||
@@ -269,6 +492,9 @@ enum {
|
||||
KING_PIN,
|
||||
JOHN_KULBA,
|
||||
AIM_SITE,
|
||||
#ifdef JA2UB
|
||||
MAIL_MIGUEL,
|
||||
#endif
|
||||
};
|
||||
|
||||
// the length of the subject in char
|
||||
@@ -300,16 +526,16 @@ void RenderEmail();
|
||||
|
||||
|
||||
// message manipulation
|
||||
void AddEmailMessage(INT32 iMessageOffset, INT32 iMessageLength,STR16 pSubject, INT32 iDate, UINT8 ubSender, BOOLEAN fAlreadyRead, INT32 uiFirstData, UINT32 uiSecondData, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID );
|
||||
void AddEmailMessage(INT32 iMessageOffset, INT32 iMessageLength,STR16 pSubject, INT32 iDate, UINT8 ubSender, BOOLEAN fAlreadyRead, INT32 uiFirstData, UINT32 uiSecondData, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType, UINT32 EmailAIM );
|
||||
void RemoveEmailMessage(INT32 iId);
|
||||
EmailPtr GetEmailMessage(INT32 iId);
|
||||
void LookForUnread();
|
||||
void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID);
|
||||
void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType);
|
||||
|
||||
// WANNE: For the new WF merc, when they available again
|
||||
void AddEmailWFMercAvailable(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition);
|
||||
void AddEmailWFMercAvailable(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType);
|
||||
|
||||
void AddPreReadEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate);
|
||||
void AddPreReadEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, UINT8 EmailType );
|
||||
BOOLEAN DisplayNewMailBox();
|
||||
void CreateDestroyNewMailButton();
|
||||
void CreateDestroyDeleteNoticeMailButton();
|
||||
@@ -319,12 +545,133 @@ void ReDrawNewMailBox( void );
|
||||
void ReDisplayBoxes( void );
|
||||
void ShutDownEmailList();
|
||||
void AddMessageToPages(INT32 iMessageId);
|
||||
void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData );
|
||||
void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailType, UINT32 EmailAIM );
|
||||
|
||||
void AddCustomEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType);
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
void AddAllEmails();
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 uiIndex;
|
||||
CHAR16 szMessage[MAIL_STRING_SIZE];
|
||||
CHAR16 szSubject[EMAIL_SUBJECT_LENGTH];
|
||||
|
||||
} EMAIL_MERC_AVAILABLE_VALUES;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 uiIndex;
|
||||
CHAR16 szMessage[MAIL_STRING_SIZE];
|
||||
CHAR16 szSubject[EMAIL_SUBJECT_LENGTH];
|
||||
|
||||
} EMAIL_MERC_LEVEL_UP_VALUES;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 uiIndex;
|
||||
CHAR16 szMessage[MAIL_STRING_SIZE];
|
||||
CHAR16 szSubject[EMAIL_SUBJECT_LENGTH];
|
||||
|
||||
} EMAIL_MERC_INSURANCE_VALUES;
|
||||
|
||||
#define EMAIL_INDEX 500
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 uiIndex;
|
||||
CHAR16 szMessage[MAIL_STRING_SIZE][30];
|
||||
CHAR16 szSubject[EMAIL_SUBJECT_LENGTH];
|
||||
} EMAIL_OTHER_VALUES;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 uiIndex;
|
||||
UINT32 EmailType;
|
||||
UINT8 EmailVersion;
|
||||
|
||||
} EMAIL_TYPE;
|
||||
|
||||
#define EMAIL_VAL 4000
|
||||
|
||||
extern EMAIL_TYPE gEmailT[EMAIL_VAL];
|
||||
|
||||
enum {
|
||||
//------------------------------
|
||||
//Read Email.edt
|
||||
// read message from Email.edt
|
||||
TYPE_EMAIL_EMAIL_EDT = 0,
|
||||
// read message from Email.edt and nickname (sender) read from MercProfiles.xml
|
||||
TYPE_EMAIL_EMAIL_EDT_NAME_MERC,
|
||||
|
||||
//-------------------------------
|
||||
//Read *.xml
|
||||
//Read message from Email\EmailMercAvailable.xml.XML and nickname (sender) read from MercProfiles.xml
|
||||
TYPE_EMAIL_AIM_AVAILABLE,
|
||||
//Read message from Email\EmailMercLevelUp.xml.XML and nickname (sender) read from MercProfiles.xml
|
||||
TYPE_EMAIL_MERC_LEVEL_UP,
|
||||
|
||||
//Read from others *.XMLs
|
||||
TYPE_EMAIL_BOBBY_R,
|
||||
|
||||
//Read from JA2 Email.edt
|
||||
TYPE_EMAIL_BOBBY_R_EMAIL_JA2_EDT,
|
||||
TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT,
|
||||
TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT,
|
||||
|
||||
//Read from others *.XMLs
|
||||
TYPE_EMAIL_ENRICO,
|
||||
TYPE_EMAIL_CHAR_PROFILE_SITE,
|
||||
TYPE_EMAIL_GAME_HELP,
|
||||
TYPE_EMAIL_IMP_PROFILE_RESULTS,
|
||||
TYPE_EMAIL_SPECK_FROM_MERC,
|
||||
TYPE_EMAIL_RIS_EMAIL,
|
||||
TYPE_EMAIL_INSURANCE_COMPANY,
|
||||
TYPE_EMAIL_KING_PIN,
|
||||
TYPE_EMAIL_JOHN_KULBA,
|
||||
TYPE_EMAIL_AIM_SITE,
|
||||
|
||||
TYPE_EMAIL_OTHER,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
TYPE_E_NONE = 0,
|
||||
|
||||
TYPE_E_AIM_L1 = 1, //206
|
||||
TYPE_E_AIM_L2 = 2, //27
|
||||
TYPE_E_AIM_L3 = 3, //217
|
||||
TYPE_E_AIM_L4 = 4, //214
|
||||
|
||||
TYPE_E_INSURANCE_L1 = 5, //170
|
||||
TYPE_E_INSURANCE_L2 = 6, //211
|
||||
TYPE_E_INSURANCE_L3 = 7, //170
|
||||
TYPE_E_INSURANCE_L4 = 8, //173
|
||||
TYPE_E_INSURANCE_L5 = 9, //179
|
||||
TYPE_E_INSURANCE_L6 = 10, //176
|
||||
|
||||
TYPE_EMAIL_BOBBY_R_L1 = 11,
|
||||
};
|
||||
|
||||
extern EMAIL_MERC_AVAILABLE_VALUES EmailMercAvailableText[NUM_PROFILES];
|
||||
extern EMAIL_MERC_LEVEL_UP_VALUES EmailMercLevelUpText[NUM_PROFILES];
|
||||
extern EMAIL_MERC_INSURANCE_VALUES EmailInsuranceText[NUM_PROFILES];
|
||||
|
||||
extern EMAIL_OTHER_VALUES EmailOtherText[EMAIL_INDEX];
|
||||
extern BOOLEAN ReadXMLEmail;
|
||||
extern void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType );
|
||||
extern void AddPreReadEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, UINT8 EmailType );
|
||||
extern void AddEmailWithSpecialDataXML(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailType );
|
||||
extern BOOLEAN SaveNewEmailDataToSaveGameFile( HWFILE hFile );
|
||||
extern BOOLEAN LoadNewEmailDataFromLoadGameFile( HWFILE hFile );
|
||||
|
||||
#ifdef JA2UB
|
||||
extern void AddBobbyREmailJA2(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
+291
-2
@@ -20,6 +20,10 @@
|
||||
#include "GameSettings.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#define TOP_X LAPTOP_SCREEN_UL_X
|
||||
#define TOP_Y LAPTOP_SCREEN_UL_Y
|
||||
#define BLOCK_FILE_HEIGHT 10
|
||||
@@ -44,7 +48,12 @@
|
||||
#define FILES_LIST_X FILES_SENDER_TEXT_X
|
||||
#define FILES_LIST_Y ( 9 * BLOCK_HEIGHT )
|
||||
#define FILES_LIST_WIDTH 100
|
||||
|
||||
#ifdef JA2UB
|
||||
#define LENGTH_OF_ENRICO_FILE 39 //Ja25 68
|
||||
#else
|
||||
#define LENGTH_OF_ENRICO_FILE 68
|
||||
#endif
|
||||
#define MAX_FILE_MESSAGE_PAGE_SIZE 325
|
||||
#define VIEWER_MESSAGE_BODY_START_Y FILES_LIST_Y
|
||||
#define PREVIOUS_FILE_PAGE_BUTTON_X iScreenWidthOffset + 553
|
||||
@@ -56,6 +65,13 @@
|
||||
#define FILES_COUNTER_2_WIDTH 43
|
||||
#define FILES_COUNTER_3_WIDTH 45
|
||||
|
||||
#ifdef JA2UB
|
||||
#define RIS_EDT_FILE_JA25 "BINARYDATA\\RIS25.edt"
|
||||
#define RIS_EDT_FILE_JA2 "BINARYDATA\\RIS.edt"
|
||||
|
||||
#define MAP_JA25 "LAPTOP\\TraconaMap.sti"
|
||||
#define MAP_JA2 "LAPTOP\\ArucoFilesMap.sti"
|
||||
#endif
|
||||
|
||||
// the highlighted line
|
||||
INT32 iHighLightFileLine=-1;
|
||||
@@ -176,6 +192,8 @@ void AddStringToFilesList( STR16 pString );
|
||||
BOOLEAN HandleSpecialFiles( UINT8 ubFormat );
|
||||
BOOLEAN HandleSpecialTerroristFile( INT32 iFileNumber, STR sPictureName );
|
||||
|
||||
BOOLEAN HandleMissionBriefingFiles( UINT8 ubFormat ); //mission briefing by Jazz
|
||||
FileRecordWidthPtr CreateWidthRecordsForMissionBriefingFile( void );
|
||||
|
||||
// callbacks
|
||||
void FilesBtnCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
@@ -224,8 +242,16 @@ void GameInitFiles( )
|
||||
ClearFilesList( );
|
||||
|
||||
// add background check by RIS
|
||||
AddFilesToPlayersLog( ENRICO_BACKGROUND, 0,255, NULL, NULL );
|
||||
|
||||
//#ifdef JA2UB
|
||||
//if ( gGameUBOptions.RISRAPORT == TRUE )
|
||||
// AddFilesToPlayersLog( ENRICO_BACKGROUND, 0,255, NULL, NULL );
|
||||
//#else
|
||||
AddFilesToPlayersLog( ENRICO_BACKGROUND, 0,255, NULL, NULL );
|
||||
//#endif
|
||||
|
||||
//mission briefing by Jazz
|
||||
//AddFilesToPlayersLog( MISSION_BRIEFING, 0,4, NULL, NULL );
|
||||
}
|
||||
|
||||
void EnterFiles()
|
||||
@@ -997,6 +1023,11 @@ BOOLEAN DisplayFormattedText( void )
|
||||
// load first graphic
|
||||
HandleSpecialTerroristFile( pFilesList->ubCode, pFilesList->pPicFileNameList[ 0 ] );
|
||||
break;
|
||||
case 4:
|
||||
// picture on the left, with text on right and below
|
||||
// load first graphic
|
||||
HandleMissionBriefingFiles( pFilesList->ubFormat );
|
||||
break;
|
||||
default:
|
||||
HandleSpecialFiles( pFilesList->ubFormat );
|
||||
break;
|
||||
@@ -1009,6 +1040,232 @@ BOOLEAN DisplayFormattedText( void )
|
||||
return ( TRUE );
|
||||
}
|
||||
|
||||
//Mission briefing by Jazz
|
||||
|
||||
FileRecordWidthPtr CreateWidthRecordsForMissionBriefingFile( void )
|
||||
{
|
||||
// this fucntion will create the width list for the Arulco intelligence file
|
||||
FileRecordWidthPtr pTempRecord = NULL;
|
||||
FileRecordWidthPtr pRecordListHead = NULL;
|
||||
|
||||
|
||||
// first record width
|
||||
// pTempRecord = CreateRecordWidth( 7, 350, 200,0 );
|
||||
pTempRecord = CreateRecordWidth( FILES_COUNTER_1_WIDTH, 200, 0,0 );
|
||||
|
||||
// set up head of list now
|
||||
pRecordListHead = pTempRecord;
|
||||
|
||||
// next record
|
||||
// pTempRecord->Next = CreateRecordWidth( 43, 200,0, 0 );
|
||||
pTempRecord->Next = CreateRecordWidth( FILES_COUNTER_2_WIDTH, 200,0, 0 );
|
||||
pTempRecord = pTempRecord->Next;
|
||||
|
||||
// and the next..
|
||||
// pTempRecord->Next = CreateRecordWidth( 45, 200,0, 0 );
|
||||
pTempRecord->Next = CreateRecordWidth( FILES_COUNTER_3_WIDTH, 200,0, 0 );
|
||||
pTempRecord = pTempRecord->Next;
|
||||
|
||||
return( pRecordListHead );
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN HandleMissionBriefingFiles( UINT8 ubFormat )
|
||||
{
|
||||
INT32 iCounter = 0;
|
||||
CHAR16 sString[2048];
|
||||
FileStringPtr pTempString = NULL ;
|
||||
FileStringPtr pLocatorString = NULL;
|
||||
INT32 iYPositionOnPage = 0;
|
||||
INT32 iFileLineWidth = 0;
|
||||
INT32 iFileStartX = 0;
|
||||
UINT32 uiFlags = 0;
|
||||
UINT32 uiFont = 0;
|
||||
BOOLEAN fGoingOffCurrentPage = FALSE;
|
||||
FileRecordWidthPtr WidthList = NULL;
|
||||
|
||||
|
||||
UINT32 uiPicture;
|
||||
HVOBJECT hHandle;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
|
||||
ClearFileStringList( );
|
||||
|
||||
switch( ubFormat )
|
||||
{
|
||||
case( 4 ):
|
||||
// load data
|
||||
// read one record from file manager file
|
||||
|
||||
WidthList = CreateWidthRecordsForMissionBriefingFile( );
|
||||
while( iCounter < 250 )
|
||||
{
|
||||
LoadEncryptedDataFromFile( "binarydata\\MissionBriefing.EDT", sString, FILE_STRING_SIZE * ( iCounter ) * 2, FILE_STRING_SIZE * 2 );
|
||||
|
||||
AddStringToFilesList( sString );
|
||||
iCounter++;
|
||||
}
|
||||
|
||||
pTempString = pFileStringList;
|
||||
|
||||
|
||||
iYPositionOnPage = 0;
|
||||
iCounter = 0;
|
||||
pLocatorString = pTempString;
|
||||
|
||||
pTempString = GetFirstStringOnThisPage( pFileStringList,FILES_TEXT_FONT, 350, FILE_GAP, giFilesPage, MAX_FILE_MESSAGE_PAGE_SIZE, WidthList);
|
||||
|
||||
// find out where this string is
|
||||
while( pLocatorString != pTempString )
|
||||
{
|
||||
iCounter++;
|
||||
pLocatorString = pLocatorString->Next;
|
||||
}
|
||||
|
||||
|
||||
// move through list and display
|
||||
while( pTempString )
|
||||
{
|
||||
uiFlags = IAN_WRAP_NO_SHADOW;
|
||||
// copy over string
|
||||
wcscpy( sString, pTempString->pString );
|
||||
|
||||
if( sString[ 0 ] == 0 )
|
||||
{
|
||||
// on last page
|
||||
fOnLastFilesPageFlag = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// set up font
|
||||
uiFont = FILES_TEXT_FONT;
|
||||
if( giFilesPage == 0 )
|
||||
{
|
||||
switch( iCounter )
|
||||
{
|
||||
case( 0 ):
|
||||
uiFont = FILES_TITLE_FONT;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if( iCounter == 0 )
|
||||
{
|
||||
// reset width
|
||||
iFileLineWidth = 350;
|
||||
iFileStartX = (UINT16) ( FILE_VIEWER_X + 10 );
|
||||
}
|
||||
else
|
||||
{
|
||||
// reset width
|
||||
iFileLineWidth = 350;
|
||||
iFileStartX = (UINT16) ( FILE_VIEWER_X + 10 );
|
||||
}
|
||||
|
||||
if( ( iYPositionOnPage + IanWrappedStringHeight(0, 0, ( UINT16 )iFileLineWidth, FILE_GAP,
|
||||
uiFont, 0, sString,
|
||||
0, 0, 0 ) ) < MAX_FILE_MESSAGE_PAGE_SIZE )
|
||||
{
|
||||
// now print it
|
||||
iYPositionOnPage += ( INT32 )IanDisplayWrappedString((UINT16) ( iFileStartX ), ( UINT16 )( FILE_VIEWER_Y + iYPositionOnPage), ( INT16 )iFileLineWidth, FILE_GAP, uiFont, FILE_TEXT_COLOR, sString,0,FALSE, uiFlags );
|
||||
|
||||
fGoingOffCurrentPage = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// gonna get cut off...end now
|
||||
fGoingOffCurrentPage = TRUE;
|
||||
}
|
||||
|
||||
pTempString = pTempString->Next;
|
||||
|
||||
if( pTempString == NULL )
|
||||
{
|
||||
// on last page
|
||||
fOnLastFilesPageFlag = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
fOnLastFilesPageFlag = FALSE;
|
||||
}
|
||||
|
||||
// going over the edge, stop now
|
||||
if( fGoingOffCurrentPage == TRUE )
|
||||
{
|
||||
pTempString = NULL;
|
||||
}
|
||||
iCounter++;
|
||||
}
|
||||
ClearOutWidthRecordsList( WidthList );
|
||||
ClearFileStringList( );
|
||||
break;
|
||||
}
|
||||
|
||||
// place pictures
|
||||
// page 1 picture of country
|
||||
if( giFilesPage == 0 )
|
||||
{
|
||||
// title bar
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
//Ja25, new map
|
||||
#ifdef JA2UB
|
||||
if (FileExists(MAP_JA25))
|
||||
{
|
||||
FilenameForBPP("LAPTOP\\TraconaMap.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
#else
|
||||
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
|
||||
#endif
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &uiPicture));
|
||||
|
||||
// get title bar object
|
||||
GetVideoObject(&hHandle, uiPicture);
|
||||
|
||||
// blt title bar to screen
|
||||
BltVideoObject(FRAME_BUFFER, hHandle, 0,iScreenWidthOffset + 300, iScreenHeightOffset + 270, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
DeleteVideoObjectFromIndex( uiPicture );
|
||||
|
||||
}
|
||||
else if( giFilesPage == 1 )
|
||||
{
|
||||
// title bar
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
//Ja25, new map
|
||||
#ifdef JA2UB
|
||||
if (FileExists(MAP_JA25))
|
||||
{
|
||||
FilenameForBPP("LAPTOP\\TraconaMap.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
#else
|
||||
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
|
||||
#endif
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &uiPicture));
|
||||
|
||||
// get title bar object
|
||||
GetVideoObject(&hHandle, uiPicture);
|
||||
|
||||
// blt title bar to screen
|
||||
BltVideoObject(FRAME_BUFFER, hHandle, 0,iScreenWidthOffset + 300, iScreenHeightOffset + 270, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
|
||||
DeleteVideoObjectFromIndex( uiPicture );
|
||||
|
||||
}
|
||||
|
||||
return ( TRUE );
|
||||
}
|
||||
|
||||
//-------------------------------------------
|
||||
|
||||
BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
|
||||
{
|
||||
@@ -1041,7 +1298,18 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
|
||||
WidthList = CreateWidthRecordsForAruloIntelFile( );
|
||||
while( iCounter < LENGTH_OF_ENRICO_FILE )
|
||||
{
|
||||
#ifdef JA2UB
|
||||
if (FileExists(RIS_EDT_FILE_JA25))
|
||||
{
|
||||
LoadEncryptedDataFromFile( RIS_EDT_FILE_JA25, sString, FILE_STRING_SIZE * ( iCounter ) * 2, FILE_STRING_SIZE * 2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadEncryptedDataFromFile( RIS_EDT_FILE_JA25, sString, FILE_STRING_SIZE * ( iCounter ) * 2, FILE_STRING_SIZE * 2 );
|
||||
}
|
||||
#else
|
||||
LoadEncryptedDataFromFile( "BINARYDATA\\RIS.EDT", sString, FILE_STRING_SIZE * ( iCounter ) * 2, FILE_STRING_SIZE * 2 );
|
||||
#endif
|
||||
AddStringToFilesList( sString );
|
||||
iCounter++;
|
||||
}
|
||||
@@ -1189,7 +1457,19 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
|
||||
{
|
||||
// title bar
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
#ifdef JA2UB
|
||||
//Ja25, new map
|
||||
if (FileExists(MAP_JA25))
|
||||
{
|
||||
FilenameForBPP("LAPTOP\\TraconaMap.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
#else
|
||||
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
|
||||
#endif
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &uiPicture));
|
||||
|
||||
// get title bar object
|
||||
@@ -1201,6 +1481,10 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
|
||||
DeleteVideoObjectFromIndex( uiPicture );
|
||||
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25 : no picture needed
|
||||
#else
|
||||
else if( giFilesPage == 4 )
|
||||
{
|
||||
// kid pic
|
||||
@@ -1217,6 +1501,11 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
|
||||
DeleteVideoObjectFromIndex( uiPicture );
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25 No picture
|
||||
#else
|
||||
else if( giFilesPage == 5 )
|
||||
{
|
||||
|
||||
@@ -1234,7 +1523,7 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
|
||||
|
||||
DeleteVideoObjectFromIndex( uiPicture );
|
||||
}
|
||||
|
||||
#endif
|
||||
return ( TRUE );
|
||||
}
|
||||
|
||||
|
||||
@@ -652,6 +652,9 @@ void BtnFlowerOrderSendButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
if ( gubCurrentlySelectedFlowerLocation == 7 )
|
||||
{
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
#else
|
||||
// sent to meduna!
|
||||
if ( gfFLoristCheckBox0Down )
|
||||
{
|
||||
@@ -661,6 +664,7 @@ void BtnFlowerOrderSendButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
HandleFlowersMeanwhileScene( 1 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//increment the order number
|
||||
|
||||
@@ -68,6 +68,11 @@ UINT32 guiSHADELINE;
|
||||
//UINT32 guiVERTLINE;
|
||||
//UINT32 guiBIGBOX;
|
||||
|
||||
#ifdef JA2UB
|
||||
#define QUEST_EDT_FILE_JA25 "BINARYDATA\\quests25.edt"
|
||||
#define QUEST_EDT_FILE_JA2 "BINARYDATA\\quests.edt"
|
||||
#endif
|
||||
|
||||
enum{
|
||||
PREV_PAGE_BUTTON=0,
|
||||
NEXT_PAGE_BUTTON,
|
||||
@@ -1681,14 +1686,36 @@ UINT32 GetTimeQuestWasStarted( UINT8 ubCode )
|
||||
void GetQuestStartedString( UINT8 ubQuestValue, STR16 sQuestString )
|
||||
{
|
||||
// open the file and copy the string
|
||||
#ifdef JA2UB
|
||||
if (FileExists(QUEST_EDT_FILE_JA25))
|
||||
{
|
||||
LoadEncryptedDataFromFile( QUEST_EDT_FILE_JA25, sQuestString, 160 * ( ubQuestValue * 2 ), 160 );
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadEncryptedDataFromFile( QUEST_EDT_FILE_JA2, sQuestString, 160 * ( ubQuestValue * 2 ), 160 );
|
||||
}
|
||||
#else
|
||||
LoadEncryptedDataFromFile( "BINARYDATA\\quests.edt", sQuestString, 160 * ( ubQuestValue * 2 ), 160 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void GetQuestEndedString( UINT8 ubQuestValue, STR16 sQuestString )
|
||||
{
|
||||
// open the file and copy the string
|
||||
#ifdef JA2UB
|
||||
if (FileExists(QUEST_EDT_FILE_JA25))
|
||||
{
|
||||
LoadEncryptedDataFromFile( QUEST_EDT_FILE_JA25, sQuestString, 160 * ( ( ubQuestValue * 2 ) + 1), 160 );
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadEncryptedDataFromFile( QUEST_EDT_FILE_JA2, sQuestString, 160 * ( ubQuestValue * 2 ), 160 );
|
||||
}
|
||||
#else
|
||||
LoadEncryptedDataFromFile( "BINARYDATA\\quests.edt", sQuestString, 160 * ( ( ubQuestValue * 2 ) + 1), 160 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
#endif
|
||||
#include <vector>
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "ub_config.h"
|
||||
#include "quests.h"
|
||||
#endif
|
||||
|
||||
#define INS_CTRCT_ORDER_GRID_WIDTH 132
|
||||
#define INS_CTRCT_ORDER_GRID_HEIGHT 216
|
||||
#define INS_CTRCT_ORDER_GRID_OFFSET_X INS_CTRCT_ORDER_GRID_WIDTH + 2
|
||||
@@ -1361,12 +1366,30 @@ void StartInsuranceInvestigation( UINT8 ubPayoutID )
|
||||
if (gStrategicStatus.ubInsuranceInvestigationsCnt == 0)
|
||||
{
|
||||
// first offense
|
||||
AddEmailWithSpecialData( INSUR_SUSPIC, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||
{
|
||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
AddEmailWithSpecialData( 173, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L4 );
|
||||
}
|
||||
#else
|
||||
AddEmailWithSpecialData( INSUR_SUSPIC, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// subsequent offense
|
||||
AddEmailWithSpecialData( INSUR_SUSPIC_2, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||
{
|
||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
AddEmailWithSpecialData( 179, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L5 );
|
||||
}
|
||||
#else
|
||||
AddEmailWithSpecialData( INSUR_SUSPIC_2, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
|
||||
@@ -1394,11 +1417,29 @@ void EndInsuranceInvestigation( UINT8 ubPayoutID )
|
||||
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
|
||||
{
|
||||
// fraud, no payout!
|
||||
AddEmailWithSpecialData( INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||
{
|
||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
AddEmailWithSpecialData( 211, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L2 );
|
||||
}
|
||||
#else
|
||||
AddEmailWithSpecialData( INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
AddEmailWithSpecialData( INSUR_INVEST_OVER, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
|
||||
#ifdef JA2UB
|
||||
// No UB
|
||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||
{
|
||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
AddEmailWithSpecialData( 176, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L6 );
|
||||
}
|
||||
#else
|
||||
AddEmailWithSpecialData( INSUR_INVEST_OVER, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
||||
#endif
|
||||
|
||||
// only now make a payment (immediately)
|
||||
InsuranceContractPayLifeInsuranceForDeadMerc( ubPayoutID );
|
||||
@@ -1427,7 +1468,16 @@ void InsuranceContractPayLifeInsuranceForDeadMerc( UINT8 ubPayoutID )
|
||||
if( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == 0 )
|
||||
{
|
||||
//Add an email telling the user that he received an insurance payment
|
||||
AddEmailWithSpecialData( INSUR_PAYMENT, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||
{
|
||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
AddEmailWithSpecialData( 170, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L3 );
|
||||
}
|
||||
#else
|
||||
AddEmailWithSpecialData( INSUR_PAYMENT, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
||||
#endif
|
||||
}
|
||||
|
||||
LaptopSaveInfo.ubNumberLifeInsurancePayoutUsed --;
|
||||
|
||||
+445
-26
@@ -85,12 +85,26 @@
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
#include "Encyclopedia_Data.h"
|
||||
#include "Encyclopedia.h"
|
||||
#include "BriefingRoom.h"
|
||||
#include "BriefingRoomM.h"
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "End Game.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
#ifdef JA2UB
|
||||
BOOLEAN gfProcessCustomMaps = FALSE; //ja25 UB
|
||||
#endif
|
||||
|
||||
// icons text id's
|
||||
enum{
|
||||
@@ -651,7 +665,10 @@ extern void CheatToGetAll5Merc();
|
||||
extern void DemoHiringOfMercs( );
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25 UB
|
||||
#define LAPTOP__HAVENT_CREATED_IMP_REMINDER_EMAIL_ARRIVE_TIME ( (8 + Random(4) ) * 60 )
|
||||
#endif
|
||||
|
||||
void SetLaptopExitScreen( UINT32 uiExitScreen )
|
||||
{
|
||||
@@ -740,6 +757,13 @@ UINT32 LaptopScreenInit()
|
||||
//reset the flag that enables the 'just hired merc' popup
|
||||
LaptopSaveInfo.sLastHiredMerc.fHaveDisplayedPopUpInLaptop = FALSE;
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25 UB
|
||||
//Set the internet as WORKING
|
||||
if ( gGameUBOptions.LaptopQuestEnabled == TRUE )
|
||||
gubQuest[ QUEST_FIX_LAPTOP ] = QUESTNOTSTARTED;
|
||||
#endif
|
||||
|
||||
//Initialize all vars
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_EMAIL;
|
||||
guiPreviousLaptopMode = LAPTOP_MODE_NONE;
|
||||
@@ -770,20 +794,37 @@ UINT32 LaptopScreenInit()
|
||||
GameInitEmail();
|
||||
GameInitCharProfile();
|
||||
GameInitFlorist();
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
{
|
||||
GameInitInsurance();
|
||||
GameInitInsuranceContract();
|
||||
}
|
||||
//JA25:
|
||||
#else
|
||||
GameInitInsurance();
|
||||
GameInitInsuranceContract();
|
||||
#endif
|
||||
GameInitFuneral();
|
||||
GameInitSirTech();
|
||||
GameInitFiles();
|
||||
GameInitPersonnel();
|
||||
|
||||
//legion
|
||||
GameInitEncyclopedia();
|
||||
GameInitEncyclopediaLocation();
|
||||
GameInitBriefingRoom();
|
||||
GameInitBriefingRoomEnter();
|
||||
|
||||
// init program states
|
||||
memset( &gLaptopProgramStates, LAPTOP_PROGRAM_MINIMIZED, sizeof( gLaptopProgramStates ) );
|
||||
|
||||
gfAtLeastOneMercWasHired = FALSE;
|
||||
|
||||
//No longer inits the laptop screens, now InitLaptopAndLaptopScreens() does
|
||||
|
||||
#ifdef JA2UB
|
||||
InitJa25SaveStruct();
|
||||
#endif
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
@@ -798,6 +839,11 @@ BOOLEAN InitLaptopAndLaptopScreens()
|
||||
LaptopSaveInfo.fIMPCompletedFlag = FALSE;
|
||||
|
||||
//Reset the flag so that BOBBYR's isnt available at the begining of the game
|
||||
#ifdef JA2UB
|
||||
if ( gGameUBOptions.fBobbyRSite == TRUE )
|
||||
LaptopSaveInfo.fBobbyRSiteCanBeAccessed = TRUE;
|
||||
else
|
||||
#endif
|
||||
LaptopSaveInfo.fBobbyRSiteCanBeAccessed = FALSE;
|
||||
|
||||
return( TRUE );
|
||||
@@ -825,7 +871,13 @@ DrawLapTopText()
|
||||
//This is only called once at game shutdown.
|
||||
UINT32 LaptopScreenShutdown()
|
||||
{
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
InsuranceContractEndGameShutDown();
|
||||
//JA25:
|
||||
#else
|
||||
InsuranceContractEndGameShutDown();
|
||||
#endif
|
||||
BobbyRayMailOrderEndGameShutDown();
|
||||
ShutDownEmailList();
|
||||
|
||||
@@ -991,17 +1043,25 @@ INT32 EnterLaptop()
|
||||
fMaximizingProgram = FALSE;
|
||||
fMinizingProgram = FALSE;
|
||||
|
||||
|
||||
// initialize open queue
|
||||
InitLaptopOpenQueue( );
|
||||
|
||||
|
||||
gfShowBookmarks=FALSE;
|
||||
LoadBookmark( );
|
||||
|
||||
if (!is_networked)
|
||||
SetBookMark(AIM_BOOKMARK);
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25 UB
|
||||
SetBookMark(MERC_BOOKMARK);
|
||||
#endif
|
||||
if ( gGameExternalOptions.gEncyclopedia == TRUE && !is_networked )
|
||||
SetBookMark(ENCYCLOPEDIA_BOOKMARK);
|
||||
|
||||
if ( gGameExternalOptions.gBriefingRoom == TRUE && !is_networked )
|
||||
SetBookMark(BRIEFING_ROOM_BOOKMARK);
|
||||
|
||||
LoadLoadPending( );
|
||||
|
||||
DrawDeskTopBackground( );
|
||||
@@ -1137,7 +1197,13 @@ void ExitLaptop()
|
||||
// CloseLibrary( LIBRARY_LAPTOP );
|
||||
//pause the game because we dont want time to advance in the laptop
|
||||
UnPauseGame();
|
||||
|
||||
#ifdef JA2UB
|
||||
//ja25 UB
|
||||
if( gTacticalStatus.uiFlags & IN_ENDGAME_SEQUENCE )
|
||||
{
|
||||
HandleJa25EndGameAndGoToCreditsScreen( FALSE );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1183,6 +1249,27 @@ void RenderLaptop()
|
||||
case( LAPTOP_MODE_NONE ):
|
||||
DrawDeskTopBackground( );
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_ENCYCLOPEDIA: //LEGION
|
||||
RenderEncyclopedia();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_ENCYCLOPEDIA_LOCATION:
|
||||
RenderEncyclopediaLocation(FALSE);
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
|
||||
RenderBriefingRoom();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM_ENTER:
|
||||
RenderBriefingRoomEnter();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM:
|
||||
RenderEncyclopediaLocation(FALSE);
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_AIM:
|
||||
RenderAIM();
|
||||
break;
|
||||
@@ -1214,10 +1301,18 @@ void RenderLaptop()
|
||||
RenderMercsFiles();
|
||||
break;
|
||||
case LAPTOP_MODE_MERC_ACCOUNT:
|
||||
#ifdef JA2UB
|
||||
//Ja25
|
||||
#else
|
||||
RenderMercsAccount();
|
||||
#endif
|
||||
break;
|
||||
case LAPTOP_MODE_MERC_NO_ACCOUNT:
|
||||
#ifdef JA2UB
|
||||
//Ja25
|
||||
#else
|
||||
RenderMercsNoAccount();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BOBBY_R:
|
||||
@@ -1259,19 +1354,43 @@ void RenderLaptop()
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE:
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
RenderInsurance();
|
||||
//JA25: // Assert( 0 );
|
||||
#else
|
||||
RenderInsurance();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE_INFO:
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
RenderInsuranceInfo();
|
||||
//JA25: // Assert( 0 );
|
||||
#else
|
||||
RenderInsuranceInfo();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE_CONTRACT:
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
RenderInsuranceContract();
|
||||
//JA25:
|
||||
#else
|
||||
RenderInsuranceContract();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE_COMMENTS:
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
RenderInsuranceComments();
|
||||
//JA25: // Assert( 0 );
|
||||
#else
|
||||
RenderInsuranceComments();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_FUNERAL:
|
||||
@@ -1450,6 +1569,16 @@ void EnterNewLaptopMode()
|
||||
default:
|
||||
if( gLaptopProgramStates[ LAPTOP_PROGRAM_WEB_BROWSER ] == LAPTOP_PROGRAM_MINIMIZED )
|
||||
{
|
||||
|
||||
if ( guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA_LOCATION || guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA )
|
||||
{
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA;
|
||||
}
|
||||
else if ( guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_PAGE || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_ENTER )
|
||||
{
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;
|
||||
}
|
||||
|
||||
// minized, maximized
|
||||
if( fMaximizingProgram == FALSE )
|
||||
{
|
||||
@@ -1536,6 +1665,26 @@ void EnterNewLaptopMode()
|
||||
//Initialize the new mode.
|
||||
switch( guiCurrentLaptopMode )
|
||||
{
|
||||
//legion
|
||||
case LAPTOP_MODE_ENCYCLOPEDIA:
|
||||
EnterEncyclopedia();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_ENCYCLOPEDIA_LOCATION:
|
||||
EnterEncyclopediaLocation();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
|
||||
EnterBriefingRoom();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM_ENTER:
|
||||
EnterBriefingRoomEnter();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM:
|
||||
EnterEncyclopediaLocation();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_AIM:
|
||||
EnterAIM();
|
||||
@@ -1570,10 +1719,18 @@ void EnterNewLaptopMode()
|
||||
EnterMercsFiles();
|
||||
break;
|
||||
case LAPTOP_MODE_MERC_ACCOUNT:
|
||||
#ifdef JA2UB
|
||||
//Ja25
|
||||
#else
|
||||
EnterMercsAccount();
|
||||
#endif
|
||||
break;
|
||||
case LAPTOP_MODE_MERC_NO_ACCOUNT:
|
||||
#ifdef JA2UB
|
||||
//Ja25
|
||||
#else
|
||||
EnterMercsNoAccount();
|
||||
#endif
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BOBBY_R:
|
||||
@@ -1613,7 +1770,24 @@ void EnterNewLaptopMode()
|
||||
case LAPTOP_MODE_FLORIST_CARD_GALLERY:
|
||||
EnterFloristCards();
|
||||
break;
|
||||
|
||||
#ifdef JA2UB
|
||||
case LAPTOP_MODE_INSURANCE:
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
EnterInsurance();
|
||||
break;
|
||||
case LAPTOP_MODE_INSURANCE_INFO:
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
EnterInsuranceInfo();
|
||||
break;
|
||||
case LAPTOP_MODE_INSURANCE_CONTRACT:
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
EnterInsuranceContract();
|
||||
break;
|
||||
case LAPTOP_MODE_INSURANCE_COMMENTS:
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
EnterInsuranceComments();
|
||||
break;
|
||||
#else
|
||||
case LAPTOP_MODE_INSURANCE:
|
||||
EnterInsurance();
|
||||
break;
|
||||
@@ -1626,7 +1800,7 @@ void EnterNewLaptopMode()
|
||||
case LAPTOP_MODE_INSURANCE_COMMENTS:
|
||||
EnterInsuranceComments();
|
||||
break;
|
||||
|
||||
#endif
|
||||
case LAPTOP_MODE_FUNERAL:
|
||||
EnterFuneral();
|
||||
break;
|
||||
@@ -1694,6 +1868,26 @@ void HandleLapTopHandles()
|
||||
|
||||
switch( guiCurrentLaptopMode )
|
||||
{
|
||||
//legion
|
||||
case LAPTOP_MODE_ENCYCLOPEDIA:
|
||||
HandleEncyclopedia();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_ENCYCLOPEDIA_LOCATION:
|
||||
HandleEncyclopediaLocation();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
|
||||
HandleBriefingRoom();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM_ENTER:
|
||||
HandleBriefingRoomEnter();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM:
|
||||
HandleEncyclopediaLocation();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_AIM:
|
||||
|
||||
@@ -1727,13 +1921,21 @@ void HandleLapTopHandles()
|
||||
case LAPTOP_MODE_MERC_FILES:
|
||||
HandleMercsFiles();
|
||||
break;
|
||||
#ifdef JA2UB
|
||||
case LAPTOP_MODE_MERC_ACCOUNT:
|
||||
//Ja25 HandleMercsAccount();
|
||||
break;
|
||||
case LAPTOP_MODE_MERC_NO_ACCOUNT:
|
||||
//Ja25 HandleMercsNoAccount();
|
||||
break;
|
||||
#else
|
||||
case LAPTOP_MODE_MERC_ACCOUNT:
|
||||
HandleMercsAccount();
|
||||
break;
|
||||
case LAPTOP_MODE_MERC_NO_ACCOUNT:
|
||||
HandleMercsNoAccount();
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
case LAPTOP_MODE_BOBBY_R:
|
||||
HandleBobbyR();
|
||||
@@ -1773,7 +1975,30 @@ void HandleLapTopHandles()
|
||||
case LAPTOP_MODE_FLORIST_CARD_GALLERY:
|
||||
HandleFloristCards();
|
||||
break;
|
||||
#ifdef JA2UB
|
||||
case LAPTOP_MODE_INSURANCE:
|
||||
// Assert( 0 );
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
HandleInsurance();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE_INFO:
|
||||
// Assert( 0 );
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
HandleInsuranceInfo();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE_CONTRACT:
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
HandleInsuranceContract();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE_COMMENTS:
|
||||
// Assert( 0 );
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
HandleInsuranceComments();
|
||||
break;
|
||||
#else
|
||||
case LAPTOP_MODE_INSURANCE:
|
||||
HandleInsurance();
|
||||
break;
|
||||
@@ -1789,6 +2014,7 @@ void HandleLapTopHandles()
|
||||
HandleInsuranceComments();
|
||||
break;
|
||||
|
||||
#endif
|
||||
case LAPTOP_MODE_FUNERAL:
|
||||
HandleFuneral();
|
||||
break;
|
||||
@@ -1857,9 +2083,9 @@ UINT32 LaptopScreenHandle()
|
||||
// just entered
|
||||
if(gfEnterLapTop)
|
||||
{
|
||||
EnterLaptop();
|
||||
CreateLaptopButtons();
|
||||
gfEnterLapTop=FALSE;
|
||||
EnterLaptop();
|
||||
CreateLaptopButtons();
|
||||
gfEnterLapTop=FALSE;
|
||||
}
|
||||
|
||||
if( gfStartMapScreenToLaptopTransition )
|
||||
@@ -2186,6 +2412,29 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
|
||||
|
||||
switch( uiMode )
|
||||
{
|
||||
|
||||
case LAPTOP_MODE_ENCYCLOPEDIA:
|
||||
ExitEncyclopedia();
|
||||
//InitEncyklopediaBool();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_ENCYCLOPEDIA_LOCATION:
|
||||
ExitEncyclopediaLocation();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
|
||||
ExitBriefingRoom();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM_ENTER:
|
||||
ExitBriefingRoomEnter();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_BRIEFING_ROOM:
|
||||
ExitEncyclopediaLocation();
|
||||
//InitEncyklopediaBool();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_AIM:
|
||||
ExitAIM();
|
||||
break;
|
||||
@@ -2217,13 +2466,21 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
|
||||
case LAPTOP_MODE_MERC_FILES:
|
||||
ExitMercsFiles();
|
||||
break;
|
||||
#ifdef JA2UB
|
||||
case LAPTOP_MODE_MERC_ACCOUNT:
|
||||
//Ja25 ExitMercsAccount();
|
||||
break;
|
||||
case LAPTOP_MODE_MERC_NO_ACCOUNT:
|
||||
//Ja25 ExitMercsNoAccount();
|
||||
break;
|
||||
#else
|
||||
case LAPTOP_MODE_MERC_ACCOUNT:
|
||||
ExitMercsAccount();
|
||||
break;
|
||||
case LAPTOP_MODE_MERC_NO_ACCOUNT:
|
||||
ExitMercsNoAccount();
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
case LAPTOP_MODE_BOBBY_R:
|
||||
ExitBobbyR();
|
||||
@@ -2263,7 +2520,30 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
|
||||
case LAPTOP_MODE_FLORIST_CARD_GALLERY:
|
||||
ExitFloristCards();
|
||||
break;
|
||||
#ifdef JA2UB
|
||||
case LAPTOP_MODE_INSURANCE:
|
||||
// Assert( 0 );
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
ExitInsurance();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE_INFO:
|
||||
// Assert( 0 );
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
ExitInsuranceInfo();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE_CONTRACT:
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
ExitInsuranceContract();
|
||||
break;
|
||||
|
||||
case LAPTOP_MODE_INSURANCE_COMMENTS:
|
||||
// Assert( 0 );
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
ExitInsuranceComments();
|
||||
break;
|
||||
#else
|
||||
case LAPTOP_MODE_INSURANCE:
|
||||
ExitInsurance();
|
||||
break;
|
||||
@@ -2278,7 +2558,7 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
|
||||
case LAPTOP_MODE_INSURANCE_COMMENTS:
|
||||
ExitInsuranceComments();
|
||||
break;
|
||||
|
||||
#endif
|
||||
case LAPTOP_MODE_FUNERAL:
|
||||
ExitFuneral();
|
||||
break;
|
||||
@@ -2509,6 +2789,11 @@ BOOLEAN LeaveLapTopScreen( void )
|
||||
fExitingLaptopFlag = TRUE;
|
||||
InitNewGame( FALSE );
|
||||
gfDontStartTransitionFromLaptop = TRUE;
|
||||
#ifdef JA2UB
|
||||
//Ja25 UB
|
||||
// ATE: Set flag to look for custom maps
|
||||
gfProcessCustomMaps = TRUE;
|
||||
#endif
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
@@ -2658,12 +2943,31 @@ BOOLEAN HandleExit( void )
|
||||
|
||||
void HaventMadeImpMercEmailCallBack()
|
||||
{
|
||||
#ifdef JA2UB
|
||||
//if the Laptop is NOT broken
|
||||
if( gubQuest[ QUEST_FIX_LAPTOP ] != QUESTINPROGRESS && gGameUBOptions.LaptopQuestEnabled == TRUE )
|
||||
{
|
||||
//if the player STILL hasnt made an imp merc yet
|
||||
if( ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) && ( LaptopSaveInfo.fSentImpWarningAlready == FALSE ) )
|
||||
{
|
||||
//if the player DIDNT import the save
|
||||
//if( !gubFact[ FACT_PLAYER_IMPORTED_SAVE ] )
|
||||
//{
|
||||
//send a follow up email to the player
|
||||
LaptopSaveInfo.fSentImpWarningAlready = TRUE;
|
||||
AddEmail( IMP_EMAIL_AGAIN, IMP_EMAIL_AGAIN_LENGTH, CHAR_PROFILE_SITE, GetWorldTotalMin( ), -1 ,-1, TYPE_EMAIL_EMAIL_EDT);
|
||||
//}
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
//if the player STILL hasnt made an imp merc yet
|
||||
if( ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) && ( LaptopSaveInfo.fSentImpWarningAlready == FALSE ) )
|
||||
{
|
||||
LaptopSaveInfo.fSentImpWarningAlready = TRUE;
|
||||
AddEmail(IMP_EMAIL_AGAIN,IMP_EMAIL_AGAIN_LENGTH,1, GetWorldTotalMin( ), -1, -1 );
|
||||
AddEmail(IMP_EMAIL_AGAIN,IMP_EMAIL_AGAIN_LENGTH,1, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2833,6 +3137,7 @@ void WWWRegionButtonCallback(GUI_BUTTON *btn,INT32 reason )
|
||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||
{
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
|
||||
if(giCurrentRegion!=WWW_REGION)
|
||||
giOldRegion=giCurrentRegion;
|
||||
if(!fNewWWW)
|
||||
@@ -2878,6 +3183,26 @@ void WWWRegionButtonCallback(GUI_BUTTON *btn,INT32 reason )
|
||||
}
|
||||
giCurrentRegion=WWW_REGION;
|
||||
RestoreOldRegion(giOldRegion);
|
||||
|
||||
if ( guiCurrentWWWMode >= LAPTOP_MODE_FINANCES && guiCurrentWWWMode <= LAPTOP_MODE_BOBBYR_SHIPMENTS )
|
||||
{
|
||||
IDPageEncyData = PAGENONE;
|
||||
UnLoadMenuButtons ();
|
||||
bEncyclopediaLocation = FALSE;
|
||||
bEncyclopediaCharacter = FALSE;
|
||||
bEncyclopediaInventory = FALSE;
|
||||
bEncyclopediaQuests = FALSE;
|
||||
bBriefingRoom = FALSE;
|
||||
bBriefingRoomSpecialMission = FALSE;
|
||||
}
|
||||
|
||||
if ( IDPageEncyData == PAGEENCYCLOPEDIALOCATION ) guiCurrentWWWMode = LAPTOP_MODE_ENCYCLOPEDIA;//{ bEncyclopediaLocation = TRUE; InitData (); }
|
||||
else if ( IDPageEncyData == PAGEENCYCLOPEDIACHARACTER ) guiCurrentWWWMode = LAPTOP_MODE_ENCYCLOPEDIA;//{ bEncyclopediaCharacter = TRUE; InitData (); }
|
||||
else if ( IDPageEncyData == PAGEENCYCLOPEDIAINVENTORY ) guiCurrentWWWMode = LAPTOP_MODE_ENCYCLOPEDIA;//{ bEncyclopediaInventory = TRUE; InitData (); }
|
||||
else if ( IDPageEncyData == PAGEENCYCLOPEDIAQUESTS ) guiCurrentWWWMode = LAPTOP_MODE_ENCYCLOPEDIA;//{ bEncyclopediaQuests = TRUE; InitData (); }
|
||||
else if ( IDPageEncyData == PAGEBRIEFINGROOM ) guiCurrentWWWMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;//{ bBriefingRoom = TRUE; InitData (); }
|
||||
else if ( IDPageEncyData == PAGEBRIEFINGROOMSPECIALMISSION ) guiCurrentWWWMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;//{ bBriefingRoomSpecialMission = TRUE; InitData (); }
|
||||
|
||||
if(guiCurrentWWWMode!=LAPTOP_MODE_NONE)
|
||||
guiCurrentLaptopMode = guiCurrentWWWMode;
|
||||
else
|
||||
@@ -2894,7 +3219,6 @@ void WWWRegionButtonCallback(GUI_BUTTON *btn,INT32 reason )
|
||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||
// nothing yet
|
||||
|
||||
|
||||
if(giCurrentRegion!=WWW_REGION)
|
||||
giOldRegion=giCurrentRegion;
|
||||
|
||||
@@ -3650,7 +3974,11 @@ void GoToWebPage(INT32 iPageId )
|
||||
//}
|
||||
//else
|
||||
// giRainDelayInternetSite = -1;
|
||||
|
||||
#ifdef JA2UB
|
||||
//if the laptop is broken
|
||||
if( (gubQuest[ QUEST_FIX_LAPTOP ] != QUESTINPROGRESS) || (gGameUBOptions.LaptopQuestEnabled != TRUE) )
|
||||
{
|
||||
#endif
|
||||
switch(iPageId)
|
||||
{
|
||||
case AIM_BOOKMARK:
|
||||
@@ -3671,6 +3999,46 @@ void GoToWebPage(INT32 iPageId )
|
||||
fFastLoadFlag = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
//LEGION
|
||||
case ENCYCLOPEDIA_BOOKMARK:
|
||||
guiCurrentWWWMode=LAPTOP_MODE_ENCYCLOPEDIA;
|
||||
guiCurrentLaptopMode=LAPTOP_MODE_ENCYCLOPEDIA;
|
||||
|
||||
// do we have to have a World Wide Wait
|
||||
if( LaptopSaveInfo.fVisitedBookmarkAlready[ ENCYCLOPEDIA_BOOKMARK ] == FALSE )
|
||||
{
|
||||
// reset flag and set load pending flag
|
||||
LaptopSaveInfo.fVisitedBookmarkAlready[ ENCYCLOPEDIA_BOOKMARK ] = TRUE;
|
||||
fLoadPendingFlag = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// fast reload
|
||||
fLoadPendingFlag = TRUE;
|
||||
fFastLoadFlag = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case BRIEFING_ROOM_BOOKMARK:
|
||||
guiCurrentWWWMode=LAPTOP_MODE_BRIEFING_ROOM_PAGE;
|
||||
guiCurrentLaptopMode=LAPTOP_MODE_BRIEFING_ROOM_PAGE;
|
||||
|
||||
// do we have to have a World Wide Wait
|
||||
if( LaptopSaveInfo.fVisitedBookmarkAlready[ BRIEFING_ROOM_BOOKMARK ] == FALSE )
|
||||
{
|
||||
// reset flag and set load pending flag
|
||||
LaptopSaveInfo.fVisitedBookmarkAlready[ BRIEFING_ROOM_BOOKMARK ] = TRUE;
|
||||
fLoadPendingFlag = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// fast reload
|
||||
fLoadPendingFlag = TRUE;
|
||||
fFastLoadFlag = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case BOBBYR_BOOKMARK:
|
||||
guiCurrentWWWMode=LAPTOP_MODE_BOBBY_R;
|
||||
guiCurrentLaptopMode=LAPTOP_MODE_BOBBY_R;
|
||||
@@ -3795,6 +4163,20 @@ void GoToWebPage(INT32 iPageId )
|
||||
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
}
|
||||
//the web is not working
|
||||
else
|
||||
{
|
||||
guiCurrentWWWMode = LAPTOP_MODE_BROKEN_LINK;
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_BROKEN_LINK;
|
||||
|
||||
// slow load
|
||||
fLoadPendingFlag = TRUE;
|
||||
fFastLoadFlag = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
gfShowBookmarks=FALSE;
|
||||
fReDrawScreenFlag=TRUE;
|
||||
return;
|
||||
@@ -3882,6 +4264,14 @@ BOOLEAN DisplayLoadPending( void )
|
||||
iUnitTime += WWaitDelayIncreasedIfRaining( iUnitTime );
|
||||
|
||||
iLoadTime = iUnitTime * 30;
|
||||
#ifdef JA2UB
|
||||
//if the site we are going to is the web poage not found page
|
||||
if( guiCurrentLaptopMode == LAPTOP_MODE_BROKEN_LINK )
|
||||
{
|
||||
iLoadTime=1;
|
||||
iUnitTime=1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -4162,7 +4552,12 @@ void EnterLaptopInitLaptopPages()
|
||||
EnterInitAimPolicies();
|
||||
EnterInitAimHistory();
|
||||
EnterInitFloristGallery();
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
EnterInitInsuranceInfo();
|
||||
#else
|
||||
EnterInitInsuranceInfo();
|
||||
#endif
|
||||
EnterInitBobbyRayOrder();
|
||||
EnterInitMercSite();
|
||||
|
||||
@@ -4271,13 +4666,13 @@ void CheckIfNewWWWW( void )
|
||||
{
|
||||
// if no www mode, set new www flag..until new www mode that is not 0
|
||||
|
||||
if( guiCurrentWWWMode == LAPTOP_MODE_NONE )
|
||||
if( guiCurrentWWWMode == LAPTOP_MODE_NONE )
|
||||
{
|
||||
fNewWWW = TRUE;
|
||||
fNewWWW = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
fNewWWW = FALSE;
|
||||
fNewWWW = FALSE;
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -5225,14 +5620,26 @@ void SetCurrentToLastProgramOpened( void )
|
||||
break;
|
||||
case( LAPTOP_PROGRAM_WEB_BROWSER ):
|
||||
// last www mode
|
||||
if( guiCurrentWWWMode != 0 )
|
||||
if ( guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA_LOCATION || guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA )
|
||||
{
|
||||
guiCurrentLaptopMode = guiCurrentWWWMode;
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA;
|
||||
}
|
||||
else if ( guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_PAGE || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_ENTER )
|
||||
{
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;
|
||||
}
|
||||
//else if( guiCurrentWWWMode != 0 && ( guiCurrentWWWMode == LAPTOP_MODE_ENCYCLOPEDIA_LOCATION || guiCurrentWWWMode == LAPTOP_MODE_ENCYCLOPEDIA || guiCurrentWWWMode == LAPTOP_MODE_BRIEFING_ROOM_PAGE || guiCurrentWWWMode == LAPTOP_MODE_BRIEFING_ROOM || guiCurrentWWWMode == LAPTOP_MODE_BRIEFING_ROOM_ENTER ) )
|
||||
|
||||
else if( guiCurrentWWWMode >= LAPTOP_MODE_FINANCES && guiCurrentWWWMode <= LAPTOP_MODE_BOBBYR_SHIPMENTS )
|
||||
{
|
||||
guiCurrentLaptopMode = guiCurrentWWWMode;
|
||||
}
|
||||
else
|
||||
{
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_WWW;
|
||||
}
|
||||
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_WWW;
|
||||
//gfShowBookmarks = TRUE;
|
||||
fShowBookmarkInfo = TRUE;
|
||||
break;
|
||||
@@ -5538,7 +5945,12 @@ void HandleKeyBoardShortCutsForLapTop( UINT16 usEvent, UINT32 usParam, UINT16 us
|
||||
SetBookMark( MERC_BOOKMARK );
|
||||
SetBookMark( FUNERAL_BOOKMARK );
|
||||
SetBookMark( FLORIST_BOOKMARK );
|
||||
#ifdef JA2UB
|
||||
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||
SetBookMark( INSURANCE_BOOKMARK );
|
||||
#else
|
||||
SetBookMark( INSURANCE_BOOKMARK );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6492,11 +6904,18 @@ void CreateLaptopButtonHelpText( INT32 iButtonIndex, UINT32 uiButtonHelpTextID )
|
||||
{
|
||||
SetButtonFastHelpText( iButtonIndex, gzLaptopHelpText[ uiButtonHelpTextID ] );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//ja25 ub
|
||||
void ShouldImpReminderEmailBeSentWhenLaptopBackOnline()
|
||||
{
|
||||
//if this is past the point of when the IMP email should have been sent
|
||||
if( GetWorldTotalMin() > LAPTOP__HAVENT_CREATED_IMP_REMINDER_EMAIL_ARRIVE_TIME )
|
||||
{
|
||||
//and the email hasnt been sent
|
||||
HaventMadeImpMercEmailCallBack();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -137,6 +137,17 @@ enum
|
||||
LAPTOP_MODE_SIRTECH,
|
||||
LAPTOP_MODE_BROKEN_LINK,
|
||||
LAPTOP_MODE_BOBBYR_SHIPMENTS,
|
||||
|
||||
//ENCYCLOPEDIA
|
||||
LAPTOP_MODE_ENCYCLOPEDIA,
|
||||
LAPTOP_MODE_ENCYCLOPEDIA_LOCATION,
|
||||
LAPTOP_MODE_BRIEFING_ROOM_PAGE,
|
||||
LAPTOP_MODE_BRIEFING_ROOM,
|
||||
LAPTOP_MODE_BRIEFING_ROOM_ENTER,
|
||||
|
||||
LAPTOP_MODE_AIM_MEMBERS_ARCHIVES_NEW,
|
||||
|
||||
|
||||
};
|
||||
|
||||
// bookamrks for WWW bookmark list
|
||||
@@ -194,6 +205,8 @@ enum{
|
||||
FLORIST_BOOKMARK,
|
||||
INSURANCE_BOOKMARK,
|
||||
CANCEL_STRING,
|
||||
ENCYCLOPEDIA_BOOKMARK, //Encyclopedia
|
||||
BRIEFING_ROOM_BOOKMARK,
|
||||
TEXT_NUM_LAPTOP_BOOKMARKS
|
||||
};
|
||||
|
||||
@@ -205,6 +218,12 @@ extern UINT32 guiLaptopBACKGROUND;
|
||||
#define DEAD_MERC_COLOR_GREEN 55
|
||||
#define DEAD_MERC_COLOR_BLUE 55
|
||||
|
||||
#ifdef JA2UB
|
||||
//ja25 UB
|
||||
void ShouldImpReminderEmailBeSentWhenLaptopBackOnline();
|
||||
|
||||
extern BOOLEAN gfProcessCustomMaps;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -83,8 +83,12 @@ INT32 guiAccountButtonImage;
|
||||
BOOLEAN gfMercPlayerDoesntHaveEnoughMoney_DisplayWarning = FALSE;
|
||||
|
||||
// The Authorize button
|
||||
#ifdef JA2UB
|
||||
// not UB
|
||||
#else
|
||||
void BtnMercAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
UINT32 guiMercAuthorizeBoxButton;
|
||||
#endif
|
||||
INT32 guiMercAuthorizeButtonImage;
|
||||
|
||||
|
||||
@@ -202,7 +206,12 @@ INT32 GetNumberOfHiredMercs()
|
||||
// Is the merc hired?
|
||||
if( IsMercOnTeam( (UINT8)usMercID ) || gMercProfiles[ usMercID ].iMercMercContractLength != 0 )
|
||||
{
|
||||
|
||||
#ifdef JA2UB
|
||||
uiContractCharge = gMercProfiles[ usMercID ].uiWeeklySalary * gMercProfiles[ usMercID ].iMercMercContractLength;
|
||||
#else
|
||||
uiContractCharge = gMercProfiles[ usMercID ].sSalary * gMercProfiles[ usMercID ].iMercMercContractLength;
|
||||
#endif
|
||||
giMercTotalContractCharge += uiContractCharge;
|
||||
|
||||
count++;
|
||||
@@ -285,7 +294,9 @@ BOOLEAN EnterMercsAccount()
|
||||
|
||||
|
||||
guiMercAuthorizeButtonImage = LoadButtonImage("LAPTOP\\BigButtons.sti", -1,0,-1,1,-1 );
|
||||
|
||||
#ifdef JA2UB
|
||||
// not UB
|
||||
#else
|
||||
guiMercAuthorizeBoxButton = CreateIconAndTextButton( guiMercAuthorizeButtonImage, MercAccountText[MERC_ACCOUNT_AUTHORIZE],
|
||||
FONT12ARIAL,
|
||||
MERC_BUTTON_UP_COLOR, DEFAULT_SHADOW,
|
||||
@@ -295,6 +306,7 @@ BOOLEAN EnterMercsAccount()
|
||||
DEFAULT_MOVE_CALLBACK, BtnMercAuthorizeButtonCallback);
|
||||
SetButtonCursor(guiMercAuthorizeBoxButton, CURSOR_LAPTOP_SCREEN);
|
||||
SpecifyDisabledButtonStyle( guiMercAuthorizeBoxButton, DISABLED_STYLE_SHADED);
|
||||
#endif
|
||||
|
||||
guiMercBackBoxButton = CreateIconAndTextButton( guiMercAuthorizeButtonImage, MercAccountText[MERC_ACCOUNT_HOME],
|
||||
FONT12ARIAL,
|
||||
@@ -329,7 +341,13 @@ void ExitMercsAccount()
|
||||
DeleteVideoObjectFromIndex(guiAccountNumberGrid);
|
||||
|
||||
UnloadButtonImage( guiMercAuthorizeButtonImage );
|
||||
|
||||
#ifdef JA2UB
|
||||
//not UB
|
||||
#else
|
||||
RemoveButton( guiMercAuthorizeBoxButton );
|
||||
#endif
|
||||
|
||||
RemoveButton( guiMercBackBoxButton );
|
||||
|
||||
DeleteVideoObjectFromIndex(guiMercOrderGrid0);
|
||||
@@ -391,11 +409,15 @@ void RenderMercsAccount()
|
||||
|
||||
DisplayHiredMercs();
|
||||
|
||||
#ifdef JA2UB
|
||||
//not UB
|
||||
#else
|
||||
// giMercTotalContractCharge gets set with the price in DisplayHiredMercs(), so if there is currently no charge, disable the button
|
||||
if( giMercTotalContractCharge == 0 )
|
||||
{
|
||||
DisableButton( guiMercAuthorizeBoxButton );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -404,7 +426,9 @@ void RenderMercsAccount()
|
||||
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
|
||||
}
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//not UB
|
||||
#else
|
||||
void BtnMercAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
@@ -440,7 +464,7 @@ void BtnMercAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void BtnMercBackButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
@@ -542,11 +566,19 @@ void DisplayHiredMercs()
|
||||
DrawTextToScreen(sTemp, MERC_AC_SECOND_COLUMN_X, usPosY, MERC_AC_SECOND_COLUMN_WIDTH, MERC_ACCOUNT_DYNAMIC_TEXT_FONT, ubFontColor, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
|
||||
//Display the mercs rate
|
||||
#ifdef JA2UB
|
||||
swprintf(sTemp, L"$%6d",gMercProfiles[ usMercID ].uiWeeklySalary );
|
||||
#else
|
||||
swprintf(sTemp, L"$%6d",gMercProfiles[ usMercID ].sSalary );
|
||||
#endif
|
||||
DrawTextToScreen(sTemp, MERC_AC_THIRD_COLUMN_X, usPosY, MERC_AC_THIRD_COLUMN_WIDTH, MERC_ACCOUNT_DYNAMIC_TEXT_FONT, ubFontColor, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
|
||||
//Display the total charge
|
||||
#ifdef JA2UB
|
||||
uiContractCharge = gMercProfiles[ usMercID ].uiWeeklySalary * gMercProfiles[ usMercID ].iMercMercContractLength;
|
||||
#else
|
||||
uiContractCharge = gMercProfiles[ usMercID ].sSalary * gMercProfiles[ usMercID ].iMercMercContractLength;
|
||||
#endif
|
||||
swprintf(sTemp, L"$%6d", uiContractCharge );
|
||||
DrawTextToScreen(sTemp, MERC_AC_FOURTH_COLUMN_X, usPosY, MERC_AC_FOURTH_COLUMN_WIDTH, MERC_ACCOUNT_DYNAMIC_TEXT_FONT, ubFontColor, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
|
||||
@@ -584,7 +616,11 @@ void SettleMercAccounts()
|
||||
if( IsMercOnTeam( ubMercID ) || ( gMercProfiles[ ubMercID ].iMercMercContractLength != 0 ) )
|
||||
{
|
||||
//Calc the contract charge
|
||||
#ifdef JA2UB
|
||||
iContractCharge = gMercProfiles[ ubMercID ].uiWeeklySalary * gMercProfiles[ ubMercID ].iMercMercContractLength;
|
||||
#else
|
||||
iContractCharge = gMercProfiles[ ubMercID ].sSalary * gMercProfiles[ ubMercID ].iMercMercContractLength;
|
||||
#endif
|
||||
|
||||
//if the player can afford to pay this merc
|
||||
if( LaptopSaveInfo.iCurrentBalance >= iPartialPayment + iContractCharge )
|
||||
@@ -611,12 +647,20 @@ void SettleMercAccounts()
|
||||
}
|
||||
|
||||
// add the transaction to the finance page
|
||||
|
||||
#ifdef JA2UB
|
||||
AddTransactionToPlayersBook( PAY_SPECK_FOR_MERC, GetMercIDFromMERCArray( gubCurMercIndex ), GetWorldTotalMin(), -iPartialPayment );
|
||||
#else
|
||||
AddTransactionToPlayersBook( PAY_SPECK_FOR_MERC, GetMercIDFromMERCArray( gubCurMercIndex ), GetWorldTotalMin(), -iPartialPayment );
|
||||
#endif
|
||||
|
||||
AddHistoryToPlayersLog( HISTORY_SETTLED_ACCOUNTS_AT_MERC, GetMercIDFromMERCArray( gubCurMercIndex ), GetWorldTotalMin(), -1, -1 );
|
||||
|
||||
//Increment the amount of money paid to speck
|
||||
LaptopSaveInfo.uiTotalMoneyPaidToSpeck += iPartialPayment;
|
||||
|
||||
#ifdef JA2UB
|
||||
//not ub
|
||||
#else
|
||||
//If the player only made a partial payment
|
||||
if( iPartialPayment != giMercTotalContractCharge )
|
||||
gusMercVideoSpeckSpeech = SPECK_QUOTE_PLAYER_MAKES_PARTIAL_PAYMENT;
|
||||
@@ -633,7 +677,7 @@ void SettleMercAccounts()
|
||||
// Since the player has paid, make sure speck wont complain about the lack of payment
|
||||
LaptopSaveInfo.uiSpeckQuoteFlags &= ~SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
|
||||
}
|
||||
|
||||
#endif
|
||||
//Go to the merc homepage to say the quote
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_MERC;
|
||||
gubArrivedFromMercSubSite = MERC_CAME_FROM_ACCOUNTS_PAGE;
|
||||
@@ -765,7 +809,11 @@ UINT32 CalculateHowMuchPlayerOwesSpeck()
|
||||
//if( IsMercOnTeam( (UINT8)usMercID ) )
|
||||
{
|
||||
//Calc salary for the # of days the merc has worked since last paid
|
||||
#ifdef JA2UB
|
||||
uiContractCharge += gMercProfiles[ usMercID ].uiWeeklySalary * gMercProfiles[ usMercID ].iMercMercContractLength;
|
||||
#else
|
||||
uiContractCharge += gMercProfiles[ usMercID ].sSalary * gMercProfiles[ usMercID ].iMercMercContractLength;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -149,9 +149,11 @@ void BtnOpenAccountBoxButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
//Get an account number
|
||||
LaptopSaveInfo.guiPlayersMercAccountNumber = Random( 99999 );
|
||||
|
||||
#ifdef JA2UB
|
||||
// gusMercVideoSpeckSpeech = SPECK_QUOTE_THANK_PLAYER_FOR_OPENING_ACCOUNT;
|
||||
#else
|
||||
gusMercVideoSpeckSpeech = SPECK_QUOTE_THANK_PLAYER_FOR_OPENING_ACCOUNT;
|
||||
|
||||
#endif
|
||||
guiCurrentLaptopMode = LAPTOP_MODE_MERC;
|
||||
gubArrivedFromMercSubSite = MERC_CAME_FROM_ACCOUNTS_PAGE;
|
||||
|
||||
|
||||
+287
-33
@@ -1,6 +1,11 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Laptop All.h"
|
||||
#include "GameSettings.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#endif
|
||||
|
||||
#else
|
||||
#include "laptop.h"
|
||||
#include "mercs.h"
|
||||
@@ -27,6 +32,12 @@
|
||||
#include "Quests.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "Speck Quotes.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
UINT8 NUMBER_OF_MERCS = 0;
|
||||
@@ -102,7 +113,11 @@ UINT8 NUMBER_OF_BAD_MERCS = -1;
|
||||
|
||||
#define SPECK_IDLE_CHAT_DELAY 10000
|
||||
|
||||
#ifdef JA2UB
|
||||
#define MERC_NUMBER_OF_RANDOM_QUOTES 20//19//14
|
||||
#else
|
||||
#define MERC_NUMBER_OF_RANDOM_QUOTES 19//14
|
||||
#endif
|
||||
|
||||
|
||||
#define MERC_FIRST_MERC BIFF
|
||||
@@ -212,10 +227,16 @@ typedef struct
|
||||
} NUMBER_TIMES_QUOTE_SAID;
|
||||
NUMBER_TIMES_QUOTE_SAID gNumberOfTimesQuoteSaid[ MERC_NUMBER_OF_RANDOM_QUOTES ] =
|
||||
{
|
||||
|
||||
#ifdef JA2UB
|
||||
{ SPECK_QUOTE_BIFF_DEAD_WHEN_IMPORTING, 0 },
|
||||
#endif
|
||||
{ SPECK_QUOTE_RANDOM_CHIT_CHAT_1, 0 },
|
||||
{ SPECK_QUOTE_RANDOM_CHIT_CHAT_2, 0 },
|
||||
|
||||
#ifdef JA2UB
|
||||
{ SPECK_QUOTE_RANDOM_CHIT_CHAT_3, 0 },
|
||||
#endif
|
||||
|
||||
{ SPECK_QUOTE_ADVERTISE_GASTON, 0 },
|
||||
{ SPECK_QUOTE_ADVERTISE_STOGIE, 0 },
|
||||
|
||||
@@ -304,6 +325,11 @@ BOOLEAN AreAnyOfTheNewMercsAvailable();
|
||||
void ShouldAnyNewMercMercBecomeAvailable();
|
||||
BOOLEAN CanMercBeAvailableYet( UINT8 ubMercToCheck );
|
||||
UINT32 CalcMercDaysServed();
|
||||
#ifdef JA2UB
|
||||
void MarkSpeckImportantQuoteUsed( UINT32 uiQuoteNum );
|
||||
BOOLEAN HasImportantSpeckQuoteBeingSaid( UINT32 uiQuoteNum );
|
||||
INT8 IsSpeckQuoteImportantQuote( UINT32 uiQuoteNum );
|
||||
#endif
|
||||
//ppp
|
||||
|
||||
BOOLEAN SaveNewMercsToSaveGameFile( HWFILE hFile )
|
||||
@@ -369,6 +395,17 @@ void GameInitMercs()
|
||||
LaptopSaveInfo.gubLastMercIndex = LAST_MERC_ID; //NUMBER_OF_BAD_MERCS;
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25. create an account immediately
|
||||
{
|
||||
//open an account
|
||||
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_VALID;
|
||||
|
||||
//Get an account number
|
||||
LaptopSaveInfo.guiPlayersMercAccountNumber = Random( 99999 );
|
||||
}
|
||||
#endif
|
||||
|
||||
gubCurrentMercVideoMode = MERC_VIDEO_NO_VIDEO_MODE;
|
||||
gfMercVideoIsBeingDisplayed = FALSE;
|
||||
|
||||
@@ -430,13 +467,16 @@ BOOLEAN EnterMercs()
|
||||
|
||||
// Account Box button
|
||||
guiAccountBoxButtonImage = LoadButtonImage("LAPTOP\\SmallButtons.sti", -1,0,-1,1,-1 );
|
||||
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
#else
|
||||
guiAccountBoxButton = QuickCreateButton(guiAccountBoxButtonImage, MERC_ACCOUNT_BUTTON_X, MERC_ACCOUNT_BUTTON_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
DEFAULT_MOVE_CALLBACK, BtnAccountBoxButtonCallback);
|
||||
SetButtonCursor(guiAccountBoxButton, CURSOR_LAPTOP_SCREEN);
|
||||
SpecifyDisabledButtonStyle( guiAccountBoxButton, DISABLED_STYLE_SHADED);
|
||||
|
||||
#endif
|
||||
guiFileBoxButton = QuickCreateButton(guiAccountBoxButtonImage, MERC_FILE_BUTTON_X, MERC_FILE_BUTTON_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
DEFAULT_MOVE_CALLBACK, BtnFileBoxButtonCallback);
|
||||
@@ -524,8 +564,11 @@ void ExitMercs()
|
||||
|
||||
UnloadButtonImage( guiAccountBoxButtonImage );
|
||||
RemoveButton( guiFileBoxButton );
|
||||
#ifdef JA2UB
|
||||
//JA25: removed RemoveButton( guiAccountBoxButton );
|
||||
#else
|
||||
RemoveButton( guiAccountBoxButton );
|
||||
|
||||
#endif
|
||||
RemoveMercBackGround();
|
||||
|
||||
DeleteVideoSurfaceFromIndex( guiMercVideoFaceBackground );
|
||||
@@ -634,21 +677,31 @@ void RenderMercs()
|
||||
//Text on the Speck Portrait
|
||||
DisplayWrappedString(MERC_PORTRAIT_TEXT_X, MERC_PORTRAIT_TEXT_Y, MERC_PORTRAIT_TEXT_WIDTH, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, MercHomePageText[MERC_SPECK_OWNER], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
|
||||
#ifdef JA2UB
|
||||
//Display the "ask about or special offer
|
||||
DisplayWrappedString(MERC_ACCOUNT_BOX_TEXT_X, MERC_ACCOUNT_BOX_TEXT_Y, 230, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, gzNewLaptopMessages[ LPTP_MSG__MERC_SPECIAL_OFFER ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
||||
#else
|
||||
/* ja25:*/
|
||||
//Text on the Account Box
|
||||
if( LaptopSaveInfo.gubPlayersMercAccountStatus == MERC_NO_ACCOUNT )
|
||||
DisplayWrappedString(MERC_ACCOUNT_BOX_TEXT_X, MERC_ACCOUNT_BOX_TEXT_Y, MERC_ACCOUNT_BOX_TEXT_WIDTH, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, MercHomePageText[MERC_OPEN_ACCOUNT], FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||
else
|
||||
DisplayWrappedString(MERC_ACCOUNT_BOX_TEXT_X, MERC_ACCOUNT_BOX_TEXT_Y, MERC_ACCOUNT_BOX_TEXT_WIDTH, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, MercHomePageText[MERC_VIEW_ACCOUNT], FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||
|
||||
#endif
|
||||
//Text on the Files Box
|
||||
DisplayWrappedString(MERC_FILE_BOX_TEXT_X, MERC_FILE_BOX_TEXT_Y, MERC_FILE_BOX_TEXT_WIDTH, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, MercHomePageText[MERC_VIEW_FILES], FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||
|
||||
//If the Specks popup dioalogue box is active, display it.
|
||||
if( iMercPopUpBox != -1 )
|
||||
{
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25: removed DrawButton( guiAccountBoxButton );
|
||||
// ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
|
||||
#else
|
||||
DrawButton( guiAccountBoxButton );
|
||||
ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
|
||||
|
||||
#endif
|
||||
RenderMercPopUpBoxFromIndex( iMercPopUpBox, gusSpeckDialogueX, MERC_TEXT_BOX_POS_Y, FRAME_BUFFER);
|
||||
}
|
||||
|
||||
@@ -657,9 +710,11 @@ void RenderMercs()
|
||||
|
||||
//if the page is redrawn, and we are in video conferencing, redraw the VC backgrund graphic
|
||||
gfMercSiteScreenIsReDrawn = TRUE;
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25: removed ButtonList[ guiAccountBoxButton ]->uiFlags &= ~BUTTON_FORCE_UNDIRTY;
|
||||
#else
|
||||
ButtonList[ guiAccountBoxButton ]->uiFlags &= ~BUTTON_FORCE_UNDIRTY;
|
||||
|
||||
#endif
|
||||
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
|
||||
}
|
||||
|
||||
@@ -692,8 +747,9 @@ BOOLEAN RemoveMercBackGround()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//no UB
|
||||
#else
|
||||
void BtnAccountBoxButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
@@ -728,6 +784,7 @@ void BtnAccountBoxButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void BtnFileBoxButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
@@ -793,12 +850,20 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
||||
// pSoldier->iTotalContractLength++;
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25: MERC does a 1 time fee, no longer pay as you go
|
||||
#else
|
||||
|
||||
//Get the longest time
|
||||
if( gMercProfiles[ pSoldier->ubProfile ].iMercMercContractLength > iNumDays )
|
||||
iNumDays = gMercProfiles[ pSoldier->ubProfile ].iMercMercContractLength;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25: No longer pay as you go, now pay up front
|
||||
#else
|
||||
//if the players hasnt paid for a while, get email him to tell him to pay
|
||||
//iTotalContractLength
|
||||
if( iNumDays > MERC_NUM_DAYS_TILL_ACCOUNT_INVALID )
|
||||
@@ -806,7 +871,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
||||
if( LaptopSaveInfo.gubPlayersMercAccountStatus != MERC_ACCOUNT_INVALID )
|
||||
{
|
||||
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_INVALID;
|
||||
AddEmail( MERC_INVALID, MERC_INVALID_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1);
|
||||
AddEmail( MERC_INVALID, MERC_INVALID_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
||||
}
|
||||
}
|
||||
else if( iNumDays > MERC_NUM_DAYS_TILL_ACCOUNT_SUSPENDED )
|
||||
@@ -814,7 +879,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
||||
if( LaptopSaveInfo.gubPlayersMercAccountStatus != MERC_ACCOUNT_SUSPENDED )
|
||||
{
|
||||
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_SUSPENDED;
|
||||
AddEmail( MERC_WARNING, MERC_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1);
|
||||
AddEmail( MERC_WARNING, MERC_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
||||
|
||||
// Have speck complain next time player come to site
|
||||
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
|
||||
@@ -825,13 +890,13 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
||||
if( LaptopSaveInfo.gubPlayersMercAccountStatus != MERC_ACCOUNT_VALID_FIRST_WARNING )
|
||||
{
|
||||
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_VALID_FIRST_WARNING;
|
||||
AddEmail( MERC_FIRST_WARNING, MERC_FIRST_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1);
|
||||
AddEmail( MERC_FIRST_WARNING, MERC_FIRST_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
||||
|
||||
// Have speck complain next time player come to site
|
||||
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//Check and act if any new Merc Mercs should become available
|
||||
ShouldAnyNewMercMercBecomeAvailable();
|
||||
@@ -868,7 +933,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
||||
//if we havent already sent an email this turn
|
||||
if( !fAlreadySentEmailToPlayerThisTurn )
|
||||
{
|
||||
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin());
|
||||
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), TYPE_EMAIL_EMAIL_EDT);
|
||||
fAlreadySentEmailToPlayerThisTurn = TRUE;
|
||||
}
|
||||
LaptopSaveInfo.gbNumDaysTillFirstMercArrives = -1;
|
||||
@@ -961,6 +1026,9 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
||||
|
||||
// If the merc site has never gone down, the number of MERC payment days is above 'X',
|
||||
// and the players account status is ok ( cant have the merc site going down when the player owes him money, player may lose account that way )
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
#else
|
||||
if( ShouldTheMercSiteServerGoDown() )
|
||||
{
|
||||
UINT32 uiTimeInMinutes=0;
|
||||
@@ -979,6 +1047,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
||||
//Add an event that will get the site back up and running
|
||||
AddStrategicEvent( EVENT_MERC_SITE_BACK_ONLINE, uiTimeInMinutes, 0 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1523,8 +1592,13 @@ void HandleTalkingSpeck()
|
||||
|
||||
if( iMercPopUpBox != -1 )
|
||||
{
|
||||
#ifdef JA2UB
|
||||
//JA25: removed DrawButton( guiAccountBoxButton );
|
||||
//JA25: removed ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
|
||||
#else
|
||||
DrawButton( guiAccountBoxButton );
|
||||
ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
|
||||
#endif
|
||||
|
||||
RenderMercPopUpBoxFromIndex( iMercPopUpBox, gusSpeckDialogueX, MERC_TEXT_BOX_POS_Y, FRAME_BUFFER);
|
||||
}
|
||||
@@ -1643,7 +1717,11 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
if( fJustEnteredScreen )
|
||||
{
|
||||
gfDoneIntroSpeech = FALSE;
|
||||
#ifdef JA2UB
|
||||
usQuoteToSay = SPECK_QUOTE_NEW_INTRO_1;
|
||||
#else
|
||||
usQuoteToSay = 0;
|
||||
#endif
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
@@ -1656,31 +1734,65 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
gfDoneIntroSpeech = TRUE;
|
||||
|
||||
//set the opening quote based on if the player has been here before
|
||||
|
||||
#ifdef JA2UB
|
||||
if( LaptopSaveInfo.ubPlayerBeenToMercSiteStatus == MERC_SITE_FIRST_VISIT && usQuoteToSay <= SPECK_QUOTE_NEW_INTRO_7 ) //!= 0 )
|
||||
#else
|
||||
if( LaptopSaveInfo.ubPlayerBeenToMercSiteStatus == MERC_SITE_FIRST_VISIT && usQuoteToSay <= 8 ) //!= 0 )
|
||||
#endif
|
||||
{
|
||||
StartSpeckTalking( usQuoteToSay );
|
||||
usQuoteToSay++;
|
||||
#ifdef JA2UB
|
||||
if( usQuoteToSay <= SPECK_QUOTE_NEW_INTRO_7 )
|
||||
#else
|
||||
if( usQuoteToSay <= 8 )
|
||||
#endif
|
||||
gfDoneIntroSpeech = FALSE;
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//else if its the first time back since the laptop went down
|
||||
else if( gJa25SaveStruct.fHaveAimandMercOffferItems && !HasImportantSpeckQuoteBeingSaid( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_1 ) )
|
||||
{
|
||||
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_1 );
|
||||
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_2 );
|
||||
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_3 );
|
||||
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_4 );
|
||||
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_5 );
|
||||
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_6 );
|
||||
}
|
||||
#else
|
||||
//if its the players second visit
|
||||
else if( LaptopSaveInfo.ubPlayerBeenToMercSiteStatus == MERC_SITE_SECOND_VISIT )
|
||||
{
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_1_TOUGH_START );
|
||||
fCanUseIdleTag = TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
// We have been here at least 2 times before, Check which quote we should use
|
||||
else
|
||||
{
|
||||
//if the player has not hired any MERC mercs before
|
||||
// CJC Dec 1 2002: fixing this, so near-bankrupt msg will play
|
||||
#ifdef JA2UB
|
||||
if( !IsAnyMercMercsHired( ) && CalcMercDaysServed() == 0)
|
||||
StartSpeckTalking( SPECK_QUOTE_DEFAULT_INTRO_HAVENT_HIRED_MERCS );
|
||||
else
|
||||
StartSpeckTalking( SPECK_QUOTE_DEFAULT_INTRO_HAVE_HIRED_MERCS );
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
//if the player has not hired any MERC mercs before
|
||||
if( !IsAnyMercMercsHired( ) && CalcMercDaysServed() == 0)
|
||||
{
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_2_BUSINESS_BAD );
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
//else if it is the first visit since the server went down
|
||||
else if( LaptopSaveInfo.fFirstVisitSinceServerWentDown == TRUE )
|
||||
{
|
||||
@@ -1688,6 +1800,7 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_9_FIRST_VISIT_SINCE_SERVER_WENT_DOWN );
|
||||
fCanUseIdleTag = TRUE;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
//else if new mercs are available
|
||||
else if( LaptopSaveInfo.fNewMercsAvailableAtMercSite )
|
||||
@@ -1698,14 +1811,20 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
}
|
||||
*/
|
||||
//else if lots of MERC mercs are DEAD, and speck can say the quote ( dont want him to continously say it )
|
||||
#ifdef JA2UB
|
||||
if( CountNumberOfMercMercsWhoAreDead() >= 2 && LaptopSaveInfo.ubSpeckCanSayPlayersLostQuote )
|
||||
#else
|
||||
else if( CountNumberOfMercMercsWhoAreDead() >= 2 && LaptopSaveInfo.ubSpeckCanSayPlayersLostQuote )
|
||||
#endif
|
||||
{
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_12_PLAYERS_LOST_MERCS );
|
||||
|
||||
//Set it so speck Wont say the quote again till someone else dies
|
||||
LaptopSaveInfo.ubSpeckCanSayPlayersLostQuote = 0;
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
//else if player owes lots of money
|
||||
else if( LaptopSaveInfo.gubPlayersMercAccountStatus == MERC_ACCOUNT_SUSPENDED )
|
||||
{
|
||||
@@ -1713,8 +1832,11 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
|
||||
fCanSayLackOfPaymentQuote = FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
//else if the player owes speck a large sum of money, have speck say so
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
else if( CalculateHowMuchPlayerOwesSpeck() > 5000 )
|
||||
{
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_6_PLAYER_OWES_SPECK_ALMOST_BANKRUPT_1 );
|
||||
@@ -1722,11 +1844,17 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
|
||||
fCanSayLackOfPaymentQuote = FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
else
|
||||
{
|
||||
#ifdef JA2UB
|
||||
UINT8 ubNumMercsDead = NumberOfMercMercsDead();
|
||||
BOOLEAN fCanUseIdleTag = FALSE;
|
||||
#endif
|
||||
UINT8 ubRandom = ( UINT8 ) Random( 100 );
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
//if business is good
|
||||
// if( ubRandom < 40 && ubNumMercsDead < 2 && CountNumberOfMercMercsHired() > 1 )
|
||||
if( ubRandom < 40 && AreAnyOfTheNewMercsAvailable() && CountNumberOfMercMercsHired() > 1 )
|
||||
@@ -1734,9 +1862,12 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_3_BUSINESS_GOOD );
|
||||
fCanUseIdleTag = TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
//or if still trying to recruit ( the last recruit hasnt arrived and the player has paid for some of his mercs )
|
||||
// else if( ubRandom < 80 && LaptopSaveInfo.gbNumDaysTillFourthMercArrives != -1 && LaptopSaveInfo.gbNumDaysTillFirstMercArrives < MERC_NUM_DAYS_TILL_FIRST_MERC_AVAILABLE )
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
else if( ubRandom < 80 && gConditionsForMercAvailability[ LaptopSaveInfo.ubLastMercAvailableId ].usMoneyPaid <= LaptopSaveInfo.uiTotalMoneyPaidToSpeck && CanMercBeAvailableYet( LaptopSaveInfo.ubLastMercAvailableId ) )
|
||||
{
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_4_TRYING_TO_RECRUIT );
|
||||
@@ -1745,10 +1876,16 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
|
||||
//else use the generic opening
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_10_GENERIC_OPENING );
|
||||
|
||||
fCanUseIdleTag = TRUE;
|
||||
|
||||
//JA25: not using quote quote
|
||||
//if the merc hasnt said the line before
|
||||
if( !LaptopSaveInfo.fSaidGenericOpeningInMercSite )
|
||||
{
|
||||
@@ -1756,8 +1893,11 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_10_TAG_FOR_20 );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//no UB
|
||||
#else
|
||||
if( fCanUseIdleTag )
|
||||
{
|
||||
UINT8 ubRandom = Random( 100 );
|
||||
@@ -1784,10 +1924,13 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
Assert( 0 );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
//If Speck has sent an email to the player, and the player still hasnt paid, has speck complain about it.
|
||||
// CJC Dec 1 2002 ACTUALLY HOOKED IN THAT CHECK
|
||||
if (fCanSayLackOfPaymentQuote)
|
||||
@@ -1807,18 +1950,22 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_11_NEW_MERCS_AVAILABLE );
|
||||
}
|
||||
#endif
|
||||
|
||||
//if any mercs are dead
|
||||
if( IsAnyMercMercsDead() )
|
||||
{
|
||||
UINT8 ubMercID;
|
||||
//if no merc has died before
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
if( !LaptopSaveInfo.fHasAMercDiedAtMercSite )
|
||||
{
|
||||
LaptopSaveInfo.fHasAMercDiedAtMercSite = TRUE;
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_TAG_FIRST_MERC_DIES );
|
||||
}
|
||||
|
||||
#endif
|
||||
//loop through all the mercs and see if any are dead and the quote is not said
|
||||
for( ubCnt=0; ubCnt<NUMBER_OF_MERCS; ubCnt++ )
|
||||
{
|
||||
@@ -1873,12 +2020,21 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
case BUBBA:
|
||||
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_TAG_BUBBA_IS_DEAD );
|
||||
break;
|
||||
#ifdef JA2UB
|
||||
case 58://GASTON:
|
||||
StartSpeckTalking( SPECK_QUOTE_GASTON_DEAD );
|
||||
break;
|
||||
case 59://STOGIE:
|
||||
StartSpeckTalking( SPECK_QUOTE_STOGIE_DEAD );
|
||||
break;
|
||||
#else
|
||||
case GASTON:
|
||||
StartSpeckTalking( SPECK_QUOTE_GASTON_DEAD );
|
||||
break;
|
||||
case STOGIE:
|
||||
StartSpeckTalking( SPECK_QUOTE_STOGIE_DEAD );
|
||||
break;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1886,7 +2042,9 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25: not using quote quote
|
||||
#else
|
||||
//if flo has married the cousin
|
||||
if( gubFact[ FACT_PC_MARRYING_DARYL_IS_FLO ] )
|
||||
{
|
||||
@@ -1899,7 +2057,7 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
|
||||
MakeBiffAwayForCoupleOfDays();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//if larry has relapsed
|
||||
if( HasLarryRelapsed() && !( LaptopSaveInfo.uiSpeckQuoteFlags & SPECK_QUOTE__ALREADY_TOLD_PLAYER_THAT_LARRY_RELAPSED ) )
|
||||
@@ -2096,7 +2254,21 @@ void HandlePlayerHiringMerc( UINT8 ubHiredMercID )
|
||||
if( IsMercMercAvailable( BIFF ) )
|
||||
StartSpeckTalking( SPECK_QUOTE_PLAYERS_HIRES_LARRY_SPECK_PLUGS_BIFF );
|
||||
break;
|
||||
#ifdef JA2UB
|
||||
//Gaston is hired
|
||||
case 58: //GASTON:
|
||||
//if biff is available, advertise for biff
|
||||
if( IsMercMercAvailable( FLO ) )
|
||||
StartSpeckTalking( SPECK_QUOTE_PLAYER_HIRES_GASTON );
|
||||
break;
|
||||
|
||||
//Stogie is hired
|
||||
case 59: //STOGIE:
|
||||
//if biff is available, advertise for biff
|
||||
if( IsMercMercAvailable( BIFF ) )
|
||||
StartSpeckTalking( SPECK_QUOTE_PLAYER_HIRES_STOGIE );
|
||||
break;
|
||||
#else
|
||||
//Gaston is hired
|
||||
case GASTON:
|
||||
//if biff is available, advertise for biff
|
||||
@@ -2110,6 +2282,7 @@ void HandlePlayerHiringMerc( UINT8 ubHiredMercID )
|
||||
if( IsMercMercAvailable( BIFF ) )
|
||||
StartSpeckTalking( SPECK_QUOTE_PLAYER_HIRES_STOGIE );
|
||||
break;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2145,13 +2318,25 @@ BOOLEAN ShouldSpeckStartTalkingDueToActionOnSubPage()
|
||||
{
|
||||
|
||||
HandlePlayerHiringMerc( GetMercIDFromMERCArray( gubCurMercIndex ) );
|
||||
|
||||
#ifdef JA2UB
|
||||
//if it hasnt been said, say the better equipment quote
|
||||
if( !HasImportantSpeckQuoteBeingSaid( SPECK_QUOTE_BETTER_STARTING_EQPMNT_TAG_ON ) )
|
||||
{
|
||||
StartSpeckTalking( SPECK_QUOTE_BETTER_STARTING_EQPMNT_TAG_ON );
|
||||
}
|
||||
#endif
|
||||
//get speck to say the thank you
|
||||
if( Random( 100 ) > 50 )
|
||||
StartSpeckTalking( SPECK_QUOTE_GENERIC_THANKS_FOR_HIRING_MERCS_1 );
|
||||
else
|
||||
StartSpeckTalking( SPECK_QUOTE_GENERIC_THANKS_FOR_HIRING_MERCS_2 );
|
||||
|
||||
#ifdef JA2UB
|
||||
//if it hasnt been said, say the encouraged to shop quote
|
||||
if( !HasImportantSpeckQuoteBeingSaid( SPECK_QUOTE_ENCOURAGE_SHOP_TAG_ON ) )
|
||||
{
|
||||
StartSpeckTalking( SPECK_QUOTE_ENCOURAGE_SHOP_TAG_ON );
|
||||
}
|
||||
#endif
|
||||
gfJustHiredAMercMerc = FALSE;
|
||||
// gfDoneIntroSpeech = TRUE;
|
||||
|
||||
@@ -2246,6 +2431,11 @@ void HandleSpeckIdleConversation( BOOLEAN fReset )
|
||||
{
|
||||
IncreaseMercRandomQuoteValue( (UINT8)sLeastSaidQuote, 1 );
|
||||
}
|
||||
#ifdef JA2UB
|
||||
//if its the biff is dead quote, only say the quote once
|
||||
else if( sLeastSaidQuote == SPECK_QUOTE_BIFF_DEAD_WHEN_IMPORTING )
|
||||
IncreaseMercRandomQuoteValue( (UINT8)sLeastSaidQuote, 255 );
|
||||
#endif
|
||||
else if( sLeastSaidQuote != -1 )
|
||||
IncreaseMercRandomQuoteValue( (UINT8)sLeastSaidQuote, 3 );
|
||||
}
|
||||
@@ -2348,15 +2538,18 @@ BOOLEAN ShouldTheMercSiteServerGoDown()
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//no UB
|
||||
#else
|
||||
void GetMercSiteBackOnline()
|
||||
{
|
||||
//Add an email telling the user the site is back up
|
||||
AddEmail( MERC_NEW_SITE_ADDRESS, MERC_NEW_SITE_ADDRESS_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1 );
|
||||
AddEmail( MERC_NEW_SITE_ADDRESS, MERC_NEW_SITE_ADDRESS_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1 , TYPE_EMAIL_EMAIL_EDT);
|
||||
|
||||
//Set a flag indicating that the server just went up ( so speck can make a comment when the player next visits the site )
|
||||
LaptopSaveInfo.fFirstVisitSinceServerWentDown = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void DrawMercVideoBackGround()
|
||||
{
|
||||
@@ -2374,7 +2567,11 @@ void DisableMercSiteButton()
|
||||
{
|
||||
if( iMercPopUpBox != -1 )
|
||||
{
|
||||
#ifdef JA2UB
|
||||
//JA25: removed ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
|
||||
#else
|
||||
ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2434,6 +2631,22 @@ BOOLEAN CanMercQuoteBeSaid( UINT32 uiQuoteID )
|
||||
if( !IsMercMercAvailable( BUBBA ) )
|
||||
fRetVal = FALSE;
|
||||
break;
|
||||
#ifdef JA2UB
|
||||
case SPECK_QUOTE_BIFF_DEAD_WHEN_IMPORTING:
|
||||
if( !gJa25SaveStruct.fBiffWasKilledWhenImportingSave )
|
||||
fRetVal = FALSE;
|
||||
break;
|
||||
|
||||
case SPECK_QUOTE_ADVERTISE_GASTON:
|
||||
if( !IsMercMercAvailable( 58 ) )//GASTON
|
||||
fRetVal = FALSE;
|
||||
break;
|
||||
|
||||
case SPECK_QUOTE_ADVERTISE_STOGIE:
|
||||
if( !IsMercMercAvailable( 59 ) )//STOGIE
|
||||
fRetVal = FALSE;
|
||||
break;
|
||||
#else
|
||||
case SPECK_QUOTE_ADVERTISE_GASTON:
|
||||
if( !IsMercMercAvailable( GASTON ) )
|
||||
fRetVal = FALSE;
|
||||
@@ -2443,6 +2656,7 @@ BOOLEAN CanMercQuoteBeSaid( UINT32 uiQuoteID )
|
||||
if( !IsMercMercAvailable( STOGIE ) )
|
||||
fRetVal = FALSE;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2563,7 +2777,7 @@ void NewMercsAvailableAtMercSiteCallBack( )
|
||||
LaptopSaveInfo.ubLastMercAvailableId = gConditionsForMercAvailability[i].uiIndex;
|
||||
gConditionsForMercAvailability[i].StartMercsAvailable = TRUE;
|
||||
|
||||
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1);
|
||||
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
||||
|
||||
//new mercs are available
|
||||
LaptopSaveInfo.fNewMercsAvailableAtMercSite = TRUE;
|
||||
@@ -2604,11 +2818,51 @@ UINT32 CalcMercDaysServed()
|
||||
}
|
||||
return( uiDaysServed );
|
||||
}
|
||||
#ifdef JA2UB
|
||||
INT8 IsSpeckQuoteImportantQuote( UINT32 uiQuoteNum )
|
||||
{
|
||||
INT32 iFlag=-1;
|
||||
switch( uiQuoteNum )
|
||||
{
|
||||
case SPECK_QUOTE_BETTER_STARTING_EQPMNT_TAG_ON:
|
||||
iFlag = SPECK__BETTER_EQUIPMENT;
|
||||
break;
|
||||
case SPECK_QUOTE_ENCOURAGE_SHOP_TAG_ON:
|
||||
iFlag = SPECK__ENCOURAGE_POAYER_TO_KEEP_SHOPPING;
|
||||
break;
|
||||
case SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_1:
|
||||
iFlag = SPECK__SECOND_INTRO_BEEN_SAID;
|
||||
break;
|
||||
}
|
||||
|
||||
return( (INT8) iFlag );
|
||||
}
|
||||
|
||||
BOOLEAN HasImportantSpeckQuoteBeingSaid( UINT32 uiQuoteNum )
|
||||
{
|
||||
INT8 iFlag;
|
||||
|
||||
iFlag = IsSpeckQuoteImportantQuote( uiQuoteNum );
|
||||
if( iFlag == -1 )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//has the quote been said
|
||||
return( ( gJa25SaveStruct.ubImportantSpeckQuotesSaidBefore & ( 1 << iFlag ) ) != 0 );
|
||||
}
|
||||
|
||||
//if the quote is a special quote, mark it said so we dont say it again
|
||||
void MarkSpeckImportantQuoteUsed( UINT32 uiQuoteNum )
|
||||
{
|
||||
INT8 iFlag;
|
||||
|
||||
iFlag = IsSpeckQuoteImportantQuote( uiQuoteNum );
|
||||
if( iFlag == -1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
gJa25SaveStruct.ubImportantSpeckQuotesSaidBefore |= ( 1 << iFlag );
|
||||
}
|
||||
#endif
|
||||
|
||||
+9
-2
@@ -129,9 +129,11 @@ BOOLEAN IsMercMercAvailable( UINT8 ubMercID );
|
||||
|
||||
void HandlePlayerHiringMerc( UINT8 ubHiredMercID );
|
||||
void EnterInitMercSite();
|
||||
|
||||
#ifdef JA2UB
|
||||
//void GetMercSiteBackOnline();
|
||||
#else
|
||||
void GetMercSiteBackOnline();
|
||||
|
||||
#endif
|
||||
void DisableMercSiteButton();
|
||||
|
||||
extern UINT16 gusMercVideoSpeckSpeech;
|
||||
@@ -152,6 +154,11 @@ void InitializeNumDaysMercArrive();
|
||||
void NewMercsAvailableAtMercSiteCallBack( );
|
||||
|
||||
void CalcAproximateAmountPaidToSpeck();
|
||||
#ifdef JA2UB
|
||||
extern void MarkSpeckImportantQuoteUsed( UINT32 uiQuoteNum );
|
||||
extern BOOLEAN HasImportantSpeckQuoteBeingSaid( UINT32 uiQuoteNum );
|
||||
extern INT8 IsSpeckQuoteImportantQuote( UINT32 uiQuoteNum );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+20
-1
@@ -6526,6 +6526,10 @@ void DisplayEmploymentinformation( INT32 iId, INT32 iSlot )
|
||||
case 0:
|
||||
{
|
||||
//UINT32 uiTimeUnderThisDisplayAsHours = 24*60;
|
||||
#ifdef JA2UB
|
||||
wcscpy( sString, gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
|
||||
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[PRSNL_TXT_CURRENT_CONTRACT]);
|
||||
#else
|
||||
static const UINT32 uiMinutesInDay = 24 * 60;
|
||||
|
||||
if(Menptr[iId].ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC || Menptr[iId].ubProfile == SLAY )
|
||||
@@ -6569,7 +6573,7 @@ void DisplayEmploymentinformation( INT32 iId, INT32 iSlot )
|
||||
wcscpy( sString, gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
|
||||
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[PRSNL_TXT_CURRENT_CONTRACT]);
|
||||
}
|
||||
|
||||
#endif
|
||||
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)+Prsnl_DATA_OffSetX),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
|
||||
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
|
||||
}
|
||||
@@ -7319,6 +7323,11 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
}
|
||||
if( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving != 0 && gGameExternalOptions.fImprovedInterruptSystem )
|
||||
{
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[27], ( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving * (fExpertLevel ? 2 : 1)), L"%");
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubMAChanceToCkickDoors != 0 )
|
||||
{
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[25], ( gSkillTraitValues.ubMAChanceToCkickDoors * (fExpertLevel ? 2 : 1)), L"%");
|
||||
@@ -7352,6 +7361,11 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[2], ( gSkillTraitValues.ubSLEffectiveLevelAsStandby * (fExpertLevel ? 2 : 1)));
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubSLCollectiveInterruptsBonus != 0 && gGameExternalOptions.fImprovedInterruptSystem )
|
||||
{
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[11], ( gSkillTraitValues.ubSLCollectiveInterruptsBonus * (fExpertLevel ? 2 : 1)), L"%");
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubSLOverallSuppresionBonusPercent != 0 )
|
||||
{
|
||||
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[3], ( gSkillTraitValues.ubSLOverallSuppresionBonusPercent * (fExpertLevel ? 2 : 1)), L"%", (fExpertLevel ? gzMercSkillTextNew[ubTraitNumber + 19] : gzMercSkillTextNew[ubTraitNumber]));
|
||||
@@ -7708,6 +7722,11 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve
|
||||
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[2], gSkillTraitValues.ubSTStealthBonus, L"%");
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubSTReducedAPsRegistered != 0 && gGameExternalOptions.fImprovedInterruptSystem )
|
||||
{
|
||||
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[4], gSkillTraitValues.ubSTReducedAPsRegistered, L"%");
|
||||
wcscat( apStr, atStr );
|
||||
}
|
||||
if( gSkillTraitValues.ubSTStealthPenaltyForMovingReduction != 0 )
|
||||
{
|
||||
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[3], gSkillTraitValues.ubSTStealthPenaltyForMovingReduction, L"%");
|
||||
|
||||
+107
-1
@@ -23,7 +23,10 @@
|
||||
extern HVSURFACE ghFrameBuffer;
|
||||
extern BOOLEAN gfSchedulesHosed;
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#endif
|
||||
UINT8 gubLastLoadingScreenID = LOADINGSCREEN_NOTHING;
|
||||
BOOLEAN bShowSmallImage = FALSE;
|
||||
SECTOR_LOADSCREENS gSectorLoadscreens[MAX_SECTOR_LOADSCREENS];
|
||||
@@ -222,7 +225,90 @@ UINT8 GetLoadScreenID(INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ)
|
||||
Assert( 0 );
|
||||
return fNight ? LOADINGSCREEN_NIGHTGENERIC : LOADINGSCREEN_DAYGENERIC;
|
||||
}
|
||||
/* WANNE: Sir-Tech System */
|
||||
}
|
||||
#ifdef JA2UB
|
||||
|
||||
case 1:
|
||||
{
|
||||
switch( ubSectorID )
|
||||
{
|
||||
case SEC_I13:
|
||||
case SEC_J13:
|
||||
return fNight ? LOADINGSCREEN_MINE : LOADINGSCREEN_MINE;
|
||||
//tunnels
|
||||
case SEC_J14:
|
||||
case SEC_K14:
|
||||
return LOADINGSCREEN_TUNNELS;
|
||||
case SEC_K15:
|
||||
{
|
||||
if( gJa25SaveStruct.ubLoadScreenStairTraversal == LS__GOING_UP_STAIRS )
|
||||
return LOADINGSCREEN_UP_STAIRS;
|
||||
else if( gJa25SaveStruct.ubLoadScreenStairTraversal == LS__GOING_DOWN_STAIRS )
|
||||
return LOADINGSCREEN_DOWN_STAIRS;
|
||||
else
|
||||
return LOADINGSCREEN_COMPLEX_BASEMENT_GENERIC;
|
||||
}
|
||||
default:
|
||||
return LOADINGSCREEN_BASEMENT;
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
switch( ubSectorID )
|
||||
{
|
||||
case SEC_K15:
|
||||
{
|
||||
//if we are going up stairs, else traversing at same level
|
||||
if( gJa25SaveStruct.ubLoadScreenStairTraversal == LS__GOING_UP_STAIRS )
|
||||
return LOADINGSCREEN_UP_STAIRS;
|
||||
else if( gJa25SaveStruct.ubLoadScreenStairTraversal == LS__GOING_DOWN_STAIRS )
|
||||
return LOADINGSCREEN_DOWN_STAIRS;
|
||||
else
|
||||
return LOADINGSCREEN_COMPLEX_BASEMENT;
|
||||
}
|
||||
case SEC_L15:
|
||||
{
|
||||
//if we are going up stairs, else traversing at same level
|
||||
if( gJa25SaveStruct.ubLoadScreenStairTraversal == LS__GOING_UP_STAIRS )
|
||||
return LOADINGSCREEN_UP_STAIRS;
|
||||
else
|
||||
return LOADINGSCREEN_COMPLEX_BASEMENT;
|
||||
}
|
||||
default:
|
||||
return LOADINGSCREEN_BASEMENT;
|
||||
}
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
switch( ubSectorID )
|
||||
{
|
||||
case SEC_L15:
|
||||
{
|
||||
//if we are going up stairs, else traversing at same level
|
||||
if( gJa25SaveStruct.ubLoadScreenStairTraversal == LS__GOING_DOWN_STAIRS )
|
||||
return LOADINGSCREEN_DOWN_STAIRS;
|
||||
else
|
||||
return LOADINGSCREEN_COMPLEX_BASEMENT_GENERIC;
|
||||
}
|
||||
default:
|
||||
return LOADINGSCREEN_CAVE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
return LOADINGSCREEN_CAVE;
|
||||
default:
|
||||
|
||||
/*
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
return LOADINGSCREEN_CAVE;
|
||||
break;
|
||||
return LOADINGSCREEN_CAVE;
|
||||
default:
|
||||
*/
|
||||
#else
|
||||
// Basement Level 1
|
||||
case 1:
|
||||
switch( ubSectorID )
|
||||
@@ -243,6 +329,7 @@ UINT8 GetLoadScreenID(INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ)
|
||||
//all level 2 and 3 maps are caves!
|
||||
return LOADINGSCREEN_CAVE;
|
||||
default:
|
||||
#endif
|
||||
// shouldn't ever happen
|
||||
Assert( FALSE );
|
||||
return fNight ? LOADINGSCREEN_NIGHTGENERIC : LOADINGSCREEN_DAYGENERIC;
|
||||
@@ -287,6 +374,10 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
||||
UINT32 uiLoadScreen;
|
||||
STRING512 smallImage = {0};
|
||||
|
||||
// STRING512 xName;
|
||||
// char szFullImagePath[80];
|
||||
STRING512 sImage = {0};
|
||||
|
||||
bShowSmallImage = FALSE;
|
||||
|
||||
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE | VSURFACE_CREATE_FROMPNG_FALLBACK;
|
||||
@@ -365,6 +456,21 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
||||
std::string strBigImage;
|
||||
BuildLoadscreenFilename(strBigImage, imagePath.c_str(), iResolution, imageFormat.c_str());
|
||||
strBigImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile)-1);
|
||||
|
||||
|
||||
if ( !FileExists(vs_desc.ImageFile) )
|
||||
{
|
||||
// Small image: 640x480
|
||||
std::string strSmallImage("LOADSCREENS\\");
|
||||
std::string strBigImage("LOADSCREENS\\");
|
||||
BuildLoadscreenFilename(strSmallImage, LoadScreenNames[1], 0, imageFormat.c_str());
|
||||
strSmallImage.copy(smallImage, sizeof(smallImage)-1);
|
||||
|
||||
// Actual image, depending on the resolution
|
||||
BuildLoadscreenFilename(strBigImage, LoadScreenNames[1], iResolution, imageFormat.c_str());
|
||||
strBigImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile)-1);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -54,6 +54,29 @@ enum
|
||||
DAY_ALT,
|
||||
NIGHT_ALT,
|
||||
UNDERGROUND,
|
||||
#ifdef JA2UB
|
||||
LOADINGSCREEN_HELI_CRASH,
|
||||
|
||||
LOADINGSCREEN_DAY_SNOW,
|
||||
LOADINGSCREEN_NIGHT_SNOW,
|
||||
|
||||
LOADINGSCREEN_GUARDPOST_DAY,
|
||||
LOADINGSCREEN_GUARDPOST_NIGHT,
|
||||
|
||||
LOADINGSCREEN_POWERPLANT_DAY,
|
||||
LOADINGSCREEN_POWERPLANT_NIGHT,
|
||||
|
||||
LOADINGSCREEN_DOWN_STAIRS,
|
||||
LOADINGSCREEN_UP_STAIRS,
|
||||
|
||||
LOADINGSCREEN_COMPLEX_BASEMENT,
|
||||
LOADINGSCREEN_COMPLEX_BASEMENT_GENERIC,
|
||||
|
||||
LOADINGSCREEN_COMPLEX_TOP_LEVEL_DAY,
|
||||
LOADINGSCREEN_COMPLEX_TOP_LEVEL_NIGHT,
|
||||
|
||||
LOADINGSCREEN_TUNNELS,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -2838,7 +2838,11 @@ void DoneFadeOutForExitMPHScreen( void )
|
||||
|
||||
gubMPHExitScreen = INTRO_SCREEN;
|
||||
|
||||
#ifdef JA2UB
|
||||
//SetIntroType( INTRO_BEGINNING );
|
||||
#else
|
||||
SetIntroType( INTRO_BEGINNING );
|
||||
#endif
|
||||
|
||||
ExitMPHScreen(); // cleanup please, if we called a fadeout then we didnt do it above
|
||||
|
||||
|
||||
@@ -609,7 +609,12 @@ void DoneFadeOutForExitMPSScreen( void )
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
//SetIntroType( INTRO_BEGINNING );
|
||||
#else
|
||||
SetIntroType( INTRO_BEGINNING );
|
||||
#endif
|
||||
|
||||
ExitMPSScreen(); // cleanup please, if we called a fadeout then we didnt do it above
|
||||
|
||||
|
||||
+132
-178
@@ -46,52 +46,45 @@
|
||||
#include <vfs/Core/vfs.h>
|
||||
#include <vfs/Core/vfs_profile.h>
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#define MAINMENU_TEXT_FILE "LoadScreens\\MainMenu.edt"
|
||||
#define MAINMENU_RECORD_SIZE 80 * 2
|
||||
|
||||
//#define TESTFOREIGNFONTS
|
||||
|
||||
// MENU ITEMS
|
||||
enum
|
||||
{
|
||||
// TITLE,
|
||||
NEW_GAME,
|
||||
NEW_MP_GAME,
|
||||
LOAD_GAME,
|
||||
//LOAD_MP_GAME,
|
||||
PREFERENCES,
|
||||
CREDITS,
|
||||
QUIT,
|
||||
NUM_MENU_ITEMS
|
||||
};
|
||||
|
||||
//#define MAINMENU_Y iScreenHeightOffset + 277
|
||||
#define MAINMENU_Y iScreenHeightOffset + 210
|
||||
#define MAINMENU_Y_SPACE 37
|
||||
UINT32 MAINMENU_Y;
|
||||
UINT32 MAINMENU_X;
|
||||
UINT32 MAINMENU_Y_SPACE;
|
||||
|
||||
|
||||
INT32 iMenuImages[ NUM_MENU_ITEMS ];
|
||||
INT32 iMenuButtons[ NUM_MENU_ITEMS ];
|
||||
INT32 iMenuImages[ NUM_MENU_ITEMS ];
|
||||
INT32 iMenuButtons[ NUM_MENU_ITEMS ];
|
||||
|
||||
UINT16 gusMainMenuButtonWidths[ NUM_MENU_ITEMS ];
|
||||
|
||||
UINT32 guiMainMenuBackGroundImage;
|
||||
UINT32 guiJa2LogoImage;
|
||||
|
||||
MOUSE_REGION gBackRegion;
|
||||
INT8 gbHandledMainMenu = 0;
|
||||
MOUSE_REGION gBackRegion;
|
||||
INT8 gbHandledMainMenu = 0;
|
||||
BOOLEAN fInitialRender = FALSE;
|
||||
//BOOLEAN gfDoHelpScreen = 0;
|
||||
|
||||
BOOLEAN gfMainMenuScreenEntry = FALSE;
|
||||
BOOLEAN gfMainMenuScreenExit = FALSE;
|
||||
|
||||
UINT32 guiMainMenuExitScreen = MAINMENU_SCREEN;
|
||||
|
||||
|
||||
extern BOOLEAN gfLoadGameUponEntry;
|
||||
|
||||
|
||||
void ExitMainMenu( );
|
||||
void MenuButtonCallback(GUI_BUTTON *btn, INT32 reason);
|
||||
void HandleMainMenuInput();
|
||||
@@ -106,11 +99,12 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate );
|
||||
void RenderMainMenu();
|
||||
void RestoreButtonBackGrounds();
|
||||
|
||||
//Main Menu layout by Jazz
|
||||
MAIN_MENU_VALUES gMainMenulayout[MAX_MAIN_MENU_IMAGE];
|
||||
VSURFACE_DESC vs_desc;
|
||||
|
||||
extern void InitSightRange(); //lal
|
||||
|
||||
|
||||
|
||||
|
||||
UINT32 MainMenuScreenInit( )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Version Label: %S", zVersionLabel ));
|
||||
@@ -120,8 +114,6 @@ UINT32 MainMenuScreenInit( )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
UINT32 MainMenuScreenHandle( )
|
||||
{
|
||||
UINT32 cnt;
|
||||
@@ -134,7 +126,7 @@ UINT32 MainMenuScreenHandle( )
|
||||
return MAINMENU_SCREEN; //The splash screen hasn't been up long enough yet.
|
||||
}
|
||||
if( guiSplashFrameFade )
|
||||
{ //Fade the splash screen.
|
||||
{
|
||||
uiTime = GetJA2Clock();
|
||||
if( guiSplashFrameFade > 2 )
|
||||
ShadowVideoSurfaceRectUsingLowPercentTable( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
@@ -143,12 +135,9 @@ UINT32 MainMenuScreenHandle( )
|
||||
else
|
||||
{
|
||||
uiTime = GetJA2Clock();
|
||||
//while( GetJA2Clock() < uiTime + 375 );
|
||||
SetMusicMode( MUSIC_MAIN_MENU );
|
||||
}
|
||||
|
||||
//while( uiTime + 100 > GetJA2Clock() );
|
||||
|
||||
guiSplashFrameFade--;
|
||||
|
||||
InvalidateScreen();
|
||||
@@ -170,7 +159,6 @@ UINT32 MainMenuScreenHandle( )
|
||||
SetMusicMode( MUSIC_MAIN_MENU );
|
||||
}
|
||||
|
||||
|
||||
if ( fInitialRender )
|
||||
{
|
||||
ClearMainMenu();
|
||||
@@ -191,12 +179,7 @@ UINT32 MainMenuScreenHandle( )
|
||||
|
||||
EndFrameBufferRender( );
|
||||
|
||||
|
||||
// if ( gfDoHelpScreen )
|
||||
// HandleHelpScreenInput();
|
||||
// else
|
||||
HandleMainMenuInput();
|
||||
|
||||
HandleMainMenuInput();
|
||||
HandleMainMenuScreen();
|
||||
|
||||
if( gfMainMenuScreenExit )
|
||||
@@ -212,15 +195,11 @@ UINT32 MainMenuScreenHandle( )
|
||||
return( guiMainMenuExitScreen );
|
||||
}
|
||||
|
||||
|
||||
UINT32 MainMenuScreenShutdown( )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void HandleMainMenuScreen()
|
||||
{
|
||||
if ( gbHandledMainMenu != 0 )
|
||||
@@ -234,14 +213,8 @@ void HandleMainMenuScreen()
|
||||
break;
|
||||
|
||||
case NEW_GAME:
|
||||
|
||||
// gfDoHelpScreen = 1;
|
||||
// gfMainMenuScreenExit = TRUE;
|
||||
// if( !gfDoHelpScreen )
|
||||
// SetMainMenuExitScreen( INIT_SCREEN );
|
||||
break;
|
||||
|
||||
// ROMAN: TODO??
|
||||
case NEW_MP_GAME:
|
||||
break;
|
||||
|
||||
@@ -252,20 +225,8 @@ void HandleMainMenuScreen()
|
||||
gbHandledMainMenu = 0;
|
||||
gfSaveGame = FALSE;
|
||||
gfMainMenuScreenExit = TRUE;
|
||||
|
||||
break;
|
||||
|
||||
// ROMAN: TODO
|
||||
// case LOAD_MP_GAME:
|
||||
//// Select the game which is to be restored
|
||||
//guiPreviousOptionScreen = guiCurrentScreen;
|
||||
//guiMainMenuExitScreen = SAVE_LOAD_SCREEN;
|
||||
//gbHandledMainMenu = 0;
|
||||
//gfSaveGame = FALSE;
|
||||
//gfMainMenuScreenExit = TRUE;
|
||||
|
||||
//break;
|
||||
|
||||
case PREFERENCES:
|
||||
guiPreviousOptionScreen = guiCurrentScreen;
|
||||
guiMainMenuExitScreen = OPTIONS_SCREEN;
|
||||
@@ -282,17 +243,17 @@ void HandleMainMenuScreen()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOLEAN InitMainMenu( )
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
// gfDoHelpScreen = 0;
|
||||
//main Menu by JAzz
|
||||
UINT16 iCounter2;
|
||||
|
||||
if(is_networked)
|
||||
{
|
||||
is_networked = FALSE;
|
||||
|
||||
#ifdef USE_VFS
|
||||
// remove Multiplayer profile if it exists
|
||||
vfs::CProfileStack *PS = getVFS()->getProfileStack();
|
||||
@@ -319,57 +280,47 @@ BOOLEAN InitMainMenu( )
|
||||
CreateDestroyMainMenuButtons( TRUE );
|
||||
|
||||
// load background graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
if (iResolution == 0)
|
||||
//Main Menu by Jazz
|
||||
for( iCounter2 = 1; iCounter2 < MAX_ELEMENT; iCounter2++ )
|
||||
{
|
||||
FilenameForBPP("LOADSCREENS\\MainMenuBackGround.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
else if (iResolution == 1)
|
||||
{
|
||||
FilenameForBPP("LOADSCREENS\\MainMenuBackGround_800x600.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
else if (iResolution == 2)
|
||||
{
|
||||
FilenameForBPP("LOADSCREENS\\MainMenuBackGround_1024x768.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
VObjectDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE;
|
||||
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiMainMenuBackGroundImage ));
|
||||
if (gMainMenulayout[iCounter2].Visible == 1)
|
||||
{
|
||||
if (iResolution == 0)
|
||||
{
|
||||
strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName);
|
||||
|
||||
// load ja2 logo graphic and add it
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
// FilenameForBPP("INTERFACE\\Ja2_2.sti", VObjectDesc.ImageFile);
|
||||
FilenameForBPP("LOADSCREENS\\Ja2Logo.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiJa2LogoImage ));
|
||||
if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName ) );
|
||||
}
|
||||
else if (iResolution == 1)
|
||||
{
|
||||
strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName800x600);
|
||||
|
||||
/*
|
||||
// Gray out some buttons based on status of game!
|
||||
if( gGameSettings.bLastSavedGameSlot < 0 || gGameSettings.bLastSavedGameSlot >= NUM_SLOT )
|
||||
{
|
||||
DisableButton( iMenuButtons[ LOAD_GAME ] );
|
||||
if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName800x600 ) );
|
||||
}
|
||||
else if (iResolution == 2)
|
||||
{
|
||||
strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName1024x768);
|
||||
|
||||
if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
|
||||
AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName1024x768 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
//The ini file said we have a saved game, but there is no saved game
|
||||
else if( gbSaveGameArray[ gGameSettings.bLastSavedGameSlot ] == FALSE )
|
||||
DisableButton( iMenuButtons[ LOAD_GAME ] );
|
||||
*/
|
||||
|
||||
//if there are no saved games, disable the button
|
||||
if( !IsThereAnySavedGameFiles() )
|
||||
DisableButton( iMenuButtons[ LOAD_GAME ] );
|
||||
|
||||
|
||||
// DisableButton( iMenuButtons[ CREDITS ] );
|
||||
// DisableButton( iMenuButtons[ TITLE ] );
|
||||
|
||||
gbHandledMainMenu = 0;
|
||||
fInitialRender = TRUE;
|
||||
|
||||
SetPendingNewScreen( MAINMENU_SCREEN);
|
||||
guiMainMenuExitScreen = MAINMENU_SCREEN;
|
||||
|
||||
// WANNE: I don't think that is needed!
|
||||
//InitGameOptions();
|
||||
|
||||
DequeueAllKeyBoardEvents();
|
||||
|
||||
return( TRUE );
|
||||
@@ -378,28 +329,20 @@ BOOLEAN InitMainMenu( )
|
||||
|
||||
void ExitMainMenu( )
|
||||
{
|
||||
// UINT32 uiDestPitchBYTES;
|
||||
// UINT8 *pDestBuf;
|
||||
|
||||
// if( !gfDoHelpScreen )
|
||||
{
|
||||
CreateDestroyBackGroundMouseMask( FALSE );
|
||||
}
|
||||
|
||||
UINT32 iCounter2 ;
|
||||
|
||||
CreateDestroyBackGroundMouseMask( FALSE );
|
||||
CreateDestroyMainMenuButtons( FALSE );
|
||||
|
||||
DeleteVideoObjectFromIndex( guiMainMenuBackGroundImage );
|
||||
DeleteVideoObjectFromIndex( guiJa2LogoImage );
|
||||
for( iCounter2 = 1; iCounter2 < MAX_ELEMENT; iCounter2++ )
|
||||
{
|
||||
if (gMainMenulayout[iCounter2].Visible == 1)
|
||||
{
|
||||
DeleteVideoObjectFromIndex( gMainMenulayout[iCounter2].uiIndex );
|
||||
}
|
||||
}
|
||||
|
||||
gMsgBox.uiExitScreen = MAINMENU_SCREEN;
|
||||
/*
|
||||
// CLEAR THE FRAME BUFFER
|
||||
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
||||
memset(pDestBuf, 0, SCREEN_HEIGHT * uiDestPitchBYTES );
|
||||
UnLockVideoSurface( FRAME_BUFFER );
|
||||
InvalidateScreen( );
|
||||
*/
|
||||
}
|
||||
|
||||
// WANNE - MP: This method initializes variables that should be initialized
|
||||
@@ -425,6 +368,10 @@ void InitDependingGameStyleOptions()
|
||||
// HEADROCK HAM 4: CTH constants
|
||||
LoadCTHConstants();
|
||||
|
||||
#ifdef JA2UB
|
||||
LoadGameUBOptions(); // JA25 UB
|
||||
#endif
|
||||
|
||||
InitSightRange(); //lal
|
||||
|
||||
ReStartingGame();
|
||||
@@ -456,7 +403,6 @@ void MenuButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
// Snap: UN-Init MP save game directory
|
||||
if ( !InitSaveDir() )
|
||||
{
|
||||
|
||||
//if something didnt work, dont even know how to make error code...//hayden
|
||||
}
|
||||
};
|
||||
@@ -518,20 +464,16 @@ void MenuButtonMoveCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
|
||||
{
|
||||
// btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||
RenderMainMenu();
|
||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
||||
}
|
||||
if(reason & MSYS_CALLBACK_REASON_GAIN_MOUSE)
|
||||
{
|
||||
// btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||
RenderMainMenu();
|
||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void HandleMainMenuInput()
|
||||
{
|
||||
InputAtom InputEvent;
|
||||
@@ -543,19 +485,12 @@ void HandleMainMenuInput()
|
||||
{
|
||||
switch( InputEvent.usParam )
|
||||
{
|
||||
/*
|
||||
case ESC:
|
||||
gbHandledMainMenu = QUIT;
|
||||
break;
|
||||
*/
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
case 'q':
|
||||
gbHandledMainMenu = NEW_GAME;
|
||||
gfMainMenuScreenExit = TRUE;
|
||||
SetMainMenuExitScreen( INIT_SCREEN );
|
||||
|
||||
// gfDoHelpScreen = 1;
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
@@ -563,7 +498,6 @@ void HandleMainMenuInput()
|
||||
gfMainMenuScreenExit = TRUE;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 'c':
|
||||
gbHandledMainMenu = LOAD_GAME;
|
||||
|
||||
@@ -626,21 +560,9 @@ void SelectMainMenuBackGroundRegionCallBack(MOUSE_REGION * pRegion, INT32 iReaso
|
||||
}
|
||||
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
{
|
||||
// if( gfDoHelpScreen )
|
||||
// {
|
||||
// SetMainMenuExitScreen( INIT_SCREEN );
|
||||
// gfDoHelpScreen = FALSE;
|
||||
// }
|
||||
}
|
||||
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
|
||||
{
|
||||
/*
|
||||
if( gfDoHelpScreen )
|
||||
{
|
||||
SetMainMenuExitScreen( INIT_SCREEN );
|
||||
gfDoHelpScreen = FALSE;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,6 +613,27 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
SGPFILENAME filenameMP;
|
||||
INT16 sSlot;
|
||||
|
||||
if (iResolution == 0)
|
||||
{
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_Y;
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_X;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
|
||||
if (iResolution == 1)
|
||||
{
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_800x600Y;
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_800x600X;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
|
||||
if (iResolution == 2)
|
||||
{
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_1024x768Y;
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_1024x768X;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
|
||||
if( fCreate )
|
||||
{
|
||||
if( fButtonsCreated )
|
||||
@@ -710,8 +653,6 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
sSlot = 0;
|
||||
iMenuImages[ LOAD_GAME ] = UseLoadedButtonImage( iMenuImages[ NEW_GAME ] ,6,3,4,5,-1 );
|
||||
|
||||
//iMenuImages[ LOAD_MP_GAME ] = UseLoadedButtonImage( iMenuImages[ NEW_MP_GAME ], 3, 3, 4, 5, -1 );
|
||||
|
||||
iMenuImages[ PREFERENCES ] = UseLoadedButtonImage( iMenuImages[ NEW_GAME ] ,7,7,8,9,-1 );
|
||||
iMenuImages[ CREDITS ] = UseLoadedButtonImage( iMenuImages[ NEW_GAME ] ,13,10,11,12,-1 );
|
||||
iMenuImages[ QUIT ] = UseLoadedButtonImage( iMenuImages[ NEW_GAME ] ,14,14,15,16,-1 );
|
||||
@@ -723,21 +664,17 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
case NEW_GAME: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], sSlot ); break;
|
||||
case NEW_MP_GAME: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 0); break;
|
||||
case LOAD_GAME: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 3 ); break;
|
||||
// case LOAD_MP_GAME: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 3); break;
|
||||
case PREFERENCES: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 7 ); break;
|
||||
case CREDITS: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 10 ); break;
|
||||
case QUIT: gusMainMenuButtonWidths[cnt] = GetWidthOfButtonPic( (UINT16)iMenuImages[cnt], 15 ); break;
|
||||
}
|
||||
#ifdef TESTFOREIGNFONTS
|
||||
iMenuButtons[ cnt ] = QuickCreateButton( iMenuImages[ cnt ], (INT16)((SCREEN_WIDTH / 2) - gusMainMenuButtonWidths[cnt]/2), (INT16)( 0 + ( cnt * 18 ) ),
|
||||
// iMenuButtons[ cnt ] = QuickCreateButton( iMenuImages[ cnt ], (INT16)((SCREEN_WIDTH / 2) - gusMainMenuButtonWidths[cnt]/2), (INT16)( 0 + ( cnt * 18 ) ),
|
||||
iMenuButtons[ cnt ] = QuickCreateButton( iMenuImages[ cnt ], (INT16)(MAINMENU_X - gusMainMenuButtonWidths[cnt]/2), (INT16)( 0 + ( cnt * 18 ) ), //(INT16)((SCREEN_WIDTH / 2) - gusMainMenuButtonWidths[cnt]/2)
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
DEFAULT_MOVE_CALLBACK, MenuButtonCallback );
|
||||
#else
|
||||
/*iMenuButtons[ cnt ] = QuickCreateButton( iMenuImages[ cnt ], (INT16)(420 - gusMainMenuButtonWidths[cnt]/2), (INT16)( MAINMENU_Y + ( cnt * MAINMENU_Y_SPACE ) ),
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
DEFAULT_MOVE_CALLBACK, MenuButtonCallback );*/
|
||||
|
||||
iMenuButtons[ cnt ] = QuickCreateButton( iMenuImages[ cnt ], (INT16)((SCREEN_WIDTH / 2) - gusMainMenuButtonWidths[cnt]/2), (INT16)( MAINMENU_Y + ( cnt * MAINMENU_Y_SPACE ) ),
|
||||
iMenuButtons[ cnt ] = QuickCreateButton( iMenuImages[ cnt ], (INT16)(MAINMENU_X - gusMainMenuButtonWidths[cnt]/2), (INT16)( MAINMENU_Y + ( cnt * MAINMENU_Y_SPACE ) ),
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
DEFAULT_MOVE_CALLBACK, MenuButtonCallback );
|
||||
#endif
|
||||
@@ -745,30 +682,10 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
ButtonList[ iMenuButtons[ cnt ] ]->UserData[0] = cnt;
|
||||
|
||||
// WANNE: Removed this, because in Release version it always crashes!
|
||||
/*
|
||||
#ifndef _DEBUG
|
||||
//load up some info from the 'mainmenu.edt' file. This makes sure the file is present. The file is
|
||||
// 'marked' with a code that identifies the testers
|
||||
INT32 iStartLoc = MAINMENU_RECORD_SIZE * cnt;
|
||||
if( !LoadEncryptedDataFromFile(MAINMENU_TEXT_FILE, zText, iStartLoc, MAINMENU_RECORD_SIZE ) )
|
||||
{
|
||||
//the file was not able to be loaded properly
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
|
||||
if( pSoldier->bActive != TRUE )
|
||||
{
|
||||
//something is very wrong
|
||||
pSoldier->bActive = pSoldier->stats.bLife;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
fButtonsCreated = TRUE;
|
||||
}
|
||||
else
|
||||
@@ -792,16 +709,35 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
|
||||
void RenderMainMenu()
|
||||
{
|
||||
HVOBJECT hPixHandle;
|
||||
UINT32 iCounter2;
|
||||
|
||||
//Get and display the background image
|
||||
GetVideoObject(&hPixHandle, guiMainMenuBackGroundImage );
|
||||
BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, 0, 0, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, 0, 0, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
for( iCounter2 = 1; iCounter2 < MAX_ELEMENT; iCounter2++ )
|
||||
{
|
||||
if (gMainMenulayout[iCounter2].Visible == 1)
|
||||
{
|
||||
if (iResolution == 0)
|
||||
{
|
||||
GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
|
||||
BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX, gMainMenulayout[iCounter2].ImagePositionY, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX, gMainMenulayout[iCounter2].ImagePositionY, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
}
|
||||
|
||||
GetVideoObject(&hPixHandle, guiJa2LogoImage );
|
||||
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, iScreenWidthOffset + 188, iScreenHeightOffset + 10, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, iScreenWidthOffset + 188, iScreenHeightOffset + 10, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
if (iResolution == 1)
|
||||
{
|
||||
GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
|
||||
BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X, gMainMenulayout[iCounter2].ImagePosition800x600Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X, gMainMenulayout[iCounter2].ImagePosition800x600Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
}
|
||||
|
||||
if (iResolution == 2)
|
||||
{
|
||||
GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
|
||||
BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X, gMainMenulayout[iCounter2].ImagePosition1024x768Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X, gMainMenulayout[iCounter2].ImagePosition1024x768Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TESTFOREIGNFONTS
|
||||
DrawTextToScreen( L"LARGEFONT1: ÄÀÁÂÇËÈÉÊÏÖÒÓÔÜÙÚÛäàáâçëèéêïöòóôüùúûÌÎìî"/*gzCopyrightText[ 0 ]*/, 0, 105, 640, LARGEFONT1, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
@@ -836,15 +772,33 @@ void RestoreButtonBackGrounds()
|
||||
{
|
||||
UINT8 cnt;
|
||||
|
||||
// RestoreExternBackgroundRect( (UINT16)(320 - gusMainMenuButtonWidths[TITLE]/2), MAINMENU_TITLE_Y, gusMainMenuButtonWidths[TITLE], 23 );
|
||||
|
||||
#ifndef TESTFOREIGNFONTS
|
||||
|
||||
if (iResolution == 0)
|
||||
{
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_Y;
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_X;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
|
||||
if (iResolution == 1)
|
||||
{
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_800x600Y;
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_800x600X;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
|
||||
if (iResolution == 2)
|
||||
{
|
||||
MAINMENU_Y = gMainMenulayout[0].MAINMENU_1024x768Y;
|
||||
MAINMENU_X = gMainMenulayout[0].MAINMENU_1024x768X;
|
||||
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
|
||||
}
|
||||
|
||||
for ( cnt = 0; cnt < NUM_MENU_ITEMS; cnt++ )
|
||||
{
|
||||
RestoreExternBackgroundRect( (UINT16)((SCREEN_WIDTH / 2) - gusMainMenuButtonWidths[cnt]/2), (INT16)( MAINMENU_Y + ( cnt * MAINMENU_Y_SPACE )-1), (UINT16)(gusMainMenuButtonWidths[cnt]+1), 23 );
|
||||
RestoreExternBackgroundRect( (UINT16)(MAINMENU_X - gusMainMenuButtonWidths[cnt]/2), (INT16)( MAINMENU_Y + ( cnt * MAINMENU_Y_SPACE )-1), (UINT16)(gusMainMenuButtonWidths[cnt]+1), 23 );
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2414,6 +2414,9 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
|
||||
gGameExternalOptions.gfAllowReinforcements = false;
|
||||
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = false;
|
||||
|
||||
// WANNE: The new improved interrupt system (IIS) does not work with multiplayer, so disable it
|
||||
gGameExternalOptions.fImprovedInterruptSystem = false;
|
||||
|
||||
// Disable Real-Time Mode
|
||||
// SANDRO - huh? real-time sneak is in preferences
|
||||
//gGameExternalOptions.fAllowRealTimeSneak = false;
|
||||
@@ -2466,6 +2469,8 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
|
||||
break;
|
||||
}
|
||||
|
||||
gGameOptions.ubSquadSize = 6;
|
||||
|
||||
// Server forces us to play with new Inventory, but NIV is not allowed on the client,
|
||||
// because of wrong resolution or other stuff
|
||||
if ( UsingNewInventorySystem() == true && !IsNIVModeValid(true) )
|
||||
@@ -2622,6 +2627,9 @@ void reapplySETTINGS()
|
||||
gGameExternalOptions.gfAllowReinforcements = false;
|
||||
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = false;
|
||||
|
||||
// WANNE: The new improved interrupt system (IIS) does not work with multiplayer, so disable it
|
||||
gGameExternalOptions.fImprovedInterruptSystem = false;
|
||||
|
||||
// Disable Real-Time Mode
|
||||
// SANDRO - real-time sneak is in preferences
|
||||
//gGameExternalOptions.fAllowRealTimeSneak = false;
|
||||
@@ -2673,6 +2681,8 @@ void reapplySETTINGS()
|
||||
break;
|
||||
}
|
||||
|
||||
gGameOptions.ubSquadSize = 6;
|
||||
|
||||
// WANNE - MP: We have to re-initialize the correct interface
|
||||
if((UsingNewInventorySystem() == true) && IsNIVModeValid(true))
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "Merc Hiring.h"
|
||||
#include "event pump.h"
|
||||
#include "Bullets.h"
|
||||
#include "builddefines.h"
|
||||
|
||||
extern bool isOwnTeamWipedOut;
|
||||
|
||||
@@ -185,7 +186,11 @@ extern BOOLEAN fClientReceivedAllFiles;
|
||||
// OJW - 20090507
|
||||
// Add basic version checking, will only work from now on
|
||||
// note: this cannot be longer than char[30]
|
||||
#ifdef JA2UB
|
||||
#define MPVERSION "MP v2.0(UB)"
|
||||
#else
|
||||
#define MPVERSION "MP v2.0"
|
||||
#endif
|
||||
|
||||
// OJW - 2009128 - inline funcs for working with soldiers and teams
|
||||
// sick of confusing myself :)
|
||||
|
||||
+584
-62
@@ -127,7 +127,14 @@
|
||||
#include "INIReader.h"
|
||||
#include "mercs.h"
|
||||
#include "soldier Profile.h"
|
||||
#ifdef JA2UB
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#endif
|
||||
|
||||
#include "LuaInitNPCs.h"
|
||||
#include "Vehicles.h"
|
||||
#include "Encyclopedia_Data.h"
|
||||
|
||||
#include <vfs/Core/vfs.h>
|
||||
//rain
|
||||
@@ -143,7 +150,20 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Strategic Movement.h"
|
||||
#include "LuaInitNPCs.h"
|
||||
#include "ub_config.h"
|
||||
#include "Ja25Update.h"
|
||||
#endif
|
||||
|
||||
#include "LuaInitNPCs.h"
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//void ConvertWeapons( SOLDIERTYPE *pSoldier );
|
||||
extern void MakeBadSectorListFromMapsOnHardDrive( BOOLEAN fDisplayMessages ); // ja25 UB
|
||||
#endif
|
||||
|
||||
void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ );
|
||||
extern void NextLoopCheckForEnoughFreeHardDriveSpace();
|
||||
@@ -183,13 +203,16 @@ extern BOOLEAN gfCreatureMeanwhileScenePlayed;
|
||||
|
||||
BOOLEAN gMusicModeToPlay = FALSE;
|
||||
|
||||
|
||||
//extern BOOLEAN gfFirstTimeInGameHeliCrash;
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
BOOLEAN gfDisplaySaveGamesNowInvalidatedMsg = FALSE;
|
||||
#endif
|
||||
|
||||
BOOLEAN gfUseConsecutiveQuickSaveSlots = FALSE;
|
||||
UINT32 guiCurrentQuickSaveNumber = 0;
|
||||
UINT32 guiLastSaveGameNum;
|
||||
UINT32 guiLastSaveGameNum = 1;
|
||||
BOOLEAN DoesAutoSaveFileExist( BOOLEAN fLatestAutoSave );
|
||||
|
||||
UINT32 guiJA2EncryptionSet = 0;
|
||||
@@ -412,6 +435,48 @@ typedef struct
|
||||
// HEADROCK HAM 3.6: Global variable keeping track of Militia Upkeep Costs at last midnight.
|
||||
UINT32 uiTotalUpkeepForMilitia;
|
||||
|
||||
UINT32 sMercArrivalGridNo;
|
||||
|
||||
//JA25 UB
|
||||
#ifdef JA2UB
|
||||
INT8 fMorrisShouldSayHi;
|
||||
BOOLEAN fFirstTimeInGameHeliCrash;
|
||||
UINT32 sINITIALHELIGRIDNO[ 7 ];
|
||||
UINT32 sLOCATEGRIDNO;
|
||||
UINT32 sLOCATEGRIDNO2;
|
||||
UINT32 sJerryGridNo;
|
||||
|
||||
BOOLEAN sJerryQuotes;
|
||||
BOOLEAN sInJerry;
|
||||
BOOLEAN sInGameHeliCrash;
|
||||
BOOLEAN sLaptopQuestEnabled;
|
||||
BOOLEAN sTEX_AND_JOHN;
|
||||
BOOLEAN sRandom_Manuel_Text;
|
||||
|
||||
BOOLEAN sEVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE_UB;
|
||||
BOOLEAN sHandleAddingEnemiesToTunnelMaps_UB;
|
||||
|
||||
BOOLEAN sInGameHeli;
|
||||
BOOLEAN spJA2UB;
|
||||
|
||||
BOOLEAN sfDeadMerc;
|
||||
|
||||
UINT8 subEndDefaultSectorX;
|
||||
UINT8 subEndDefaultSectorY;
|
||||
UINT8 subEndDefaultSectorZ;
|
||||
|
||||
BOOLEAN sTestUB;
|
||||
|
||||
BOOLEAN sLaptopLinkInsurance;
|
||||
BOOLEAN sLaptopLinkFuneral;
|
||||
BOOLEAN sLaptopLinkBobby;
|
||||
|
||||
BOOLEAN ubFiller2[255];
|
||||
UINT32 ubFiller3[255];
|
||||
INT8 ubFiller4[255];
|
||||
|
||||
#endif
|
||||
|
||||
// HEADROCK HAM 4: Added manual restrictions
|
||||
UINT8 ubManualRestrictMilitia[256];
|
||||
|
||||
@@ -1906,6 +1971,12 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
||||
numBytesRead = ReadFieldByField(hFile, &this->snowCamo, sizeof(snowCamo), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->wornSnowCamo, sizeof(wornSnowCamo), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->sFacilityTypeOperated, sizeof(sFacilityTypeOperated), sizeof(INT16), numBytesRead);
|
||||
#ifdef JA2UB
|
||||
numBytesRead = ReadFieldByField(hFile, &this->fIgnoreGetupFromCollapseCheck, sizeof(fIgnoreGetupFromCollapseCheck), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->GetupFromJA25StartCounter, sizeof(GetupFromJA25StartCounter), sizeof(TIMECOUNTER), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->fWaitingToGetupFromJA25Start, sizeof(fWaitingToGetupFromJA25Start), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->ubPercentDamageInflictedByTeam, sizeof(ubPercentDamageInflictedByTeam), sizeof(UINT8), numBytesRead);
|
||||
#endif
|
||||
numBytesRead += buffer;
|
||||
if(numBytesRead != SIZEOF_SOLDIERTYPE_POD)
|
||||
return(FALSE);
|
||||
@@ -2014,6 +2085,18 @@ BOOLEAN SOLDIERTYPE::Load(HWFILE hFile)
|
||||
else
|
||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.bAimTime, 1, 1, numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.bShownAimTime, sizeof(aiData.bShownAimTime), sizeof(INT8), numBytesRead);
|
||||
if ( guiCurrentSaveGameVersion >= IMPROVED_INTERRUPT_SYSTEM )
|
||||
numBytesRead = ReadFieldByField(hFile, &this->aiData.ubInterruptCounter, sizeof(aiData.ubInterruptCounter), sizeof(UINT8), numBytesRead); // SANDRO - interrupt counter
|
||||
else
|
||||
{
|
||||
//CHRISL: We have to make sure we add a buffer to account for the lack of ubInterruptCounter and that buffer needs to be a full DWORD in size
|
||||
buffer = 0;
|
||||
for(int i = 0; i < sizeof(aiData.ubInterruptCounter); i++)
|
||||
buffer++;
|
||||
while((buffer%4) > 0)
|
||||
buffer++;
|
||||
numBytesRead += buffer;
|
||||
}
|
||||
//CHRISL: We also need to make sure the structure aligns properly and that we don't need to read any extra
|
||||
// padding bytes
|
||||
while((numBytesRead%__alignof(STRUCT_AIData)) > 0)
|
||||
@@ -2412,7 +2495,6 @@ BOOLEAN OBJECTTYPE::Load( HWFILE hFile )
|
||||
// WANNE.MEMORY: This call takes all the pc memory if we pass an invalid huge size as a parameter. See previous safety check.
|
||||
objectStack.resize(size);
|
||||
|
||||
|
||||
int x = 0;
|
||||
for (StackedObjects::iterator iter = objectStack.begin(); iter != objectStack.end(); ++iter, ++x) {
|
||||
if (! iter->Load(hFile)) {
|
||||
@@ -2425,7 +2507,6 @@ BOOLEAN OBJECTTYPE::Load( HWFILE hFile )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2685,18 +2766,10 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
||||
UINT16 usPosX, usActualWidth, usActualHeight;
|
||||
BOOLEAN fWePausedIt = FALSE;
|
||||
|
||||
CHAR16 zString[128];
|
||||
|
||||
//sprintf( saveDir, "%S", pMessageStrings[ MSG_SAVEDIRECTORY ] );
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
#ifndef CRIPPLED_VERSION
|
||||
//AssertMsg( uiSizeOfGeneralInfo == 1024, String( "Saved General info is NOT 1024, it is %d. DF 1.", uiSizeOfGeneralInfo ) );
|
||||
//AssertMsg( sizeof( LaptopSaveInfoStruct ) == 7440, String( "LaptopSaveStruct is NOT 7440, it is %d. DF 1.", sizeof( LaptopSaveInfoStruct ) ) );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if( ubSaveGameID > NUM_SLOT && ubSaveGameID < EARLIST_SPECIAL_SAVE )
|
||||
return( FALSE ); //ddd
|
||||
if( ubSaveGameID > NUM_SAVE_GAMES || ubSaveGameID == EARLIST_SPECIAL_SAVE )
|
||||
return( FALSE );
|
||||
alreadySaving = true;
|
||||
|
||||
//clear out the save game header
|
||||
@@ -2708,14 +2781,24 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
||||
fWePausedIt = TRUE;
|
||||
}
|
||||
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
InitShutDownMapTempFileTest( TRUE, "SaveMapTempFile", ubSaveGameID );
|
||||
#endif
|
||||
|
||||
|
||||
//Place a message on the screen telling the user that we are saving the game
|
||||
iSaveLoadGameMessageBoxID = PrepareMercPopupBox( iSaveLoadGameMessageBoxID, BASIC_MERC_POPUP_BACKGROUND, BASIC_MERC_POPUP_BORDER, zSaveLoadText[ SLG_SAVING_GAME_MESSAGE ], 300, 0, 0, 0, &usActualWidth, &usActualHeight);
|
||||
if ( ubSaveGameID >= SAVE__TIMED_AUTOSAVE_SLOT1 && ubSaveGameID < SAVE__TIMED_AUTOSAVE_SLOT5 + 1 )
|
||||
{
|
||||
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_SAVING_TEXT ],ubSaveGameID );
|
||||
iSaveLoadGameMessageBoxID = PrepareMercPopupBox( iSaveLoadGameMessageBoxID, BASIC_MERC_POPUP_BACKGROUND, BASIC_MERC_POPUP_BORDER, zString, 300, 0, 0, 0, &usActualWidth, &usActualHeight);
|
||||
}
|
||||
else if ( ubSaveGameID == SAVE__END_TURN_NUM ) //SAVE__END_TURN_NUM_1 || ubSaveGameID == SAVE__END_TURN_NUM_2 )
|
||||
{
|
||||
swprintf( zString, L"%s",pMessageStrings[ MSG_SAVE_END_TURN_SAVE_SAVING_TEXT ] );
|
||||
iSaveLoadGameMessageBoxID = PrepareMercPopupBox( iSaveLoadGameMessageBoxID, BASIC_MERC_POPUP_BACKGROUND, BASIC_MERC_POPUP_BORDER, zString, 300, 0, 0, 0, &usActualWidth, &usActualHeight);
|
||||
}
|
||||
else
|
||||
iSaveLoadGameMessageBoxID = PrepareMercPopupBox( iSaveLoadGameMessageBoxID, BASIC_MERC_POPUP_BACKGROUND, BASIC_MERC_POPUP_BORDER, zSaveLoadText[ SLG_SAVING_GAME_MESSAGE ], 300, 0, 0, 0, &usActualWidth, &usActualHeight);
|
||||
|
||||
usPosX = ( SCREEN_WIDTH - usActualWidth ) / 2 ;
|
||||
|
||||
RenderMercPopUpBoxFromIndex( iSaveLoadGameMessageBoxID, usPosX, iScreenHeightOffset + 160, FRAME_BUFFER );
|
||||
@@ -2817,9 +2900,11 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
||||
SaveGameHeader.uiRandom = Random( RAND_MAX );
|
||||
|
||||
// CHRISL: We need to know what inventory system we're using early on
|
||||
SaveGameHeader.ubInventorySystem = gGameOptions.ubInventorySystem;
|
||||
SaveGameHeader.sInitialGameOptions.ubInventorySystem = gGameOptions.ubInventorySystem;
|
||||
|
||||
SaveGameHeader.ubAttachmentSystem = gGameOptions.ubAttachmentSystem;
|
||||
SaveGameHeader.sInitialGameOptions.ubAttachmentSystem = gGameOptions.ubAttachmentSystem;
|
||||
|
||||
SaveGameHeader.sInitialGameOptions.ubSquadSize = gGameOptions.ubSquadSize;
|
||||
|
||||
//
|
||||
// Save the Save Game header file
|
||||
@@ -3541,6 +3626,21 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
||||
goto FAILED_TO_SAVE;
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//save Ja25 info
|
||||
if( !SaveJa25SaveInfoToSaveGame( hFile ) )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"Ja25 Save info Struct");
|
||||
goto FAILED_TO_SAVE;
|
||||
}
|
||||
|
||||
//Save the tactical info
|
||||
if( !SaveJa25TacticalInfoToSaveGame( hFile ) )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"Ja25 Tactical info");
|
||||
goto FAILED_TO_SAVE;
|
||||
}
|
||||
#endif
|
||||
//New profiles by Jazz
|
||||
if( !SaveNewMercsToSaveGameFile( hFile ) )
|
||||
{
|
||||
@@ -3567,19 +3667,89 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing lua global");
|
||||
goto FAILED_TO_SAVE;
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
SaveGameFilePosition( FileGetPos( hFile ), "Lua global" );
|
||||
#endif
|
||||
|
||||
//Close the saved game file
|
||||
//New vehicles by Jazz
|
||||
if( !SaveNewVehiclesToSaveGameFile( hFile ) )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing new vehicles");
|
||||
goto FAILED_TO_SAVE;
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
SaveGameFilePosition( FileGetPos( hFile ), "New Vehicles" );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if( !SaveDataSaveToSaveGameFile( hFile ) )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing save data");
|
||||
goto FAILED_TO_SAVE;
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
SaveGameFilePosition( FileGetPos( hFile ), "Save Data" );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if( !SaveNewEmailDataToSaveGameFile( hFile ) )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing save data");
|
||||
goto FAILED_TO_SAVE;
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
SaveGameFilePosition( FileGetPos( hFile ), "Save New Email Data" );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if( !SaveHiddenTownToSaveGameFile( hFile ) )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing hidden town");
|
||||
goto FAILED_TO_SAVE;
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
SaveGameFilePosition( FileGetPos( hFile ), "Hidden Town" );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if( !SaveEncyclopediaToSaveGameFile( hFile ) )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing Briefing Room & Encyclopedia");
|
||||
goto FAILED_TO_SAVE;
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
SaveGameFilePosition( FileGetPos( hFile ), "Briefing Room & Encyclopedia" );
|
||||
#endif
|
||||
|
||||
}
|
||||
//Close the saved game file
|
||||
FileClose( hFile );
|
||||
|
||||
|
||||
//if we succesfully saved the game, mark this entry as the last saved game file
|
||||
if( ubSaveGameID < EARLIST_SPECIAL_SAVE && ubSaveGameID != SAVE__TIMED_AUTOSAVE )
|
||||
// This defines, which savegame is highlighted in the load screen
|
||||
if (ubSaveGameID == SAVE__END_TURN_NUM)
|
||||
{
|
||||
if (guiLastSaveGameNum == 0)
|
||||
gGameSettings.bLastSavedGameSlot = SAVE__END_TURN_NUM_1;
|
||||
else
|
||||
gGameSettings.bLastSavedGameSlot = SAVE__END_TURN_NUM_2;
|
||||
}
|
||||
else if ( ubSaveGameID >= 0 && (ubSaveGameID != SAVE__ASSERTION_FAILURE || ubSaveGameID != EARLIST_SPECIAL_SAVE))
|
||||
{
|
||||
gGameSettings.bLastSavedGameSlot = ubSaveGameID;
|
||||
}
|
||||
else
|
||||
{
|
||||
// No selection
|
||||
gGameSettings.bLastSavedGameSlot = -1;
|
||||
}
|
||||
|
||||
//Save the save game settings
|
||||
SaveGameSettings();
|
||||
@@ -3594,7 +3764,7 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, pMessageStrings[ MSG_SAVESUCCESS ] );
|
||||
}
|
||||
//#ifdef JA2BETAVERSION
|
||||
else if( ubSaveGameID == SAVE__END_TURN_NUM )
|
||||
else if( ubSaveGameID == SAVE__END_TURN_NUM ) //SAVE__END_TURN_NUM_1 || ubSaveGameID == SAVE__END_TURN_NUM_2 )
|
||||
{
|
||||
// ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, pMessageStrings[ MSG_END_TURN_AUTO_SAVE ] );
|
||||
}
|
||||
@@ -3701,6 +3871,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
//Empty the dialogue Queue cause someone could still have a quote in waiting
|
||||
EmptyDialogueQueue( );
|
||||
|
||||
#ifdef JA2UB
|
||||
//Reset Jerry Quotes JA25UB
|
||||
if ( gGameUBOptions.JerryQuotes == TRUE )
|
||||
HandleJerryMiloQuotes( TRUE );
|
||||
#endif
|
||||
|
||||
//If there is someone talking, stop them
|
||||
StopAnyCurrentlyTalkingSpeech( );
|
||||
|
||||
@@ -3717,7 +3893,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
#endif
|
||||
|
||||
//is it a valid save number
|
||||
if( ubSavedGameID >= NUM_SLOT )
|
||||
if( ubSavedGameID >= SAVE__END_TURN_NUM ) //NUM_SLOT )
|
||||
{
|
||||
if( ubSavedGameID != SAVE__END_TURN_NUM )
|
||||
return( FALSE );
|
||||
@@ -3794,6 +3970,10 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
guiCurrentSaveGameVersion = SaveGameHeader.uiSavedGameVersion;
|
||||
guiBrokenSaveGameVersion = SaveGameHeader.uiSavedGameVersion;
|
||||
|
||||
// WANNE: Store the info
|
||||
lastLoadedSaveGameDay = SaveGameHeader.uiDay;
|
||||
lastLoadedSaveGameHour = SaveGameHeader.ubHour;
|
||||
|
||||
if(guiCurrentSaveGameVersion >= MOVED_GENERAL_INFO)
|
||||
{
|
||||
FileRead(hFile, &gGameOptions, sizeof( GAME_OPTIONS ), &uiNumBytesRead );
|
||||
@@ -3802,10 +3982,10 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
{
|
||||
// CHRISL: We need to know what inventory system we're using early on
|
||||
if(SaveGameHeader.uiSavedGameVersion < NIV_SAVEGAME_DATATYPE_CHANGE)
|
||||
SaveGameHeader.ubInventorySystem = 0;
|
||||
SaveGameHeader.sInitialGameOptions.ubInventorySystem = 0;
|
||||
|
||||
gGameOptions.ubInventorySystem = SaveGameHeader.ubInventorySystem;
|
||||
gGameOptions.ubAttachmentSystem = SaveGameHeader.ubAttachmentSystem;
|
||||
gGameOptions.ubInventorySystem = SaveGameHeader.sInitialGameOptions.ubInventorySystem;
|
||||
gGameOptions.ubAttachmentSystem = SaveGameHeader.sInitialGameOptions.ubAttachmentSystem;
|
||||
}
|
||||
|
||||
if((UsingNewInventorySystem() == true))
|
||||
@@ -3831,6 +4011,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
InitializeInvPanelCoordsOld();
|
||||
}
|
||||
|
||||
if (gGameOptions.ubSquadSize > 6 && iResolution == 0 || gGameOptions.ubSquadSize > 8 && iResolution == 1)
|
||||
{
|
||||
FileClose( hFile );
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
//if the player is loading up an older version of the game, and the person DOESNT have the cheats on,
|
||||
if( guiCurrentSaveGameVersion < 65 && !CHEATER_CHEAT_LEVEL( ) )
|
||||
{
|
||||
@@ -3894,6 +4080,10 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
gfUseAlternateMap = TRUE;
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//Re-init the heli gridnos and time..
|
||||
InitializeHeliGridnoAndTime( TRUE );
|
||||
#endif
|
||||
|
||||
for (int x = 0; x < 256; ++x) {
|
||||
gEnemyPreservedTempFileVersion[x] = guiCurrentSaveGameVersion;
|
||||
@@ -4131,7 +4321,17 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Strategic Information" );
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25 UB
|
||||
// ATE: Validate any new maps...
|
||||
// OK, if we're a camapign, check for new maps
|
||||
//if ( !InDefaultCampaign( ) )
|
||||
//{
|
||||
MakeBadSectorListFromMapsOnHardDrive( TRUE );
|
||||
LetLuaMakeBadSectorListFromMapsOnHardDrive( 0 );
|
||||
|
||||
//}
|
||||
#endif
|
||||
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"UnderGround Information..." );
|
||||
@@ -4212,18 +4412,30 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
|
||||
|
||||
if( !LoadQuestInfoFromSavedGameFile( hFile ) )
|
||||
if( guiCurrentSaveGameVersion < QUESTS_DATATYPE_CHANGE )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadQuestInfoFromSavedGameFile failed" ) );
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
if( !LoadQuestInfoFromSavedGameFile( hFile, MAX_OLD_QUESTS ) )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadQuestInfoFromSavedGameFile failed" ) );
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
}
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Quest Info" );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !LoadQuestInfoFromSavedGameFile( hFile, MAX_QUESTS ) )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadQuestInfoFromSavedGameFile failed" ) );
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
}
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Quest Info" );
|
||||
#endif
|
||||
}
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Quest Info" );
|
||||
#endif
|
||||
|
||||
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"OppList Info..." );
|
||||
@@ -4915,6 +5127,43 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Ja25 Tactical info" );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
if ( !LoadJa25SaveInfoFromSavedGame( hFile ) )
|
||||
{
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Ja25 Tactical info" );
|
||||
#endif
|
||||
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Ja25 Save info Struct" );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
|
||||
if ( !LoadJa25TacticalInfoFromSavedGame( hFile ) )
|
||||
{
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Ja25 Save info Struct" );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load New Mercs Prfiles..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
@@ -4956,15 +5205,15 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Final Checks..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Lua Global System..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
|
||||
|
||||
if( guiCurrentSaveGameVersion >= 114 )
|
||||
{
|
||||
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Lua Global System..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
if( !LoadLuaGlobalFromLoadGameFile( hFile ) )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadLuaGlobalFromLoadGameFile failed" ) );
|
||||
@@ -4972,10 +5221,110 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Lua Global System" );
|
||||
#endif
|
||||
|
||||
if( guiCurrentSaveGameVersion >= VEHICLES_DATATYPE_CHANGE)
|
||||
{
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load New Vehicles..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
if( !LoadNewVehiclesToSaveGameFile( hFile ) )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadNewVehiclesToSaveGameFile failed" ) );
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "New Vehicles" );
|
||||
#endif
|
||||
|
||||
if( guiCurrentSaveGameVersion >= NEW_SAVE_GAME_GENERAL_SAVE_INFO_DATA)
|
||||
{
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load Save Data..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
if( !LoadDataSaveFromLoadGameFile( hFile ) )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadDataSaveFromLoadGameFile failed" ) );
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Load Save Data" );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if( guiCurrentSaveGameVersion >= NEW_EMAIL_SAVE_GAME)
|
||||
{
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load New Email Data..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
if( !LoadNewEmailDataFromLoadGameFile( hFile ) )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadNewEmailDataFromLoadGameFile failed" ) );
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Load New Email Data" );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if( guiCurrentSaveGameVersion >= HIDDENTOWN_DATATYPE_CHANGE)
|
||||
{
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load Hidden Towns..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
if( !LoadHiddenTownFromLoadGameFile( hFile ) )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadHiddenTownFromLoadGameFile failed" ) );
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Load Hidden Towns" );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if( guiCurrentSaveGameVersion > ENCYCLOPEDIA_SAVEGAME_CHANGE)
|
||||
{
|
||||
uiRelEndPerc += 1;
|
||||
SetRelativeStartAndEndPercentage( 0, uiRelStartPerc, uiRelEndPerc, L"Load Briefing Room & Encyclopedia..." );
|
||||
RenderProgressBar( 0, 100 );
|
||||
uiRelStartPerc = uiRelEndPerc;
|
||||
|
||||
if( !LoadEncyclopediaFromLoadGameFile( hFile ) )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("LoadEncyclopediaFromLoadGameFile failed" ) );
|
||||
FileClose( hFile );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
LoadGameFilePosition( FileGetPos( hFile ), "Briefing Room & Load Encyclopedia" );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
//Close the saved game file
|
||||
@@ -5006,8 +5355,12 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
pEmail=pEmail->Next;
|
||||
}
|
||||
}
|
||||
#ifdef JA2UB
|
||||
|
||||
#else
|
||||
if(!fBookMark && !fEmail)
|
||||
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, -1 );
|
||||
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, -1 , TYPE_EMAIL_EMAIL_EDT);
|
||||
#endif
|
||||
}
|
||||
|
||||
// WANNE: I disabled that for now, because I am not sure if this works like intended
|
||||
@@ -5658,6 +6011,11 @@ BOOLEAN LoadSoldierStructure( HWFILE hFile )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//#ifdef JA2UB
|
||||
//if the soldier has the NON weapon version of the merc knofe or merc umbrella
|
||||
//ConvertWeapons( &Menptr[ cnt ] );
|
||||
//#endif
|
||||
|
||||
// JA2Gold: fix next-to-previous attacker value
|
||||
if ( guiCurrentSaveGameVersion < 99 )
|
||||
{
|
||||
@@ -5984,6 +6342,8 @@ BOOLEAN SaveEmailToSavedGame( HWFILE hFile )
|
||||
//loop through all the email to find out the total number
|
||||
while(pEmail)
|
||||
{
|
||||
gEmailT[ uiNumOfEmails ].EmailVersion = 0; //reset
|
||||
gEmailT[ uiNumOfEmails ].EmailVersion = pEmail->EmailVersion;
|
||||
pEmail=pEmail->Next;
|
||||
uiNumOfEmails++;
|
||||
}
|
||||
@@ -6358,12 +6718,15 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
|
||||
if ( guiCurrentSaveGameVersion >= BUGFIX_NPC_DATA_FOR_BIG_MAPS )
|
||||
{
|
||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubLastRequesterSurgeryTargetID, sizeof(gTacticalStatus.ubLastRequesterSurgeryTargetID), sizeof(UINT8), numBytesRead);
|
||||
if ( guiCurrentSaveGameVersion >= IMPROVED_INTERRUPT_SYSTEM )
|
||||
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubInterruptPending, sizeof(gTacticalStatus.ubInterruptPending), sizeof(UINT8), numBytesRead);
|
||||
while( (numBytesRead%4) != 0 ) // This is to make sure the total read is of DWORD length
|
||||
numBytesRead = ReadFieldByField(hFile, &filler, sizeof(filler), sizeof(UINT8), numBytesRead);
|
||||
}
|
||||
else
|
||||
{
|
||||
numBytesRead++;
|
||||
numBytesRead++; //&gTacticalStatus.ubLastRequesterSurgeryTargetID added with BUGFIX_NPC_DATA_FOR_BIG_MAPS
|
||||
numBytesRead++; //&gTacticalStatus.ubInterruptPending added with IMPROVED_INTERRUPT_SYSTEM
|
||||
while( (numBytesRead%4) != 0 ) // This is to make sure the total read is of DWORD length
|
||||
numBytesRead++;
|
||||
}
|
||||
@@ -6764,25 +7127,24 @@ void CreateSavedGameFileNameFromNumber( UINT8 ubSaveGameID, STR pzNewFileName )
|
||||
#endif
|
||||
sprintf( pzNewFileName , "%s\\%S.%S", gSaveDir, pMessageStrings[ MSG_QUICKSAVE_NAME ], pMessageStrings[ MSG_SAVEEXTENSION ] );
|
||||
}
|
||||
//#ifdef JA2BETAVERSION
|
||||
else if( ubSaveGameID == SAVE__END_TURN_NUM )
|
||||
else if( ubSaveGameID>= SAVE__TIMED_AUTOSAVE_SLOT1 && ubSaveGameID < SAVE__TIMED_AUTOSAVE_SLOT5 + 1 )
|
||||
{
|
||||
//The name of the file
|
||||
sprintf( pzNewFileName , "%s\\Auto%02d.%S", gSaveDir, guiLastSaveGameNum, pMessageStrings[ MSG_SAVEEXTENSION ] );
|
||||
|
||||
//increment end turn number
|
||||
guiLastSaveGameNum++;
|
||||
|
||||
//just have 2 saves
|
||||
if( guiLastSaveGameNum == 2 )
|
||||
{
|
||||
guiLastSaveGameNum = 0;
|
||||
}
|
||||
sprintf( pzNewFileName , "%s\\%S%02d.%S", gSaveDir, pMessageStrings[ MSG_SAVE_AUTOSAVE_FILENAME ], ubSaveGameID, pMessageStrings[ MSG_SAVEEXTENSION ] );
|
||||
}
|
||||
else if( ubSaveGameID == SAVE__END_TURN_NUM_1 || ubSaveGameID == SAVE__END_TURN_NUM_2 )
|
||||
{
|
||||
if ( ubSaveGameID == SAVE__END_TURN_NUM_1 )
|
||||
sprintf( pzNewFileName , "%s\\Auto%02d.%S", gSaveDir, 0, pMessageStrings[ MSG_SAVEEXTENSION ] );
|
||||
else if ( ubSaveGameID == SAVE__END_TURN_NUM_2 )
|
||||
sprintf( pzNewFileName , "%s\\Auto%02d.%S", gSaveDir, 1, pMessageStrings[ MSG_SAVEEXTENSION ] );
|
||||
}
|
||||
else if( ubSaveGameID == SAVE__END_TURN_NUM )
|
||||
{
|
||||
//The name of the file
|
||||
sprintf( pzNewFileName , "%s\\Auto%02d.%S", gSaveDir, guiLastSaveGameNum, pMessageStrings[ MSG_SAVEEXTENSION ] );
|
||||
}
|
||||
//#endif
|
||||
|
||||
else
|
||||
sprintf( pzNewFileName , "%s\\%S%02d.%S", gSaveDir, pMessageStrings[ MSG_SAVE_NAME ], ubSaveGameID, pMessageStrings[ MSG_SAVEEXTENSION ] );
|
||||
sprintf( pzNewFileName , "%s\\%S%02d.%S", gSaveDir, pMessageStrings[ MSG_SAVE_NAME ], ubSaveGameID - SAVE__END_TURN_NUM_2, pMessageStrings[ MSG_SAVEEXTENSION ] );
|
||||
}
|
||||
|
||||
|
||||
@@ -7235,6 +7597,12 @@ BOOLEAN SaveGeneralInfo( HWFILE hFile )
|
||||
// HEADROCK HAM 3.6: Save new global variable for militia upkeep
|
||||
sGeneralInfo.uiTotalUpkeepForMilitia = guiTotalUpkeepForMilitia;
|
||||
|
||||
#ifdef JA2UB
|
||||
//ja25 UB
|
||||
sGeneralInfo.fMorrisShouldSayHi = gfMorrisShouldSayHi;
|
||||
sGeneralInfo.fFirstTimeInGameHeliCrash = gfFirstTimeInGameHeliCrash;
|
||||
#endif
|
||||
|
||||
// HEADROCK HAM 4: Save global array for Manual Mobile Militia Restrictions
|
||||
// testing for loop
|
||||
memcpy(sGeneralInfo.ubManualRestrictMilitia, gubManualRestrictMilitia, sizeof( UINT8 )*256);
|
||||
@@ -7244,6 +7612,45 @@ BOOLEAN SaveGeneralInfo( HWFILE hFile )
|
||||
sGeneralInfo.HiddenNames[i] = !zHiddenNames[i].Hidden; //legion2
|
||||
}
|
||||
|
||||
sGeneralInfo.sMercArrivalGridNo = gGameExternalOptions.iInitialMercArrivalLocation;
|
||||
|
||||
#ifdef JA2UB
|
||||
sGeneralInfo.sINITIALHELIGRIDNO[ 0 ] = gGameUBOptions.InitialHeliGridNo[ 0 ];//14947;
|
||||
sGeneralInfo.sINITIALHELIGRIDNO[ 1 ] = gGameUBOptions.InitialHeliGridNo[ 1 ];//15584;//16067;
|
||||
sGeneralInfo.sINITIALHELIGRIDNO[ 2 ] = gGameUBOptions.InitialHeliGridNo[ 2 ];//15754;
|
||||
sGeneralInfo.sINITIALHELIGRIDNO[ 3 ] = gGameUBOptions.InitialHeliGridNo[ 3 ];//16232;
|
||||
sGeneralInfo.sINITIALHELIGRIDNO[ 4 ] = gGameUBOptions.InitialHeliGridNo[ 4 ];//16067;
|
||||
sGeneralInfo.sINITIALHELIGRIDNO[ 5 ] = gGameUBOptions.InitialHeliGridNo[ 5 ];//16230;
|
||||
sGeneralInfo.sINITIALHELIGRIDNO[ 6 ] = gGameUBOptions.InitialHeliGridNo[ 6 ];//15272;
|
||||
|
||||
sGeneralInfo.sLOCATEGRIDNO = gGameUBOptions.LOCATEGRIDNO;
|
||||
sGeneralInfo.sLOCATEGRIDNO2 = gGameUBOptions.LOCATEGRIDNO2;
|
||||
sGeneralInfo.sInGameHeliCrash = gGameUBOptions.InGameHeliCrash;
|
||||
sGeneralInfo.sJerryGridNo = gGameUBOptions.JerryGridNo;
|
||||
sGeneralInfo.sJerryQuotes = gGameUBOptions.JerryQuotes;
|
||||
sGeneralInfo.sInJerry = gGameUBOptions.InJerry;
|
||||
sGeneralInfo.sLaptopQuestEnabled = gGameUBOptions.LaptopQuestEnabled;
|
||||
sGeneralInfo.sTEX_AND_JOHN = gGameUBOptions.fTexAndJohn;
|
||||
sGeneralInfo.sRandom_Manuel_Text = gGameUBOptions.fRandomManuelText;
|
||||
sGeneralInfo.sEVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE_UB = gGameUBOptions.EventAttackInitialSectorIfPlayerStillThere;
|
||||
sGeneralInfo.sHandleAddingEnemiesToTunnelMaps_UB = gGameUBOptions.HandleAddingEnemiesToTunnelMaps;
|
||||
sGeneralInfo.sInGameHeli = gGameUBOptions.InGameHeli;
|
||||
sGeneralInfo.spJA2UB = gGameUBOptions.pJA2UB;
|
||||
|
||||
sGeneralInfo.sfDeadMerc = gGameUBOptions.fDeadMerc;
|
||||
|
||||
sGeneralInfo.subEndDefaultSectorX = gGameUBOptions.ubEndDefaultSectorX;
|
||||
sGeneralInfo.subEndDefaultSectorY = gGameUBOptions.ubEndDefaultSectorY;
|
||||
sGeneralInfo.subEndDefaultSectorZ = gGameUBOptions.ubEndDefaultSectorZ;
|
||||
|
||||
sGeneralInfo.sTestUB = gGameUBOptions.TestUB;
|
||||
|
||||
sGeneralInfo.sLaptopLinkInsurance = gGameUBOptions.LaptopLinkInsurance;
|
||||
sGeneralInfo.sLaptopLinkFuneral = gGameUBOptions.LaptopLinkFuneral;
|
||||
sGeneralInfo.sLaptopLinkBobby = gGameUBOptions.LaptopLinkBobby;
|
||||
|
||||
#endif
|
||||
|
||||
//Setup the
|
||||
//Save the current music mode
|
||||
FileWrite( hFile, &sGeneralInfo, sizeof( GENERAL_SAVE_INFO ), &uiNumBytesWritten );
|
||||
@@ -7404,6 +7811,47 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sSkyriderCostModifier, sizeof(sGeneralInfo.sSkyriderCostModifier), sizeof(INT16), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fOutstandingFacilityDebt, sizeof(sGeneralInfo.fOutstandingFacilityDebt), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.uiTotalUpkeepForMilitia, sizeof(sGeneralInfo.uiTotalUpkeepForMilitia), sizeof(UINT32), numBytesRead);
|
||||
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sMercArrivalGridNo, sizeof(sGeneralInfo.sMercArrivalGridNo), sizeof(UINT32), numBytesRead);
|
||||
#ifdef JA2UB
|
||||
//ja25 UB
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fMorrisShouldSayHi, sizeof(sGeneralInfo.fMorrisShouldSayHi), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.fFirstTimeInGameHeliCrash, sizeof(sGeneralInfo.fFirstTimeInGameHeliCrash), sizeof(BOOLEAN), numBytesRead);
|
||||
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sINITIALHELIGRIDNO, sizeof(sGeneralInfo.sINITIALHELIGRIDNO), sizeof(UINT32), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sLOCATEGRIDNO, sizeof(sGeneralInfo.sLOCATEGRIDNO), sizeof(UINT32), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sLOCATEGRIDNO2, sizeof(sGeneralInfo.sLOCATEGRIDNO2), sizeof(UINT32), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sJerryGridNo, sizeof(sGeneralInfo.sJerryGridNo), sizeof(UINT32), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sJerryQuotes, sizeof(sGeneralInfo.sJerryQuotes), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sInJerry, sizeof(sGeneralInfo.sInJerry), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sInGameHeliCrash, sizeof(sGeneralInfo.sInGameHeliCrash), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sLaptopQuestEnabled, sizeof(sGeneralInfo.sLaptopQuestEnabled), sizeof(BOOLEAN), numBytesRead);
|
||||
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sTEX_AND_JOHN, sizeof(sGeneralInfo.sTEX_AND_JOHN), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sRandom_Manuel_Text, sizeof(sGeneralInfo.sRandom_Manuel_Text), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sEVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE_UB, sizeof(sGeneralInfo.sEVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE_UB), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sHandleAddingEnemiesToTunnelMaps_UB, sizeof(sGeneralInfo.sHandleAddingEnemiesToTunnelMaps_UB), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sInGameHeli, sizeof(sGeneralInfo.sInGameHeli), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.spJA2UB, sizeof(sGeneralInfo.spJA2UB), sizeof(BOOLEAN), numBytesRead);
|
||||
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sfDeadMerc, sizeof(sGeneralInfo.sfDeadMerc), sizeof(BOOLEAN), numBytesRead);
|
||||
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.subEndDefaultSectorX, sizeof(sGeneralInfo.subEndDefaultSectorX), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.subEndDefaultSectorY, sizeof(sGeneralInfo.subEndDefaultSectorY), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.subEndDefaultSectorZ, sizeof(sGeneralInfo.subEndDefaultSectorZ), sizeof(UINT8), numBytesRead);
|
||||
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sTestUB, sizeof(sGeneralInfo.sTestUB), sizeof(BOOLEAN), numBytesRead);
|
||||
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sLaptopLinkInsurance, sizeof(sGeneralInfo.sLaptopLinkInsurance), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sLaptopLinkFuneral, sizeof(sGeneralInfo.sLaptopLinkFuneral), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.sLaptopLinkBobby, sizeof(sGeneralInfo.sLaptopLinkBobby), sizeof(BOOLEAN), numBytesRead);
|
||||
|
||||
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubFiller2, sizeof(sGeneralInfo.ubFiller2), sizeof(BOOLEAN), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubFiller3, sizeof(sGeneralInfo.ubFiller3), sizeof(UINT32), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubFiller4, sizeof(sGeneralInfo.ubFiller4), sizeof(INT8), numBytesRead);
|
||||
|
||||
#endif
|
||||
if ( guiCurrentSaveGameVersion >= NEW_GENERAL_SAVE_INFO_DATA ){
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.ubManualRestrictMilitia, sizeof(sGeneralInfo.ubManualRestrictMilitia), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField(hFile, &sGeneralInfo.HiddenNames, sizeof(sGeneralInfo.HiddenNames), sizeof(BOOLEAN), numBytesRead);
|
||||
@@ -7646,6 +8094,14 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
||||
gsMercArriveSectorX = sGeneralInfo.sMercArriveSectorX;
|
||||
gsMercArriveSectorY = sGeneralInfo.sMercArriveSectorY;
|
||||
|
||||
gGameExternalOptions.ubDefaultArrivalSectorX = (UINT8)gsMercArriveSectorX;
|
||||
gGameExternalOptions.ubDefaultArrivalSectorY = (UINT8)gsMercArriveSectorY;
|
||||
|
||||
#ifdef JA2UB
|
||||
JA2_5_START_SECTOR_X = gGameExternalOptions.ubDefaultArrivalSectorX;
|
||||
JA2_5_START_SECTOR_Y = gGameExternalOptions.ubDefaultArrivalSectorY;
|
||||
#endif
|
||||
|
||||
gfCreatureMeanwhileScenePlayed = sGeneralInfo.fCreatureMeanwhileScenePlayed;
|
||||
|
||||
//load the global player num
|
||||
@@ -7682,6 +8138,12 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
||||
// HEADROCK HAM 3.6: Load new global variable for militia upkeep
|
||||
guiTotalUpkeepForMilitia = sGeneralInfo.uiTotalUpkeepForMilitia;
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25 UB
|
||||
gfMorrisShouldSayHi = sGeneralInfo.fMorrisShouldSayHi;
|
||||
gfFirstTimeInGameHeliCrash = sGeneralInfo.fFirstTimeInGameHeliCrash;
|
||||
#endif
|
||||
|
||||
// HEADROCK HAM 4: Load Manual Mobile Militia Restrictions
|
||||
memcpy(gubManualRestrictMilitia, sGeneralInfo.ubManualRestrictMilitia, sizeof(UINT8) * 256);
|
||||
|
||||
@@ -7690,6 +8152,39 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
||||
zHiddenNames[i].Hidden = !sGeneralInfo.HiddenNames[i];
|
||||
}
|
||||
|
||||
gGameExternalOptions.iInitialMercArrivalLocation = sGeneralInfo.sMercArrivalGridNo;
|
||||
|
||||
#ifdef JA2UB
|
||||
gGameUBOptions.InitialHeliGridNo[ 0 ] = sGeneralInfo.sINITIALHELIGRIDNO[ 0 ];//14947;
|
||||
gGameUBOptions.InitialHeliGridNo[ 1 ] = sGeneralInfo.sINITIALHELIGRIDNO[ 1 ];//15584;//16067;
|
||||
gGameUBOptions.InitialHeliGridNo[ 2 ] = sGeneralInfo.sINITIALHELIGRIDNO[ 2 ];//15754;
|
||||
gGameUBOptions.InitialHeliGridNo[ 3 ] = sGeneralInfo.sINITIALHELIGRIDNO[ 3 ];//16232;
|
||||
gGameUBOptions.InitialHeliGridNo[ 4 ] = sGeneralInfo.sINITIALHELIGRIDNO[ 4 ];//16067;
|
||||
gGameUBOptions.InitialHeliGridNo[ 5 ] = sGeneralInfo.sINITIALHELIGRIDNO[ 5 ];//16230;
|
||||
gGameUBOptions.InitialHeliGridNo[ 6 ] = sGeneralInfo.sINITIALHELIGRIDNO[ 6 ];//15272;
|
||||
|
||||
gGameUBOptions.LOCATEGRIDNO = sGeneralInfo.sLOCATEGRIDNO;
|
||||
gGameUBOptions.LOCATEGRIDNO2 = sGeneralInfo.sLOCATEGRIDNO2;
|
||||
gGameUBOptions.InGameHeliCrash = sGeneralInfo.sInGameHeliCrash;
|
||||
gGameUBOptions.JerryGridNo = sGeneralInfo.sJerryGridNo;
|
||||
gGameUBOptions.JerryQuotes = sGeneralInfo.sJerryQuotes;
|
||||
gGameUBOptions.InJerry = sGeneralInfo.sInJerry;
|
||||
gGameUBOptions.InGameHeli = sGeneralInfo.sInGameHeli;
|
||||
gGameUBOptions.pJA2UB = sGeneralInfo.spJA2UB;
|
||||
|
||||
gGameUBOptions.fDeadMerc = sGeneralInfo.sfDeadMerc;
|
||||
|
||||
gGameUBOptions.ubEndDefaultSectorX = sGeneralInfo.subEndDefaultSectorX;
|
||||
gGameUBOptions.ubEndDefaultSectorY = sGeneralInfo.subEndDefaultSectorY;
|
||||
gGameUBOptions.ubEndDefaultSectorZ = sGeneralInfo.subEndDefaultSectorZ;
|
||||
|
||||
gGameUBOptions.TestUB = sGeneralInfo.sTestUB;
|
||||
|
||||
gGameUBOptions.LaptopLinkInsurance = sGeneralInfo.sLaptopLinkInsurance;
|
||||
gGameUBOptions.LaptopLinkFuneral = sGeneralInfo.sLaptopLinkFuneral;
|
||||
gGameUBOptions.LaptopLinkBobby = sGeneralInfo.sLaptopLinkBobby;
|
||||
#endif
|
||||
|
||||
if ( gGameExternalOptions.fShowCamouflageFaces == TRUE )
|
||||
{
|
||||
|
||||
@@ -8337,3 +8832,30 @@ UINT32 CalcJA2EncryptionSet( SAVED_GAME_HEADER * pSaveGameHeader )
|
||||
|
||||
return( uiEncryptionSet );
|
||||
}
|
||||
|
||||
//inshy: Now we dont need this convertation, all items chenged in the maps
|
||||
/*
|
||||
#ifdef JA2UB
|
||||
void ConvertWeapons( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
INT32 iCnt;
|
||||
|
||||
for( iCnt=0; iCnt< NUM_INV_SLOTS; iCnt++)
|
||||
{
|
||||
|
||||
|
||||
if(UsingNewInventorySystem() == false && gGameOptions.ubAttachmentSystem == ATTACHMENT_OLD )
|
||||
{
|
||||
if( pSoldier->inv[ iCnt ].usItem == 97 || pSoldier->inv[ iCnt ].usItem == 1346 || pSoldier->inv[ iCnt ].usItem == 99
|
||||
|| pSoldier->inv[ iCnt ].usItem == 1347 || pSoldier->inv[ iCnt ].usItem == 584 || pSoldier->inv[ iCnt ].usItem == 551 )
|
||||
pSoldier->inv[ iCnt ].usItem = 129;
|
||||
|
||||
if( pSoldier->inv[ iCnt ].usItem == 117 || pSoldier->inv[ iCnt ].usItem == 349 || pSoldier->inv[ iCnt ].usItem == 1263 )
|
||||
pSoldier->inv[ iCnt ].usItem = 71;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
|
||||
+17
-11
@@ -15,15 +15,25 @@ class SOLDIERTYPE;
|
||||
|
||||
#define GAME_VERSION_LENGTH 16
|
||||
|
||||
#define SAVE__ERROR_NUM 99
|
||||
#define SAVE__END_TURN_NUM 98
|
||||
#define SAVE__ERROR_NUM 249//99
|
||||
|
||||
// WANNE: The end turn have 2 saves (Auto00.sav and Auto01.sav). This 2 save slots should be underneath the 5 auto save slots
|
||||
#define SAVE__END_TURN_NUM 248//98
|
||||
#define SAVE__END_TURN_NUM_1 6//98
|
||||
#define SAVE__END_TURN_NUM_2 7//98
|
||||
|
||||
// WDS - Automatically try to save when an assertion failure occurs
|
||||
#define SAVE__ASSERTION_FAILURE 97
|
||||
|
||||
#define SAVE__TIMED_AUTOSAVE 19 // WANNE: This slot does not show up in the load/save screen because it is > 18
|
||||
// WANNE: This SAVEGAME should not show up in the load screen
|
||||
#define SAVE__ASSERTION_FAILURE 247//97
|
||||
|
||||
#define EARLIST_SPECIAL_SAVE 97
|
||||
#define SAVE__TIMED_AUTOSAVE_SLOT1 1 //19 // WANNE: This slot does not show up in the load/save screen because it is > 18
|
||||
#define SAVE__TIMED_AUTOSAVE_SLOT2 2
|
||||
#define SAVE__TIMED_AUTOSAVE_SLOT3 3
|
||||
#define SAVE__TIMED_AUTOSAVE_SLOT4 4
|
||||
#define SAVE__TIMED_AUTOSAVE_SLOT5 5
|
||||
|
||||
#define EARLIST_SPECIAL_SAVE 247//97
|
||||
|
||||
|
||||
typedef struct
|
||||
@@ -62,11 +72,7 @@ typedef struct
|
||||
|
||||
UINT32 uiRandom;
|
||||
|
||||
UINT8 ubInventorySystem;
|
||||
|
||||
UINT8 ubAttachmentSystem;
|
||||
|
||||
UINT8 ubFiller[108]; // WANNE: Changed from 109 to 108 because of ubNewAttachmentSystem integration
|
||||
UINT8 ubFiller[500]; // WANNE: Decrease this filler by 1, for each new UINT8 variable!
|
||||
|
||||
} SAVED_GAME_HEADER;
|
||||
|
||||
@@ -92,7 +98,7 @@ BOOLEAN DoesUserHaveEnoughHardDriveSpace();
|
||||
void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ );
|
||||
|
||||
|
||||
extern UINT32 guiLastSaveGameNum;
|
||||
extern UINT32 guiLastSaveGameNum; // The end turn auto save number (0 = Auto00.sav, 1 = Auto01.sav)
|
||||
INT8 GetNumberForAutoSave( BOOLEAN fLatestAutoSave );
|
||||
|
||||
#endif
|
||||
|
||||
+852
-685
File diff suppressed because it is too large
Load Diff
+11
-3
@@ -7,7 +7,13 @@
|
||||
#define NUM_SAVE_GAMES_OLD 11
|
||||
#define NUM_SAVE_GAMES_NEW 19
|
||||
|
||||
#define NUM_SAVE_GAMES 19
|
||||
#define NUM_SAVE_GAMES 255//19
|
||||
|
||||
extern BOOLEAN AutoSaveToSlot[5];
|
||||
|
||||
// WANNE: Used For auto save games
|
||||
extern UINT32 lastLoadedSaveGameDay;
|
||||
extern UINT8 lastLoadedSaveGameHour;
|
||||
|
||||
extern UINT16 NUM_SLOT;
|
||||
extern UINT32 SLG_SAVELOCATION_HEIGHT;
|
||||
@@ -23,7 +29,7 @@ extern void LoadSaveGameOldOrNew();
|
||||
extern BOOLEAN gfSaveGame;
|
||||
|
||||
//if there is to be a slot selected when entering this screen
|
||||
extern INT8 gbSetSlotToBeSelected;
|
||||
extern INT32 gbSetSlotToBeSelected;
|
||||
|
||||
extern BOOLEAN gbSaveGameArray[ NUM_SAVE_GAMES ];
|
||||
|
||||
@@ -49,5 +55,7 @@ BOOLEAN IsThereAnySavedGameFiles();
|
||||
|
||||
void DeleteSaveGameNumber( UINT8 ubSaveGameSlotID );
|
||||
|
||||
|
||||
extern BOOLEAN DoAutoSave( int ubSaveGameID, STR16 pGameDesc );
|
||||
extern BOOLEAN SaveDataSaveToSaveGameFile( HWFILE hFile );
|
||||
extern BOOLEAN LoadDataSaveFromLoadGameFile( HWFILE hFile );
|
||||
#endif
|
||||
|
||||
@@ -724,8 +724,7 @@ INT16 GetIndex(CHAR16 siChar)
|
||||
UINT16 ssCount=0;
|
||||
UINT16 usNumberOfSymbols = pFManager->pTranslationTable->usNumberOfSymbols;
|
||||
|
||||
//inshy: We don't need anymore ANSI convertation to UNICODE.
|
||||
//siChar = GetUnicodeChar(siChar);
|
||||
siChar = GetUnicodeChar(siChar);
|
||||
|
||||
// search the Translation Table and return the index for the font
|
||||
pTrav = pFManager->pTranslationTable->DynamicArrayOf16BitValues;
|
||||
@@ -746,8 +745,7 @@ INT16 GetIndex(CHAR16 siChar)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//inshy: We don't need anymore ANSI convertation to UNICODE.
|
||||
/*
|
||||
|
||||
CHAR16 GetUnicodeChar(CHAR16 siChar)
|
||||
{
|
||||
#ifdef GERMAN
|
||||
@@ -920,7 +918,7 @@ CHAR16 GetUnicodeChar(CHAR16 siChar)
|
||||
//case 236: siChar = 236; break; //i'
|
||||
//case 210: siChar = 210; break; //O'
|
||||
//case 242: siChar = 242; break; //o'
|
||||
//inshy: French ligatures
|
||||
//inshy: I've added the character codes for French ligatures to the sources, but I haven't added them in the fonts!
|
||||
//Ligature
|
||||
//case 198: siChar = 198; break; //Æ
|
||||
//case 140: siChar = 338; break; //Œ
|
||||
@@ -932,7 +930,6 @@ CHAR16 GetUnicodeChar(CHAR16 siChar)
|
||||
|
||||
return siChar;
|
||||
}
|
||||
*/
|
||||
|
||||
//*****************************************************************************
|
||||
// SetFont
|
||||
@@ -1972,23 +1969,23 @@ FontTranslationTable *CreateEnglishTransTable( )
|
||||
temp++;
|
||||
|
||||
// POLISH letters in UNICODE
|
||||
*temp = 260; // ¥ (on)
|
||||
*temp = 260; // ¥ (îí)
|
||||
temp++;
|
||||
*temp = 262; // Æ (tse)
|
||||
*temp = 262; // Æ (öå)
|
||||
temp++;
|
||||
*temp = 280; // Ê (en')
|
||||
*temp = 280; // Ê (ýí)
|
||||
temp++;
|
||||
*temp = 321; // £ (el')
|
||||
*temp = 321; // £ (ýëü)
|
||||
temp++;
|
||||
*temp = 323; // Ñ (en)
|
||||
*temp = 323; // Ñ (ýíü)
|
||||
temp++;
|
||||
*temp = 211; // Ó (o kratkoe)
|
||||
*temp = 211; // Ó (î êðàòêîå)
|
||||
temp++;
|
||||
*temp = 346; // Œ (es')
|
||||
*temp = 346; // Œ (ýñü)
|
||||
temp++;
|
||||
*temp = 379; // ¯ (zhet)
|
||||
*temp = 379; // ¯ (æåò)
|
||||
temp++;
|
||||
*temp = 377; // � (zet)
|
||||
*temp = 377; // � (çåò)
|
||||
temp++;
|
||||
*temp = 261; // ¹ (îí)
|
||||
temp++;
|
||||
@@ -2073,15 +2070,16 @@ FontTranslationTable *CreateEnglishTransTable( )
|
||||
*temp = 242; //o'
|
||||
temp++;
|
||||
|
||||
//French ligatures
|
||||
*temp = 198; //Æ
|
||||
temp++;
|
||||
*temp = 338; //Œ
|
||||
temp++;
|
||||
*temp = 230; //æ
|
||||
temp++;
|
||||
*temp = 339; //œ
|
||||
temp++;
|
||||
//inshy: I've added the character codes for French ligatures to the sources, but I haven't added them in the fonts!
|
||||
//Ligature
|
||||
// *temp = 198; //Æ
|
||||
// temp++;
|
||||
// *temp = 338; //Œ
|
||||
// temp++;
|
||||
// *temp = 230; //æ
|
||||
// temp++;
|
||||
// *temp = 339; //œ
|
||||
// temp++;
|
||||
|
||||
|
||||
// Font glyphs for spell targeting icons
|
||||
|
||||
Binary file not shown.
@@ -168,13 +168,12 @@ StackTrace::StackTrace() {
|
||||
// the sum of FramesToSkip and FramesToCapture must be less than 63,
|
||||
// so set it to 62.
|
||||
const int kMaxCallers = 62;
|
||||
|
||||
void* callers[kMaxCallers];
|
||||
// TODO(ajwong): Migrate this to StackWalk64.
|
||||
|
||||
// WANNE: VS 2005 compilation error
|
||||
// WANNE: I disabled the method call "CaptureStackBackTrace()" because it gives a compilation error in VS 2005
|
||||
#if ENABLE_STACK_TRACE
|
||||
void* callers[kMaxCallers];
|
||||
int count = CaptureStackBackTrace(0, kMaxCallers, callers, NULL);
|
||||
|
||||
// WANNE: This also does not work in VS 2005
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "input.h"
|
||||
#include "zmouse.h"
|
||||
#include "GameSettings.h"
|
||||
|
||||
#include <vfs/Aspects/vfs_settings.h>
|
||||
#include <vfs/Core/vfs.h>
|
||||
@@ -796,10 +797,14 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
|
||||
// Snap: Initialize the Data directory catalogue
|
||||
gDefaultDataCat.NewCat(DataDir);
|
||||
|
||||
// Snap: Get the custom Data directory location from ja2.ini (if any)
|
||||
STRING512 ja2INIfile;
|
||||
strcat(ja2INIfile, "..\\");
|
||||
strcat(ja2INIfile, GAME_INI_FILE);
|
||||
|
||||
// Snap: Get the custom Data directory location from GAME_INI_FILE (if any)
|
||||
// and initialize the custom catalogue
|
||||
char customDataPath[MAX_PATH];
|
||||
if ( GetPrivateProfileString( "Ja2 Settings","CUSTOM_DATA_LOCATION", "", customDataPath, MAX_PATH, "..\\Ja2.ini" ) )
|
||||
if ( GetPrivateProfileString( "Ja2 Settings","CUSTOM_DATA_LOCATION", "", customDataPath, MAX_PATH, ja2INIfile ) )
|
||||
{
|
||||
gCustomDataCat.NewCat(std::string(CurrentDir) + '\\' + customDataPath);
|
||||
}
|
||||
@@ -1329,10 +1334,11 @@ void GetRuntimeSettings( )
|
||||
// Get Executable Directory
|
||||
GetExecutableDirectory( INIFile );
|
||||
|
||||
strcat(INIFile, "\\Ja2.ini");
|
||||
strcat(INIFile, "\\");
|
||||
strcat(INIFile, GAME_INI_FILE);
|
||||
#else
|
||||
vfs::PropertyContainer oProps;
|
||||
oProps.initFromIniFile("Ja2.ini");
|
||||
oProps.initFromIniFile(GAME_INI_FILE);
|
||||
#endif
|
||||
iResolution = -1;
|
||||
#ifndef USE_VFS
|
||||
@@ -1384,6 +1390,15 @@ void GetRuntimeSettings( )
|
||||
CIniReader::RegisterFileForMerging(*it);
|
||||
}
|
||||
}
|
||||
|
||||
std::list<vfs::String> merge_list_ub;
|
||||
if(oProps.getStringListProperty(L"Ja2 Settings", L"MERGE_INI_FILES_UB", merge_list_ub, L""))
|
||||
{
|
||||
for(std::list<vfs::String>::iterator it = merge_list_ub.begin(); it != merge_list_ub.end(); ++it)
|
||||
{
|
||||
CIniReader::RegisterFileForMerging(*it);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_VFS
|
||||
|
||||
@@ -67,6 +67,8 @@
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
|
||||
#include "Vehicles.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -75,6 +77,19 @@ class SOLDIERTYPE;
|
||||
// HEADROCK HAM 3.5: Include Facility data
|
||||
#include "Facilities.h"
|
||||
|
||||
#include "Vehicles.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Explosion Control.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "email.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "mercs.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
// various reason an assignment can be aborted before completion
|
||||
enum{
|
||||
NO_MORE_MED_KITS = 40,
|
||||
@@ -520,6 +535,11 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
|
||||
void RepairItemsOnOthers( SOLDIERTYPE *pSoldier, UINT8 *pubRepairPtsLeft );
|
||||
BOOLEAN UnjamGunsOnSoldier( SOLDIERTYPE *pOwnerSoldier, SOLDIERTYPE *pRepairSoldier, UINT8 *pubRepairPtsLeft );
|
||||
|
||||
#ifdef JA2UB
|
||||
void HaveMercSayWhyHeWontLeave( SOLDIERTYPE *pSoldier ); //Ja25 UB
|
||||
BOOLEAN CanMercBeAllowedToLeaveTeam( SOLDIERTYPE *pSoldier ); //JA25 UB
|
||||
#endif
|
||||
|
||||
/* No point in allowing SAM site repair any more. Jan/13/99. ARM
|
||||
BOOLEAN IsTheSAMSiteInSectorRepairable( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
BOOLEAN SoldierInSameSectorAsSAM( SOLDIERTYPE *pSoldier );
|
||||
@@ -2109,7 +2129,8 @@ INT8 CanCharacterSquad( SOLDIERTYPE *pSoldier, INT8 bSquadValue )
|
||||
return( CHARACTER_CANT_JOIN_SQUAD_VEHICLE );
|
||||
}
|
||||
|
||||
if ( NumberOfPeopleInSquad( bSquadValue ) >= NUMBER_OF_SOLDIERS_PER_SQUAD )
|
||||
//SQUAD10 FIX
|
||||
if ( NumberOfPeopleInSquad( bSquadValue ) >= gGameOptions.ubSquadSize )
|
||||
{
|
||||
return( CHARACTER_CANT_JOIN_SQUAD_FULL );
|
||||
}
|
||||
@@ -6050,7 +6071,8 @@ BOOLEAN DisplayRepairMenu( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
if ( IsThisVehicleAccessibleToSoldier( pSoldier, iVehicleIndex ) )
|
||||
{
|
||||
AddMonoString( (UINT32 *)&hStringHandle,pVehicleStrings[ pVehicleList[ iVehicleIndex ].ubVehicleType ] );
|
||||
//AddMonoString( (UINT32 *)&hStringHandle,pVehicleStrings[ pVehicleList[ iVehicleIndex ].ubVehicleType ] );
|
||||
AddMonoString( (UINT32 *)&hStringHandle,gNewVehicle[ pVehicleList[ iVehicleIndex ].ubVehicleType ].NewVehicleStrings );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8072,6 +8094,17 @@ void BeginRemoveMercFromContract( SOLDIERTYPE *pSoldier )
|
||||
// This function will setup the quote, then start dialogue beginning the actual leave sequence
|
||||
if( ( pSoldier->stats.bLife > 0 ) && ( pSoldier->bAssignment != ASSIGNMENT_POW ) )
|
||||
{
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25 UB
|
||||
//if the merc cant leave
|
||||
if( !CanMercBeAllowedToLeaveTeam( pSoldier ) )
|
||||
{
|
||||
HaveMercSayWhyHeWontLeave( pSoldier );
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// WANNE: Nothing to do here, when we want to dismiss the robot
|
||||
BOOLEAN fAmIaRobot = AM_A_ROBOT( pSoldier );
|
||||
if (!fAmIaRobot)
|
||||
@@ -9302,7 +9335,8 @@ void CreateSquadBox( void )
|
||||
for(uiCounter=0; uiCounter <= uiMaxSquad; uiCounter++)
|
||||
{
|
||||
// get info about current squad and put in string
|
||||
swprintf( sString, L"%s ( %d/%d )", pSquadMenuStrings[uiCounter], NumberOfPeopleInSquad( ( INT8 )uiCounter ), NUMBER_OF_SOLDIERS_PER_SQUAD );
|
||||
//SQUAD10 FIX
|
||||
swprintf( sString, L"%s ( %d/%d )", pSquadMenuStrings[uiCounter], NumberOfPeopleInSquad( ( INT8 )uiCounter ), gGameOptions.ubSquadSize );
|
||||
AddMonoString(&hStringHandle, sString );
|
||||
|
||||
// make sure it is unhighlighted
|
||||
@@ -9506,7 +9540,8 @@ BOOLEAN DisplayVehicleMenu( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
if ( IsThisVehicleAccessibleToSoldier( pSoldier, iCounter ) )
|
||||
{
|
||||
AddMonoString((UINT32 *)&hStringHandle, pVehicleStrings[ pVehicleList[ iCounter ].ubVehicleType ]);
|
||||
//AddMonoString((UINT32 *)&hStringHandle, pVehicleStrings[ pVehicleList[ iCounter ].ubVehicleType ]);
|
||||
AddMonoString((UINT32 *)&hStringHandle, gNewVehicle[ pVehicleList[ iCounter ].ubVehicleType ].NewVehicleStrings);
|
||||
fVehiclePresent = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -14430,7 +14465,8 @@ BOOLEAN DisplayFacilityAssignmentMenu( SOLDIERTYPE *pSoldier, UINT8 ubFacilityTy
|
||||
if ( IsThisVehicleAccessibleToSoldier( pSoldier, iCounterB ) )
|
||||
{
|
||||
// Create line that says "Repair X" where X is the vehicle.
|
||||
swprintf( sTempString, gzFacilityAssignmentStrings[ FAC_REPAIR_VEHICLE ], pVehicleStrings[ pVehicleList[ iCounterB ].ubVehicleType ]);
|
||||
// swprintf( sTempString, gzFacilityAssignmentStrings[ FAC_REPAIR_VEHICLE ], pVehicleStrings[ pVehicleList[ iCounterB ].ubVehicleType ]);
|
||||
swprintf( sTempString, gzFacilityAssignmentStrings[ FAC_REPAIR_VEHICLE ], gNewVehicle[ pVehicleList[ iCounterB ].ubVehicleType ].NewVehicleStrings);
|
||||
AddMonoString((UINT32 *)&hStringHandle, sTempString );
|
||||
fFoundVehicle = TRUE;
|
||||
}
|
||||
@@ -16348,3 +16384,36 @@ void RecordNumMilitiaTrainedForMercs( INT16 sX, INT16 sY, INT8 bZ, UINT8 ubMilit
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef JA2UB
|
||||
//Ja25 UB
|
||||
|
||||
BOOLEAN CanMercBeAllowedToLeaveTeam( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
/*
|
||||
//if we are in sector... J14_1 && K14_1
|
||||
if( gWorldSectorX == 14 && gWorldSectorY == MAP_ROW_J && gbWorldSectorZ == 1 ||
|
||||
gWorldSectorX == 14 && gWorldSectorY == MAP_ROW_K && gbWorldSectorZ == 1 )
|
||||
*/
|
||||
//if we are in, or passed the tunnels
|
||||
if( pSoldier->sSectorX >= 14 )
|
||||
{
|
||||
//dont allow anyone to leave
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
void HaveMercSayWhyHeWontLeave( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
//if the merc is qualified
|
||||
if( IsSoldierQualifiedMerc( pSoldier ) )
|
||||
{
|
||||
TacticalCharacterDialogue( pSoldier, QUOTE_ANSWERING_MACHINE_MSG );
|
||||
}
|
||||
else
|
||||
{
|
||||
TacticalCharacterDialogue( pSoldier, QUOTE_REFUSING_ORDER );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1990,7 +1990,11 @@ void RenderAutoResolve()
|
||||
SetFactTrue( FACT_FIRST_BATTLE_WON );
|
||||
}
|
||||
SetTheFirstBattleSector( ( INT16 ) (gpAR->ubSectorX + gpAR->ubSectorY * MAP_WORLD_X ) );
|
||||
#ifdef JA2UB
|
||||
//Ja25: no loyalty
|
||||
#else
|
||||
HandleFirstBattleEndingWhileInTown( gpAR->ubSectorX, gpAR->ubSectorY, 0, TRUE );
|
||||
#endif
|
||||
}
|
||||
|
||||
switch( gpAR->ubBattleStatus )
|
||||
|
||||
@@ -642,11 +642,14 @@ void InitNewCampaign()
|
||||
//InitKnowFacilitiesFlags( );
|
||||
|
||||
BuildUndergroundSectorInfoList();
|
||||
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
#else
|
||||
if (!is_networked)
|
||||
// allow overhead view of omerta A9 on game onset
|
||||
// HEADROCK HAM 3.5: Externalized.
|
||||
SetSectorFlag( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ, SF_ALREADY_VISITED ); //hayden
|
||||
#endif
|
||||
|
||||
//Generates the initial forces in a new campaign. The idea is to randomize numbers and sectors
|
||||
//so that no two games are the same.
|
||||
|
||||
@@ -91,6 +91,10 @@ enum //strategic values for each sector
|
||||
#define SF_SKYRIDER_NOTICED_ENEMIES_HERE 0x00000400
|
||||
#define SF_HAVE_USED_GUIDE_QUOTE 0x00000800
|
||||
|
||||
#ifdef JA2UB
|
||||
#define SF_HAVE_SAID_PLAYER_QUOTE_NEW_SECTOR 0x00001000
|
||||
#endif
|
||||
|
||||
#define SF_SMOKE_EFFECTS_TEMP_FILE_EXISTS 0x00100000 //Temp File starts with sm_
|
||||
#define SF_LIGHTING_EFFECTS_TEMP_FILE_EXISTS 0x00200000 //Temp File starts with l_
|
||||
#define SF_REVEALED_STATUS_TEMP_FILE_EXISTS 0x01000000 //Temp File starts with v_
|
||||
@@ -377,6 +381,16 @@ enum
|
||||
SHELTER,
|
||||
ABANDONED_MINE,
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25: New
|
||||
FINAL_COMPLEX,
|
||||
GUARD_POST_TYPE,
|
||||
CRASH_SITE_TYPE,
|
||||
POWER_PLANT_TYPE,
|
||||
MOUNTAINS_TYPE,
|
||||
UNKNOWN_TYPE,
|
||||
#endif
|
||||
|
||||
NUM_TRAVTERRAIN_TYPES
|
||||
};
|
||||
extern UINT8 gszTerrain[NUM_TRAVTERRAIN_TYPES][15];
|
||||
@@ -451,6 +465,11 @@ typedef struct SECTORINFO
|
||||
UINT8 bFiller3;
|
||||
|
||||
UINT32 uiNumberOfWorldItemsInTempFileThatCanBeSeenByPlayer;
|
||||
#ifdef JA2UB
|
||||
BOOLEAN fValidSector; //ja25 UB
|
||||
BOOLEAN fCustomSector;
|
||||
BOOLEAN fCampaignSector;
|
||||
#endif
|
||||
|
||||
INT8 bPadding[ 41 ];
|
||||
|
||||
@@ -484,6 +503,11 @@ typedef struct UNDERGROUND_SECTORINFO
|
||||
UINT8 ubMusicMode, ubUnsed;
|
||||
|
||||
UINT32 uiNumberOfWorldItemsInTempFileThatCanBeSeenByPlayer;
|
||||
#ifdef JA2UB
|
||||
BOOLEAN fCustomSector;
|
||||
BOOLEAN fCampaignSector;
|
||||
#endif
|
||||
|
||||
INT8 bPadding[36];
|
||||
//no padding left!
|
||||
}UNDERGROUND_SECTORINFO;
|
||||
|
||||
@@ -298,13 +298,16 @@ void InitCreatureQuest()
|
||||
fPlayMeanwhile = TRUE;
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25 No meanwhiles && no creatures
|
||||
#else
|
||||
if( fPlayMeanwhile && !gfCreatureMeanwhileScenePlayed )
|
||||
{
|
||||
//Start the meanwhile scene for the queen ordering the release of the creatures.
|
||||
HandleCreatureRelease();
|
||||
gfCreatureMeanwhileScenePlayed = TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
giHabitatedDistance = 0;
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
@@ -1558,8 +1561,12 @@ BOOLEAN LoadCreatureDirectives( HWFILE hFile, UINT32 uiSavedGameVersion )
|
||||
if( gfClearCreatureQuest && giLairID != -1 )
|
||||
{
|
||||
giLairID = 0;
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
#else
|
||||
gfCreatureMeanwhileScenePlayed = FALSE;
|
||||
uiMeanWhileFlags &= ~(0x00000800);
|
||||
#endif
|
||||
}
|
||||
gfClearCreatureQuest = FALSE;
|
||||
#endif
|
||||
|
||||
@@ -49,6 +49,18 @@
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Explosion Control.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "email.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "mercs.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
extern BOOLEAN gfMercsNeverQuit;
|
||||
#endif
|
||||
@@ -209,11 +221,15 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
||||
// WANNE: This fixes the bug, that Speck did not sent the email on Day 3, when MERC_WEBSITE_ALL_MERCS_AVAILABLE = TRUE!
|
||||
if ( gGameExternalOptions.fMercDayOne == FALSE /* && gGameExternalOptions.fAllMercsAvailable == FALSE */ )
|
||||
{
|
||||
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, -1 );
|
||||
#ifdef JA2UB
|
||||
//No JA25 UB
|
||||
#else
|
||||
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, -1 ,TYPE_EMAIL_EMAIL_EDT );
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case EVENT_DAY2_ADD_EMAIL_FROM_IMP:
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), -1, -1);
|
||||
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
||||
break;
|
||||
//If a merc gets hired and they dont show up immediately, the merc gets added to the queue and shows up
|
||||
// uiTimeTillMercArrives minutes later
|
||||
@@ -344,6 +360,10 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
||||
//case EVENT_BEGIN_AIR_RAID:
|
||||
// BeginAirRaid( );
|
||||
// break;
|
||||
|
||||
#ifdef JA2UB
|
||||
// Ja25 No meanwhiles
|
||||
#else
|
||||
case EVENT_MEANWHILE:
|
||||
if( !DelayEventIfBattleInProgress( pEvent ) )
|
||||
{
|
||||
@@ -351,6 +371,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
||||
InterruptTime();
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case EVENT_BEGIN_CREATURE_QUEST:
|
||||
break;
|
||||
case EVENT_CREATURE_SPREAD:
|
||||
@@ -407,7 +428,11 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
||||
}
|
||||
break;
|
||||
case EVENT_MERC_SITE_BACK_ONLINE:
|
||||
#ifdef JA2UB
|
||||
// no JA25 UB
|
||||
#else
|
||||
GetMercSiteBackOnline();
|
||||
#endif
|
||||
break;
|
||||
case EVENT_INVESTIGATE_SECTOR:
|
||||
InvestigateSector( (UINT8)pEvent->uiParam );
|
||||
@@ -444,6 +469,31 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
||||
case EVENT_POSTAL_SERVICE_SHIPMENT:
|
||||
gPostalService.DeliverShipment(pEvent->uiParam);
|
||||
break;
|
||||
#ifdef JA2UB
|
||||
//Ja25 UB
|
||||
case EVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE:
|
||||
if ( gGameUBOptions.EventAttackInitialSectorIfPlayerStillThere == TRUE )
|
||||
{
|
||||
ShouldEnemiesBeAddedToInitialSector();
|
||||
}
|
||||
break;
|
||||
|
||||
case EVENT_SAY_DELAYED_MERC_QUOTE:
|
||||
DelayedSayingOfMercQuote( pEvent->uiParam );
|
||||
break;
|
||||
|
||||
case EVENT_DELAY_SOMEONE_IN_SECTOR_MSGBOX:
|
||||
SetMsgBoxForPlayerBeNotifiedOfSomeoneElseInSector();
|
||||
break;
|
||||
|
||||
case EVENT_SECTOR_H8_DONT_WAIT_IN_SECTOR:
|
||||
HandleSayingDontStayToLongWarningInSectorH8();
|
||||
break;
|
||||
|
||||
case EVENT_SEND_ENRICO_UNDERSTANDING_EMAIL:
|
||||
HandleEnricosUnderstandingEmail();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CRIPPLED_VERSION
|
||||
case EVENT_CRIPPLED_VERSION_END_GAME_CHECK:
|
||||
|
||||
@@ -85,7 +85,15 @@ enum
|
||||
EVENT_MERC_SITE_NEW_MERC_AVAILABLE,
|
||||
EVENT_POSTAL_SERVICE_SHIPMENT,
|
||||
// EVENT_CHECK_FOR_AIR_RAID,
|
||||
#ifdef JA2UB
|
||||
//Ja25:
|
||||
EVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE,
|
||||
EVENT_SAY_DELAYED_MERC_QUOTE,
|
||||
|
||||
EVENT_DELAY_SOMEONE_IN_SECTOR_MSGBOX,
|
||||
EVENT_SECTOR_H8_DONT_WAIT_IN_SECTOR,
|
||||
EVENT_SEND_ENRICO_UNDERSTANDING_EMAIL,
|
||||
#endif
|
||||
#ifdef CRIPPLED_VERSION
|
||||
EVENT_CRIPPLED_VERSION_END_GAME_CHECK,
|
||||
#endif
|
||||
|
||||
+100
-4
@@ -74,9 +74,16 @@
|
||||
#include "XML.h"
|
||||
#include "mercs.h"
|
||||
#include "aim.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#ifdef JA2UB
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Arms Dealer Init.h"
|
||||
#endif
|
||||
|
||||
#include "LuaInitNPCs.h"
|
||||
#include "Luaglobal.h"
|
||||
#include "SaveLoadScreen.h"
|
||||
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -93,6 +100,14 @@ extern UNDERGROUND_SECTORINFO* FindUnderGroundSector( INT16 sMapX, INT16 sMapY,
|
||||
|
||||
UINT8 gubScreenCount=0;
|
||||
|
||||
#ifdef JA2UB
|
||||
void InitCustomStrategicLayer ( void )
|
||||
{
|
||||
LetLuaGameInit(2); //load custom InitStrategicLayer
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void InitNPCs( void )
|
||||
{
|
||||
|
||||
@@ -422,8 +437,30 @@ void InitStrategicLayer( void )
|
||||
InitSquads();
|
||||
// Init vehicles
|
||||
InitAllVehicles( );
|
||||
// init town loyalty
|
||||
InitTownLoyalty();
|
||||
|
||||
#ifdef JA2UB
|
||||
InitCustomStrategicLayer ( );
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25 UB
|
||||
InitJerryQuotes();
|
||||
if ( gGameUBOptions.JerryQuotes == TRUE )
|
||||
{
|
||||
HandleJerryMiloQuotes( TRUE ); //AA
|
||||
}
|
||||
|
||||
InitJa25StrategicAi( );
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
////if ( gGameUBOptions.InitTownLoyalty_UB == TRUE )
|
||||
InitTownLoyalty(); //Ja25 no loyalty
|
||||
#else
|
||||
// init town loyalty
|
||||
InitTownLoyalty(); //Ja25 no loyalty
|
||||
#endif
|
||||
// init the mine management system
|
||||
InitializeMines();
|
||||
// initialize map screen flags
|
||||
@@ -453,6 +490,9 @@ void InitStrategicLayer( void )
|
||||
// re-set up leave list arrays for dismissed mercs
|
||||
InitLeaveList( );
|
||||
|
||||
#ifdef JA2UB
|
||||
LuaInitStrategicLayer(0); //JA25 UB InitStrategicLayer.lua
|
||||
#endif
|
||||
// reset time compression mode to X0 (this will also pause it)
|
||||
SetGameTimeCompressionLevel( TIME_COMPRESS_X0 );
|
||||
|
||||
@@ -472,6 +512,16 @@ void ShutdownStrategicLayer()
|
||||
DeleteAllStrategicEvents();
|
||||
RemoveAllGroups();
|
||||
TrashUndergroundSectorInfo();
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25 No creatures
|
||||
//Ja25 No strategic ai
|
||||
#else
|
||||
DeleteCreatureDirectives();
|
||||
|
||||
KillStrategicAI();
|
||||
|
||||
#endif
|
||||
DeleteCreatureDirectives();
|
||||
KillStrategicAI();
|
||||
ClearTacticalMessageQueue();
|
||||
@@ -487,8 +537,25 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
//reset autosave
|
||||
AutoSaveToSlot[0] = FALSE;
|
||||
AutoSaveToSlot[1] = FALSE;
|
||||
AutoSaveToSlot[2] = FALSE;
|
||||
AutoSaveToSlot[3] = FALSE;
|
||||
AutoSaveToSlot[4] = FALSE;
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25 no meanwhiles
|
||||
#else
|
||||
// reset meanwhile flags
|
||||
uiMeanWhileFlags = 0;
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
fFirstTimeInMapScreen = TRUE;
|
||||
#endif
|
||||
|
||||
|
||||
// Reset the selected soldier
|
||||
gusSelectedSoldier = NOBODY;
|
||||
@@ -528,7 +595,12 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
{
|
||||
//Init all the arms dealers inventory
|
||||
InitAllArmsDealers();
|
||||
#ifdef JA2UB
|
||||
if ( gGameUBOptions.fBobbyRSite == TRUE )
|
||||
InitBobbyRayInventory(); //Ja25 UB
|
||||
#else
|
||||
InitBobbyRayInventory();
|
||||
#endif
|
||||
}
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"InitNewGame: clearing messages");
|
||||
@@ -625,8 +697,16 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
ResetHeliSeats( );
|
||||
|
||||
#ifdef LUA_GAME_INIT_NEW_GAME
|
||||
LetLuaGameInit(0);
|
||||
|
||||
LetLuaGameInit(0);
|
||||
|
||||
#ifdef JA2UB
|
||||
InitCustomStrategicLayer ( );
|
||||
#endif
|
||||
#else
|
||||
#ifdef JA2UB
|
||||
|
||||
#else
|
||||
INT32 iStartingCash;
|
||||
|
||||
// Setup two new messages!
|
||||
@@ -675,7 +755,7 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
|
||||
// Setup initial money
|
||||
AddTransactionToPlayersBook( ANONYMOUS_DEPOSIT, 0, GetWorldTotalMin(), iStartingCash );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
UINT32 uiDaysTimeMercSiteAvailable = Random( 2 ) + 1;
|
||||
@@ -700,6 +780,22 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
|
||||
gubScreenCount = 1;
|
||||
|
||||
#ifdef JA2UB
|
||||
//ja25 ub
|
||||
//Init the initial hweli crash sequence variable
|
||||
if ( gGameUBOptions.InGameHeli == FALSE )
|
||||
InitializeHeliGridnoAndTime( FALSE );
|
||||
|
||||
//If tex is in the game ( John is NOT in the game )
|
||||
//if( gJa25SaveStruct.fJohnKulbaIsInGame == FALSE )
|
||||
//{
|
||||
//make sure Betty offers his videos for sale
|
||||
//AddTexsVideosToBettysInventory();
|
||||
//}
|
||||
|
||||
InitJerryMiloInfo(); //JA25 UB
|
||||
#endif
|
||||
|
||||
//Set the fact the game is in progress
|
||||
gTacticalStatus.fHasAGameBeenStarted = TRUE;
|
||||
|
||||
|
||||
+106
-6
@@ -26,6 +26,9 @@
|
||||
#include "SaveLoadGame.h"
|
||||
#include "GameSettings.h"
|
||||
#include "connect.h"
|
||||
#include "Options Screen.h"
|
||||
#include "SaveLoadScreen.h"
|
||||
#include "Text.h"
|
||||
// HEADROCK HAM 3.5: Add facility code for hourly update of detection levels
|
||||
#include "Facilities.h"
|
||||
|
||||
@@ -34,7 +37,11 @@ void HourlyLarryUpdate( void );
|
||||
|
||||
extern INT32 GetCurrentBalance( void );
|
||||
extern void PayOffSkyriderDebtIfAny( );
|
||||
#ifdef JA2UB
|
||||
//no UB
|
||||
#else
|
||||
void HourlyCheckIfSlayAloneSoHeCanLeave();
|
||||
#endif
|
||||
|
||||
void UpdateRegenCounters( void );
|
||||
|
||||
@@ -48,6 +55,7 @@ void HandleMinuteUpdate()
|
||||
|
||||
void HandleHourlyUpdate()
|
||||
{
|
||||
CHAR16 zString[128];
|
||||
//if the game hasnt even started yet ( we havent arrived in the sector ) dont process this
|
||||
if ( DidGameJustStart() )
|
||||
return;
|
||||
@@ -87,9 +95,11 @@ void HandleHourlyUpdate()
|
||||
HourlyQuestUpdate();
|
||||
|
||||
HourlyLarryUpdate();
|
||||
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
#else
|
||||
HourlyCheckIfSlayAloneSoHeCanLeave();
|
||||
|
||||
#endif
|
||||
// WDS - New AI
|
||||
HourlyCheckStrategicAI();
|
||||
|
||||
@@ -100,9 +110,96 @@ void HandleHourlyUpdate()
|
||||
UpdateRegenCounters();
|
||||
}
|
||||
|
||||
if ((gGameExternalOptions.autoSaveTime != 0) &&
|
||||
(GetWorldHour() % gGameExternalOptions.autoSaveTime == 0)) {
|
||||
SaveGame( SAVE__TIMED_AUTOSAVE, L"Auto Save" );
|
||||
// WANNE: This check should avoid the resaving of a loaded auto-save game, when entering tactical
|
||||
BOOLEAN doAutoSave = TRUE;
|
||||
if (lastLoadedSaveGameDay == GetWorldDay() && lastLoadedSaveGameHour == GetWorldHour() )
|
||||
{
|
||||
doAutoSave = FALSE;
|
||||
}
|
||||
|
||||
if (doAutoSave)
|
||||
{
|
||||
if ( AutoSaveToSlot[1] == FALSE && AutoSaveToSlot[2] == FALSE && AutoSaveToSlot[3] == FALSE && AutoSaveToSlot[4] == FALSE )
|
||||
AutoSaveToSlot[0] = TRUE;
|
||||
|
||||
if ((gGameExternalOptions.autoSaveTime != 0) && (GetWorldHour() % gGameExternalOptions.autoSaveTime == 0))
|
||||
{
|
||||
if ( AutoSaveToSlot[0] == TRUE )
|
||||
{
|
||||
if( CanGameBeSaved() )
|
||||
{
|
||||
guiPreviousOptionScreen = guiCurrentScreen;
|
||||
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT1);
|
||||
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT1,zString);
|
||||
}
|
||||
|
||||
AutoSaveToSlot[0] = FALSE;
|
||||
AutoSaveToSlot[1] = TRUE;
|
||||
AutoSaveToSlot[2] = FALSE;
|
||||
AutoSaveToSlot[3] = FALSE;
|
||||
AutoSaveToSlot[4] = FALSE;
|
||||
}
|
||||
else if ( AutoSaveToSlot[1] == TRUE )
|
||||
{
|
||||
if( CanGameBeSaved() )
|
||||
{
|
||||
guiPreviousOptionScreen = guiCurrentScreen;
|
||||
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT2);
|
||||
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT2,zString);
|
||||
}
|
||||
|
||||
AutoSaveToSlot[0] = FALSE;
|
||||
AutoSaveToSlot[1] = FALSE;
|
||||
AutoSaveToSlot[2] = TRUE;
|
||||
AutoSaveToSlot[3] = FALSE;
|
||||
AutoSaveToSlot[4] = FALSE;
|
||||
}
|
||||
else if ( AutoSaveToSlot[2] == TRUE )
|
||||
{
|
||||
if( CanGameBeSaved() )
|
||||
{
|
||||
guiPreviousOptionScreen = guiCurrentScreen;
|
||||
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT3);
|
||||
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT3,zString);
|
||||
}
|
||||
|
||||
AutoSaveToSlot[0] = FALSE;
|
||||
AutoSaveToSlot[1] = FALSE;
|
||||
AutoSaveToSlot[2] = FALSE;
|
||||
AutoSaveToSlot[3] = TRUE;
|
||||
AutoSaveToSlot[4] = FALSE;
|
||||
}
|
||||
else if ( AutoSaveToSlot[3] == TRUE )
|
||||
{
|
||||
if( CanGameBeSaved() )
|
||||
{
|
||||
guiPreviousOptionScreen = guiCurrentScreen;
|
||||
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT4);
|
||||
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT4,zString);
|
||||
}
|
||||
AutoSaveToSlot[0] = FALSE;
|
||||
AutoSaveToSlot[1] = FALSE;
|
||||
AutoSaveToSlot[2] = FALSE;
|
||||
AutoSaveToSlot[3] = FALSE;
|
||||
AutoSaveToSlot[4] = TRUE;
|
||||
|
||||
}
|
||||
else if ( AutoSaveToSlot[4] == TRUE )
|
||||
{
|
||||
if( CanGameBeSaved() )
|
||||
{
|
||||
guiPreviousOptionScreen = guiCurrentScreen;
|
||||
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT5);
|
||||
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT5,zString);
|
||||
}
|
||||
AutoSaveToSlot[0] = TRUE;
|
||||
AutoSaveToSlot[1] = FALSE;
|
||||
AutoSaveToSlot[2] = FALSE;
|
||||
AutoSaveToSlot[3] = FALSE;
|
||||
AutoSaveToSlot[4] = FALSE;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +440,9 @@ void HourlyLarryUpdate( void )
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
// no JA25 UB
|
||||
#else
|
||||
void HourlyCheckIfSlayAloneSoHeCanLeave()
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
@@ -369,3 +468,4 @@ void HourlyCheckIfSlayAloneSoHeCanLeave()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,338 @@
|
||||
#ifndef JA25__STRATEGIC_AI
|
||||
#define JA25__STRATEGIC_AI
|
||||
|
||||
#ifdef JA2UB
|
||||
typedef struct
|
||||
{
|
||||
UINT32 uiJerryMiloQuotesFlags; //used to keep track of the quotes Jerry says.
|
||||
BOOLEAN fImportCharactersFromOldJa2Save; // True if we have loaded in merc profiles from JA2
|
||||
|
||||
BOOLEAN fInCustomMap;
|
||||
|
||||
BOOLEAN fJohnKulbaIsInGame; // If true Kulba is in the game, otherwise tex is
|
||||
|
||||
BOOLEAN fMorrisToSayHurtPlayerQuoteNextTurn;
|
||||
UINT8 ubPlayerMorrisHurt;
|
||||
|
||||
BOOLEAN fBiggensUsedDetonator;
|
||||
|
||||
BOOLEAN fSendEmail_10_NextSector; // True if we are to send email #10 next time the player loads up a sector
|
||||
|
||||
UINT8 ubEmailFromSectorFlag;
|
||||
|
||||
BOOLEAN fNpcHasBeenAdded; // True if manuel has been added to sector H10 or i9
|
||||
|
||||
BOOLEAN fShowMercDestinationDialogWhenHiringMerc; //
|
||||
|
||||
BOOLEAN fHaveAimandMercOffferItems; // TRUE when MERC and AIM are giving away 'gifts' to the mercs that get hired
|
||||
|
||||
BOOLEAN fBiffWasKilledWhenImportingSave; //TRUE is biff was killed when we imported the save
|
||||
|
||||
UINT8 ubImportantSpeckQuotesSaidBefore;
|
||||
|
||||
BOOLEAN fShouldMsgBoxComeUpSayingSomeoneImportantIsInSector;
|
||||
|
||||
UINT8 ubStateOfFanInPowerGenSector;
|
||||
|
||||
UINT8 ubHowPlayerGotThroughFan;
|
||||
|
||||
UINT32 uiJa25TacticalFlags;
|
||||
|
||||
INT32 iPowerGenFanPositionSndID;
|
||||
|
||||
UINT32 uiTacticalTurnCounter;
|
||||
|
||||
UINT32 uiTurnPowerGenFanWentDown;
|
||||
|
||||
UINT32 uiJa25GeneralFlags;
|
||||
|
||||
UINT8 ubStatusOfFortifiedDoor;
|
||||
|
||||
UINT32 uiDisplayCoverCounter;
|
||||
UINT32 uiDisplayLosCounter;
|
||||
UINT32 uiDisplayGunRangeCounter;
|
||||
|
||||
UINT8 ubLoadScreenStairTraversal;
|
||||
|
||||
UINT8 ubMorrisNoteState;
|
||||
|
||||
UINT8 ubJohnKulbaInitialSectorX;
|
||||
UINT8 ubJohnKulbaInitialSectorY;
|
||||
|
||||
UINT8 ubDisplayPlayerLostMsgBox;
|
||||
|
||||
BOOLEAN fJerryBreakingLaptopOccuring;
|
||||
|
||||
BOOLEAN fEnemyShouldImmediatelySeekThePlayer;
|
||||
INT8 bSectorTheEnemyWillSeekEnemy;
|
||||
|
||||
INT8 bNewMercProfileIDForSayingMorrisNote;
|
||||
|
||||
UINT8 ubDisplayCommanderMorrisNote;
|
||||
|
||||
UINT16 usFiller1;
|
||||
|
||||
UINT32 uiTurnLastSaidSeeEnemyQuote;
|
||||
|
||||
UINT8 ubFiller[928]; //Struct is originally 1000 bytes in size
|
||||
|
||||
} JA25_SAVE_INFO;
|
||||
|
||||
extern JA25_SAVE_INFO gJa25SaveStruct;
|
||||
|
||||
//following flags use uiEmailFromSectorFlag
|
||||
#define SECTOR_EMAIL__ANOTHER_SECTOR 0x01
|
||||
#define SECTOR_EMAIL__J11_J12 0x02
|
||||
#define SECTOR_EMAIL__POWER_GEN 0x04
|
||||
#define SECTOR_EMAIL__TUNNEL 0x08
|
||||
#define SECTOR_EMAIL__POWER_GEN_LVL_1 0x10
|
||||
|
||||
|
||||
//following flags use fNpcHasBeenAdded
|
||||
#define SECTOR_ADDED_NPC__MANUEL 0x01
|
||||
#define SECTOR_ADDED_NPC__TEX 0x02
|
||||
#define SECTOR_ADDED_NPC__JOHN_K 0x04
|
||||
|
||||
|
||||
//Following flags use ubImportantSpeckQuotesSaidBefore
|
||||
#define SPECK__ENCOURAGE_POAYER_TO_KEEP_SHOPPING 1<<0
|
||||
#define SPECK__SECOND_INTRO_BEEN_SAID 1<<1
|
||||
#define SPECK__BETTER_EQUIPMENT 1<<2
|
||||
|
||||
|
||||
//following flags are used with ubStateOfFanInPowerGenSector
|
||||
enum
|
||||
{
|
||||
PGF__RUNNING_NORMALLY,
|
||||
PGF__STOPPED,
|
||||
PGF__BLOWN_UP,
|
||||
};
|
||||
|
||||
|
||||
//following flags are used with uiJa25TacticalFlags
|
||||
|
||||
|
||||
|
||||
//following flags are used with ubHowPlayerGotThroughFan
|
||||
enum
|
||||
{
|
||||
PG__PLAYER_NOT_GONE_THROUGH_YET,
|
||||
PG__PLAYER_BLEW_UP_FAN_TO_GET_THROUGH,
|
||||
PG__PLAYER_STOPPED_FAN_TO_GET_THROUGH,
|
||||
};
|
||||
|
||||
//The following flags are used with uiJa25GeneralFlags.
|
||||
#define JA_GF__POWER_GEN_FAN_HAS_BEEN_STOPPED 0x00000001
|
||||
#define JA_GF__BIGGENS_SAID_QUOTE_117 0x00000002
|
||||
#define JA_GF__DID_PLAYER_MAKE_SOUND_GOING_THROUGH_TUNNEL_GATE 0x00000004
|
||||
#define JA_GF__PLAYER_HAS_SEEN_FORTIFIED_DOOR 0x00000008
|
||||
|
||||
#define JA_GF__ALL_DEAD_TOP_LEVEL_OF_COMPLEX 0x00000010
|
||||
#define JA_GF__ALREADY_MOVED_ENEMIES_IN_COMPLEX 0x00000020
|
||||
#define JA_GF__PICKED_UP_MONEY_IN_GUARD_POST 0x00000040
|
||||
#define JA_GF__PICKED_UP_MONEY_IN_FIRST_TOWN 0x00000080
|
||||
|
||||
#define JA_GF__PLAYER_SAID_LAPTOP_FIXED_QUOTE 0x00000100
|
||||
#define JA_GF__RAUL_BLOW_HIMSELF_UP 0x00000200
|
||||
#define JA_GF__QUOTE_105_HAS_BEEN_SAID 0x00000400
|
||||
#define JA_GF__BARRETT_IS_HALF_PRICE 0x00000800
|
||||
|
||||
#define JA_GF__MOVE_ENEMIES_TO_EDGE_IN_TUNNEL_1 0x00001000
|
||||
#define JA_GF__MOVE_ENEMIES_TO_EDGE_IN_TUNNEL_2 0x00002000
|
||||
#define JA_GF__PLAYER_SEEN_FAN_BEFORE 0x00004000
|
||||
#define JA_GF__PLAYER_SAID_GATE_LOCKED_QUOTE 0x00008000
|
||||
|
||||
|
||||
//The following is used with ubStatusOfFortifiedDoor
|
||||
enum
|
||||
{
|
||||
FD__CLOSED,
|
||||
FD__OPEN,
|
||||
};
|
||||
|
||||
|
||||
//the following is used with ubLoadScreenStairTraversal
|
||||
enum
|
||||
{
|
||||
LS__NOT_GOING_UP_STAIRS,
|
||||
LS__GOING_UP_STAIRS,
|
||||
LS__GOING_DOWN_STAIRS,
|
||||
};
|
||||
|
||||
|
||||
|
||||
//the following is used with ubMorrisNoteState
|
||||
enum
|
||||
{
|
||||
MN__NOT_PICKED_UP_YET,
|
||||
MN__PICKED_UP_BY_OLD_MERC_NEVER_SAID_QUOTE,
|
||||
MN__PICKED_UP_BY_OLD_MERC_SAID_QUOTE_ALREADY,
|
||||
MN__PICKED_UP_BY_NEW_MERC,
|
||||
MN__FINISHED = MN__PICKED_UP_BY_NEW_MERC,
|
||||
};
|
||||
|
||||
|
||||
//used with ubDisplayCommanderMorrisNote
|
||||
enum
|
||||
{
|
||||
DMN__NOT_TO_DISPLAY_IT,
|
||||
DMN__DISPLAY_PART_1,
|
||||
DMN__DISPLAY_PART_2,
|
||||
DMN__FINISHED,
|
||||
};
|
||||
|
||||
|
||||
BOOLEAN AreAnyPlayerMercsStillInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
|
||||
|
||||
BOOLEAN ShouldEnemiesBeAddedToInitialSector();
|
||||
|
||||
void InitJa25StrategicAi();
|
||||
|
||||
extern void SetNumberJa25EnemiesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites );
|
||||
|
||||
void InitJa25SaveStruct();
|
||||
|
||||
void InitJa25StrategicAiBloodcats( );
|
||||
extern void SetNumberJa25EnemiesInSurfaceSector( INT32 iSectorID, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites );
|
||||
|
||||
BOOLEAN SaveJa25SaveInfoToSaveGame( HWFILE hFile );
|
||||
BOOLEAN LoadJa25SaveInfoFromSavedGame( HWFILE hFile );
|
||||
|
||||
|
||||
void AddEnemiesToJa25TunnelMaps();
|
||||
void HandleAddingEnemiesToTunnelMaps();
|
||||
|
||||
void SetJa25GeneralFlag( UINT32 uiFlagToSet );
|
||||
void ClearJa25GeneralFlag( UINT32 uiFlagToClear );
|
||||
BOOLEAN IsJa25GeneralFlagSet( UINT32 uiFlagToCheck );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT32 uiTimeOfLastBattleInMinutes;
|
||||
UINT32 uiTimeOfLastUpdate;
|
||||
|
||||
INT16 iLastBattleSectorID;
|
||||
INT8 bLastBattleSectorZ;
|
||||
|
||||
INT8 bFiller1;
|
||||
|
||||
UINT32 uiAttackedSameSectorCounter;
|
||||
|
||||
INT8 bFiller[16];
|
||||
|
||||
} JA25_SECTOR_AI_MANAGER;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
INT16 iSectorID;
|
||||
INT8 bSectorZ;
|
||||
|
||||
INT8 bBaseNumEnemies; // The base number of enemies that can present in the sector
|
||||
INT8 bRandomNumEnemies; // The random amount of enemies that can be present
|
||||
|
||||
INT8 bProbabilityOfAttacking; // The probability Increase of attacking every hour of time compressing
|
||||
|
||||
INT8 bMaxProbabilityForAttackingSector; // The max amount of probabilty the enemy will attack enemy
|
||||
|
||||
INT8 bCurrentProbability; // Gets updated every hour when there can be an attack, reset when attack occurs
|
||||
|
||||
BOOLEAN fPlayerControlled; // Set when the player controls the sector
|
||||
|
||||
UINT8 ubMinimumProbabiltyBeforeAttack;
|
||||
|
||||
BOOLEAN fPlayerHasLiberatedSectorBefore; //Set when the player has a victory in the sector, never gets cleared after that
|
||||
|
||||
BOOLEAN fAutoDirection; //Calculate direction enemy are coming in from
|
||||
|
||||
UINT8 ubInsertionDirection; // For custom maps, used to describe which direction enemies are from
|
||||
|
||||
UINT32 sInsertionGridNo; // For custom maps, the insertion gridno
|
||||
|
||||
BOOLEAN fCustomSector; // Ah, a flag so the AI doesn't need to lookup sector info
|
||||
|
||||
UINT8 ubLoadingScreenID; // For a custom map, which loading screen to use
|
||||
|
||||
BOOLEAN fEnemyEnrouteToAttack; // To help things so that the enemy wioll not continually send dudes
|
||||
|
||||
INT8 bFiller[21];
|
||||
|
||||
} JA25_SECTOR_AI;
|
||||
|
||||
#define CUSTOMSECTOR 1020
|
||||
|
||||
extern JA25_SECTOR_AI gJa25AiSectorStruct[CUSTOMSECTOR];
|
||||
|
||||
enum
|
||||
{
|
||||
JA25_H7,
|
||||
JA25_H8,
|
||||
JA25_H9,
|
||||
JA25_I9,
|
||||
JA25_H10,
|
||||
JA25_I10, //5
|
||||
JA25_I11,
|
||||
JA25_J11,
|
||||
JA25_I12,
|
||||
JA25_J12,
|
||||
JA25_I13, //10
|
||||
JA25_J13,
|
||||
JA25_I13_1,
|
||||
JA25_J13_1,
|
||||
JA25_J14_1,
|
||||
JA25_K14_1, //15
|
||||
JA25_K15,
|
||||
JA25_K15_1,
|
||||
JA25_K15_2,
|
||||
JA25_L15_2,
|
||||
JA25_L15_3,
|
||||
|
||||
NUM_CAMPAIGN_JA25_SECTORS
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
extern BOOLEAN gfEnemyShouldImmediatelySeekThePlayer;
|
||||
//extern INT32 giNumJA25Sectors;
|
||||
|
||||
extern void SetNumberJa25EnemiesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites );
|
||||
void SetJa25SectorOwnedStatus( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fPlayerOwned );
|
||||
INT8 GetTheFurthestSectorPlayerOwns();
|
||||
void Ja25_UpdateTimeOfEndOfLastBattle( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
|
||||
BOOLEAN Ja25_AreEnemiesAbleToAttackSector( INT16 iSectorID, INT8 bSectorZ );
|
||||
BOOLEAN InitJa25SectorAi();
|
||||
INT16 GetJA25SectorID( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
|
||||
void JA25_HandleUpdateOfStrategicAi();
|
||||
|
||||
void SetEnemiesToFindThePlayerMercs();
|
||||
|
||||
void HandleSayingDontStayToLongWarningInSectorH8();
|
||||
extern void SetNumberJa25EnemiesInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites );
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
BOOLEAN InitJa25StrategicAiDecisions( BOOLEAN fLoadedGame );
|
||||
#endif
|
||||
|
||||
void HandleEnricosUnderstandingEmail();
|
||||
|
||||
void HandleRemovingEnemySoldierInitLinksIfPlayerEverWonInSector();
|
||||
|
||||
// -1 if enemy isnt supposed to seek player, otherwise SAI sectgor ID get returned
|
||||
INT8 GetSectorEnemyIsToImmediatelySeekEnemyIn();
|
||||
|
||||
void AddJA25AIDataToSector( JA25_SECTOR_AI *pSectorAIInfo );
|
||||
extern void SetNumberOfJa25BloodCatsInSector( INT32 iSectorID, INT8 bNumBloodCats, INT8 bBloodCatPlacements );
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+1259
-27
File diff suppressed because it is too large
Load Diff
@@ -56,8 +56,8 @@ extern BOOLEAN LetLuaInterfaceDialogue( UINT8 ubNPC, UINT8 InitFunction);
|
||||
extern BOOLEAN LuaHandlePlayerTeamMemberDeath(UINT8 ProfileId, UINT8 Init);
|
||||
extern BOOLEAN LuaHandleNPCTeamMemberDeath(UINT8 ProfileId, UINT8 Init);
|
||||
extern BOOLEAN LuaCheckForKingpinsMoneyMissing( BOOLEAN fFirstCheck, UINT8 Init);
|
||||
extern BOOLEAN LuaHandleQuestCodeOnSectorExit( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 Init);
|
||||
extern BOOLEAN LuaHandleQuestCodeOnSectorEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 Init);
|
||||
extern BOOLEAN LuaHandleQuestCodeOnSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 Init);
|
||||
//extern BOOLEAN LuaHandleQuestCodeOnSectorEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 Init);
|
||||
extern BOOLEAN LuaHandleDelayedItemsArrival( UINT32 uiReason, UINT8 Init);
|
||||
extern BOOLEAN LetLuaHandleNPCSystemEvent( UINT32 uiEvent, UINT8 Init);
|
||||
|
||||
@@ -69,6 +69,12 @@ extern void IniLuaGlobal();
|
||||
extern BOOLEAN LoadLuaGlobalFromLoadGameFile( HWFILE hFile );
|
||||
extern BOOLEAN SaveLuaGlobalToSaveGameFile( HWFILE hFile );
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
extern BOOLEAN LuaInitStrategicLayer(UINT8 Init);
|
||||
extern BOOLEAN LetLuaMakeBadSectorListFromMapsOnHardDrive(UINT8 Init);
|
||||
#endif
|
||||
|
||||
//Intro
|
||||
extern BOOLEAN LuaIntro(UINT8 Init, UINT32 uiCurrentVideo, INT8 bIntroType, UINT32 iStringToUse);
|
||||
|
||||
|
||||
+182
-3
@@ -22,6 +22,7 @@
|
||||
#include "Queen Command.h"
|
||||
#include "gamescreen.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "ub_config.h"
|
||||
|
||||
#include "Creature Spreading.h"
|
||||
#include "World Items.h"
|
||||
@@ -34,6 +35,8 @@ extern "C" {
|
||||
#include "lualib.h"
|
||||
}
|
||||
|
||||
#include "Ja25_Tactical.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern BOOLEAN gfDoneWithSplashScreen;
|
||||
@@ -51,6 +54,11 @@ void IniGlobalGameSetting(lua_State *L)
|
||||
lua_pushinteger(L, gGameOptions.ubDifficultyLevel);
|
||||
lua_setglobal(L, "newDIFFICULTY_LEVEL");
|
||||
|
||||
#ifdef JA2UB
|
||||
lua_pushinteger(L, gGameOptions.ubDifficultyLevel);
|
||||
lua_setglobal(L, "difficultyLevel");
|
||||
#endif
|
||||
|
||||
// -------------------------------
|
||||
// ja2_options.ini Settings (use "ini" prefix)
|
||||
// -------------------------------
|
||||
@@ -84,10 +92,74 @@ void IniGlobalGameSetting(lua_State *L)
|
||||
lua_pushinteger(L, gGameExternalOptions.fCanTrueCiviliansBecomeHostile);
|
||||
lua_setglobal(L, "iniCAN_TRUE_CIVILIANS_BECOME_HOSTILE");
|
||||
|
||||
#ifdef JA2UB
|
||||
lua_pushinteger(L, gGameUBOptions.LOCATEGRIDNO);
|
||||
lua_setglobal(L, "iniNEW_MERC_ARRIVAL_LOCATION");
|
||||
#else
|
||||
lua_pushinteger(L, gGameExternalOptions.iInitialMercArrivalLocation);
|
||||
lua_setglobal(L, "iniNEW_MERC_ARRIVAL_LOCATION");
|
||||
#endif
|
||||
|
||||
lua_pushinteger(L, gGameExternalOptions.ubDefaultArrivalSectorY);
|
||||
lua_setglobal(L, "iniDEFAULT_ARRIVAL_SECTOR_Y");
|
||||
|
||||
lua_pushinteger(L, gGameExternalOptions.ubDefaultArrivalSectorX);
|
||||
lua_setglobal(L, "iniDEFAULT_ARRIVAL_SECTOR_X");
|
||||
|
||||
#ifdef JA2UB
|
||||
lua_pushinteger(L, gGameUBOptions.ubEndDefaultSectorX);
|
||||
lua_setglobal(L, "iniDEFAULT_END_SECTOR_X");
|
||||
|
||||
lua_pushinteger(L, gGameUBOptions.ubEndDefaultSectorY);
|
||||
lua_setglobal(L, "iniDEFAULT_END_SECTOR_Y");
|
||||
|
||||
lua_pushinteger(L, gGameUBOptions.ubEndDefaultSectorZ);
|
||||
lua_setglobal(L, "iniDEFAULT_END_SECTOR_Z");
|
||||
|
||||
lua_pushinteger(L, gGameUBOptions.InitialHeliGridNo[ 0 ]);
|
||||
lua_setglobal(L, "iniINITIALHELIGRIDNO1");
|
||||
lua_pushinteger(L, gGameUBOptions.InitialHeliGridNo[ 1 ]);
|
||||
lua_setglobal(L, "iniINITIALHELIGRIDNO2");
|
||||
lua_pushinteger(L, gGameUBOptions.InitialHeliGridNo[ 2 ]);
|
||||
lua_setglobal(L, "iniINITIALHELIGRIDNO3");
|
||||
lua_pushinteger(L, gGameUBOptions.InitialHeliGridNo[ 3 ]);
|
||||
lua_setglobal(L, "iniINITIALHELIGRIDNO4");
|
||||
lua_pushinteger(L, gGameUBOptions.InitialHeliGridNo[ 4 ]);
|
||||
lua_setglobal(L, "iniINITIALHELIGRIDNO5");
|
||||
lua_pushinteger(L, gGameUBOptions.InitialHeliGridNo[ 5 ]);
|
||||
lua_setglobal(L, "iniINITIALHELIGRIDNO6");
|
||||
lua_pushinteger(L, gGameUBOptions.InitialHeliGridNo[ 6 ]);
|
||||
lua_setglobal(L, "iniINITIALHELIGRIDNO7");
|
||||
|
||||
lua_pushinteger(L, gGameUBOptions.JerryGridNo);
|
||||
lua_setglobal(L, "iniJERRYGRIDNO");
|
||||
|
||||
lua_pushboolean(L, gGameUBOptions.LaptopQuestEnabled);
|
||||
lua_setglobal(L, "iniLAPTOP_QUEST");
|
||||
|
||||
lua_pushboolean(L, gGameUBOptions.InJerry);
|
||||
lua_setglobal(L, "iniJERRY");
|
||||
|
||||
lua_pushboolean(L, gGameUBOptions.JerryQuotes);
|
||||
lua_setglobal(L, "iniJERRYQUOTES");
|
||||
|
||||
lua_pushboolean(L, gGameUBOptions.InGameHeliCrash);
|
||||
lua_setglobal(L, "iniINGAMEHELICRASH");
|
||||
|
||||
|
||||
lua_pushboolean(L, gGameUBOptions.InGameHeli);
|
||||
lua_setglobal(L, "iniINGAMEHELI");
|
||||
#endif
|
||||
|
||||
// -------------------------------
|
||||
// Other global variables
|
||||
// -------------------------------
|
||||
|
||||
#ifdef JA2UB
|
||||
lua_pushinteger(L, gGameUBOptions.TestUB);
|
||||
lua_setglobal(L, "TestUB");
|
||||
#endif
|
||||
|
||||
lua_pushinteger(L, gGameExternalOptions.ubDefaultArrivalSectorY);
|
||||
lua_setglobal(L, "ubDefaultArrivalSectorY");
|
||||
|
||||
@@ -166,9 +238,39 @@ void IniGlobalGameSetting(lua_State *L)
|
||||
lua_pushboolean(L, IsMusicPlaying());
|
||||
lua_setglobal(L, "fMusicPlaying");
|
||||
|
||||
// unused
|
||||
//lua_pushboolean(L, gfForceMusicToTense);
|
||||
//lua_setglobal(L, "gfForceMusicToTense");
|
||||
// lua_pushboolean(L, gfForceMusicToTense);
|
||||
// lua_setglobal(L, "gfForceMusicToTense");
|
||||
|
||||
//GameExternalOptions
|
||||
lua_pushboolean(L, gGameExternalOptions.gfInvestigateSector);
|
||||
lua_setglobal(L, "gfInvestigateSector");
|
||||
|
||||
lua_pushboolean(L, gGameExternalOptions.fMercDayOne);
|
||||
lua_setglobal(L, "fMercDayOne");
|
||||
|
||||
lua_pushinteger(L, gGameOptions.ubGameStyle);
|
||||
lua_setglobal(L, "gameStyle");
|
||||
|
||||
lua_pushinteger(L, gGameExternalOptions.fEnableCrepitus);
|
||||
lua_setglobal(L, "enableCrepitus");
|
||||
|
||||
lua_pushinteger(L, gGameOptions.ubDifficultyLevel);
|
||||
lua_setglobal(L, "difficultyLevel");
|
||||
|
||||
lua_pushinteger(L, gGameExternalOptions.iStartingCashNovice);
|
||||
lua_setglobal(L, "startingCashNovice");
|
||||
|
||||
lua_pushinteger(L, gGameExternalOptions.iStartingCashExperienced);
|
||||
lua_setglobal(L, "startingCashExperienced");
|
||||
|
||||
lua_pushinteger(L, gGameExternalOptions.iStartingCashExpert);
|
||||
lua_setglobal(L, "startingCashExpert");
|
||||
|
||||
lua_pushinteger(L, gGameExternalOptions.iStartingCashInsane);
|
||||
lua_setglobal(L, "startingCashInsane");
|
||||
|
||||
lua_pushinteger(L, gGameExternalOptions.fCanTrueCiviliansBecomeHostile);
|
||||
lua_setglobal(L, "fCanTrueCiviliansBecomeHostile");
|
||||
|
||||
// WANNE: Currently not used
|
||||
lua_pushinteger(L, guiNumWorldItems);
|
||||
@@ -197,4 +299,81 @@ void IniGlobalGameSetting(lua_State *L)
|
||||
|
||||
lua_pushinteger(L, gbIntroScreenMode);
|
||||
lua_setglobal(L, "gbIntroScreenMode");
|
||||
|
||||
#ifdef JA2UB
|
||||
lua_pushboolean(L, gGameUBOptions.fTexAndJohn);
|
||||
lua_setglobal(L, "enabledJohnAndTex");
|
||||
|
||||
lua_pushboolean(L, gGameUBOptions.fRandomManuelText);
|
||||
lua_setglobal(L, "RandomManuelText");
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
//Items
|
||||
lua_pushinteger(L, BARRETT_UB);
|
||||
lua_setglobal(L, "itemBARRETT_UB");
|
||||
|
||||
lua_pushinteger(L, CALICO_960_UB);
|
||||
lua_setglobal(L, "itemCALICO_960_UB");
|
||||
|
||||
lua_pushinteger(L, PSG1_UB);
|
||||
lua_setglobal(L, "itemPSG1_UB");
|
||||
|
||||
lua_pushinteger(L, L85_UB);
|
||||
lua_setglobal(L, "itemL85_UB");
|
||||
|
||||
lua_pushinteger(L, TAR21_UB);
|
||||
lua_setglobal(L, "itemTAR21_UB");
|
||||
|
||||
lua_pushinteger(L, VAL_SILENT_UB);
|
||||
lua_setglobal(L, "itemVAL_SILENT_UB");
|
||||
|
||||
lua_pushinteger(L, MICRO_UZI_UB);
|
||||
lua_setglobal(L, "itemMICRO_UZI_UB");
|
||||
|
||||
lua_pushinteger(L, CALICO_950_UB);
|
||||
lua_setglobal(L, "itemCALICO_950_UB");
|
||||
|
||||
lua_pushinteger(L, CALICO_900_UB);
|
||||
lua_setglobal(L, "itemCALICO_900_UB");
|
||||
|
||||
lua_pushinteger(L, CLIP_CANNON_BALL);
|
||||
lua_setglobal(L, "itemCLIP_CANNON_BALL");
|
||||
|
||||
lua_pushinteger(L, MERC_UMBRELLA);
|
||||
lua_setglobal(L, "itemMERC_UMBRELLA");
|
||||
|
||||
lua_pushinteger(L, HAND_CANNON);
|
||||
lua_setglobal(L, "itemHAND_CANNON");
|
||||
|
||||
lua_pushinteger(L, HARTFORD_6_SHOOTER);
|
||||
lua_setglobal(L, "itemHARTFORD_6_SHOOTER");
|
||||
|
||||
lua_pushinteger(L, TEX_MOVIE_ATTACK_CLYDESDALES);
|
||||
lua_setglobal(L, "itemTEX_MOVIE_ATTACK_CLYDESDALES");
|
||||
|
||||
lua_pushinteger(L, TEX_MOVIE_WILD_EAST);
|
||||
lua_setglobal(L, "itemTEX_MOVIE_WILD_EAST");
|
||||
|
||||
lua_pushboolean(L, TEX_MOVIE_HAVE_HONDA);
|
||||
lua_setglobal(L, "itemTEX_MOVIE_HAVE_HONDA");
|
||||
|
||||
lua_pushboolean(L, LAPTOP_TRANSMITTER);
|
||||
lua_setglobal(L, "itemLAPTOP_TRANSMITTER");
|
||||
|
||||
lua_pushboolean(L, CHE_GUEVARA_CANTEEN);
|
||||
lua_setglobal(L, "itemCHE_GUEVARA_CANTEEN");
|
||||
|
||||
lua_pushboolean(L, MERC_WRISTWATCH);
|
||||
lua_setglobal(L, "itemMERC_WRISTWATCH");
|
||||
|
||||
lua_pushboolean(L, SAM_GARVER_COMBAT_KNIFE);
|
||||
lua_setglobal(L, "itemSAM_GARVER_COMBAT_KNIFE");
|
||||
|
||||
lua_pushboolean(L, MERC_UMBRELLA_OLD);
|
||||
lua_setglobal(L, "itemMERC_UMBRELLA_OLD");
|
||||
|
||||
lua_pushboolean(L, MORRIS_INSTRUCTION_NOTE);
|
||||
lua_setglobal(L, "itemMORRIS_INSTRUCTION_NOTE");
|
||||
#endif
|
||||
}
|
||||
+11
-7
@@ -11,13 +11,17 @@ extern "C" {
|
||||
|
||||
// --------------------------
|
||||
// WANNE: Should we enable lua scripting for different actions, or should we use "hardcoded" stuff instead?
|
||||
#define LUA_GAME_INIT_NEW_GAME // GameInit.lua (Function: InitNewGame)
|
||||
#define LUA_GAME_INIT_NPCS // GameInit.lua (Function: InitNPCs)
|
||||
#define LUA_INTRO // Intro.lua
|
||||
#define LUA_HOURLY_QUEST_UPDATE // HourlyUpdate.lua
|
||||
#define LUA_STRATEGY_EVENT_HANDLER // StrategicEventHandler.lua
|
||||
#define LUA_STRATEGY_TOWN_LOYALTY // StrategicTownLoyalty.lua
|
||||
#define LUA_OVERHEAD // Overhead.lua
|
||||
|
||||
#define LUA_INTERFACE_DIALOGUE // InterfaceDialogue.lua
|
||||
#define LUA_EXPLOSION_CONTROL // ExplosionControl.lua
|
||||
#define LUA_HANDLE_QUEST_CODE_ON_SECTOR // Strategicmap.lua
|
||||
#define LUA_GAME_INIT_NEW_GAME // GameInit.lua (Function: InitNewGame)
|
||||
#define LUA_GAME_INIT_NPCS // GameInit.lua (Function: InitNPCs)
|
||||
#define LUA_INTRO // Intro.lua
|
||||
#define LUA_HOURLY_QUEST_UPDATE // HourlyUpdate.lua
|
||||
#define LUA_STRATEGY_EVENT_HANDLER // StrategicEventHandler.lua
|
||||
#define LUA_STRATEGY_TOWN_LOYALTY // StrategicTownLoyalty.lua
|
||||
#define LUA_OVERHEAD // Overhead.lua
|
||||
// --------------------------
|
||||
|
||||
void IniGlobalGameSetting(lua_State *L);
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "Facilities.h"
|
||||
#endif
|
||||
|
||||
#include "Vehicles.h"
|
||||
|
||||
// the amounts of time to wait for hover stuff
|
||||
#define TIME_DELAY_FOR_HOVER_WAIT 10 // minutes
|
||||
@@ -69,7 +70,7 @@ extern PathStPtr pTempHelicopterPath;
|
||||
extern UINT8 ubSAMControlledSectors[ MAP_WORLD_Y ][ MAP_WORLD_X ];
|
||||
|
||||
// the seating capacities
|
||||
extern INT32 iSeatingCapacities[];
|
||||
//extern INT32 iSeatingCapacities[];
|
||||
|
||||
// the static NPC dialogue faces
|
||||
//extern UINT32 uiExternalStaticNPCFaces[];
|
||||
@@ -677,8 +678,13 @@ void LandHelicopter( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef JA2UB
|
||||
Assert( 0 );
|
||||
//No meanwhiles
|
||||
#else
|
||||
// play meanwhile scene if it hasn't been used yet
|
||||
HandleKillChopperMeanwhileScene();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -862,7 +868,7 @@ void SetUpHelicopterForMovement( void )
|
||||
pVehicleList[ iHelicopterVehicleId ].ubMovementGroup = CreateNewVehicleGroupDepartingFromSector( ( UINT8 )( pVehicleList[ iHelicopterVehicleId ].sSectorX ), ( UINT8 )( pVehicleList[ iHelicopterVehicleId ].sSectorY ), iHelicopterVehicleId );
|
||||
|
||||
// add everyone in vehicle to this mvt group
|
||||
for( iCounter = 0; iCounter < iSeatingCapacities[ pVehicleList[ iHelicopterVehicleId ].ubVehicleType ]; iCounter++ )
|
||||
for( iCounter = 0; iCounter < gNewVehicle[ pVehicleList[ iHelicopterVehicleId ].ubVehicleType ].iNewSeatingCapacities; iCounter++ )
|
||||
{
|
||||
if( pVehicleList[ iHelicopterVehicleId ].pPassengers[ iCounter ] != NULL )
|
||||
{
|
||||
@@ -949,14 +955,14 @@ void UpdateRefuelSiteAvailability( void )
|
||||
}
|
||||
|
||||
|
||||
void SetUpHelicopterForPlayer( INT16 sX, INT16 sY , UINT8 SkyDrive )
|
||||
void SetUpHelicopterForPlayer( INT16 sX, INT16 sY , UINT8 SkyDrive, UINT8 VehicleID )
|
||||
{
|
||||
if( fSkyRiderSetUp == FALSE )
|
||||
{
|
||||
fHelicopterAvailable = TRUE;
|
||||
fSkyRiderAvailable = TRUE;
|
||||
|
||||
iHelicopterVehicleId = AddVehicleToList( sX, sY, 0, HELICOPTER );
|
||||
iHelicopterVehicleId = AddVehicleToList( sX, sY, 0, VehicleID ); //HELICOPTER
|
||||
|
||||
Assert( iHelicopterVehicleId != -1 );
|
||||
|
||||
@@ -1001,7 +1007,7 @@ UINT8 MoveAllInHelicopterToFootMovementGroup( void )
|
||||
}
|
||||
|
||||
// go through list of everyone in helicopter
|
||||
for( iCounter = 0; iCounter < iSeatingCapacities[ pVehicleList[ iHelicopterVehicleId ].ubVehicleType ]; iCounter++ )
|
||||
for( iCounter = 0; iCounter < gNewVehicle[ pVehicleList[ iHelicopterVehicleId ].ubVehicleType ].iNewSeatingCapacities; iCounter++ )
|
||||
{
|
||||
// get passenger
|
||||
pSoldier = pVehicleList[ iHelicopterVehicleId ].pPassengers[ iCounter ];
|
||||
|
||||
@@ -191,7 +191,7 @@ BOOLEAN IsRefuelSiteInSector( INT16 sMapX, INT16 sMapY );
|
||||
void UpdateRefuelSiteAvailability( void );
|
||||
|
||||
// setup helicopter for player
|
||||
void SetUpHelicopterForPlayer( INT16 sX, INT16 sY , UINT8 SkyDrive );
|
||||
void SetUpHelicopterForPlayer( INT16 sX, INT16 sY , UINT8 SkyDrive, UINT8 VehicleID );
|
||||
|
||||
// the intended path of the helicopter
|
||||
INT32 DistanceOfIntendedHelicopterPath( void );
|
||||
|
||||
@@ -30,10 +30,11 @@
|
||||
// Also include Quests, for checking whether a fact is true.
|
||||
#include "Quests.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
//#define MAP_BORDER_CORNER_X 584
|
||||
//#define MAP_BORDER_CORNER_Y 279
|
||||
@@ -454,6 +455,65 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
// SetButtonCursor(guiMapBorderLandRaiseButtons[ 0 ], MSYS_NO_CURSOR );
|
||||
// SetButtonCursor(guiMapBorderLandRaiseButtons[ 1 ], MSYS_NO_CURSOR );
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//EnableButton
|
||||
|
||||
if (gGameUBOptions.BorderTown == TRUE)
|
||||
{
|
||||
EnableButton( giMapBorderButtons[ MAP_BORDER_TOWN_BTN ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_TOWN_BTN ]);
|
||||
}
|
||||
|
||||
if (gGameUBOptions.BorderMine == TRUE)
|
||||
{
|
||||
EnableButton( giMapBorderButtons[ MAP_BORDER_MINE_BTN ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_MINE_BTN ]);
|
||||
}
|
||||
|
||||
if (gGameUBOptions.BorderTeams == TRUE)
|
||||
{
|
||||
EnableButton( giMapBorderButtons[ MAP_BORDER_TEAMS_BTN ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_TEAMS_BTN ]);
|
||||
}
|
||||
|
||||
if (gGameUBOptions.BorderMilitia == TRUE)
|
||||
{
|
||||
EnableButton( giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ]);
|
||||
}
|
||||
|
||||
if (gGameUBOptions.BorderAirspace == TRUE)
|
||||
{
|
||||
EnableButton( giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ]);
|
||||
}
|
||||
|
||||
if (gGameUBOptions.BorderItem == TRUE)
|
||||
{
|
||||
EnableButton( giMapBorderButtons[ MAP_BORDER_ITEM_BTN ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_ITEM_BTN ]);
|
||||
}
|
||||
#endif
|
||||
|
||||
InitializeMapBorderButtonStates( );
|
||||
|
||||
return( TRUE );
|
||||
|
||||
@@ -54,6 +54,13 @@
|
||||
#include "game init.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "SaveLoadGame.h"
|
||||
#include "strategicmap.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
/* CHRISL: Adjusted settings to allow new Map_Screen_Bottom_800x600.sti to work. This is needed if we
|
||||
@@ -1329,11 +1336,15 @@ BOOLEAN AllowedToTimeCompress( void )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25 no meanwhiles
|
||||
#else
|
||||
// meanwhile coming up
|
||||
if ( gfMeanwhileTryingToStart )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
#endif
|
||||
|
||||
// someone has something to say
|
||||
if ( !DialogueQueueIsEmpty() )
|
||||
@@ -1419,6 +1430,17 @@ BOOLEAN AllowedToTimeCompress( void )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#ifdef JA2UB
|
||||
//if the player hasnt been to the initial sector yet
|
||||
if( !GetSectorFlagStatus( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, 0, SF_HAS_ENTERED_TACTICAL ) ) //7, 8
|
||||
{
|
||||
//if there is something that jerry wants to say
|
||||
if( !WillJerryMiloAllowThePlayerToCompressTimeAtBeginingOfGame() )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -1734,8 +1756,11 @@ BOOLEAN AnyUsableRealMercenariesOnTeam( void )
|
||||
|
||||
void RequestTriggerExitFromMapscreen( INT8 bExitToWhere )
|
||||
{
|
||||
Assert( ( bExitToWhere >= MAP_EXIT_TO_LAPTOP ) && ( bExitToWhere <= MAP_EXIT_TO_MAINMENU ) );
|
||||
|
||||
#ifdef JA2UB
|
||||
Assert( ( bExitToWhere >= MAP_EXIT_TO_LAPTOP ) && ( bExitToWhere <= MAP_EXIT_TO_INTRO_SCREEN ));//MAP_EXIT_TO_MAINMENU ) );
|
||||
#else
|
||||
Assert( ( bExitToWhere >= MAP_EXIT_TO_LAPTOP ) && ( bExitToWhere <= MAP_EXIT_TO_MAINMENU ));
|
||||
#endif
|
||||
// if allowed to do so
|
||||
if ( AllowedToExitFromMapscreenTo( bExitToWhere ) )
|
||||
{
|
||||
@@ -1777,8 +1802,11 @@ void RequestTriggerExitFromMapscreen( INT8 bExitToWhere )
|
||||
|
||||
BOOLEAN AllowedToExitFromMapscreenTo( INT8 bExitToWhere )
|
||||
{
|
||||
#ifdef JA2UB
|
||||
Assert( ( bExitToWhere >= MAP_EXIT_TO_LAPTOP ) && ( bExitToWhere <= MAP_EXIT_TO_INTRO_SCREEN)); //MAP_EXIT_TO_MAINMENU ) );
|
||||
#else
|
||||
Assert( ( bExitToWhere >= MAP_EXIT_TO_LAPTOP ) && ( bExitToWhere <= MAP_EXIT_TO_MAINMENU ) );
|
||||
|
||||
#endif
|
||||
// if already leaving, disallow any other attempts to exit
|
||||
if ( fLeavingMapScreen )
|
||||
{
|
||||
@@ -1813,11 +1841,15 @@ BOOLEAN AllowedToExitFromMapscreenTo( INT8 bExitToWhere )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25 No meanwhiles
|
||||
#else
|
||||
// meanwhile coming up
|
||||
if ( gfMeanwhileTryingToStart )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
#endif
|
||||
|
||||
// if we're locked into paused time compression by some event that enforces that
|
||||
if ( PauseStateLocked() )
|
||||
@@ -1953,6 +1985,13 @@ void HandleExitsFromMapScreen( void )
|
||||
ReStartingGame();
|
||||
SetPendingNewScreen( MAINMENU_SCREEN );
|
||||
break;
|
||||
#ifdef JA2UB
|
||||
//JA25 ub
|
||||
case MAP_EXIT_TO_INTRO_SCREEN:
|
||||
// SetPendingNewScreen( INTRO_SCREEN );
|
||||
BeginLoadScreen();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
// invalid exit type
|
||||
Assert( FALSE );
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
#else
|
||||
#define MAX_MESSAGES_ON_MAP_BOTTOM 9
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
extern INT8 gbExitingMapScreenToWhere;
|
||||
#endif
|
||||
// exit to where defines
|
||||
enum{
|
||||
MAP_EXIT_TO_LAPTOP = 0,
|
||||
@@ -18,6 +20,9 @@ enum{
|
||||
MAP_EXIT_TO_OPTIONS,
|
||||
MAP_EXIT_TO_LOAD,
|
||||
MAP_EXIT_TO_SAVE,
|
||||
#ifdef JA2UB
|
||||
MAP_EXIT_TO_INTRO_SCREEN,
|
||||
#endif
|
||||
// OJW - 20090210 - clean resources on disconnect
|
||||
MAP_EXIT_TO_MAINMENU
|
||||
};
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "InterfaceItemImages.h"
|
||||
#include "SaveLoadGame.h"//dnl ch51 081009
|
||||
#include "Map Information.h"//dnl ch51 091009
|
||||
#include "Interface Items.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
|
||||
@@ -593,6 +593,71 @@ void AnimateRoute( PathStPtr pPath );
|
||||
extern void EndConfirmMapMoveMode( void );
|
||||
extern BOOLEAN CanDrawSectorCursor( void );
|
||||
|
||||
void DrawIconL(INT32 MAP_GRID_X2, INT32 MAP_GRID_Y2, INT32 i, INT32 Sector_X , INT32 Sector_Y ); //Legion
|
||||
UINT32 guiIcon2[256];
|
||||
ICON_FILE gHiddenIcon[ 256 ];
|
||||
|
||||
#ifdef JA2UB
|
||||
void SetUpValidCampaignSectors( void );
|
||||
#endif
|
||||
|
||||
BOOLEAN LoadHiddenTownFromLoadGameFile( HWFILE hFile );
|
||||
BOOLEAN SaveHiddenTownToSaveGameFile( HWFILE hFile );
|
||||
|
||||
//--------------Legion 2----Jazz-----------
|
||||
|
||||
void DrawIconL(INT32 MAP_GRID_X2, INT32 MAP_GRID_Y2, INT32 i, INT32 Sector_X , INT32 Sector_Y )
|
||||
{
|
||||
UINT8 *pDestBuf2;
|
||||
UINT32 uiDestPitchBYTES;
|
||||
INT16 sX, sY;
|
||||
HVOBJECT hHandle;
|
||||
INT8 ubVidObjIndex = 0;
|
||||
|
||||
if( fZoomFlag )
|
||||
{
|
||||
pDestBuf2 = LockVideoSurface( guiSAVEBUFFER, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, MAP_VIEW_START_X+MAP_GRID_X - 1, MAP_VIEW_START_Y+MAP_GRID_Y - 1, MAP_VIEW_WIDTH+1,MAP_VIEW_HEIGHT-9 );
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
|
||||
GetScreenXYFromMapXYStationary( Sector_X, Sector_Y, &sX, &sY );
|
||||
sX += -MAP_GRID_X + MAP_GRID_X2;
|
||||
sY += -MAP_GRID_Y - MAP_GRID_Y2;
|
||||
ubVidObjIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetScreenXYFromMapXY( Sector_X, Sector_Y, &sX, &sY );
|
||||
|
||||
sX = (UINT16) (MAP_VIEW_START_X + MAP_GRID_X + (MAP_GRID_X2 * MAP_GRID_X) / 10);
|
||||
sY = (UINT16) (MAP_VIEW_START_Y + MAP_GRID_Y + ((MAP_GRID_Y2 * MAP_GRID_Y) / 10) + 1);
|
||||
|
||||
/*
|
||||
if (iResolution == 0)
|
||||
{
|
||||
sY += MAP_GRID_Y2;
|
||||
sX += MAP_GRID_X2;
|
||||
}
|
||||
else if (iResolution == 1)
|
||||
{
|
||||
sY += + 5 + MAP_GRID_Y2;
|
||||
sX += - MAP_GRID_X2 + 3;
|
||||
}
|
||||
else if (iResolution == 2)
|
||||
{
|
||||
sY += + 10 + MAP_GRID_Y2;
|
||||
sX += - MAP_GRID_X2 + 10;
|
||||
}
|
||||
*/
|
||||
ubVidObjIndex = 1;
|
||||
}
|
||||
|
||||
// draw Tixa in its sector
|
||||
GetVideoObject( &hHandle, guiIcon2[i]);
|
||||
BltVideoObject( guiSAVEBUFFER, hHandle, ubVidObjIndex, sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
|
||||
// This method outputs the numbers (1-16) and letters (A - P)
|
||||
void DrawMapIndexBigMap( BOOLEAN fSelectedCursorIsYellow )
|
||||
@@ -724,6 +789,9 @@ UINT32 DrawMap( void )
|
||||
SGPRect clip;
|
||||
INT16 cnt, cnt2;
|
||||
INT32 iCounter = 0;
|
||||
INT32 iCounter2 = 0;
|
||||
INT16 pSectorX = 0, pSectorY = 0;
|
||||
INT16 sBaseSectorValue = 0;
|
||||
|
||||
//MAP_VIEW_START_X = (SCREEN_WIDTH - 370);
|
||||
//MAP_VIEW_START_Y = 10;
|
||||
@@ -933,6 +1001,26 @@ UINT32 DrawMap( void )
|
||||
// DOESN'T MERELY SHADE THE EXISTING MAP SURFACE, BUT INSTEAD GRABS THE ORIGINAL GRAPHICS FROM BIGMAP, AND CHANGES
|
||||
// THEIR PALETTE. BLITTING ICONS PRIOR TO SHADING WOULD MEAN THEY DON'T SHOW UP IN AIRSPACE VIEW AT ALL.
|
||||
|
||||
for (cnt = 1; cnt < NUM_TOWNS; cnt++)
|
||||
{
|
||||
if ( gfHiddenTown[ cnt ] == TRUE )
|
||||
{
|
||||
if ( gfIconTown[ cnt ] == TRUE && gfDrawHiddenTown[ cnt ] == TRUE )
|
||||
{
|
||||
sBaseSectorValue = sBaseSectorList[ cnt-1 ];
|
||||
pSectorX = SECTORX( sBaseSectorValue );
|
||||
pSectorY = SECTORY( sBaseSectorValue );
|
||||
|
||||
INT8 bTownId = GetTownIdForSector( pSectorX, pSectorY );
|
||||
if ( /*bTownId != 0 &&*/ bTownId < NUM_TOWNS )
|
||||
{
|
||||
DrawIconL(gHiddenIcon[cnt].IconX, gHiddenIcon[cnt].IconY, cnt, pSectorX, pSectorY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// if Orta found
|
||||
if( fFoundOrta )
|
||||
{
|
||||
@@ -944,6 +1032,7 @@ UINT32 DrawMap( void )
|
||||
{
|
||||
DrawTixa();
|
||||
}
|
||||
*/
|
||||
|
||||
// draw SAM sites
|
||||
ShowSAMSitesOnStrategicMap( );
|
||||
@@ -1081,7 +1170,8 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen1");
|
||||
for( bTown = FIRST_TOWN; bTown < NUM_TOWNS; bTown++)
|
||||
{
|
||||
// skip Orta/Tixa until found
|
||||
if( ( ( fFoundOrta != FALSE ) || ( bTown != ORTA ) ) && ( ( bTown != TIXA ) || ( fFoundTixa != FALSE) ) )
|
||||
//if( ( ( fFoundOrta != FALSE ) || ( bTown != ORTA ) ) && ( ( bTown != TIXA ) || ( fFoundTixa != FALSE) ) )
|
||||
if( gfHiddenTown[ bTown ] == TRUE )
|
||||
{
|
||||
swprintf( sString, L"%s", pTownNames[ bTown ] );
|
||||
|
||||
@@ -4212,6 +4302,18 @@ void DisplayThePotentialPathForHelicopter(INT16 sMapX, INT16 sMapY )
|
||||
|
||||
BOOLEAN IsTheCursorAllowedToHighLightThisSector( INT16 sSectorX, INT16 sSectorY )
|
||||
{
|
||||
//Ja25UB
|
||||
// check to see if this sector is a blocked out sector?
|
||||
/* if ( !SectorInfo[ ( SECTOR( sSectorX, sSectorY ) ) ].fValidSector )
|
||||
{
|
||||
return ( FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
// return cursor is allowed to highlight this sector
|
||||
return ( TRUE );
|
||||
}
|
||||
*/
|
||||
// check to see if this sector is a blocked out sector?
|
||||
|
||||
if( sBadSectorsList[ sSectorX ][ sSectorY ] )
|
||||
@@ -4793,7 +4895,7 @@ void DisplayPositionOfHelicopter( void )
|
||||
RemoveVehicleFromList (iHelicopterVehicleId);
|
||||
InitAVehicle (iHelicopterVehicleId, 13, MAP_ROW_B);
|
||||
fSkyRiderSetUp = FALSE;
|
||||
SetUpHelicopterForPlayer( 13, MAP_ROW_B , SKYRIDER );
|
||||
SetUpHelicopterForPlayer( 13, MAP_ROW_B, gNewVehicle[ HELICOPTER ].NewPilot, HELICOPTER );
|
||||
pGroup = GetGroup( pVehicleList[ iHelicopterVehicleId ].ubMovementGroup );
|
||||
if (!pGroup) {
|
||||
static bool heliMsg2Given = false;
|
||||
@@ -5186,7 +5288,8 @@ void BlitTownGridMarkers( void )
|
||||
while( pTownNamesList[ iCounter ] != 0 )
|
||||
{
|
||||
// skip Orta/Tixa until found
|
||||
if( ( ( fFoundOrta != FALSE ) || ( pTownNamesList[ iCounter ] != ORTA ) ) && ( ( pTownNamesList[ iCounter ] != TIXA ) || ( fFoundTixa != FALSE) ) )
|
||||
//if( ( ( fFoundOrta != FALSE ) || ( pTownNamesList[ iCounter ] != ORTA ) ) && ( ( pTownNamesList[ iCounter ] != TIXA ) || ( fFoundTixa != FALSE) ) )
|
||||
if( gfHiddenTown[ pTownNamesList[ iCounter ] ] == TRUE )
|
||||
{
|
||||
if( fZoomFlag )
|
||||
{
|
||||
@@ -7548,10 +7651,18 @@ void HideExistenceOfUndergroundMapSector( UINT8 ubSectorX, UINT8 ubSectorY )
|
||||
void InitMapSecrets( void )
|
||||
{
|
||||
//UINT8 ubSamIndex;
|
||||
INT32 iCounter2 = 0;
|
||||
|
||||
fFoundTixa = FALSE;
|
||||
fFoundOrta = FALSE;
|
||||
|
||||
for( iCounter2 = 1; iCounter2 < NUM_TOWNS; iCounter2++ )
|
||||
{
|
||||
gfHiddenTown [ iCounter2 ] = gfHiddenTownTemp [ iCounter2 ];
|
||||
gfDrawHiddenTown[ iCounter2 ] = FALSE;
|
||||
gfIconTown [ iCounter2 ] = gfIconTownTemp [ iCounter2 ];
|
||||
}
|
||||
|
||||
//for( ubSamIndex = 0; ubSamIndex < NUMBER_OF_SAMS; ubSamIndex++ )
|
||||
//{
|
||||
// fSamSiteFound[ ubSamIndex ] = fSamSiteFoundOrig[ ubSamIndex ];
|
||||
@@ -7655,3 +7766,152 @@ void MilitiaDisbandYesNoBoxCallback( UINT8 bExitValue )
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
void SetUpValidCampaignSectors( void )
|
||||
{
|
||||
/*
|
||||
INT32 iRow, iCol;
|
||||
|
||||
for( iRow=1; iRow<=16; iRow++ )
|
||||
{
|
||||
for( iCol=1; iCol<=16; iCol++ )
|
||||
{
|
||||
SectorInfo[ ( SECTOR( iCol , iRow ) ) ].fValidSector = FALSE;
|
||||
sBadSectorsList[iCol][iRow] = 1;
|
||||
// SectorInfo[ ( SECTOR( iCol , iRow ) ) ].fCampaignSector = FALSE;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#ifdef JA2UB_PRESS_PREVIEW
|
||||
|
||||
INT32 iRow, iCol;
|
||||
|
||||
for( iRow=1; iRow<=16; iRow++ )
|
||||
{
|
||||
for( iCol=1; iCol<=16; iCol++ )
|
||||
{
|
||||
SectorInfo[ ( SECTOR( iCol , iRow ) ) ].fValidSector = FALSE;
|
||||
SectorInfo[ ( SECTOR( iCol , iRow ) ) ].fCampaignSector = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
SectorInfo[ ( SECTOR( 7 , 8 ) ) ].fValidSector = TRUE; //H7
|
||||
SectorInfo[ ( SECTOR( 7 , 8 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 8 , 8 ) ) ].fValidSector = TRUE; //H8
|
||||
SectorInfo[ ( SECTOR( 8 , 8 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 9 , 8 ) ) ].fValidSector = TRUE; //H9
|
||||
SectorInfo[ ( SECTOR( 9 , 8 ) ) ].fCampaignSector = TRUE; //H9
|
||||
|
||||
SectorInfo[ ( SECTOR( 10 , 8 ) ) ].fValidSector = TRUE; //H10
|
||||
SectorInfo[ ( SECTOR( 10 , 8 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
#ifndef JA2UB_PRESS_PREVIEW
|
||||
|
||||
SectorInfo[ ( SECTOR( 11, 8 ) ) ].fValidSector = TRUE; //H11
|
||||
SectorInfo[ ( SECTOR( 11, 8 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
#endif
|
||||
|
||||
SectorInfo[ ( SECTOR( 9 , 9 ) ) ].fValidSector = TRUE; //I9
|
||||
SectorInfo[ ( SECTOR( 9 , 9 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 10 , 9 ) ) ].fValidSector = TRUE; //I10
|
||||
SectorInfo[ ( SECTOR( 10 , 9 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
#ifndef JA2UB_PRESS_PREVIEW
|
||||
|
||||
SectorInfo[ ( SECTOR( 11 , 9 ) ) ].fValidSector = TRUE; //I11
|
||||
SectorInfo[ ( SECTOR( 11 , 9 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 12 , 9 ) ) ].fValidSector = TRUE; //I12
|
||||
SectorInfo[ ( SECTOR( 12 , 9 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 13 , 9 ) ) ].fValidSector = TRUE; //I13
|
||||
SectorInfo[ ( SECTOR( 13 , 9 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 11 , 10 ) ) ].fValidSector = TRUE; //J11
|
||||
SectorInfo[ ( SECTOR( 11 , 10 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 12 , 10 ) ) ].fValidSector = TRUE; //J12
|
||||
SectorInfo[ ( SECTOR( 12 , 10 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 13 , 10 ) ) ].fValidSector = TRUE; //J13
|
||||
SectorInfo[ ( SECTOR( 13 , 10 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 14 , 10 ) ) ].fValidSector = TRUE; //J14
|
||||
SectorInfo[ ( SECTOR( 14 , 10 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 14 , 11 ) ) ].fValidSector = TRUE; //K14
|
||||
SectorInfo[ ( SECTOR( 14 , 11 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 15 , 11 ) ) ].fValidSector = TRUE; //K15
|
||||
SectorInfo[ ( SECTOR( 15 , 11 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 16 , 11 ) ) ].fValidSector = TRUE; //K16
|
||||
SectorInfo[ ( SECTOR( 16 , 11 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
SectorInfo[ ( SECTOR( 15 , 12 ) ) ].fValidSector = TRUE; //L15
|
||||
SectorInfo[ ( SECTOR( 15 , 12 ) ) ].fCampaignSector = TRUE;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOLEAN SaveHiddenTownToSaveGameFile( HWFILE hFile )
|
||||
{
|
||||
UINT32 uiNumBytesWritten;
|
||||
|
||||
FileWrite( hFile, &gfHiddenTown, sizeof( gfHiddenTown), &uiNumBytesWritten );
|
||||
if( uiNumBytesWritten != sizeof( gfHiddenTown ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
FileWrite( hFile, &gfDrawHiddenTown, sizeof( gfDrawHiddenTown), &uiNumBytesWritten );
|
||||
if( uiNumBytesWritten != sizeof( gfDrawHiddenTown ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
FileWrite( hFile, &gfIconTown, sizeof( gfIconTown), &uiNumBytesWritten );
|
||||
if( uiNumBytesWritten != sizeof( gfIconTown ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN LoadHiddenTownFromLoadGameFile( HWFILE hFile )
|
||||
{
|
||||
UINT32 uiNumBytesRead;
|
||||
|
||||
FileRead( hFile, &gfHiddenTown, sizeof( gfHiddenTown), &uiNumBytesRead );
|
||||
if( uiNumBytesRead != sizeof( gfHiddenTown ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
FileRead( hFile, &gfDrawHiddenTown, sizeof( gfDrawHiddenTown), &uiNumBytesRead );
|
||||
if( uiNumBytesRead != sizeof( gfDrawHiddenTown ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
FileRead( hFile, &gfIconTown, sizeof( gfIconTown), &uiNumBytesRead );
|
||||
if( uiNumBytesRead != sizeof( gfIconTown ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -11,6 +11,22 @@ void DrawMapIndexBigMap( BOOLEAN fSelectedCursorIsYellow );
|
||||
|
||||
UINT32 DrawMap( void );
|
||||
|
||||
#define MAX_ICON_CHARS 500
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CHAR8 IconSti[MAX_ICON_CHARS];
|
||||
INT32 IconX;
|
||||
INT32 IconY;
|
||||
} ICON_FILE;
|
||||
|
||||
extern ICON_FILE gHiddenIcon[ 256 ];
|
||||
|
||||
extern UINT32 guiIcon2[256];
|
||||
|
||||
extern BOOLEAN LoadHiddenTownFromLoadGameFile( HWFILE hFile );
|
||||
extern BOOLEAN SaveHiddenTownToSaveGameFile( HWFILE hFile );
|
||||
|
||||
void GetScreenXYFromMapXY( INT16 sMapX, INT16 sMapY, INT16 *psX, INT16 *psY );
|
||||
void GetScreenXYFromMapXYStationary( INT16 sMapX, INT16 sMapY, INT16 *psX, INT16 *psY );
|
||||
|
||||
@@ -307,4 +323,8 @@ extern UINT32 guiSubLevel1, guiSubLevel2, guiSubLevel3;
|
||||
extern INT16 sBaseSectorList[ MAX_TOWNS - 1 ];
|
||||
extern POINT pTownPoints[ MAX_TOWNS ];
|
||||
|
||||
#ifdef JA2UB
|
||||
extern void SetUpValidCampaignSectors( void );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -303,13 +303,15 @@ void AddTextToTownBox( void )
|
||||
AddMonoString( &hStringHandle, pLandTypeStrings[ CAMBRIA_HOSPITAL_SITE ] );
|
||||
break;
|
||||
case SEC_J9: //Tixa
|
||||
if( !fFoundTixa )
|
||||
//if( !fFoundTixa )
|
||||
if( gfHiddenTown[ TIXA ] == FALSE )
|
||||
AddMonoString( &hStringHandle, pLandTypeStrings[ SAND ] );
|
||||
else
|
||||
AddMonoString( &hStringHandle, pTownNames[ TIXA ] );
|
||||
break;
|
||||
case SEC_K4: //Orta
|
||||
if( !fFoundOrta )
|
||||
//if( !fFoundOrta )
|
||||
if( gfHiddenTown[ ORTA ] == FALSE )
|
||||
AddMonoString( &hStringHandle, pLandTypeStrings[ SWAMP ] );
|
||||
else
|
||||
AddMonoString( &hStringHandle, pTownNames[ ORTA ] );
|
||||
|
||||
@@ -3932,11 +3932,13 @@ void AddStringsToMoveBox( void )
|
||||
// add this vehicle
|
||||
if( fVehicleIsMoving[ iCount ] )
|
||||
{
|
||||
swprintf( sString, L"*%s*", pVehicleStrings[ pVehicleList[ iVehicleMovingList[ iCount ] ].ubVehicleType ] );
|
||||
// swprintf( sString, L"*%s*", pVehicleStrings[ pVehicleList[ iVehicleMovingList[ iCount ] ].ubVehicleType ] );
|
||||
swprintf( sString, L"*%s*", gNewVehicle[ pVehicleList[ iVehicleMovingList[ iCount ] ].ubVehicleType ].NewVehicleStrings );
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( sString, L"%s", pVehicleStrings[ pVehicleList[ iVehicleMovingList[ iCount ] ].ubVehicleType ] );
|
||||
// swprintf( sString, L"%s", pVehicleStrings[ pVehicleList[ iVehicleMovingList[ iCount ] ].ubVehicleType ] );
|
||||
swprintf( sString, L"%s", gNewVehicle[ pVehicleList[ iVehicleMovingList[ iCount ] ].ubVehicleType ].NewVehicleStrings);
|
||||
}
|
||||
AddMonoString(&hStringHandle, sString );
|
||||
|
||||
@@ -5781,8 +5783,8 @@ BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
gubPBSectorX = gGameExternalOptions.ubDefaultArrivalSectorX;
|
||||
gubPBSectorY = gGameExternalOptions.ubDefaultArrivalSectorY;
|
||||
gubPBSectorX = (UINT8)gGameExternalOptions.ubDefaultArrivalSectorX;
|
||||
gubPBSectorY = (UINT8)gGameExternalOptions.ubDefaultArrivalSectorY;
|
||||
}
|
||||
gubPBSectorZ = 0;
|
||||
|
||||
@@ -5805,10 +5807,13 @@ BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void )
|
||||
FadeInGameScreen( );
|
||||
|
||||
SetUpShutDownMapScreenHelpTextScreenMask( );
|
||||
|
||||
#ifdef JA2UB
|
||||
//no ja25 UB
|
||||
#else
|
||||
// Add e-mail message
|
||||
AddEmail(ENRICO_CONGRATS,ENRICO_CONGRATS_LENGTH,MAIL_ENRICO, GetWorldTotalMin(), -1, -1);
|
||||
AddEmail(ENRICO_CONGRATS,ENRICO_CONGRATS_LENGTH,MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
||||
|
||||
#endif
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -5919,12 +5924,19 @@ BOOLEAN NotifyPlayerWhenEnemyTakesControlOfImportantSector( INT16 sSectorX, INT1
|
||||
|
||||
if( fContested && bTownId )
|
||||
{
|
||||
#ifdef JA2UB
|
||||
// no UB
|
||||
#else
|
||||
if( bTownId == SAN_MONA )
|
||||
{ //San Mona isn't important.
|
||||
return( TRUE );
|
||||
}
|
||||
#endif
|
||||
swprintf( sStringB, pMapErrorString[ 25 ], sString );
|
||||
|
||||
#ifdef JA2UB
|
||||
HandleDisplayingOfPlayerLostDialogue( );
|
||||
#endif
|
||||
// put up the message informing the player of the event
|
||||
DoScreenIndependantMessageBox( sStringB, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback );
|
||||
return( TRUE );
|
||||
|
||||
@@ -0,0 +1,486 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Strategic All.h"
|
||||
#else
|
||||
#include "Map Screen Interface.h"
|
||||
#include "string.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "Font Control.h"
|
||||
#include "Assignments.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "Overhead.h"
|
||||
#include "Squads.h"
|
||||
#include "Sound Control.h"
|
||||
#include "Soundman.h"
|
||||
#include "Message.h"
|
||||
#include "PopUpBox.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Handle Items.h"
|
||||
#include "Interface Items.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Interface.h"
|
||||
#include "Game Event Hook.h"
|
||||
#include "Tactical Save.h"
|
||||
#include "Quests.h"
|
||||
#include "Strategicmap.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Strategic Movement.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Map Screen Interface Border.h"
|
||||
#include "Map Screen Interface Bottom.h"
|
||||
#include "Vehicles.h"
|
||||
#include "LINE.H"
|
||||
#include "Text.h"
|
||||
#include "gameloop.h"
|
||||
#include "Map Screen Helicopter.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "WordWrap.h"
|
||||
#include "interface control.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Map Screen Interface Map Inventory.h"
|
||||
#include "strategic.h"
|
||||
#include "Keys.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Militia Control.h"
|
||||
#include "Random.h"
|
||||
#include "Cursor Control.h"
|
||||
#include "renderworld.h"
|
||||
#include "Game Init.h"
|
||||
#include "Strategic Mines.h"
|
||||
#include "finances.h"
|
||||
#include "strategic.h"
|
||||
#include "Air Raid.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Render Fun.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "ub_config.h"
|
||||
#include "Ja25Update.h"
|
||||
|
||||
|
||||
#include "MapScreen Quotes.h"
|
||||
//****** Global Variables *****************************************
|
||||
|
||||
UINT16 gusWaitingQuote=MILO_NO_QUOTE;
|
||||
UINT16 gusJerryDialogueDelay = 0;
|
||||
|
||||
|
||||
|
||||
//******* Function Prototypes ***************************************
|
||||
|
||||
BOOLEAN Internal_JerryMeloCharacterDialogue( UINT16 usQuoteNum );
|
||||
BOOLEAN DoesPlayerHaveMoreThen6MercsAndJerryHasntComplained();
|
||||
BOOLEAN DoesPlayerHaveMoreThen6MercsAndJerryHasntComplained2ndTime();
|
||||
BOOLEAN DoesPlayerHaveMoreThen6MercsAndJerryHasComplained2ndTime();
|
||||
BOOLEAN DoesPlayerHaveLessThen6MercsAndJerryHasNotDoubleCheckedYet();
|
||||
//BOOLEAN DoesPlayerHaveExactly6MercsOrLessThen6MercsAndJerryHasDoubleChecked();
|
||||
BOOLEAN DoesPlayerHaveLessThen6MercsAndJerryHasDoubleChecked();
|
||||
BOOLEAN DoesPlayerHaveExactly6MercsAndNotSaidQuoteBefore();
|
||||
BOOLEAN HasJerryAlreadySaidTheMapScreenIntroSequence();
|
||||
BOOLEAN HasJerrySaidTheLetsGoToTraconaQuote();
|
||||
|
||||
|
||||
//ppp
|
||||
|
||||
//******* Functions **************************************************
|
||||
|
||||
|
||||
//void JerryMiloTalk( UINT16 usQuoteNum, UINT32 uiDelay )
|
||||
void JerryMiloTalk( UINT16 usQuoteNum )
|
||||
{
|
||||
// gusWaitingQuote = usQuoteNum;
|
||||
|
||||
// have skyrider talk to player
|
||||
Internal_JerryMeloCharacterDialogue( usQuoteNum );
|
||||
|
||||
//set that jerry has said the quote
|
||||
JerryMiloSaidQuote( usQuoteNum );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void JerryMiloDelayedTalk( UINT16 usQuoteNum, UINT32 uiDelay )
|
||||
{
|
||||
gusWaitingQuote = usQuoteNum;
|
||||
gusJerryDialogueDelay = uiDelay;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void HandleJerryMiloQuotes( BOOLEAN fReset )
|
||||
{
|
||||
|
||||
static UINT32 uiLastCount;
|
||||
UINT32 uiCurrentTime = GetJA2Clock();
|
||||
|
||||
|
||||
if( fReset )
|
||||
{
|
||||
uiLastCount = 0;
|
||||
gusWaitingQuote = MILO_NO_QUOTE;
|
||||
return;
|
||||
}
|
||||
|
||||
// if ( gGameUBOptions.InGameHeliCrash == TRUE )
|
||||
// {
|
||||
|
||||
// return;//AA
|
||||
if( gusWaitingQuote == MILO_NO_QUOTE )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( uiLastCount == 0 )
|
||||
{
|
||||
uiLastCount = GetJA2Clock();
|
||||
return;
|
||||
}
|
||||
|
||||
if( ( uiCurrentTime - uiLastCount ) > gusJerryDialogueDelay )
|
||||
{
|
||||
JerryMiloTalk( gusWaitingQuote );
|
||||
|
||||
//if the quote waiting to be said was the opening quote
|
||||
if( gusWaitingQuote == MILO_QUOTE__OPENING_GREETING_PART_1 )
|
||||
{
|
||||
//say the follow up part
|
||||
if( DoesPlayerHaveExactly6MercsAndNotSaidQuoteBefore() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__ALREADY_HAS_6_MERCS );
|
||||
}
|
||||
else
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__OPENING_GREETING_PART_2 );
|
||||
}
|
||||
}
|
||||
|
||||
gusWaitingQuote = MILO_NO_QUOTE;
|
||||
|
||||
uiLastCount = uiCurrentTime;
|
||||
}
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
BOOLEAN Internal_JerryMeloCharacterDialogue( UINT16 usQuoteNum )
|
||||
{
|
||||
BOOLEAN fRetVal = FALSE;
|
||||
fTeamPanelDirty = TRUE;
|
||||
|
||||
fRetVal = CharacterDialogue( 76, usQuoteNum, uiExternalStaticNPCFacesUB[ JERRY_MELO_FACE ], DIALOGUE_EXTERNAL_NPC_UI, FALSE, FALSE );
|
||||
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_JERRY_MILO, usQuoteNum, 0, 0, uiExternalStaticNPCFacesUB[ JERRY_MELO_FACE ], DIALOGUE_EXTERNAL_NPC_UI );
|
||||
|
||||
return( fRetVal );
|
||||
}
|
||||
|
||||
BOOLEAN HasJerryMiloSaidQuoteBefore( UINT32 uiQuoteID )
|
||||
{
|
||||
//has the quote been said
|
||||
return( ( gJa25SaveStruct.uiJerryMiloQuotesFlags & ( 1 << uiQuoteID ) ) != 0 );
|
||||
}
|
||||
|
||||
|
||||
void JerryMiloSaidQuote( UINT32 uiQuoteID )
|
||||
{
|
||||
gJa25SaveStruct.uiJerryMiloQuotesFlags |= ( 1 << uiQuoteID );
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN WillJerryMiloAllowThePlayerToCompressTimeAtBeginingOfGame()
|
||||
{
|
||||
|
||||
if ( gGameUBOptions.JerryQuotes == TRUE )
|
||||
{
|
||||
//to speed things up, has jerry finished the intro speech?
|
||||
if( HasJerryAlreadySaidTheMapScreenIntroSequence() )
|
||||
return( TRUE );
|
||||
|
||||
|
||||
//if the player has more then 6merc and Jerry hasnt complained the first time
|
||||
if( DoesPlayerHaveMoreThen6MercsAndJerryHasntComplained() )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//if the player has over 6 mercs and jerry HAS NOT complained the 2nd time
|
||||
if( DoesPlayerHaveMoreThen6MercsAndJerryHasntComplained2ndTime() )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//if the player has over 6 mercs and jerry HAS complained the 2nd time
|
||||
if( DoesPlayerHaveMoreThen6MercsAndJerryHasComplained2ndTime() )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//if the player has less then 6 mercs, and hasnt double checked yet
|
||||
if( DoesPlayerHaveLessThen6MercsAndJerryHasNotDoubleCheckedYet() )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
/*
|
||||
//if the player has exactly 6 mercs OR the player has less then 6 AND has double checked
|
||||
if( DoesPlayerHaveExactly6MercsOrLessThen6MercsAndJerryHasDoubleChecked() )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
*/
|
||||
|
||||
//if the player has exactly 6 mercs OR the player has less then 6 AND has double checked
|
||||
if( DoesPlayerHaveLessThen6MercsAndJerryHasDoubleChecked() )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//if the player has exactly 6 mercs OR the player has less then 6 AND has double checked
|
||||
if( DoesPlayerHaveExactly6MercsAndNotSaidQuoteBefore() )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
if( !HasJerrySaidTheLetsGoToTraconaQuote() )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN HasJerrySaidTheLetsGoToTraconaQuote()
|
||||
{
|
||||
return( HasJerryMiloSaidQuoteBefore( MILO_QUOTE__HEADED_TO_TRACONA_QUOTE ) );
|
||||
}
|
||||
|
||||
void HaveJerrySayWhyPlayerCantTimeCompressAtBeginningOfGame()
|
||||
{
|
||||
if( !gfFirstTimeInGameHeliCrash)
|
||||
{
|
||||
INT32 i=0;
|
||||
}
|
||||
|
||||
/*
|
||||
if (gGameOptions.ubSquadSize > 6)
|
||||
{
|
||||
if( DoesPlayerHaveLessThen6MercsAndJerryHasNotDoubleCheckedYet() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__PLAYER_HAS_LESS_THEN_6_MERCS );
|
||||
return;
|
||||
}
|
||||
//else if the player has less then 6 mercs, and hasnt double checked yet
|
||||
else if( DoesPlayerHaveLessThen6MercsAndJerryHasNotDoubleCheckedYet() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__PLAYER_HAS_LESS_THEN_6_MERCS );
|
||||
return;
|
||||
}
|
||||
//if the player has less then 6 AND has double checked
|
||||
else if( DoesPlayerHaveLessThen6MercsAndJerryHasDoubleChecked() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__HEADED_TO_TRACONA_QUOTE );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__HEADED_TO_TRACONA_QUOTE );
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
//if the player has more then 6merc and Jerry hasnt complained the first time
|
||||
if( DoesPlayerHaveMoreThen6MercsAndJerryHasntComplained() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__PLAYER_HAS_MORE_THEN_6_MERCS );
|
||||
return;
|
||||
}
|
||||
|
||||
//else if the player has over 6 mercs and jerry HAS NOT complained the 2nd time
|
||||
else if( DoesPlayerHaveMoreThen6MercsAndJerryHasntComplained2ndTime() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__PLAYER_HAS_MORE_THEN_6_MERCS_2ND_TIME );
|
||||
return;
|
||||
}
|
||||
|
||||
//else if the player has over 6 mercs and jerry HAS complained the 2nd time
|
||||
else if( DoesPlayerHaveMoreThen6MercsAndJerryHasComplained2ndTime() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__PLAYER_HAS_MORE_THEN_6_MERCS_2ND_TIME );
|
||||
return;
|
||||
}
|
||||
|
||||
//else if the player has less then 6 mercs, and hasnt double checked yet
|
||||
else if( DoesPlayerHaveLessThen6MercsAndJerryHasNotDoubleCheckedYet() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__PLAYER_HAS_LESS_THEN_6_MERCS );
|
||||
return;
|
||||
}
|
||||
|
||||
//if the player has less then 6 AND has double checked
|
||||
else if( DoesPlayerHaveLessThen6MercsAndJerryHasDoubleChecked() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__HEADED_TO_TRACONA_QUOTE );
|
||||
return;
|
||||
}
|
||||
|
||||
else if( !HasJerrySaidTheLetsGoToTraconaQuote() )
|
||||
{
|
||||
JerryMiloTalk( MILO_QUOTE__HEADED_TO_TRACONA_QUOTE );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//shoud satisfy condition above
|
||||
Assert( 0 );
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN DoesPlayerHaveMoreThen6MercsAndJerryHasntComplained()
|
||||
{
|
||||
UINT8 ubNumMercsOnTeam = NumberOfMercsOnPlayerTeam();
|
||||
|
||||
//if the player has over 6 mercs, and jerry hasnt complained about that yet
|
||||
if( ubNumMercsOnTeam > 6 && !HasJerryMiloSaidQuoteBefore( MILO_QUOTE__PLAYER_HAS_MORE_THEN_6_MERCS ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN DoesPlayerHaveMoreThen6MercsAndJerryHasntComplained2ndTime()
|
||||
{
|
||||
UINT8 ubNumMercsOnTeam = NumberOfMercsOnPlayerTeam();
|
||||
|
||||
//if the player has over 6 mercs and jerry HAS NOT complained the 2nd time
|
||||
if( ubNumMercsOnTeam > 6 && !HasJerryMiloSaidQuoteBefore( MILO_QUOTE__PLAYER_HAS_MORE_THEN_6_MERCS_2ND_TIME ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN DoesPlayerHaveMoreThen6MercsAndJerryHasComplained2ndTime()
|
||||
{
|
||||
UINT8 ubNumMercsOnTeam = NumberOfMercsOnPlayerTeam();
|
||||
|
||||
//if the player has over 6 mercs and jerry HAS complained the 2nd time
|
||||
if( ubNumMercsOnTeam > 6 && HasJerryMiloSaidQuoteBefore( MILO_QUOTE__PLAYER_HAS_MORE_THEN_6_MERCS_2ND_TIME ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN DoesPlayerHaveLessThen6MercsAndJerryHasNotDoubleCheckedYet()
|
||||
{
|
||||
UINT8 ubNumMercsOnTeam = NumberOfMercsOnPlayerTeam();
|
||||
|
||||
//if the player has less then 6 mercs, and hasnt double checked yet
|
||||
if( ubNumMercsOnTeam < 6 && !HasJerryMiloSaidQuoteBefore( MILO_QUOTE__PLAYER_HAS_LESS_THEN_6_MERCS ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN DoesPlayerHaveExactly6MercsAndNotSaidQuoteBefore()
|
||||
{
|
||||
UINT8 ubNumMercsOnTeam = NumberOfMercsOnPlayerTeam();
|
||||
|
||||
//if the player has exactly 6 mercs OR the player has less then 6 AND has double checked
|
||||
if( ubNumMercsOnTeam == 6 && !HasJerryMiloSaidQuoteBefore( MILO_QUOTE__ALREADY_HAS_6_MERCS ) && !HasJerryMiloSaidQuoteBefore( MILO_QUOTE__PLAYER_HAS_LESS_THEN_6_MERCS ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN DoesPlayerHaveLessThen6MercsAndJerryHasDoubleChecked()
|
||||
{
|
||||
UINT8 ubNumMercsOnTeam = NumberOfMercsOnPlayerTeam();
|
||||
|
||||
//if the player has exactly 6 mercs OR the player has less then 6 AND has double checked
|
||||
if( ubNumMercsOnTeam < 6 && HasJerryMiloSaidQuoteBefore( MILO_QUOTE__PLAYER_HAS_LESS_THEN_6_MERCS ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN DoesPlayerHaveNoMercsHiredAndJerryHasntSaidQuoteYet()
|
||||
{
|
||||
UINT8 ubNumMercsOnTeam = NumberOfMercsOnPlayerTeam();
|
||||
|
||||
//if the player has less then 6 mercs, and hasnt double checked yet
|
||||
//if( ubNumMercsOnTeam == 0 && !HasJerryMiloSaidQuoteBefore( MILO_QUOTE__PLAYER_HAS_NO_MERCS ) )
|
||||
if( ubNumMercsOnTeam == 0 )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
BOOLEAN DidPlayerInitiallyHaveLessThen6MercsAndNowHaveExactly6AndHasntSaidFullLoadQuote()
|
||||
{
|
||||
UINT8 ubNumMercsOnTeam = NumberOfMercsOnPlayerTeam();
|
||||
|
||||
//If we have been to the sector, make sure we dont say it
|
||||
|
||||
//if( SectorInfo[ SEC_H7].uiFlags & SF_HAS_ENTERED_TACTICAL )
|
||||
if( SectorInfo[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].uiFlags & SF_HAS_ENTERED_TACTICAL )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//if the player has 6 mercs, and has said the regular opening line ( not the line with 6 mercs )
|
||||
if( ubNumMercsOnTeam == 6 &&
|
||||
HasJerryMiloSaidQuoteBefore( MILO_QUOTE__OPENING_GREETING_PART_2 ) &&
|
||||
!HasJerryMiloSaidQuoteBefore( MILO_QUOTE__ALREADY_HAS_6_MERCS ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
void InitJerryQuotes()
|
||||
{
|
||||
//Clear out the quote flags
|
||||
gJa25SaveStruct.uiJerryMiloQuotesFlags = 0;
|
||||
}
|
||||
|
||||
BOOLEAN HasJerryAlreadySaidTheMapScreenIntroSequence()
|
||||
{
|
||||
// return TRUE; //AA
|
||||
if( HasJerryMiloSaidQuoteBefore( MILO_QUOTE__HEADED_TO_TRACONA_QUOTE ) || gGameUBOptions.InGameHeliCrash == FALSE )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user