First step in making the Cities.xml useable with other languages (Russian.Cities.xml, ...)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2311 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2008-08-18 12:49:34 +00:00
parent 7e37a07476
commit e3dd3f5487
3 changed files with 26 additions and 4 deletions
+12 -2
View File
@@ -574,7 +574,7 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
strcpy(fileName, directoryName); strcpy(fileName, directoryName);
strcat(fileName, CITYTABLEFILENAME); strcat(fileName, CITYTABLEFILENAME);
if(!ReadInMapStructure(fileName)) if(!ReadInMapStructure(fileName, FALSE))
return FALSE; return FALSE;
#ifdef RUSSIAN #ifdef RUSSIAN
@@ -582,7 +582,17 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
if ( FileExists(fileName) ) if ( FileExists(fileName) )
{ {
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName)); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInMapStructure(fileName)) if(!ReadInMapStructure(fileName, TRUE))
return FALSE;
}
#endif
#ifdef GERMAN
AddLanguagePrefix( fileName, GERMAN_PREFIX);
if ( FileExists(fileName) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
if(!ReadInMapStructure(fileName, TRUE))
return FALSE; return FALSE;
} }
#endif #endif
+13 -1
View File
@@ -314,6 +314,8 @@ extern STR16 pBullseyeStrings[];
extern void HandleRPCDescription( ); extern void HandleRPCDescription( );
BOOLEAN locTextOnly;
#ifdef CRIPPLED_VERSION #ifdef CRIPPLED_VERSION
void CrippledVersionFailureToLoadMapCallBack( UINT8 bExitValue ); void CrippledVersionFailureToLoadMapCallBack( UINT8 bExitValue );
@@ -808,6 +810,10 @@ typedef struct
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1]; CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
cityInfo curCityInfo; cityInfo curCityInfo;
//cityInfo * curArray; // ROMAN: added
//UINT32 maxArraySize; // ROMAN: added
UINT32 uiRowNumber; UINT32 uiRowNumber;
UINT32 uiHighestIndex; UINT32 uiHighestIndex;
@@ -1186,6 +1192,10 @@ BOOLEAN ReadInStrategicMapSectorTownNames(STR fileName)
memset(&pData,0,sizeof(pData)); memset(&pData,0,sizeof(pData));
// TODO: ROMAN
//pData.curCityInfo
NUM_TOWNS = 0; NUM_TOWNS = 0;
XML_SetUserData(parser, &pData); XML_SetUserData(parser, &pData);
@@ -1208,10 +1218,12 @@ BOOLEAN ReadInStrategicMapSectorTownNames(STR fileName)
return TRUE; return TRUE;
} }
BOOLEAN ReadInMapStructure(STR fileName) BOOLEAN ReadInMapStructure(STR fileName, BOOLEAN localizedVersion)
{ {
memset(StrategicMap, 0, sizeof(StrategicMap)); memset(StrategicMap, 0, sizeof(StrategicMap));
locTextOnly = localizedVersion;
return ReadInStrategicMapSectorTownNames(fileName); return ReadInStrategicMapSectorTownNames(fileName);
} }
+1 -1
View File
@@ -81,7 +81,7 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ ); void UpdateMercsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
void UpdateMercInSector( SOLDIERTYPE *pSoldier, INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ ); void UpdateMercInSector( SOLDIERTYPE *pSoldier, INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
BOOLEAN ReadInMapStructure(STR fileName); BOOLEAN ReadInMapStructure(STR fileName, BOOLEAN localizedVersion);
BOOLEAN ReadInStrategicMapSectorTownNames(STR fileName); BOOLEAN ReadInStrategicMapSectorTownNames(STR fileName);
BOOLEAN WriteInStrategicMapSectorTownNames(STR fileName); BOOLEAN WriteInStrategicMapSectorTownNames(STR fileName);