From 47b3674bac55d9efb02d3f172cad1407740e71c0 Mon Sep 17 00:00:00 2001 From: Andrew Lanzone Date: Mon, 9 Jun 2025 22:03:12 -0700 Subject: [PATCH] Update controller focus to use a message box's default focus if available --- apps/openmw/mwgui/messagebox.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/messagebox.cpp b/apps/openmw/mwgui/messagebox.cpp index c7e997a565..80b2a34a5b 100644 --- a/apps/openmw/mwgui/messagebox.cpp +++ b/apps/openmw/mwgui/messagebox.cpp @@ -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(mButtons.size())) + mControllerFocus = mDefaultFocus; + for (int i = 0; i < static_cast(mButtons.size()); ++i) + mButtons[i]->setStateSelected(i == mControllerFocus); + } } MyGUI::IntSize mainWidgetSize;