- Improved LoadScreenHint feature

o The load screen hint is now also shown in strategic log and tactical log

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6396 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-09-12 11:09:25 +00:00
parent 6b37cd418b
commit aba5c67ec8
18 changed files with 67 additions and 10 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ BOOLEAN EnterMPCScreen()
CHECKF(AddVideoObject(&VObjectDesc, &guiMPCMainBackGroundImage ));
CreateLoadingScreenProgressBar();
CreateLoadingScreenProgressBar(TRUE);
// default to red connecting color
SetProgressBarColor(0,150,0,0);
SetRelativeStartAndEndPercentage(0,0,100,L"");
Binary file not shown.
+1 -1
View File
@@ -4360,7 +4360,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
BeginLoadScreen();
}
CreateLoadingScreenProgressBar();
CreateLoadingScreenProgressBar(FALSE);
SetProgressBarColor( 0, 0, 0, 150 );
#ifdef JA2BETAVERSION
+1
View File
@@ -4462,6 +4462,7 @@ UINT32 MapScreenHandle(void)
INT32 iCounter = 0;
INT32 iCounter2 = 0;
ShowLoadScreenHintInStrategicLog();
//DO NOT MOVE THIS FUNCTION CALL!!!
//This determines if the help screen should be active
+1 -1
View File
@@ -2948,7 +2948,7 @@ BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ )
AssertMsg( 0, "Failed to find Placeholder1.dat (placeholder map)." );
}
CreateLoadingScreenProgressBar();
CreateLoadingScreenProgressBar(TRUE);
#ifdef JA2BETAVERSION
//set the font
SetProgressBarMsgAttributes( 0, FONT12ARIAL, FONT_MCOLOR_WHITE, 0 );
+44 -3
View File
@@ -15,6 +15,8 @@
#include "random.h"
#include "math.h"
#include "WordWrap.h"
#include "Message.h"
#include "Text.h"
#endif
double rStart, rEnd;
@@ -33,10 +35,12 @@ extern BOOLEAN bShowSmallImage;
// Flugente: stuff needed for loadscreen hints
extern UINT16 num_found_loadscreenhints;
static UINT16 usCurrentLoadScreenHint = 0;
static BOOLEAN bShowLoadScreenHintInLog = FALSE; // FALSE: No Display in Strategic/Tactical Log, TRUE: Display in Strategic/Tactical Log
void CreateLoadingScreenProgressBar()
void CreateLoadingScreenProgressBar(BOOLEAN resetLoadScreenHint)
{
ResetLoadScreenHint();
if (resetLoadScreenHint)
ResetLoadScreenHint();
gusLeftmostShaded = 162;
@@ -235,6 +239,34 @@ void RemoveProgressBar( UINT8 ubID )
void ResetLoadScreenHint()
{
usCurrentLoadScreenHint = 0;
bShowLoadScreenHintInLog = FALSE;
}
void ShowLoadScreenHintInLoadScreen(UINT16 bottomPosition)
{
DisplayWrappedString( 0, bottomPosition, SCREEN_WIDTH, 2, FONT12ARIAL, FONT_GRAY2, zLoadScreenHint[usCurrentLoadScreenHint].szName, FONT_MCOLOR_BLACK, TRUE, CENTER_JUSTIFIED );
// Next show the hint in the log (strategic / tactical)
bShowLoadScreenHintInLog = TRUE;
}
void ShowLoadScreenHintInStrategicLog()
{
// We should display the hint in strategic log
if (bShowLoadScreenHintInLog == TRUE && gGameExternalOptions.gfUseLoadScreenHints && usCurrentLoadScreenHint )
{
ScreenMsg( FONT_GRAY2, MSG_INTERFACE, New113Message[MSG113_HINT_TEXT], zLoadScreenHint[usCurrentLoadScreenHint].szName);
bShowLoadScreenHintInLog = FALSE;
}
}
void ShowLoadScreenHintInTacticalLog()
{
if (bShowLoadScreenHintInLog == TRUE && gGameExternalOptions.gfUseLoadScreenHints && usCurrentLoadScreenHint)
{
ScreenMsg( FONT_GRAY2, MSG_INTERFACE, New113Message[MSG113_HINT_TEXT], zLoadScreenHint[usCurrentLoadScreenHint].szName);
bShowLoadScreenHintInLog = FALSE;
}
}
// Flugente: this function selects the next hint to display, and makes sure it is not played again during this run of the exe
@@ -274,6 +306,15 @@ void SetNewLoadScreenHint()
}
UINT16 sel = possiblehints[ Random(lastfnd) ];
// WANNE: All the loadscreen hints we have, have already been displayed. No matter, re-display a random loadscreen
if (sel <= 0 || sel > num_found_loadscreenhints)
{
sel = Random(num_found_loadscreenhints);
if (sel == 0)
sel++;
}
zLoadScreenHint[sel].fAlreadyShown = TRUE;
usCurrentLoadScreenHint = sel;
@@ -349,7 +390,7 @@ void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT16 uiRelStartPerc, UINT16
// Flugente: loadscreen hints
if (gGameExternalOptions.gfUseLoadScreenHints && usCurrentLoadScreenHint )
{
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 );
ShowLoadScreenHintInLoadScreen(pCurr->usBarBottom + 3 - 100);
}
}
+4 -1
View File
@@ -47,6 +47,9 @@ 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();
void ShowLoadScreenHintInLoadScreen(UINT16 bottomPosition);
void ShowLoadScreenHintInStrategicLog();
void ShowLoadScreenHintInTacticalLog();
// -------- 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!!!
@@ -90,7 +93,7 @@ void ResetLoadScreenHint();
#define WH40K_SOLDIER_ILLUSION 0x40000000 //1073741824 // Soldier is an Illusion
#define WH40K_SOLDIER_KILLSTREAK 0x80000000 //2147483648 // Soldier is on a kill streak*/
void CreateLoadingScreenProgressBar();
void CreateLoadingScreenProgressBar(BOOLEAN resetLoadScreenHint);
void RemoveLoadingScreenProgressBar();
+2
View File
@@ -2316,6 +2316,8 @@ enum
MSG113_INVENTORY_APS_INSUFFICIENT,
MSG113_HINT_TEXT,
TEXT_NUM_MSG113,
};
+1
View File
@@ -6220,6 +6220,7 @@ STR16 New113Message[] =
L"注意: 敌人尸体被发现!!!",
L"%s [%d rnds]\n%s %1.1f %s",
L"AP不够!需要%d,你只有%d。", //L"Insufficient AP Points! Cost %d, you have %d.",
L"Hint: %s", // TODO.Translate
};
STR16 New113HAMMessage[] =
+1
View File
@@ -6225,6 +6225,7 @@ STR16 New113Message[] =
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
L"Hint: %s", // TODO.Translate
};
// TODO.Translate
+1
View File
@@ -6219,6 +6219,7 @@ STR16 New113Message[] =
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
L"Insufficient AP Points! Cost %d, you have %d.",
L"Hint: %s",
};
STR16 New113HAMMessage[] =
+1
View File
@@ -6216,6 +6216,7 @@ STR16 New113Message[] =
L"Attention: Cadavre ennemi trouvé !!!",
L"%s [%d rnds]\n%s %1.1f %s",
L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
L"Hint: %s", // TODO.Translate
};
STR16 New113HAMMessage[] =
+1
View File
@@ -6047,6 +6047,7 @@ STR16 New113Message[] =
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
L"Zu wenig APs! Es werden %d APs benötigt, Sie haben aber nur %d APs.",
L"Tipp: %s",
};
STR16 New113HAMMessage[] =
+1
View File
@@ -6212,6 +6212,7 @@ STR16 New113Message[] =
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
L"Hint: %s", // TODO.Translate
};
// TODO.Translate
+1
View File
@@ -6227,6 +6227,7 @@ STR16 New113Message[] =
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
L"Hint: %s", // TODO.Translate
};
STR16 New113HAMMessage[] =
+1
View File
@@ -6219,6 +6219,7 @@ STR16 New113Message[] =
L"Внимание: враг обнаружил труп!!!",
L"%s [%d патр.]\n%s %1.1f %s",
L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
L"Hint: %s", // TODO.Translate
};
STR16 New113HAMMessage[] =
+1
View File
@@ -6229,6 +6229,7 @@ STR16 New113Message[] =
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
L"Hint: %s", // TODO.Translate
};
// TODO.Translate
+4 -3
View File
@@ -83,6 +83,7 @@
#include "Random.h"
#include "editscreen.h"
#include "Scheduling.h"
#include "Animated ProgressBar.h"
#endif
#include "connect.h"
@@ -241,7 +242,7 @@ void FadeOutGameScreen( )
}
void EnterTacticalScreen( )
{
{
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen"));
guiTacticalLeaveScreen = FALSE;
@@ -359,8 +360,7 @@ void EnterTacticalScreen( )
// ATE: Enable messages again...
EnableScrollMessages( );
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: done"));
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("EnterTacticalScreen: done"));
}
void LeaveTacticalScreen( UINT32 uiNewScreen )
@@ -678,6 +678,7 @@ UINT32 MainGameScreenHandle(void)
{
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("maingamescreenhandle: entertacticalscreen"));
EnterTacticalScreen( );
ShowLoadScreenHintInTacticalLog();
// Select a guy if he hasn;'
if( !gfTacticalPlacementGUIActive )