#include "gui_util.hpp" #include "elements/Label.hpp" #include "elements/Menu.hpp" #include "elements/Button.hpp" #include "gui_xml.hpp" #include "../../logic/scripting/scripting.h" #include "../../frontend/locale.hpp" #include "../../util/stringutil.hpp" #include "../../delegates.h" #include using namespace gui; std::shared_ptr" )); } std::shared_ptr" )); } std::shared_ptr guiutil::create(const std::string& source, scriptenv env) { if (env == nullptr) { env = scripting::get_root_environment(); } UiXmlReader reader(env); return reader.readXML("", source); } void guiutil::alert(GUI* gui, const std::wstring& text, runnable on_hidden) { auto menu = gui->getMenu(); auto panel = std::make_shared(glm::vec2(500, 300), glm::vec4(8.0f), 8.0f); panel->setColor(glm::vec4(0.0f, 0.0f, 0.0f, 0.5f)); auto label = std::make_shared