mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-13 20:43:07 +00:00
Update controller focus to use a message box's default focus if available
This commit is contained in:
parent
57ae097257
commit
47b3674bac
1 changed files with 7 additions and 1 deletions
|
|
@ -288,7 +288,13 @@ namespace MWGui
|
||||||
|
|
||||||
// If we have more than one button, we need to set the focus to the first one.
|
// If we have more than one button, we need to set the focus to the first one.
|
||||||
if (mButtons.size() > 1)
|
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;
|
MyGUI::IntSize mainWidgetSize;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue