mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
UiDocument is an asset now
This commit is contained in:
parent
241d15e349
commit
07adbd04ea
21 changed files with 402 additions and 304 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "InventoryView.h"
|
||||
#include "../logic/scripting/scripting.h"
|
||||
#include "../files/files.h"
|
||||
#include "../frontend/gui/gui_xml.h"
|
||||
|
||||
UiDocument::UiDocument(
|
||||
std::string namesp,
|
||||
|
|
@ -27,16 +28,14 @@ void UiDocument::collect(uinodes_map& map, std::shared_ptr<gui::UINode> node) {
|
|||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<UiDocument> UiDocument::readInventory(
|
||||
std::string namesp,
|
||||
fs::path file,
|
||||
LevelFrontend* frontend,
|
||||
InventoryInteraction& interaction
|
||||
) {
|
||||
std::unique_ptr<UiDocument> UiDocument::read(std::string namesp, fs::path file) {
|
||||
const std::string text = files::read_string(file);
|
||||
auto xmldoc = xml::parse(file.u8string(), text);
|
||||
auto env = scripting::create_environment();
|
||||
auto view = InventoryView::readXML(
|
||||
frontend, interaction, text, file.u8string(), *env
|
||||
gui::UiXmlReader reader(*env);
|
||||
InventoryView::createReaders(reader);
|
||||
auto view = reader.readXML(
|
||||
file.u8string(), xmldoc->getRoot()
|
||||
);
|
||||
uidocscript script {};
|
||||
auto scriptFile = fs::path(file.u8string()+".lua");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue