mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Merged from revision: 6953
- Increased text limit for load screen hints from 190 to 254 o Hopefully this does not cause any problems when rendering on the loadscreens. Tests resulted in success - Support for localization of LoadScreenHints.xml (*.LoadScreenHints.xml) o Now the language specific xmls only have the <uiIndex> and <szName> attributes. All other attributes are in the LoadScreenHints.xml git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6954 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -385,26 +385,17 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, LOADSCREENHINTSFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName, FALSE),LOADSCREENHINTSFILENAME);
|
||||
|
||||
#ifndef ENGLISH
|
||||
AddLanguagePrefix(fileName);
|
||||
if ( FileExists(fileName) )
|
||||
{
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName,TRUE), fileName);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef ENGLISH
|
||||
AddLanguagePrefix(fileName);
|
||||
|
||||
if ( FileExists(fileName) )
|
||||
{
|
||||
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName),LOADSCREENHINTSFILENAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
//CHRISL: If we fail to load, try loading just the default english
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, LOADSCREENHINTSFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName),LOADSCREENHINTSFILENAME);
|
||||
}
|
||||
#else
|
||||
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName),LOADSCREENHINTSFILENAME);
|
||||
#endif
|
||||
|
||||
|
||||
strcpy(fileName, directoryName);
|
||||
strcat(fileName, ARMOURSFILENAME);
|
||||
SGP_THROW_IFFALSE(ReadInArmourStats(fileName),ARMOURSFILENAME);
|
||||
|
||||
+1
-1
@@ -323,7 +323,7 @@ extern BOOLEAN ReadInSquadNamesStats(STR fileName);
|
||||
extern BOOLEAN WriteSquadNamesStats();
|
||||
|
||||
// Flugente: loadscreen hints
|
||||
extern BOOLEAN ReadInLoadScreenHints(STR fileName);
|
||||
extern BOOLEAN ReadInLoadScreenHints(STR fileName, BOOLEAN localizedVersion);
|
||||
extern BOOLEAN WriteLoadScreenHints();
|
||||
|
||||
// Flugente: soldier profiles
|
||||
|
||||
@@ -24,6 +24,8 @@ struct
|
||||
}
|
||||
typedef enemyRankParseData;
|
||||
|
||||
BOOLEAN localizedTextOnly_LoadScreenHints;
|
||||
|
||||
UINT16 num_found_loadscreenhints = 0; // the correct number is set on reading the xml
|
||||
|
||||
LOADSCREENHINT_STRUCT zLoadScreenHint[LOADSCREENHINT_MAX];
|
||||
@@ -39,7 +41,8 @@ loadscreenhintsStartElementHandle(void *userData, const XML_Char *name, const XM
|
||||
{
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
memset(pData->curArray,0,sizeof(LOADSCREENHINT_STRUCT)*pData->maxArraySize);
|
||||
if (!localizedTextOnly_LoadScreenHints)
|
||||
memset(pData->curArray,0,sizeof(LOADSCREENHINT_STRUCT)*pData->maxArraySize);
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
@@ -47,7 +50,8 @@ loadscreenhintsStartElementHandle(void *userData, const XML_Char *name, const XM
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
memset(&pData->curLoadScreenHint,0,sizeof(LOADSCREENHINT_STRUCT));
|
||||
if (!localizedTextOnly_LoadScreenHints)
|
||||
memset(&pData->curLoadScreenHint,0,sizeof(LOADSCREENHINT_STRUCT));
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
@@ -104,7 +108,14 @@ loadscreenhintsEndElementHandle(void *userData, const XML_Char *name)
|
||||
|
||||
if(pData->curLoadScreenHint.uiIndex < pData->maxArraySize)
|
||||
{
|
||||
pData->curArray[pData->curLoadScreenHint.uiIndex] = pData->curLoadScreenHint;
|
||||
if (!localizedTextOnly_LoadScreenHints)
|
||||
{
|
||||
pData->curArray[pData->curLoadScreenHint.uiIndex] = pData->curLoadScreenHint;
|
||||
}
|
||||
else
|
||||
{
|
||||
wcscpy(zLoadScreenHint[pData->curLoadScreenHint.uiIndex].szName, pData->curLoadScreenHint.szName);
|
||||
}
|
||||
}
|
||||
|
||||
num_found_loadscreenhints = pData->curLoadScreenHint.uiIndex;
|
||||
@@ -172,7 +183,7 @@ loadscreenhintsEndElementHandle(void *userData, const XML_Char *name)
|
||||
pData->currentDepth--;
|
||||
}
|
||||
|
||||
BOOLEAN ReadInLoadScreenHints(STR fileName)
|
||||
BOOLEAN ReadInLoadScreenHints(STR fileName, BOOLEAN localizedVersion)
|
||||
{
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead;
|
||||
@@ -182,6 +193,8 @@ BOOLEAN ReadInLoadScreenHints(STR fileName)
|
||||
|
||||
enemyRankParseData pData;
|
||||
|
||||
localizedTextOnly_LoadScreenHints = localizedVersion;
|
||||
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading LoadScreenHints.xml" );
|
||||
|
||||
// Open file
|
||||
|
||||
@@ -35,7 +35,9 @@ extern PROGRESSBAR *pBar[ MAX_PROGRESSBARS ];
|
||||
typedef struct
|
||||
{
|
||||
UINT16 uiIndex;
|
||||
CHAR16 szName[190]; // text of the hint. Note that this size + any text it is used in msut be < than CHAR16 pzText[ 200 ]; of VIDEO_OVERLAY_DESC if you display this in any logs
|
||||
// WANNE: I changed them from 190 to 256 because otherwise it is too short for the loadscreen hints. I works just fine even if it is > 200.
|
||||
CHAR16 szName[256]; // text of the hint. Note that this size + any text it is used in msut be < than CHAR16 pzText[ 200 ]; of VIDEO_OVERLAY_DESC if you display this in any logs
|
||||
|
||||
UINT32 usFlags; // flags that can be used to determine wether a hint is currently appropriate
|
||||
BOOLEAN fAlreadyShown; // to remember if this hint has already been shown in this game (reset on starting exe)
|
||||
} LOADSCREENHINT_STRUCT;
|
||||
|
||||
Reference in New Issue
Block a user