Skip to content
Open
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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

validateMessageDelay is a better name

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The name is probably general purpose so more things could go in there.


// interface for the popup messages
virtual void popupMessage( const AsciiString& message, Int x, Int y, Int width, Bool pause, Bool pauseMusic);
Expand Down
16 changes: 15 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;
Comment on lines +935 to +938

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Intentional delays are overridden

Every parsed InGameUI block that sets MessageDelayMS = 75000 is silently rewritten to 7500 when GUI hacks are enabled. Because this parser also handles layered and mod-provided InGameUI files, an intentional 75-second delay becomes 7.5 seconds, causing messages to fade roughly 67.5 seconds earlier than configured. The same issue appears in GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp:964-967. Restrict this correction to known retail source data rather than applying it to every parsed value.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp
Line: 935-938

Comment:
**Intentional delays are overridden**

Every parsed `InGameUI` block that sets `MessageDelayMS = 75000` is silently rewritten to `7500` when GUI hacks are enabled. Because this parser also handles layered and mod-provided InGameUI files, an intentional 75-second delay becomes 7.5 seconds, causing messages to fade roughly 67.5 seconds earlier than configured. The same issue appears in `GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp:964-967`. Restrict this correction to known retail source data rather than applying it to every parsed value.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

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.

This also affects intentional 75000 values when GUI hacks are enabled. I’m keeping the guarded correction per Mauller’s recommendation

}
#endif
}

//-------------------------------------------------------------------------------------------------
namespace
{
Expand Down Expand Up @@ -1848,7 +1861,8 @@ 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
const int messageTimeout = REAL_TO_INT_CEIL( ConvertDurationFromMsecsToFrames( (Real)max(0, 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.

The clamp would be a better fit in the validate function.

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
16 changes: 15 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,8 @@ 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
const int messageTimeout = REAL_TO_INT_CEIL( ConvertDurationFromMsecsToFrames( (Real)max(0, m_messageDelayMS) ) );
UnsignedByte r, g, b, a;
Int amount;
for( i = MAX_UI_MESSAGES - 1; i >= 0; i-- )
Expand Down
Loading