1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-18 18:55:29 +02:00

Chat console: Prevent input loss on double open

This commit is contained in:
SmallJoker
2024-04-30 20:14:20 +02:00
committed by sfan5
parent c352fbf5c9
commit f0bb5313d3
2 changed files with 8 additions and 4 deletions

View File

@@ -48,14 +48,14 @@ class MainMenuManager : public IMenuManager
public:
virtual void createdMenu(gui::IGUIElement *menu)
{
#ifndef NDEBUG
for (gui::IGUIElement *i : m_stack) {
assert(i != menu);
for (gui::IGUIElement *e : m_stack) {
if (e == menu)
return;
}
#endif
if(!m_stack.empty())
m_stack.back()->setVisible(false);
m_stack.push_back(menu);
guienv->setFocus(m_stack.back());
}