From e2f8f4da83206d551f9acebd14d574ea37ca214a Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Mon, 10 Jun 2019 13:01:07 +0200 Subject: Formspecs: Close on metadata removal (#8348) Formspecs will now close as soon the formspec string in the node metadata turns invalid. --- src/client/gameui.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/client/gameui.cpp') diff --git a/src/client/gameui.cpp b/src/client/gameui.cpp index 5533cd119..f3c3fefb6 100644 --- a/src/client/gameui.cpp +++ b/src/client/gameui.cpp @@ -302,3 +302,15 @@ void GameUI::toggleProfiler() showTranslatedStatusText("Profiler hidden"); } } + + +void GameUI::deleteFormspec() +{ + if (m_formspec) + m_formspec->quitMenu(); + + delete m_formspec; + m_formspec = nullptr; + + m_formname.clear(); +} -- cgit v1.2.3