- Bugfix: LoadScreenHints

o Added support for language specific (German, Russian, ...) LoadScreenHints (*.LoadScreenHints.xml)
o Added support for long (multi line) load screen hints (there will be an automatic line break in long load screen hints text)
o Reset load screen hint text to 0 (no display), because otherwise the old load screen will also be shown underneath the correct new one which resulted in an unreadable text mess

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6053 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-05-02 19:50:21 +00:00
parent 15696994a0
commit 3083ac66b3
4 changed files with 32 additions and 3 deletions
+19 -1
View File
@@ -386,8 +386,26 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
strcpy(fileName, directoryName);
strcat(fileName, LOADSCREENHINTSFILENAME);
SGP_THROW_IFFALSE(ReadInLoadScreenHints(fileName),LOADSCREENHINTSFILENAME);
#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);
+3
View File
@@ -2883,6 +2883,9 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ )
UNDERGROUND_SECTORINFO *pNode = NULL;
CHAR8 bFilename[ 50 ];
// Reset
//ResetLoadScreenHint();
// pause game
PauseGame( );
+9 -2
View File
@@ -32,6 +32,8 @@ extern BOOLEAN bShowSmallImage;
void CreateLoadingScreenProgressBar()
{
ResetLoadScreenHint();
gusLeftmostShaded = 162;
//// Special case->show small image centered
@@ -224,6 +226,11 @@ void RemoveProgressBar( UINT8 ubID )
extern UINT16 num_found_loadscreenhints;
static UINT16 usCurrentLoadScreenHint = 0;
void ResetLoadScreenHint()
{
usCurrentLoadScreenHint = 0;
}
// Flugente: this function selects the next hint to display, and makes sure it is not played again during this run of the exe
void SetNewLoadScreenHint()
{
@@ -335,8 +342,8 @@ void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT16 uiRelStartPerc, UINT16
// Flugente: loadscreen hints
if (gGameExternalOptions.gfUseLoadScreenHints && usCurrentLoadScreenHint )
{
DrawTextToScreen( zLoadScreenHint[usCurrentLoadScreenHint].szName, 1, pCurr->usBarBottom + 3 - 200, SCREEN_WIDTH - 1, FONT12ARIAL, FONT_MCOLOR_WHITE, 0, FALSE, INVALIDATE_TEXT | CENTER_JUSTIFIED );
{
DisplayWrappedString( 10, pCurr->usBarBottom + 3 - 100, SCREEN_WIDTH - 10, 2, FONT12ARIAL, FONT_MCOLOR_WHITE, zLoadScreenHint[usCurrentLoadScreenHint].szName, FONT_MCOLOR_BLACK, FALSE, INVALIDATE_TEXT | CENTER_JUSTIFIED );
}
}
+1
View File
@@ -46,6 +46,7 @@ extern LOADSCREENHINT_STRUCT zLoadScreenHint[LOADSCREENHINT_MAX];
// Flugente: this function selects the next hint to display, and makes sure it is not played again during this run of the exe
void SetNewLoadScreenHint();
void ResetLoadScreenHint();
// -------- added by Flugente: various flags for loadscreen hints--------
// easier than adding 32 differently named variables. DO NOT CHANGE THEM, UNLESS YOU KNOW WHAT YOU ARE DOING!!!