aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes/GUINode.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-08-30 23:29:57 +0200
committer GitHub <noreply@github.com>2024-08-30 23:29:57 +0200
commitf54e454afb90f8868e7c62529e2a388fdaadf20b (patch)
treef19dbcdfe613397e86dc52cc34e0a443bd0f3e96 /extension/src/openvic-extension/classes/GUINode.cpp
parent855e5b087459da19caf230cf22d99462680b268e (diff)
parentd7672f406406eea46625bc725690651f28211e19 (diff)
Merge pull request #251 from OpenVicProject/gui-text-label
Add GUILabel (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..25ef821 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(GUILabel, gui_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";