From 7c85ab11e840c281a2499dcc6dd3219c33e7d37f Mon Sep 17 00:00:00 2001 From: hop311 Date: Thu, 15 Aug 2024 00:13:54 +0100 Subject: Add GUITextLabel (colour code + currency icon support) --- extension/src/openvic-extension/classes/GUINode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'extension/src/openvic-extension/classes/GUINode.cpp') diff --git a/extension/src/openvic-extension/classes/GUINode.cpp b/extension/src/openvic-extension/classes/GUINode.cpp index bd8197b..4d7d33e 100644 --- a/extension/src/openvic-extension/classes/GUINode.cpp +++ b/extension/src/openvic-extension/classes/GUINode.cpp @@ -40,7 +40,7 @@ using namespace OpenVic; #define APPLY_TO_CHILD_TYPES(F) \ F(Button, button) \ - F(Label, label) \ + F(GUITextLabel, gui_text_label) \ F(Panel, panel) \ F(TextureProgressBar, progress_bar) \ F(TextureRect, texture_rect) \ @@ -90,6 +90,7 @@ void GUINode::_bind_methods() { OV_BIND_SMETHOD(int_to_string_suffixed, { "val" }); OV_BIND_SMETHOD(float_to_string_suffixed, { "val" }); OV_BIND_SMETHOD(float_to_string_dp, { "val", "decimal_places" }); + OV_BIND_SMETHOD(float_to_string_dp_dynamic, { "val" }); OV_BIND_SMETHOD(format_province_name, { "province_identifier" }); } @@ -266,6 +267,10 @@ String GUINode::float_to_string_dp(float val, int32_t decimal_places) { return Utilities::float_to_string_dp(val, decimal_places); } +String GUINode::float_to_string_dp_dynamic(float val) { + return Utilities::float_to_string_dp_dynamic(val); +} + String GUINode::format_province_name(String const& province_identifier) { if (!province_identifier.is_empty()) { static const String province_prefix = "PROV"; -- cgit v1.2.3-56-ga3b1