aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GUINode.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-08-15 01:13:54 +0200
committer hop311 <hop3114@gmail.com>2024-08-15 01:13:54 +0200
commit7c85ab11e840c281a2499dcc6dd3219c33e7d37f (patch)
tree84460d9e4c3af8656604add874fc9a379a0adc4a /extension/src/openvic-extension/classes/GUINode.cpp
parent82b16bcca7c74607a8885b882ec36f5202e7ef70 (diff)
Add GUITextLabel (colour code + currency icon support)
Diffstat (limited to 'extension/src/openvic-extension/classes/GUINode.cpp')
-rw-r--r--extension/src/openvic-extension/classes/GUINode.cpp7
1 files changed, 6 insertions, 1 deletions
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";