diff --git a/Generals/Code/GameEngine/Include/GameClient/InGameUI.h b/Generals/Code/GameEngine/Include/GameClient/InGameUI.h index 59e753c1d05..b7a716a3df0 100644 --- a/Generals/Code/GameEngine/Include/GameClient/InGameUI.h +++ b/Generals/Code/GameEngine/Include/GameClient/InGameUI.h @@ -355,6 +355,7 @@ friend class Drawable; // for selection/deselection transactions virtual void update() override; ///< Update the UI by calling preDraw(), draw(), and postDraw() virtual void reset() override; ///< Reset //----------------------------------------------------------------------------------------------- + void validate(); // interface for the popup messages virtual void popupMessage( const AsciiString& message, Int x, Int y, Int width, Bool pause, Bool pauseMusic); diff --git a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp index 91c3bec2bf2..dbdccb47f1a 100644 --- a/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -924,9 +924,22 @@ void INI::parseInGameUIDefinition( INI* ini ) { // parse the ini weapon definition ini->initFromINI( TheInGameUI, TheInGameUI->getFieldParse() ); + TheInGameUI->validate(); } } +//------------------------------------------------------------------------------------------------- +void InGameUI::validate() +{ +#if ENABLE_GUI_HACKS + // TheSuperHackers @bugfix bobtista 02/09/2026 Correct the known retail InGameUI.ini message delay typo + if (m_messageDelayMS == 75000) + { + m_messageDelayMS = 7500; + } +#endif +} + //------------------------------------------------------------------------------------------------- namespace { @@ -1848,7 +1861,9 @@ void InGameUI::update() // frame // UnsignedInt currLogicFrame = TheGameLogic->getFrame(); - const int messageTimeout = m_messageDelayMS / LOGICFRAMES_PER_SECOND / 1000; + // TheSuperHackers @bugfix bobtista 13/08/2026 Convert milliseconds to logic frames. Dividing by + // both evaluated to floor(m_messageDelayMS / 30000), so MessageDelayMS had no effect below 30s + const int messageTimeout = REAL_TO_INT_CEIL( ConvertDurationFromMsecsToFrames( (Real)m_messageDelayMS ) ); UnsignedByte r, g, b, a; Int amount; for( i = MAX_UI_MESSAGES - 1; i >= 0; i-- ) diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h index ecc1c4fdaf5..85c889bccc3 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h @@ -369,6 +369,7 @@ friend class Drawable; // for selection/deselection transactions virtual void update() override; ///< Update the UI by calling preDraw(), draw(), and postDraw() virtual void reset() override; ///< Reset //----------------------------------------------------------------------------------------------- + void validate(); // interface for the popup messages virtual void popupMessage( const AsciiString& message, Int x, Int y, Int width, Bool pause, Bool pauseMusic); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp index e323d96d34d..8344da988b7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp @@ -953,9 +953,22 @@ void INI::parseInGameUIDefinition( INI* ini ) { // parse the ini weapon definition ini->initFromINI( TheInGameUI, TheInGameUI->getFieldParse() ); + TheInGameUI->validate(); } } +//------------------------------------------------------------------------------------------------- +void InGameUI::validate() +{ +#if ENABLE_GUI_HACKS + // TheSuperHackers @bugfix bobtista 02/09/2026 Correct the known retail InGameUI.ini message delay typo + if (m_messageDelayMS == 75000) + { + m_messageDelayMS = 7500; + } +#endif +} + //------------------------------------------------------------------------------------------------- namespace { @@ -1882,7 +1895,9 @@ void InGameUI::update() // frame // UnsignedInt currLogicFrame = TheGameLogic->getFrame(); - const int messageTimeout = m_messageDelayMS / LOGICFRAMES_PER_SECOND / 1000; + // TheSuperHackers @bugfix bobtista 13/08/2026 Convert milliseconds to logic frames. Dividing by + // both evaluated to floor(m_messageDelayMS / 30000), so MessageDelayMS had no effect below 30s + const int messageTimeout = REAL_TO_INT_CEIL( ConvertDurationFromMsecsToFrames( (Real)m_messageDelayMS ) ); UnsignedByte r, g, b, a; Int amount; for( i = MAX_UI_MESSAGES - 1; i >= 0; i-- )