1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-12 19:13:07 +00:00

Update controller focus to use a message box's default focus if available

This commit is contained in:
Andrew Lanzone 2025-06-09 22:03:12 -07:00
parent 57ae097257
commit 47b3674bac

View file

@ -288,7 +288,13 @@ namespace MWGui
// If we have more than one button, we need to set the focus to the first one.
if (mButtons.size() > 1)
mButtons[0]->setStateSelected(true);
{
mControllerFocus = 0;
if (mDefaultFocus >= 0 && mDefaultFocus < static_cast<int>(mButtons.size()))
mControllerFocus = mDefaultFocus;
for (int i = 0; i < static_cast<int>(mButtons.size()); ++i)
mButtons[i]->setStateSelected(i == mControllerFocus);
}
}
MyGUI::IntSize mainWidgetSize;