Skip to content

Commit

Permalink
Fixed bug: form with replay buttons overlaps with options button
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Nov 23, 2024
1 parent 96ce8bf commit 7b4d296
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/hci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ void ReplayControllerWidget::run(W_CONTEXT *psContext)
}

static std::shared_ptr<W_SCREEN> replayOverlayScreen;
static std::shared_ptr<ReplayControllerWidget> replayControllerForm = nullptr;

bool createReplayControllerOverlay()
{
Expand All @@ -859,7 +860,7 @@ bool createReplayControllerOverlay()
replayOverlayScreen->psForm->hide();

// Create the Replay Controller form
auto replayControllerForm = ReplayControllerWidget::make();
replayControllerForm = ReplayControllerWidget::make();
replayOverlayScreen->psForm->attach(replayControllerForm);

// Position the Replay Controller form
Expand Down Expand Up @@ -975,6 +976,7 @@ void interfaceShutDown()
{
widgRemoveOverlayScreen(replayOverlayScreen);
replayOverlayScreen = nullptr;
replayControllerForm = nullptr;
}

groupsUI = nullptr;
Expand Down Expand Up @@ -2285,6 +2287,15 @@ bool intAddInGameOptionsButton()
}
}

// Position the Replay Controller form
if (replayControllerForm)
{
replayControllerForm->setCalcLayout([button, hiddenOptionsButton](WIDGET *psWidget) {
int y = hiddenOptionsButton ? 0 : button->y() + button->height();
psWidget->move(psWidget->x(), y);
});
}

return true;
}

Expand Down

0 comments on commit 7b4d296

Please sign in to comment.