From 45abdefc1e4a6291ec0b114b974ca1cef3cbf04e Mon Sep 17 00:00:00 2001 From: devZoGok Date: Thu, 17 Apr 2025 20:36:56 +0300 Subject: [PATCH] clearing GUI elements after parsing --- concreteGuiManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/concreteGuiManager.cpp b/concreteGuiManager.cpp index 0d12268..a5a05bb 100644 --- a/concreteGuiManager.cpp +++ b/concreteGuiManager.cpp @@ -534,7 +534,6 @@ namespace battleship{ vector textExceptions ){ removeAllGuiElements(buttonExceptions, listboxExceptions, checkboxExceptions, sliderExceptions, textboxExceptions, guiRectboxExceptions, textExceptions); - guiElements.clear(); parseLuaScript(script); } @@ -556,11 +555,12 @@ namespace battleship{ for(Node *r : guiRectboxs) removeGuiRectangle(r); for(Text *t : texts) removeText(t); - guiElements.clear(); parseLuaScript(script); } void ConcreteGuiManager::parseLuaScript(string script){ + guiElements.clear(); + string basePath = GameManager::getSingleton()->getPath() + "Scripts/Gui/"; sol::state_view SOL_LUA_VIEW = generateView(); SOL_LUA_VIEW.script_file(basePath + script);