mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
Merge pull request #843 from MihailRis/common-vc-funcs
new functions and settings
This commit is contained in:
commit
025e32eec1
33 changed files with 617 additions and 421 deletions
|
|
@ -57,6 +57,10 @@ FullCheckBox::FullCheckBox(
|
|||
|
||||
add(checkbox);
|
||||
|
||||
auto& checkboxActions = actions;
|
||||
label->setMargin(glm::vec4(5.f, 5.f, 0.f, 0.f));
|
||||
label->listenAction(UIAction::CLICK, [&checkboxActions](auto& gui) {
|
||||
checkboxActions.notify(UIAction::CLICK, gui);
|
||||
});
|
||||
add(label);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -889,8 +889,8 @@ static std::shared_ptr<UINode> read_iframe(
|
|||
return iframe;
|
||||
}
|
||||
|
||||
UiXmlReader::UiXmlReader(gui::GUI& gui, scriptenv&& env)
|
||||
: gui(gui), env(std::move(env)) {
|
||||
UiXmlReader::UiXmlReader(gui::GUI& gui, const scriptenv& env)
|
||||
: gui(gui), env(env) {
|
||||
contextStack.emplace("");
|
||||
add("image", read_image);
|
||||
add("canvas", read_canvas);
|
||||
|
|
@ -922,8 +922,7 @@ void UiXmlReader::addIgnore(const std::string& tag) {
|
|||
ignored.insert(tag);
|
||||
}
|
||||
|
||||
std::shared_ptr<UINode> UiXmlReader::readUINode(const xml::xmlelement& element
|
||||
) {
|
||||
std::shared_ptr<UINode> UiXmlReader::readUINode(const xml::xmlelement& element) {
|
||||
if (element.has("if")) {
|
||||
const auto& cond = element.attr("if").getText();
|
||||
if (cond.empty() || cond == "false" || cond == "nil") return nullptr;
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ namespace gui {
|
|||
std::unordered_set<std::string> ignored;
|
||||
std::stack<std::string> contextStack;
|
||||
std::string filename;
|
||||
scriptenv env;
|
||||
const scriptenv& env;
|
||||
public:
|
||||
UiXmlReader(gui::GUI& gui, scriptenv&& env);
|
||||
UiXmlReader(gui::GUI& gui, const scriptenv& env);
|
||||
|
||||
void add(const std::string& tag, uinode_reader reader);
|
||||
bool hasReader(const std::string& tag) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue