From 95a6b95a5df63fa1bcb1d4680b3fdd7091a9c38e Mon Sep 17 00:00:00 2001 From: hop311 Date: Fri, 23 Aug 2024 00:03:02 +0100 Subject: Rework GUITextLabel to use custom text handling instead of RichTextLabel --- extension/src/openvic-extension/utility/UITools.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'extension/src/openvic-extension/utility') diff --git a/extension/src/openvic-extension/utility/UITools.cpp b/extension/src/openvic-extension/utility/UITools.cpp index f972681..3fcc837 100644 --- a/extension/src/openvic-extension/utility/UITools.cpp +++ b/extension/src/openvic-extension/utility/UITools.cpp @@ -510,7 +510,11 @@ static bool generate_text(generate_gui_args_t&& args) { text_label->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); - if (text_label->set_gui_text(&text) != OK) { + GameSingleton const* game_singleton = GameSingleton::get_singleton(); + GFX::Font::colour_codes_t const* override_colour_codes = game_singleton != nullptr + ? &game_singleton->get_definition_manager().get_ui_manager().get_universal_colour_codes() : nullptr; + + if (text_label->set_gui_text(&text, override_colour_codes) != OK) { UtilityFunctions::push_error("Error initialising GUITextLabel for GUI text ", text_name); ret = false; } -- cgit v1.2.3-56-ga3b1