mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Merged from revision: 7134
- Externalized country name and noun to cities.xml (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7135 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -6348,14 +6348,20 @@ BOOLEAN CanEntireMovementGroupMercIsInMove( SOLDIERTYPE *pSoldier, INT8 *pbError
|
||||
|
||||
void ReportMapScreenMovementError( INT8 bErrorNumber )
|
||||
{
|
||||
if ( bErrorNumber == -99 )
|
||||
CHAR16 sString[ 1024 ];
|
||||
|
||||
switch( bErrorNumber )
|
||||
{
|
||||
// - 99 is a special message # indicating a customized message
|
||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, gsCustomErrorString, MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback );
|
||||
}
|
||||
else
|
||||
{
|
||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapErrorString[ bErrorNumber ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback );
|
||||
case -99:
|
||||
// - 99 is a special message # indicating a customized message
|
||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, gsCustomErrorString, MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback );
|
||||
break;
|
||||
case 8:
|
||||
swprintf( sString, pMapErrorString[ 8 ], pCountryNames[COUNTRY_NAME] );
|
||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback );
|
||||
break;
|
||||
default:
|
||||
DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapErrorString[ bErrorNumber ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,14 @@ extern int MAP_ITEMDESC_START_X;
|
||||
// HEADROCK HAM B2.7: Moved here from Strategicmap.cpp to allow use by MilitiaSquads.cpp
|
||||
|
||||
extern BOOLEAN gfMilitiaAllowedInTown [ MAX_TOWNS ];
|
||||
|
||||
// Country name identifiers
|
||||
enum
|
||||
{
|
||||
COUNTRY_NAME,
|
||||
COUNTRY_NOUN,
|
||||
} ;
|
||||
|
||||
// Sector name identifiers
|
||||
enum Towns
|
||||
{
|
||||
|
||||
@@ -862,7 +862,10 @@ typedef enum
|
||||
CITYTABLE_ELEMENT_ICONFILE,
|
||||
CITYTABLE_ELEMENT_ICON_POSITION,
|
||||
CITYTABLE_ELEMENT_ICON_POSITION_X,
|
||||
CITYTABLE_ELEMENT_ICON_POSITION_Y
|
||||
CITYTABLE_ELEMENT_ICON_POSITION_Y,
|
||||
CITYTABLE_ELEMENT_COUNTRYINFO,
|
||||
CITYTABLE_ELEMENT_COUNTRYNAME,
|
||||
CITYTABLE_ELEMENT_COUNTRYNOUN
|
||||
|
||||
} CITYTABLE_PARSE_STAGE;
|
||||
|
||||
@@ -888,6 +891,8 @@ typedef struct
|
||||
CITYTABLE_PARSE_STAGE curElement;
|
||||
|
||||
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
|
||||
CHAR8 countryName[MAX_TOWN_NAME_LENGHT];
|
||||
CHAR8 countryNoun[MAX_TOWN_NAME_LENGHT];
|
||||
cityInfo curCityInfo;
|
||||
|
||||
//cityInfo * curArray; // ROMAN: added
|
||||
@@ -909,7 +914,6 @@ citytableStartElementHandle(void *userData, const XML_Char *name, const XML_Char
|
||||
|
||||
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
||||
{
|
||||
|
||||
if(strcmp(name, "CITY_INFO") == 0 && pData->curElement == CITYTABLE_ELEMENT_NONE)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_CITYINFO;
|
||||
@@ -1065,6 +1069,21 @@ citytableStartElementHandle(void *userData, const XML_Char *name, const XML_Char
|
||||
pData->curElement = CITYTABLE_ELEMENT_TOWNPOINT_Y;
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "COUNTRY") == 0 && pData->curElement == CITYTABLE_ELEMENT_CITYINFO)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_COUNTRYINFO;
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "countryName") == 0 && pData->curElement == CITYTABLE_ELEMENT_COUNTRYINFO)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_COUNTRYNAME;
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
else if(strcmp(name, "countryNoun") == 0 && pData->curElement == CITYTABLE_ELEMENT_COUNTRYINFO)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_COUNTRYNOUN;
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
|
||||
//pData->szCharData[0] = '\0';
|
||||
}
|
||||
@@ -1299,6 +1318,36 @@ char temp;
|
||||
|
||||
pData->curCityInfo.townPoint.y = atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "COUNTRY") == 0 && pData->curElement == CITYTABLE_ELEMENT_COUNTRYINFO)
|
||||
{
|
||||
pData->curElement = CITYTABLE_ELEMENT_CITYINFO;
|
||||
|
||||
if ( !localizedMapTextOnly )
|
||||
{
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->countryName, -1, pCountryNames[COUNTRY_NAME], MAX_TOWN_NAME_LENGHT);
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->countryNoun, -1, pCountryNames[COUNTRY_NOUN], MAX_TOWN_NAME_LENGHT);
|
||||
|
||||
}
|
||||
else if ( localizedMapTextOnly )
|
||||
{
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->countryName, -1, pCountryNames[COUNTRY_NAME], MAX_TOWN_NAME_LENGHT);
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->countryNoun, -1, pCountryNames[COUNTRY_NOUN], MAX_TOWN_NAME_LENGHT);
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "countryName") == 0 && pData->curElement == CITYTABLE_ELEMENT_COUNTRYNAME)
|
||||
{
|
||||
strncpy(pData->countryName, pData->szCharData, MAX_TOWN_NAME_LENGHT - 1);
|
||||
pData->countryName[MAX_TOWN_NAME_LENGHT - 1] = 0;
|
||||
|
||||
pData->curElement = CITYTABLE_ELEMENT_COUNTRYINFO;
|
||||
}
|
||||
else if(strcmp(name, "countryNoun") == 0 && pData->curElement == CITYTABLE_ELEMENT_COUNTRYNOUN)
|
||||
{
|
||||
strncpy(pData->countryNoun, pData->szCharData, MAX_TOWN_NAME_LENGHT - 1);
|
||||
pData->countryNoun[MAX_TOWN_NAME_LENGHT - 1] = 0;
|
||||
|
||||
pData->curElement = CITYTABLE_ELEMENT_COUNTRYINFO;
|
||||
}
|
||||
|
||||
pData->maxReadDepth--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user