Progress
This commit is contained in:
@ -7,10 +7,6 @@
|
||||
#include "label.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
enum ChildType {
|
||||
CHILD_TYPE_LABEL
|
||||
};
|
||||
|
||||
struct ChildInfo;
|
||||
|
||||
struct ChildrenInfo {
|
||||
@ -19,8 +15,10 @@ namespace Dawn {
|
||||
|
||||
struct ChildInfo {
|
||||
enum ChildType type;
|
||||
struct LabelInfo label;
|
||||
struct ChildrenInfo children;
|
||||
std::string ref;
|
||||
bool_t hasRef = false;
|
||||
struct LabelInfo label;
|
||||
};
|
||||
|
||||
class ChildrenParser : public XmlParser<struct ChildrenInfo> {
|
||||
@ -48,6 +46,7 @@ namespace Dawn {
|
||||
|
||||
if(c->node == "label") {
|
||||
child.type = CHILD_TYPE_LABEL;
|
||||
|
||||
ret = (LabelParser()).parse(c, &child.label, error);
|
||||
} else {
|
||||
*error = "Unrecognized UI Element " + c->node;
|
||||
|
31
src/dawntools/tools/uigen/parse/elements/common.hpp
Normal file
31
src/dawntools/tools/uigen/parse/elements/common.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "util/XmlParser.hpp"
|
||||
#include "util/CodeGen.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
enum AlignType {
|
||||
UI_COMPONENT_ALIGN_START,
|
||||
UI_COMPONENT_ALIGN_MIDDLE,
|
||||
UI_COMPONENT_ALIGN_END,
|
||||
UI_COMPONENT_ALIGN_STRETCH
|
||||
};
|
||||
|
||||
struct Alignment {
|
||||
float_t x0 = 0;
|
||||
float_t y0 = 0;
|
||||
float_t x1 = 0;
|
||||
float_t y1 = 0;
|
||||
|
||||
enum AlignType xAlign = UI_COMPONENT_ALIGN_START;
|
||||
enum AlignType yAlign = UI_COMPONENT_ALIGN_START;
|
||||
};
|
||||
|
||||
enum ChildType {
|
||||
CHILD_TYPE_LABEL
|
||||
};
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "util/XmlParser.hpp"
|
||||
#include "common.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
struct LabelInfo {
|
||||
|
Reference in New Issue
Block a user