scriptenv?
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef FRONTEND_UI_DOCUMENT_H_
|
||||
#define FRONTEND_UI_DOCUMENT_H_
|
||||
|
||||
#include "../logic/scripting/Environment.h"
|
||||
#include "../typedefs.h"
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
@@ -14,12 +14,7 @@ namespace gui {
|
||||
class UINode;
|
||||
}
|
||||
|
||||
namespace scripting {
|
||||
class Environment;
|
||||
}
|
||||
|
||||
struct uidocscript {
|
||||
int environment;
|
||||
bool onopen : 1;
|
||||
bool onclose : 1;
|
||||
};
|
||||
@@ -31,13 +26,13 @@ class UiDocument {
|
||||
uidocscript script;
|
||||
uinodes_map map;
|
||||
std::shared_ptr<gui::UINode> root;
|
||||
std::unique_ptr<scripting::Environment> env;
|
||||
scriptenv env;
|
||||
public:
|
||||
UiDocument(
|
||||
std::string id,
|
||||
uidocscript script,
|
||||
std::shared_ptr<gui::UINode> root,
|
||||
std::unique_ptr<scripting::Environment> env
|
||||
scriptenv env
|
||||
);
|
||||
|
||||
void rebuildIndices();
|
||||
@@ -48,9 +43,9 @@ public:
|
||||
const std::shared_ptr<gui::UINode> getRoot() const;
|
||||
const std::shared_ptr<gui::UINode> get(const std::string& id) const;
|
||||
const uidocscript& getScript() const;
|
||||
int getEnvironment() const;
|
||||
scriptenv getEnvironment() const;
|
||||
|
||||
static std::unique_ptr<UiDocument> read(int env, std::string name, fs::path file);
|
||||
static std::unique_ptr<UiDocument> read(scriptenv parent_env, std::string name, fs::path file);
|
||||
static std::shared_ptr<gui::UINode> readElement(fs::path file);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user