mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Fix Exit to OS button focus in Pause Menu
This commit is contained in:
parent
a704c04f00
commit
dd2bb950be
3 changed files with 15 additions and 4 deletions
|
@ -97,6 +97,7 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
|
|||
m_form_src(fsrc),
|
||||
m_text_dst(tdst),
|
||||
m_formspec_version(0),
|
||||
m_focused_element(L""),
|
||||
m_font(NULL)
|
||||
#ifdef __ANDROID__
|
||||
,m_JavaDialogFieldName(L"")
|
||||
|
@ -1757,8 +1758,6 @@ void GUIFormSpecMenu::parseElement(parserData* data, std::string element)
|
|||
<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
|
||||
{
|
||||
/* useless to regenerate without a screensize */
|
||||
|
@ -1775,6 +1774,10 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
|
|||
mydata.table_dyndata[tablename] = table->getDynamicData();
|
||||
}
|
||||
|
||||
//set focus
|
||||
if (!m_focused_element.empty())
|
||||
mydata.focused_fieldname = m_focused_element;
|
||||
|
||||
//preserve focus
|
||||
gui::IGUIElement *focused_element = Environment->getFocus();
|
||||
if (focused_element && focused_element->getParent() == this) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue