1 #include "lxgui/gui_button.hpp"
2 #include "lxgui/gui_font_string.hpp"
3 #include "lxgui/gui_layout_node.hpp"
4 #include "lxgui/gui_localizer.hpp"
5 #include "lxgui/gui_manager.hpp"
6 #include "lxgui/gui_out.hpp"
7 #include "lxgui/gui_parser_common.hpp"
8 #include "lxgui/gui_texture.hpp"
22 auto layer = special_node->get_attribute_value_or<std::string>(
"layer",
"ARTWORK");
26 defaulted.get_or_set_attribute_value(
"setAllAnchors",
"true");
30 tex->set_manually_inherited(
true);
35 special_node->bypass_access_check();
39 auto layer = special_node->get_attribute_value_or<std::string>(
"layer",
"BORDER");
43 defaulted.get_or_set_attribute_value(
"setAllAnchors",
"true");
47 tex->set_manually_inherited(
true);
52 special_node->bypass_access_check();
56 auto layer = special_node->get_attribute_value_or<std::string>(
"layer",
"BORDER");
60 defaulted.get_or_set_attribute_value(
"setAllAnchors",
"true");
64 tex->set_manually_inherited(
true);
69 special_node->bypass_access_check();
73 auto layer = special_node->get_attribute_value_or<std::string>(
"layer",
"HIGHLIGHT");
77 defaulted.get_or_set_attribute_value(
"setAllAnchors",
"true");
81 tex->set_manually_inherited(
true);
86 special_node->bypass_access_check();
90 auto layer = special_node->get_attribute_value_or<std::string>(
"layer",
"ARTWORK");
94 defaulted.get_or_set_attribute_value(
"setAllAnchors",
"true");
98 fstr->set_manually_inherited(
true);
103 special_node->bypass_access_check();
107 auto layer = special_node->get_attribute_value_or<std::string>(
"layer",
"HIGHLIGHT");
111 defaulted.get_or_set_attribute_value(
"setAllAnchors",
"true");
115 fstr->set_manually_inherited(
true);
120 special_node->bypass_access_check();
124 auto layer = special_node->get_attribute_value_or<std::string>(
"layer",
"BORDER");
128 defaulted.get_or_set_attribute_value(
"setAllAnchors",
"true");
132 fstr->set_manually_inherited(
true);
137 special_node->bypass_access_check();
144 vector2f(dimensions.second.x.value_or(0.0f), dimensions.second.y.value_or(0.0f)));
147 <<
"RelDimension for Button:PushedTextOffset is not yet supported. Skipped."
virtual void parse_all_nodes_before_children_(const layout_node &node)
void parse_attributes_(const layout_node &node) override
utils::observer_ptr< layered_region > parse_region_(const layout_node &node, const std::string &layer_name, const std::string &type)
An node in a layout file.
std::optional< std::string_view > try_get_attribute_value(std::string_view name) const noexcept
Returns the value of the attribute with the provided name, nullopt if not found.
std::string_view get_or_set_attribute_value(std::string_view name, std::string_view value)
Returns the value of the attribute with the provided name, or set it if none.
const layout_node * try_get_child(std::string_view name) const noexcept
Returns the first child with a given name, or null if none.
std::pair< anchor_type, vector2< std::optional< float > > > parse_dimension_node_(const layout_node &node)
manager & get_manager()
Returns this region's manager.
layer
ID of a layer for rendering inside a frame.
vector2< float > vector2f
Holds 2D coordinates (as floats)
const std::string warning
void warn_for_not_accessed_node(const layout_node &node)
Emit a warning if this node (or any of its attributes/children) was not read.