mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- externalised squad names
- moved Pockets.xml an PocketPopups.xml - requires GameDir >= r1608 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5872 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1915,6 +1915,8 @@ void LoadGameExternalOptions()
|
|||||||
|
|
||||||
gGameExternalOptions.fRobotNoReadytime = iniReader.ReadBoolean("Tactical Gameplay Settings", "ROBOT_NO_READYTIME", FALSE);
|
gGameExternalOptions.fRobotNoReadytime = iniReader.ReadBoolean("Tactical Gameplay Settings", "ROBOT_NO_READYTIME", FALSE);
|
||||||
|
|
||||||
|
gGameExternalOptions.fUseXMLSquadNames = iniReader.ReadBoolean("Strategic Assignment Settings", "USE_XML_SQUADNAMES", FALSE);
|
||||||
|
|
||||||
// WANNE: This is just a debug setting. Only in debug version we set that property to 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
|
// In Release version this should always be set to FALSE
|
||||||
// dnl ch51 081009 JA2 Debug Settings
|
// dnl ch51 081009 JA2 Debug Settings
|
||||||
|
|||||||
@@ -1221,6 +1221,9 @@ typedef struct
|
|||||||
|
|
||||||
BOOLEAN fRobotNoReadytime; //DBrot: should the robot need to ready his gun?
|
BOOLEAN fRobotNoReadytime; //DBrot: should the robot need to ready his gun?
|
||||||
|
|
||||||
|
// Flugente: externalised squad names
|
||||||
|
BOOLEAN fUseXMLSquadNames;
|
||||||
|
|
||||||
} GAME_EXTERNAL_OPTIONS;
|
} GAME_EXTERNAL_OPTIONS;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|||||||
@@ -380,6 +380,10 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
|||||||
strcat(fileName, RANDOMITEMFILENAME);
|
strcat(fileName, RANDOMITEMFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInRandomItemStats(fileName),RANDOMITEMFILENAME);
|
SGP_THROW_IFFALSE(ReadInRandomItemStats(fileName),RANDOMITEMFILENAME);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, SQUADNAMEFILENAME);
|
||||||
|
SGP_THROW_IFFALSE(ReadInSquadNamesStats(fileName),SQUADNAMEFILENAME);
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, ARMOURSFILENAME);
|
strcat(fileName, ARMOURSFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInArmourStats(fileName),ARMOURSFILENAME);
|
SGP_THROW_IFFALSE(ReadInArmourStats(fileName),ARMOURSFILENAME);
|
||||||
|
|||||||
@@ -37,6 +37,9 @@
|
|||||||
#include "Soldier Macros.h"
|
#include "Soldier Macros.h"
|
||||||
#include "InterfaceItemImages.h"
|
#include "InterfaceItemImages.h"
|
||||||
|
|
||||||
|
#include "Map Screen Interface.h" // added by Flugente
|
||||||
|
|
||||||
|
|
||||||
// WDS - make number of mercenaries, etc. be configurable
|
// WDS - make number of mercenaries, etc. be configurable
|
||||||
#define MAX_MERCS_ON_SCREEN 20
|
#define MAX_MERCS_ON_SCREEN 20
|
||||||
|
|
||||||
@@ -1309,7 +1312,12 @@ void DisplayCharName( INT32 iId, INT32 iSlot )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Display the mercs name
|
//Display the mercs name
|
||||||
mprintf(sX+iSlot*IMAGE_BOX_WIDTH, CHAR_NAME_Y, sString );
|
if ( Menptr[iId].bAssignment < ON_DUTY && gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
{
|
||||||
|
swprintf( sString, L"%s", SquadNames[ Menptr[iId].bAssignment ].squadname);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mprintf(sX+iSlot*IMAGE_BOX_WIDTH, CHAR_NAME_Y, sString );
|
||||||
|
|
||||||
swprintf( sString, L"%s", pPersonnelAssignmentStrings[Menptr[iId].bAssignment]);
|
swprintf( sString, L"%s", pPersonnelAssignmentStrings[Menptr[iId].bAssignment]);
|
||||||
|
|
||||||
|
|||||||
@@ -9226,10 +9226,16 @@ void SquadMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
swprintf( sString, pMapErrorString[ 37 ], pSoldier->name );
|
swprintf( sString, pMapErrorString[ 37 ], pSoldier->name );
|
||||||
break;
|
break;
|
||||||
case CHARACTER_CANT_JOIN_SQUAD_TOO_FAR:
|
case CHARACTER_CANT_JOIN_SQUAD_TOO_FAR:
|
||||||
swprintf( sString, pMapErrorString[ 20 ], pSoldier->name, pLongAssignmentStrings[ iValue ] );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
swprintf( sString, pMapErrorString[ 20 ], pSoldier->name, SquadNames[ iValue ].squadname );
|
||||||
|
else
|
||||||
|
swprintf( sString, pMapErrorString[ 20 ], pSoldier->name, pLongAssignmentStrings[ iValue ] );
|
||||||
break;
|
break;
|
||||||
case CHARACTER_CANT_JOIN_SQUAD_FULL:
|
case CHARACTER_CANT_JOIN_SQUAD_FULL:
|
||||||
swprintf( sString, pMapErrorString[ 19 ], pSoldier->name, pLongAssignmentStrings[ iValue ] );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
swprintf( sString, pMapErrorString[ 19 ], pSoldier->name, SquadNames[ iValue ].squadname );
|
||||||
|
else
|
||||||
|
swprintf( sString, pMapErrorString[ 19 ], pSoldier->name, pLongAssignmentStrings[ iValue ] );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// generic "you can't join this squad" msg
|
// generic "you can't join this squad" msg
|
||||||
@@ -10059,13 +10065,17 @@ void CreateSquadBox( void )
|
|||||||
// add strings for box
|
// add strings for box
|
||||||
for(uiCounter=0; uiCounter <= uiMaxSquad; uiCounter++)
|
for(uiCounter=0; uiCounter <= uiMaxSquad; uiCounter++)
|
||||||
{
|
{
|
||||||
// get info about current squad and put in string
|
// get info about current squad and put in string
|
||||||
//SQUAD10 FIX
|
//SQUAD10 FIX
|
||||||
swprintf( sString, L"%s ( %d/%d )", pSquadMenuStrings[uiCounter], NumberOfPeopleInSquad( ( INT8 )uiCounter ), gGameOptions.ubSquadSize );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
AddMonoString(&hStringHandle, sString );
|
swprintf( sString, L"%s ( %d/%d )", SquadNames[ uiCounter ].squadname, NumberOfPeopleInSquad( ( INT8 )uiCounter ), gGameOptions.ubSquadSize );
|
||||||
|
else
|
||||||
|
swprintf( sString, L"%s ( %d/%d )", pSquadMenuStrings[uiCounter], NumberOfPeopleInSquad( ( INT8 )uiCounter ), gGameOptions.ubSquadSize );
|
||||||
|
|
||||||
// make sure it is unhighlighted
|
AddMonoString(&hStringHandle, sString );
|
||||||
UnHighLightLine(hStringHandle);
|
|
||||||
|
// make sure it is unhighlighted
|
||||||
|
UnHighLightLine(hStringHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add cancel line
|
// add cancel line
|
||||||
@@ -13744,6 +13754,10 @@ UINT32 GetLastSquadListedInSquadMenu( void )
|
|||||||
uiMaxSquad = NUMBER_OF_SQUADS - 1;
|
uiMaxSquad = NUMBER_OF_SQUADS - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Flugente: if using xml squad names, always show all squads - people will propably want to use them
|
||||||
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
uiMaxSquad = NUMBER_OF_SQUADS - 1;
|
||||||
|
|
||||||
return( uiMaxSquad );
|
return( uiMaxSquad );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2173,7 +2173,10 @@ void PlotPathForCharacter( SOLDIERTYPE *pCharacter, INT16 sX, INT16 sY, BOOLEAN
|
|||||||
}
|
}
|
||||||
else // squad
|
else // squad
|
||||||
{
|
{
|
||||||
MapScreenMessage( FONT_MCOLOR_DKRED, MSG_INTERFACE, L"%s %s", pLongAssignmentStrings[ pCharacter->bAssignment ], gsUndergroundString[0] );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
MapScreenMessage( FONT_MCOLOR_DKRED, MSG_INTERFACE, L"%s %s", SquadNames[ pCharacter->bAssignment ].squadname, gsUndergroundString[0] );
|
||||||
|
else
|
||||||
|
MapScreenMessage( FONT_MCOLOR_DKRED, MSG_INTERFACE, L"%s %s", pLongAssignmentStrings[ pCharacter->bAssignment ], gsUndergroundString[0] );
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -367,6 +367,8 @@ SGPPoint OrigFacilityPosition = { 160, 150 }; // HEADROCK HAM 3.6
|
|||||||
SGPPoint OrigFacilityAssignmentPosition = { 220,150 }; // HEADROCK HAM 3.6
|
SGPPoint OrigFacilityAssignmentPosition = { 220,150 }; // HEADROCK HAM 3.6
|
||||||
//SGPPoint OrigTalkToAllPosition = { 160, 150 };
|
//SGPPoint OrigTalkToAllPosition = { 160, 150 };
|
||||||
|
|
||||||
|
SQUAD_NAMES SquadNames[20];
|
||||||
|
|
||||||
//extern BOOLEAN fMapExitDueToMessageBox;
|
//extern BOOLEAN fMapExitDueToMessageBox;
|
||||||
|
|
||||||
// at least one merc was hired at some time
|
// at least one merc was hired at some time
|
||||||
@@ -3871,11 +3873,17 @@ void AddStringsToMoveBox( void )
|
|||||||
// add this squad, now add all the grunts in it
|
// add this squad, now add all the grunts in it
|
||||||
if( fSquadIsMoving[ iCount ] )
|
if( fSquadIsMoving[ iCount ] )
|
||||||
{
|
{
|
||||||
swprintf( sString, L"*%s*", pSquadMenuStrings[iSquadMovingList[ iCount ] ] );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
swprintf( sString, L"*%s*", SquadNames[ iSquadMovingList[ iCount ] ].squadname );
|
||||||
|
else
|
||||||
|
swprintf( sString, L"*%s*", pSquadMenuStrings[iSquadMovingList[ iCount ] ] );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swprintf( sString, L"%s", pSquadMenuStrings[iSquadMovingList[ iCount ] ] );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
swprintf( sString, L"%s", SquadNames[ iSquadMovingList[ iCount ] ].squadname );
|
||||||
|
else
|
||||||
|
swprintf( sString, L"%s", pSquadMenuStrings[iSquadMovingList[ iCount ] ] );
|
||||||
}
|
}
|
||||||
AddMonoString(&hStringHandle, sString );
|
AddMonoString(&hStringHandle, sString );
|
||||||
|
|
||||||
@@ -3962,11 +3970,17 @@ void AddStringsToMoveBox( void )
|
|||||||
// add OTHER soldiers (not on duty nor in a vehicle)
|
// add OTHER soldiers (not on duty nor in a vehicle)
|
||||||
if( IsSoldierSelectedForMovement( pSoldierMovingList[ iCount ] ) == TRUE )
|
if( IsSoldierSelectedForMovement( pSoldierMovingList[ iCount ] ) == TRUE )
|
||||||
{
|
{
|
||||||
swprintf( sString, L" *%s ( %s )*", pSoldierMovingList[ iCount ]->name, pAssignmentStrings[ pSoldierMovingList[ iCount ]->bAssignment ] );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
swprintf( sString, L" *%s ( %s )*", pSoldierMovingList[ iCount ]->name, SquadNames[ pSoldierMovingList[ iCount ]->bAssignment ].squadname );
|
||||||
|
else
|
||||||
|
swprintf( sString, L" *%s ( %s )*", pSoldierMovingList[ iCount ]->name, pAssignmentStrings[ pSoldierMovingList[ iCount ]->bAssignment ] );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swprintf( sString, L" %s ( %s )", pSoldierMovingList[ iCount ]->name, pAssignmentStrings[ pSoldierMovingList[ iCount ]->bAssignment ] );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
swprintf( sString, L" %s ( %s )", pSoldierMovingList[ iCount ]->name, SquadNames[ pSoldierMovingList[ iCount ]->bAssignment ].squadname );
|
||||||
|
else
|
||||||
|
swprintf( sString, L" %s ( %s )", pSoldierMovingList[ iCount ]->name, pAssignmentStrings[ pSoldierMovingList[ iCount ]->bAssignment ] );
|
||||||
}
|
}
|
||||||
AddMonoString(&hStringHandle, sString );
|
AddMonoString(&hStringHandle, sString );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ typedef struct FASTHELPREGION {
|
|||||||
|
|
||||||
} FASTHELPREGION;
|
} FASTHELPREGION;
|
||||||
|
|
||||||
|
// Flugente: externalised squad names
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
UINT32 uiIndex;
|
||||||
|
CHAR16 squadname[10];
|
||||||
|
} SQUAD_NAMES;
|
||||||
|
|
||||||
|
extern SQUAD_NAMES SquadNames[20];
|
||||||
|
|
||||||
extern UINT8 FIRSTmercTOdisplay ;
|
extern UINT8 FIRSTmercTOdisplay ;
|
||||||
extern UINT8 maxNumberOfMercVisibleInStrategyList;
|
extern UINT8 maxNumberOfMercVisibleInStrategyList;
|
||||||
|
|||||||
@@ -1931,7 +1931,10 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
|||||||
{
|
{
|
||||||
// squad
|
// squad
|
||||||
// HEADROCK HAM 3.6: Messages are no longer yellow by default.
|
// HEADROCK HAM 3.6: Messages are no longer yellow by default.
|
||||||
ScreenMsg( FONT_MCOLOR_LTGREEN, MSG_INTERFACE, pMessageStrings[ MSG_ARRIVE ], pAssignmentStrings[ pGroup->pPlayerList->pSoldier->bAssignment ], pMapVertIndex[ pGroup->pPlayerList->pSoldier->sSectorY ], pMapHortIndex[ pGroup->pPlayerList->pSoldier->sSectorX ]);
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
ScreenMsg( FONT_MCOLOR_LTGREEN, MSG_INTERFACE, pMessageStrings[ MSG_ARRIVE ], SquadNames[ pGroup->pPlayerList->pSoldier->bAssignment ].squadname, pMapVertIndex[ pGroup->pPlayerList->pSoldier->sSectorY ], pMapHortIndex[ pGroup->pPlayerList->pSoldier->sSectorX ]);
|
||||||
|
else
|
||||||
|
ScreenMsg( FONT_MCOLOR_LTGREEN, MSG_INTERFACE, pMessageStrings[ MSG_ARRIVE ], pAssignmentStrings[ pGroup->pPlayerList->pSoldier->bAssignment ], pMapVertIndex[ pGroup->pPlayerList->pSoldier->sSectorY ], pMapHortIndex[ pGroup->pPlayerList->pSoldier->sSectorX ]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -776,6 +776,10 @@
|
|||||||
RelativePath=".\XML_SectorNames.cpp"
|
RelativePath=".\XML_SectorNames.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\XML_SquadNames.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\XML_UniformColors.cpp"
|
RelativePath=".\XML_UniformColors.cpp"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -774,6 +774,10 @@
|
|||||||
RelativePath=".\XML_SectorNames.cpp"
|
RelativePath=".\XML_SectorNames.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\XML_SquadNames.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\XML_UniformColors.cpp"
|
RelativePath=".\XML_UniformColors.cpp"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -133,6 +133,7 @@
|
|||||||
<ClCompile Include="XML_FacilityTypes.cpp" />
|
<ClCompile Include="XML_FacilityTypes.cpp" />
|
||||||
<ClCompile Include="XML_Roaming.cpp" />
|
<ClCompile Include="XML_Roaming.cpp" />
|
||||||
<ClCompile Include="XML_SectorNames.cpp" />
|
<ClCompile Include="XML_SectorNames.cpp" />
|
||||||
|
<ClCompile Include="XML_SquadNames.cpp" />
|
||||||
<ClCompile Include="XML_UniformColors.cpp" />
|
<ClCompile Include="XML_UniformColors.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
|
|||||||
@@ -338,5 +338,8 @@
|
|||||||
<ClCompile Include="XML_CoolnessBySector.cpp">
|
<ClCompile Include="XML_CoolnessBySector.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="XML_SquadNames.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
#ifdef PRECOMPILEDHEADERS
|
||||||
|
#include "Tactical All.h"
|
||||||
|
#else
|
||||||
|
#include "sgp.h"
|
||||||
|
#include "Map Screen Interface.h"
|
||||||
|
#include "overhead.h"
|
||||||
|
#include "Debug Control.h"
|
||||||
|
#include "expat.h"
|
||||||
|
#include "XML.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
PARSE_STAGE curElement;
|
||||||
|
|
||||||
|
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
|
||||||
|
SQUAD_NAMES curSquadNames;
|
||||||
|
SQUAD_NAMES * curArray;
|
||||||
|
UINT32 maxArraySize;
|
||||||
|
|
||||||
|
UINT32 currentDepth;
|
||||||
|
UINT32 maxReadDepth;
|
||||||
|
}
|
||||||
|
typedef squadnamesParseData;
|
||||||
|
|
||||||
|
static void XMLCALL
|
||||||
|
squadnamesStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||||
|
{
|
||||||
|
squadnamesParseData * pData = (squadnamesParseData *)userData;
|
||||||
|
|
||||||
|
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
||||||
|
{
|
||||||
|
if(strcmp(name, "SQUAD_NAMES") == 0 && pData->curElement == ELEMENT_NONE)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT_LIST;
|
||||||
|
|
||||||
|
memset(pData->curArray,0,sizeof(SQUAD_NAMES)*pData->maxArraySize);
|
||||||
|
|
||||||
|
pData->maxReadDepth++; //we are not skipping this element
|
||||||
|
}
|
||||||
|
else if(strcmp(name, "SQUADNAME") == 0 && pData->curElement == ELEMENT_LIST)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
|
||||||
|
memset(&pData->curSquadNames,0,sizeof(SQUAD_NAMES));
|
||||||
|
|
||||||
|
pData->maxReadDepth++; //we are not skipping this element
|
||||||
|
}
|
||||||
|
else if(pData->curElement == ELEMENT &&
|
||||||
|
(strcmp(name, "uiIndex") == 0 ||
|
||||||
|
strcmp(name, "Squad") == 0 ))
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT_PROPERTY;
|
||||||
|
|
||||||
|
pData->maxReadDepth++; //we are not skipping this element
|
||||||
|
}
|
||||||
|
|
||||||
|
pData->szCharData[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
pData->currentDepth++;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void XMLCALL
|
||||||
|
squadnamesCharacterDataHandle(void *userData, const XML_Char *str, int len)
|
||||||
|
{
|
||||||
|
squadnamesParseData * pData = (squadnamesParseData *)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
|
||||||
|
squadnamesEndElementHandle(void *userData, const XML_Char *name)
|
||||||
|
{
|
||||||
|
squadnamesParseData * pData = (squadnamesParseData *)userData;
|
||||||
|
|
||||||
|
if(pData->currentDepth <= pData->maxReadDepth) //we're at the end of an element that we've been reading
|
||||||
|
{
|
||||||
|
if(strcmp(name, "SQUAD_NAMES") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT_NONE;
|
||||||
|
}
|
||||||
|
else if(strcmp(name, "SQUADNAME") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT_LIST;
|
||||||
|
|
||||||
|
if(pData->curSquadNames.uiIndex < pData->maxArraySize)
|
||||||
|
{
|
||||||
|
pData->curArray[pData->curSquadNames.uiIndex] = pData->curSquadNames; //write the squadnames into the table
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(strcmp(name, "uiIndex") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
pData->curSquadNames.uiIndex = (UINT32) atol(pData->szCharData);
|
||||||
|
}
|
||||||
|
else if(strcmp(name, "Squad") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
|
||||||
|
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curSquadNames.squadname, sizeof(pData->curSquadNames.squadname)/sizeof(pData->curSquadNames.squadname[0]) );
|
||||||
|
pData->curSquadNames.squadname[sizeof(pData->curSquadNames.squadname)/sizeof(pData->curSquadNames.squadname[0]) - 1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pData->maxReadDepth--;
|
||||||
|
}
|
||||||
|
|
||||||
|
pData->currentDepth--;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BOOLEAN ReadInSquadNamesStats(STR fileName)
|
||||||
|
{
|
||||||
|
HWFILE hFile;
|
||||||
|
UINT32 uiBytesRead;
|
||||||
|
UINT32 uiFSize;
|
||||||
|
CHAR8 * lpcBuffer;
|
||||||
|
XML_Parser parser = XML_ParserCreate(NULL);
|
||||||
|
|
||||||
|
squadnamesParseData pData;
|
||||||
|
|
||||||
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading SquadNames.xml" );
|
||||||
|
|
||||||
|
// Open squadnames file
|
||||||
|
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
|
||||||
|
if ( !hFile )
|
||||||
|
return( FALSE );
|
||||||
|
|
||||||
|
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, squadnamesStartElementHandle, squadnamesEndElementHandle);
|
||||||
|
XML_SetCharacterDataHandler(parser, squadnamesCharacterDataHandle);
|
||||||
|
|
||||||
|
|
||||||
|
memset(&pData,0,sizeof(pData));
|
||||||
|
pData.curArray = SquadNames;
|
||||||
|
pData.maxArraySize = 20;
|
||||||
|
|
||||||
|
XML_SetUserData(parser, &pData);
|
||||||
|
|
||||||
|
|
||||||
|
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
|
||||||
|
{
|
||||||
|
CHAR8 errorBuf[511];
|
||||||
|
|
||||||
|
sprintf(errorBuf, "XML Parser Error in SquadNames.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 WriteSquadNamesStats()
|
||||||
|
{
|
||||||
|
|
||||||
|
return( TRUE );
|
||||||
|
}
|
||||||
@@ -2829,7 +2829,10 @@ void DrawCharacterInfo(INT16 sCharNumber)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wcscpy( sString, pAssignmentStrings[ pSoldier->bAssignment ] );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
swprintf( sString, L"%s", SquadNames[ pSoldier->bAssignment ].squadname );
|
||||||
|
else
|
||||||
|
wcscpy( sString, pAssignmentStrings[ pSoldier->bAssignment ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
FindFontCenterCoordinates( CHAR_ASSIGN_X, CHAR_ASSIGN1_Y, CHAR_ASSIGN_WID, CHAR_ASSIGN_HEI, sString, CHAR_FONT, &usX, &usY );
|
FindFontCenterCoordinates( CHAR_ASSIGN_X, CHAR_ASSIGN1_Y, CHAR_ASSIGN_WID, CHAR_ASSIGN_HEI, sString, CHAR_FONT, &usX, &usY );
|
||||||
@@ -15553,7 +15556,10 @@ void GetMapscreenMercAssignmentString( SOLDIERTYPE *pSoldier, CHAR16 sString[] )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wcscpy(sString, pAssignmentStrings[ pSoldier->bAssignment ] );
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
swprintf( sString, L" %s", SquadNames[ pSoldier->bAssignment ].squadname );
|
||||||
|
else
|
||||||
|
wcscpy(sString, pAssignmentStrings[ pSoldier->bAssignment ] );
|
||||||
}
|
}
|
||||||
// If soldier is working at a facility, add an asterisk.
|
// If soldier is working at a facility, add an asterisk.
|
||||||
if (pSoldier->sFacilityTypeOperated != -1)
|
if (pSoldier->sFacilityTypeOperated != -1)
|
||||||
|
|||||||
+7
-2
@@ -69,12 +69,15 @@ typedef PARSE_STAGE;
|
|||||||
#define FOODFILENAME "Items\\Food.xml"
|
#define FOODFILENAME "Items\\Food.xml"
|
||||||
#define CLOTHESFILENAME "Items\\Clothes.xml"
|
#define CLOTHESFILENAME "Items\\Clothes.xml"
|
||||||
#define RANDOMITEMFILENAME "Items\\RandomItem.xml"
|
#define RANDOMITEMFILENAME "Items\\RandomItem.xml"
|
||||||
|
#define SQUADNAMEFILENAME "SquadNames.xml"
|
||||||
#define AMMOFILENAME "Items\\AmmoStrings.xml"
|
#define AMMOFILENAME "Items\\AmmoStrings.xml"
|
||||||
#define AMMOTYPESFILENAME "Items\\AmmoTypes.xml"
|
#define AMMOTYPESFILENAME "Items\\AmmoTypes.xml"
|
||||||
#define INCOMPATIBLEATTACHMENTSFILENAME "Items\\IncompatibleAttachments.xml"
|
#define INCOMPATIBLEATTACHMENTSFILENAME "Items\\IncompatibleAttachments.xml"
|
||||||
#define ATTACHMENTSLOTSFILENAME "Items\\AttachmentSlots.xml"
|
#define ATTACHMENTSLOTSFILENAME "Items\\AttachmentSlots.xml"
|
||||||
#define LOADBEARINGEQUIPMENTFILENAME "Items\\LoadBearingEquipment.xml"
|
#define LOADBEARINGEQUIPMENTFILENAME "Items\\LoadBearingEquipment.xml"
|
||||||
#define EXPLOSIONDATAFILENAME "Items\\ExplosionData.xml"
|
#define EXPLOSIONDATAFILENAME "Items\\ExplosionData.xml"
|
||||||
|
#define LBEPOCKETFILENAME "Items\\Pockets.xml"
|
||||||
|
#define LBEPOCKETPOPUPFILENAME "Items\\PocketPopups.xml"
|
||||||
|
|
||||||
#define ENEMYGUNCHOICESFILENAME "Inventory\\EnemyGunChoices.xml" // default selection
|
#define ENEMYGUNCHOICESFILENAME "Inventory\\EnemyGunChoices.xml" // default selection
|
||||||
#define GUNCHOICESFILENAME_ENEMY_ADMIN "Inventory\\GunChoices_Enemy_Admin.xml"
|
#define GUNCHOICESFILENAME_ENEMY_ADMIN "Inventory\\GunChoices_Enemy_Admin.xml"
|
||||||
@@ -91,8 +94,6 @@ typedef PARSE_STAGE;
|
|||||||
#define ITEMCHOICESFILENAME_MILITIA_REGULAR "Inventory\\ItemChoices_Militia_Regular.xml"
|
#define ITEMCHOICESFILENAME_MILITIA_REGULAR "Inventory\\ItemChoices_Militia_Regular.xml"
|
||||||
#define ITEMCHOICESFILENAME_MILITIA_ELITE "Inventory\\ItemChoices_Militia_Elite.xml"
|
#define ITEMCHOICESFILENAME_MILITIA_ELITE "Inventory\\ItemChoices_Militia_Elite.xml"
|
||||||
#define IMPITEMCHOICESFILENAME "Inventory\\IMPItemChoices.xml"
|
#define IMPITEMCHOICESFILENAME "Inventory\\IMPItemChoices.xml"
|
||||||
#define LBEPOCKETFILENAME "Inventory\\Pockets.xml"
|
|
||||||
#define LBEPOCKETPOPUPFILENAME "Inventory\\PocketPopups.xml"
|
|
||||||
#define MERCSTARTINGGEARFILENAME "Inventory\\MercStartingGear.xml"
|
#define MERCSTARTINGGEARFILENAME "Inventory\\MercStartingGear.xml"
|
||||||
#define ENEMYWEAPONDROPSFILENAME "Inventory\\EnemyWeaponDrops.xml"
|
#define ENEMYWEAPONDROPSFILENAME "Inventory\\EnemyWeaponDrops.xml"
|
||||||
#define ENEMYAMMODROPSFILENAME "Inventory\\EnemyAmmoDrops.xml"
|
#define ENEMYAMMODROPSFILENAME "Inventory\\EnemyAmmoDrops.xml"
|
||||||
@@ -297,6 +298,10 @@ extern BOOLEAN WriteClothesStats();
|
|||||||
extern BOOLEAN ReadInRandomItemStats(STR fileName);
|
extern BOOLEAN ReadInRandomItemStats(STR fileName);
|
||||||
extern BOOLEAN WriteRandomItemStats();
|
extern BOOLEAN WriteRandomItemStats();
|
||||||
|
|
||||||
|
// Flugente: squad names
|
||||||
|
extern BOOLEAN ReadInSquadNamesStats(STR fileName);
|
||||||
|
extern BOOLEAN WriteSquadNamesStats();
|
||||||
|
|
||||||
extern BOOLEAN ReadInAmmoStats(STR fileName);
|
extern BOOLEAN ReadInAmmoStats(STR fileName);
|
||||||
extern BOOLEAN WriteAmmoStats();
|
extern BOOLEAN WriteAmmoStats();
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "Animation Data.h"
|
#include "Animation Data.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
|
#include "Map Screen Interface.h" // added by Flugente
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//forward declarations of common classes to eliminate includes
|
//forward declarations of common classes to eliminate includes
|
||||||
@@ -851,12 +852,18 @@ void RenderSquadList( void )
|
|||||||
if( sCounter < NUMBER_OF_SQUADS / 2 )
|
if( sCounter < NUMBER_OF_SQUADS / 2 )
|
||||||
{
|
{
|
||||||
// CHRISL:
|
// CHRISL:
|
||||||
FindFontCenterCoordinates( RADAR_WINDOW_TM_X , ( INT16 )( SQUAD_WINDOW_TM_Y + ( sCounter * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ) ,pSquadMenuStrings[ sCounter ] , SQUAD_FONT, &sX, &sY);
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
FindFontCenterCoordinates( RADAR_WINDOW_TM_X , ( INT16 )( SQUAD_WINDOW_TM_Y + ( sCounter * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ) , SquadNames[ sCounter ].squadname , SQUAD_FONT, &sX, &sY);
|
||||||
|
else
|
||||||
|
FindFontCenterCoordinates( RADAR_WINDOW_TM_X , ( INT16 )( SQUAD_WINDOW_TM_Y + ( sCounter * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ) ,pSquadMenuStrings[ sCounter ] , SQUAD_FONT, &sX, &sY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// CHRISL:
|
// CHRISL:
|
||||||
FindFontCenterCoordinates(RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH / 2, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter - ( NUMBER_OF_SQUADS / 2) ) * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), pSquadMenuStrings[ sCounter ] , SQUAD_FONT, &sX, &sY);
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
FindFontCenterCoordinates(RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH / 2, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter - ( NUMBER_OF_SQUADS / 2) ) * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), SquadNames[ sCounter ].squadname , SQUAD_FONT, &sX, &sY);
|
||||||
|
else
|
||||||
|
FindFontCenterCoordinates(RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH / 2, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter - ( NUMBER_OF_SQUADS / 2) ) * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), pSquadMenuStrings[ sCounter ] , SQUAD_FONT, &sX, &sY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// highlight line?
|
// highlight line?
|
||||||
@@ -893,7 +900,11 @@ void RenderSquadList( void )
|
|||||||
{
|
{
|
||||||
sX = RADAR_WINDOW_TM_X + ( RADAR_WINDOW_WIDTH / 2 ) - 2;
|
sX = RADAR_WINDOW_TM_X + ( RADAR_WINDOW_WIDTH / 2 ) - 2;
|
||||||
}
|
}
|
||||||
mprintf( sX, sY , pSquadMenuStrings[ sCounter ]);
|
|
||||||
|
if ( gGameExternalOptions.fUseXMLSquadNames )
|
||||||
|
mprintf( sX, sY , SquadNames[ sCounter ].squadname);
|
||||||
|
else
|
||||||
|
mprintf( sX, sY , pSquadMenuStrings[ sCounter ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user