diff --git a/MPConnectScreen.cpp b/MPConnectScreen.cpp index 100e2230..baa7c02e 100644 --- a/MPConnectScreen.cpp +++ b/MPConnectScreen.cpp @@ -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""); diff --git a/Options Screen.cpp b/Options Screen.cpp index fcc055fd..89e8e52a 100644 Binary files a/Options Screen.cpp and b/Options Screen.cpp differ diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index fe0f06fa..7eff63c4 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -4360,7 +4360,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID ) BeginLoadScreen(); } - CreateLoadingScreenProgressBar(); + CreateLoadingScreenProgressBar(FALSE); SetProgressBarColor( 0, 0, 0, 150 ); #ifdef JA2BETAVERSION diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index c0f6511b..93e74209 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -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 diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index c25691b2..96145020 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -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 ); diff --git a/Utils/Animated ProgressBar.cpp b/Utils/Animated ProgressBar.cpp index fb485b76..f59a085a 100644 --- a/Utils/Animated ProgressBar.cpp +++ b/Utils/Animated ProgressBar.cpp @@ -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); } } diff --git a/Utils/Animated ProgressBar.h b/Utils/Animated ProgressBar.h index 48291336..2ce25127 100644 --- a/Utils/Animated ProgressBar.h +++ b/Utils/Animated ProgressBar.h @@ -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(); diff --git a/Utils/Text.h b/Utils/Text.h index 53f6449e..627ef2f3 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -2316,6 +2316,8 @@ enum MSG113_INVENTORY_APS_INSUFFICIENT, + MSG113_HINT_TEXT, + TEXT_NUM_MSG113, }; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index c5759976..00ffd31b 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -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[] = diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 26781850..c3b78a5e 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -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 diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 0c743c0f..dfdef38b 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -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[] = diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index e146009f..360f34ea 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -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[] = diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 0f9275a6..8fa969ad 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -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[] = diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 54b093f2..ae777810 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -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 diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index a22ccb14..06c5bb32 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -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[] = diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 9008a255..bf817637 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -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[] = diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp index e456199c..ea873025 100644 --- a/Utils/_TaiwaneseText.cpp +++ b/Utils/_TaiwaneseText.cpp @@ -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 diff --git a/gamescreen.cpp b/gamescreen.cpp index a3446287..b4b67d9c 100644 --- a/gamescreen.cpp +++ b/gamescreen.cpp @@ -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 )