aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GUILabel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src/openvic-extension/classes/GUILabel.cpp')
-rw-r--r--extension/src/openvic-extension/classes/GUILabel.cpp6
1 files changed, 4 insertions, 2 deletions
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);