mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
xml elements context
This commit is contained in:
parent
4b6c61ad89
commit
8b8bc55ff7
6 changed files with 48 additions and 14 deletions
|
|
@ -1,9 +1,11 @@
|
|||
#include "gui_util.h"
|
||||
#include "elements/controls.h"
|
||||
#include "elements/containers.h"
|
||||
#include "gui_xml.h"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "../../logic/scripting/scripting.h"
|
||||
#include "../../frontend/locale/langs.h"
|
||||
#include "../../delegates.h"
|
||||
|
||||
|
|
@ -32,6 +34,12 @@ std::shared_ptr<Button> guiutil::gotoButton(
|
|||
});
|
||||
}
|
||||
|
||||
std::shared_ptr<gui::UINode> guiutil::create(const std::string& source) {
|
||||
scripting::Environment env(0);
|
||||
UiXmlReader reader(env);
|
||||
return reader.readXML("<string>", source);
|
||||
}
|
||||
|
||||
void guiutil::alert(GUI* gui, const std::wstring& text, runnable on_hidden) {
|
||||
auto menu = gui->getMenu();
|
||||
auto panel = std::make_shared<Panel>(glm::vec2(500, 200), glm::vec4(8.0f), 8.0f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue