diff options
author | Nemrav <> | 2024-11-16 18:22:18 +0100 |
---|---|---|
committer | Nemrav <> | 2024-11-16 18:22:18 +0100 |
commit | 401f3ffbc5e727e46c42c5643b4e9515e23a3c03 (patch) | |
tree | 025e1e4379191738ee78f28ddb1ef52162093dcb /extension | |
parent | 9455c807d392e2cdd11c7f3cc89dd567422faa99 (diff) |
use text alignment type
Diffstat (limited to 'extension')
m--------- | extension/deps/openvic-simulation | 0 | ||||
-rw-r--r-- | extension/src/openvic-extension/classes/GUILabel.cpp | 6 | ||||
-rw-r--r-- | extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/extension/deps/openvic-simulation b/extension/deps/openvic-simulation -Subproject 8defcd5daa1acd2c61aa1cd0a26478d472fed9b +Subproject cb1b56b0146d32c881abd48f53e85f7cf8283be diff --git a/extension/src/openvic-extension/classes/GUILabel.cpp b/extension/src/openvic-extension/classes/GUILabel.cpp index 3c7cfed..01c5b4e 100644 --- a/extension/src/openvic-extension/classes/GUILabel.cpp +++ b/extension/src/openvic-extension/classes/GUILabel.cpp @@ -7,6 +7,7 @@ #include "openvic-extension/singletons/AssetManager.hpp" #include "openvic-extension/utility/ClassBindings.hpp" #include "openvic-extension/utility/Utilities.hpp" +#include "openvic-simulation/types/TextFormat.hpp" using namespace OpenVic; using namespace godot; @@ -241,12 +242,13 @@ Error GUILabel::set_gui_text(GUI::Text const* new_gui_text, GFX::Font::colour_co set_text(Utilities::std_to_godot_string(gui_text->get_text())); - using enum GUI::AlignedElement::format_t; - static const ordered_map<GUI::AlignedElement::format_t, HorizontalAlignment> format_map { + using enum text_format_t; + static const ordered_map<text_format_t, HorizontalAlignment> format_map { { left, HORIZONTAL_ALIGNMENT_LEFT }, { centre, HORIZONTAL_ALIGNMENT_CENTER }, { right, HORIZONTAL_ALIGNMENT_RIGHT } }; + const decltype(format_map)::const_iterator it = format_map.find(gui_text->get_format()); set_horizontal_alignment(it != format_map.end() ? it->second : HORIZONTAL_ALIGNMENT_LEFT); diff --git a/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp b/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp index ca5e666..52d26b7 100644 --- a/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp +++ b/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp @@ -5,6 +5,7 @@ #include "openvic-extension/utility/ClassBindings.hpp" #include "openvic-extension/utility/UITools.hpp" #include "openvic-extension/utility/Utilities.hpp" +#include "openvic-simulation/types/TextFormat.hpp" using namespace OpenVic; using namespace godot; @@ -30,7 +31,7 @@ Error GUIOverlappingElementsBox::_update_child_positions() { float starting_x = 0.0f; Error err = OK; - using enum GUI::AlignedElement::format_t; + using enum text_format_t; switch (gui_overlapping_elements_box->get_format()) { case left: break; |