Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Generals/Code/GameEngine/Include/GameClient/InGameUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 16 additions & 1 deletion Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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 ) );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could check for the invalid ini value being loaded and then correct it within a validate function.

Then just place that within a ENABLE_GUI_HACKS block.

Similar to what i have done for smudge particles

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense. I’ll keep the unit-conversion fix unconditional, add an InGameUI::validate() call after parsing, and normalize the known retail value from 75000 to 7500 under ENABLE_GUI_HACKS. I’d keep the GamePatch2 change as the source-data fix, while validation handles stock or unpatched game data.

UnsignedByte r, g, b, a;
Int amount;
for( i = MAX_UI_MESSAGES - 1; i >= 0; i-- )
Expand Down
1 change: 1 addition & 0 deletions GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 16 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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-- )
Expand Down
Loading