aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-03-03 14:23:21 +0100
committer hop311 <hop3114@gmail.com>2024-03-03 14:29:30 +0100
commitd45d6270c8924f571b53d71ac8eb9ce5a7788255 (patch)
treea617e5ff1f417797330e9a81abb478700b602ec4 /extension/src/openvic-extension/classes
parent9e305db5e5090a1a24979c480d64eebfe2de65da (diff)
ProgressBar, StyleBoxTexture, Icon tweaks + current dir install check fix
Diffstat (limited to 'extension/src/openvic-extension/classes')
-rw-r--r--extension/src/openvic-extension/classes/GUINode.cpp6
-rw-r--r--extension/src/openvic-extension/classes/GUINode.hpp1
2 files changed, 7 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/classes/GUINode.cpp b/extension/src/openvic-extension/classes/GUINode.cpp
index 5296ad7..ceff66e 100644
--- a/extension/src/openvic-extension/classes/GUINode.cpp
+++ b/extension/src/openvic-extension/classes/GUINode.cpp
@@ -48,6 +48,7 @@ void GUINode::_bind_methods() {
OV_BIND_SMETHOD(int_to_formatted_string, { "val" });
OV_BIND_SMETHOD(float_to_formatted_string, { "val", "decimal_places" });
+ OV_BIND_SMETHOD(format_province_name, { "province_identifier" });
}
GUINode::GUINode() {
@@ -189,3 +190,8 @@ String GUINode::int_to_formatted_string(int64_t val) {
String GUINode::float_to_formatted_string(float val, int32_t decimal_places) {
return Utilities::float_to_formatted_string(val, decimal_places);
}
+
+String GUINode::format_province_name(String const& province_identifier) {
+ static const String province_prefix = "PROV";
+ return province_prefix + province_identifier;
+}
diff --git a/extension/src/openvic-extension/classes/GUINode.hpp b/extension/src/openvic-extension/classes/GUINode.hpp
index f935683..dc7f665 100644
--- a/extension/src/openvic-extension/classes/GUINode.hpp
+++ b/extension/src/openvic-extension/classes/GUINode.hpp
@@ -69,5 +69,6 @@ namespace OpenVic {
static godot::String int_to_formatted_string(int64_t val);
static godot::String float_to_formatted_string(float val, int32_t decimal_places);
+ static godot::String format_province_name(godot::String const& province_identifier);
};
}