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
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,11 @@ const Image *ControlBar::getStarImage()
return nullptr;
}

if(TheGameLogic->getFrame()% LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND/2)
// TheSuperHackers @tweak bobtista 27/06/2026 Blink the general-promotion star on a
// wall-clock cycle so the blink rate is independent of the render frame rate and the
// logic time scale, and freezes while the game is paused.
const UnsignedInt blinkPeriodMs = 1000;
if( !TheGameLogic->isGamePaused() && timeGetTime() % blinkPeriodMs >= blinkPeriodMs / 2 )

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 Paused-state behavior contradicts the PR's stated goal

The PR description says the fix "keeps blinking while paused," but !TheGameLogic->isGamePaused() short-circuits the whole expression to false when the game is paused, meaning the star always shows the non-highlighted (normal) image during pause — blinking is fully suppressed. The code comment even acknowledges this by saying "freezes while the game is paused." This doesn't fix the original problem of the stars stopping their blink during pause; it just replaces a stuck-on-highlight state with a stuck-on-normal state. If the intent truly is to keep the star blinking while paused, the !TheGameLogic->isGamePaused() && guard should be removed so timeGetTime() drives the blink unconditionally. The same issue is present in GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp line 1688.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
Line: 1688

Comment:
**Paused-state behavior contradicts the PR's stated goal**

The PR description says the fix "keeps blinking while paused," but `!TheGameLogic->isGamePaused()` short-circuits the whole expression to `false` when the game is paused, meaning the star always shows the non-highlighted (normal) image during pause — blinking is fully suppressed. The code comment even acknowledges this by saying "freezes while the game is paused." This doesn't fix the original problem of the stars stopping their blink during pause; it just replaces a stuck-on-highlight state with a stuck-on-normal state. If the intent truly is to keep the star blinking while paused, the `!TheGameLogic->isGamePaused() &&` guard should be removed so `timeGetTime()` drives the blink unconditionally. The same issue is present in `GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp` line 1688.

How can I resolve this? If you propose a fix, please make it concise.

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 was fixed

{
GadgetButtonSetEnabledImage(win, m_generalButtonHighlight);
return nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,11 @@ const Image *ControlBar::getStarImage()
return nullptr;
}

if(TheGameLogic->getFrame()% LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND/2)
// TheSuperHackers @tweak bobtista 27/06/2026 Blink the general-promotion star on a
// wall-clock cycle so the blink rate is independent of the render frame rate and the
// logic time scale, and freezes while the game is paused.
const UnsignedInt blinkPeriodMs = 1000;
if( !TheGameLogic->isGamePaused() && timeGetTime() % blinkPeriodMs >= blinkPeriodMs / 2 )
{
GadgetButtonSetEnabledImage(win, m_generalButtonHighlight);
return nullptr;
Expand Down
Loading