aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-08-27 00:54:19 +0200
committer hop311 <hop3114@gmail.com>2024-08-27 01:03:10 +0200
commitd7672f406406eea46625bc725690651f28211e19 (patch)
treeacb1166215188163b3406bd72508ace83e426911
parent344651044bfee007f59e76d48661b34edee4bd5a (diff)
Rename GUITextLabel to GUILabelgui-text-label
-rw-r--r--extension/src/openvic-extension/classes/GUILabel.cpp (renamed from extension/src/openvic-extension/classes/GUITextLabel.cpp)148
-rw-r--r--extension/src/openvic-extension/classes/GUILabel.hpp (renamed from extension/src/openvic-extension/classes/GUITextLabel.hpp)6
-rw-r--r--extension/src/openvic-extension/classes/GUINode.cpp2
-rw-r--r--extension/src/openvic-extension/classes/GUINode.hpp6
-rw-r--r--extension/src/openvic-extension/register_types.cpp4
-rw-r--r--extension/src/openvic-extension/utility/UITools.cpp16
-rw-r--r--game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd96
-rw-r--r--game/src/Game/GameSession/NationManagementScreen/PopulationMenu.gd42
-rw-r--r--game/src/Game/GameSession/ProvinceOverviewPanel.gd62
-rw-r--r--game/src/Game/GameSession/Topbar.gd108
10 files changed, 245 insertions, 245 deletions
diff --git a/extension/src/openvic-extension/classes/GUITextLabel.cpp b/extension/src/openvic-extension/classes/GUILabel.cpp
index ec8f158..9fd6b60 100644
--- a/extension/src/openvic-extension/classes/GUITextLabel.cpp
+++ b/extension/src/openvic-extension/classes/GUILabel.cpp
@@ -1,4 +1,4 @@
-#include "GUITextLabel.hpp"
+#include "GUILabel.hpp"
#include <godot_cpp/classes/font_file.hpp>
#include <godot_cpp/classes/style_box_texture.hpp>
@@ -14,40 +14,40 @@ using namespace OpenVic::Utilities::literals;
static constexpr int32_t DEFAULT_FONT_SIZE = 16;
-void GUITextLabel::_bind_methods() {
- OV_BIND_METHOD(GUITextLabel::clear);
- OV_BIND_METHOD(GUITextLabel::get_gui_text_name);
-
- OV_BIND_METHOD(GUITextLabel::get_text);
- OV_BIND_METHOD(GUITextLabel::set_text, { "new_text" });
-
- OV_BIND_METHOD(GUITextLabel::get_substitution_dict);
- OV_BIND_METHOD(GUITextLabel::add_substitution, { "key", "value" });
- OV_BIND_METHOD(GUITextLabel::set_substitution_dict, { "new_substitution_dict" });
- OV_BIND_METHOD(GUITextLabel::clear_substitutions);
-
- OV_BIND_METHOD(GUITextLabel::get_horizontal_alignment);
- OV_BIND_METHOD(GUITextLabel::set_horizontal_alignment, { "new_horizontal_alignment" });
- OV_BIND_METHOD(GUITextLabel::get_max_size);
- OV_BIND_METHOD(GUITextLabel::set_max_size, { "new_max_size" });
- OV_BIND_METHOD(GUITextLabel::get_border_size);
- OV_BIND_METHOD(GUITextLabel::set_border_size, { "new_border_size" });
- OV_BIND_METHOD(GUITextLabel::get_adjusted_rect);
- OV_BIND_METHOD(GUITextLabel::will_auto_adjust_to_content_size);
- OV_BIND_METHOD(GUITextLabel::set_auto_adjust_to_content_size, { "new_auto_adjust_to_content_size" });
-
- OV_BIND_METHOD(GUITextLabel::get_font);
- OV_BIND_METHOD(GUITextLabel::set_font, { "new_font" });
- OV_BIND_METHOD(GUITextLabel::set_font_file, { "new_font_file" });
- OV_BIND_METHOD(GUITextLabel::get_font_size);
- OV_BIND_METHOD(GUITextLabel::set_font_size, { "new_font_size" });
- OV_BIND_METHOD(GUITextLabel::get_default_colour);
- OV_BIND_METHOD(GUITextLabel::set_default_colour, { "new_default_colour" });
- OV_BIND_METHOD(GUITextLabel::get_currency_texture);
-
- OV_BIND_METHOD(GUITextLabel::get_background);
- OV_BIND_METHOD(GUITextLabel::set_background_texture, { "new_texture" });
- OV_BIND_METHOD(GUITextLabel::set_background_stylebox, { "new_stylebox_texture" });
+void GUILabel::_bind_methods() {
+ OV_BIND_METHOD(GUILabel::clear);
+ OV_BIND_METHOD(GUILabel::get_gui_text_name);
+
+ OV_BIND_METHOD(GUILabel::get_text);
+ OV_BIND_METHOD(GUILabel::set_text, { "new_text" });
+
+ OV_BIND_METHOD(GUILabel::get_substitution_dict);
+ OV_BIND_METHOD(GUILabel::add_substitution, { "key", "value" });
+ OV_BIND_METHOD(GUILabel::set_substitution_dict, { "new_substitution_dict" });
+ OV_BIND_METHOD(GUILabel::clear_substitutions);
+
+ OV_BIND_METHOD(GUILabel::get_horizontal_alignment);
+ OV_BIND_METHOD(GUILabel::set_horizontal_alignment, { "new_horizontal_alignment" });
+ OV_BIND_METHOD(GUILabel::get_max_size);
+ OV_BIND_METHOD(GUILabel::set_max_size, { "new_max_size" });
+ OV_BIND_METHOD(GUILabel::get_border_size);
+ OV_BIND_METHOD(GUILabel::set_border_size, { "new_border_size" });
+ OV_BIND_METHOD(GUILabel::get_adjusted_rect);
+ OV_BIND_METHOD(GUILabel::will_auto_adjust_to_content_size);
+ OV_BIND_METHOD(GUILabel::set_auto_adjust_to_content_size, { "new_auto_adjust_to_content_size" });
+
+ OV_BIND_METHOD(GUILabel::get_font);
+ OV_BIND_METHOD(GUILabel::set_font, { "new_font" });
+ OV_BIND_METHOD(GUILabel::set_font_file, { "new_font_file" });
+ OV_BIND_METHOD(GUILabel::get_font_size);
+ OV_BIND_METHOD(GUILabel::set_font_size, { "new_font_size" });
+ OV_BIND_METHOD(GUILabel::get_default_colour);
+ OV_BIND_METHOD(GUILabel::set_default_colour, { "new_default_colour" });
+ OV_BIND_METHOD(GUILabel::get_currency_texture);
+
+ OV_BIND_METHOD(GUILabel::get_background);
+ OV_BIND_METHOD(GUILabel::set_background_texture, { "new_texture" });
+ OV_BIND_METHOD(GUILabel::set_background_stylebox, { "new_stylebox_texture" });
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text");
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "substitution_dict"), "set_substitution_dict", "get_substitution_dict");
@@ -79,7 +79,7 @@ void GUITextLabel::_bind_methods() {
);
}
-void GUITextLabel::_notification(int what) {
+void GUILabel::_notification(int what) {
switch (what) {
case NOTIFICATION_RESIZED:
case NOTIFICATION_TRANSLATION_CHANGED: {
@@ -145,7 +145,7 @@ void GUITextLabel::_notification(int what) {
}
}
-GUITextLabel::GUITextLabel()
+GUILabel::GUILabel()
: gui_text { nullptr },
text {},
substitution_dict {},
@@ -163,7 +163,7 @@ GUITextLabel::GUITextLabel()
lines {},
line_update_queued { false } {}
-void GUITextLabel::clear() {
+void GUILabel::clear() {
gui_text = nullptr;
text = String {};
@@ -188,11 +188,11 @@ void GUITextLabel::clear() {
queue_redraw();
}
-String GUITextLabel::get_gui_text_name() const {
+String GUILabel::get_gui_text_name() const {
return gui_text != nullptr ? Utilities::std_to_godot_string(gui_text->get_name()) : String {};
}
-Error GUITextLabel::set_gui_text(GUI::Text const* new_gui_text, GFX::Font::colour_codes_t const* override_colour_codes) {
+Error GUILabel::set_gui_text(GUI::Text const* new_gui_text, GFX::Font::colour_codes_t const* override_colour_codes) {
if (gui_text == new_gui_text) {
return OK;
}
@@ -237,7 +237,7 @@ Error GUITextLabel::set_gui_text(GUI::Text const* new_gui_text, GFX::Font::colou
err = FAILED;
}
} else {
- UtilityFunctions::push_error("Failed to load font \"", font_filepath, "\" for GUITextLabel");
+ UtilityFunctions::push_error("Failed to load font \"", font_filepath, "\" for GUILabel");
err = FAILED;
}
@@ -247,12 +247,12 @@ Error GUITextLabel::set_gui_text(GUI::Text const* new_gui_text, GFX::Font::colou
if (texture.is_valid()) {
set_background_texture(texture);
} else {
- UtilityFunctions::push_error("Failed to load texture \"", texture_path, "\" for GUITextLabel ", get_name());
+ UtilityFunctions::push_error("Failed to load texture \"", texture_path, "\" for GUILabel ", get_name());
err = FAILED;
}
}
} else {
- UtilityFunctions::push_error("Failed to get AssetManager singleton for GUITextLabel");
+ UtilityFunctions::push_error("Failed to get AssetManager singleton for GUILabel");
err = FAILED;
}
@@ -261,7 +261,7 @@ Error GUITextLabel::set_gui_text(GUI::Text const* new_gui_text, GFX::Font::colou
return err;
}
-void GUITextLabel::set_text(String const& new_text) {
+void GUILabel::set_text(String const& new_text) {
if (text != new_text) {
text = new_text;
@@ -269,7 +269,7 @@ void GUITextLabel::set_text(String const& new_text) {
}
}
-void GUITextLabel::add_substitution(String const& key, String const& value) {
+void GUILabel::add_substitution(String const& key, String const& value) {
Variant& existing_value = substitution_dict[key];
if (existing_value != value) {
existing_value = value;
@@ -278,12 +278,12 @@ void GUITextLabel::add_substitution(String const& key, String const& value) {
}
}
-void GUITextLabel::set_substitution_dict(Dictionary const& new_substitution_dict) {
+void GUILabel::set_substitution_dict(Dictionary const& new_substitution_dict) {
substitution_dict = new_substitution_dict;
_queue_line_update();
}
-void GUITextLabel::clear_substitutions() {
+void GUILabel::clear_substitutions() {
if (!substitution_dict.is_empty()) {
substitution_dict.clear();
@@ -291,7 +291,7 @@ void GUITextLabel::clear_substitutions() {
}
}
-void GUITextLabel::set_horizontal_alignment(HorizontalAlignment new_horizontal_alignment) {
+void GUILabel::set_horizontal_alignment(HorizontalAlignment new_horizontal_alignment) {
if (horizontal_alignment != new_horizontal_alignment) {
horizontal_alignment = new_horizontal_alignment;
@@ -299,7 +299,7 @@ void GUITextLabel::set_horizontal_alignment(HorizontalAlignment new_horizontal_a
}
}
-void GUITextLabel::set_max_size(Size2 new_max_size) {
+void GUILabel::set_max_size(Size2 new_max_size) {
if (max_size != new_max_size) {
max_size = new_max_size;
@@ -310,7 +310,7 @@ void GUITextLabel::set_max_size(Size2 new_max_size) {
}
}
-void GUITextLabel::set_border_size(Size2 new_border_size) {
+void GUILabel::set_border_size(Size2 new_border_size) {
if (border_size != new_border_size) {
border_size = new_border_size;
@@ -320,7 +320,7 @@ void GUITextLabel::set_border_size(Size2 new_border_size) {
}
}
-void GUITextLabel::set_auto_adjust_to_content_size(bool new_auto_adjust_to_content_size) {
+void GUILabel::set_auto_adjust_to_content_size(bool new_auto_adjust_to_content_size) {
if (auto_adjust_to_content_size != new_auto_adjust_to_content_size) {
auto_adjust_to_content_size = new_auto_adjust_to_content_size;
@@ -330,17 +330,17 @@ void GUITextLabel::set_auto_adjust_to_content_size(bool new_auto_adjust_to_conte
}
}
-Ref<Font> GUITextLabel::get_font() const {
+Ref<Font> GUILabel::get_font() const {
return font;
}
-void GUITextLabel::set_font(Ref<Font> const& new_font) {
+void GUILabel::set_font(Ref<Font> const& new_font) {
font = new_font;
_queue_line_update();
}
-Error GUITextLabel::set_font_file(Ref<FontFile> const& new_font_file) {
+Error GUILabel::set_font_file(Ref<FontFile> const& new_font_file) {
ERR_FAIL_NULL_V(new_font_file, FAILED);
set_font(new_font_file);
@@ -348,13 +348,13 @@ Error GUITextLabel::set_font_file(Ref<FontFile> const& new_font_file) {
return set_font_size(new_font_file->get_fixed_size());
}
-Error GUITextLabel::set_font_size(int32_t new_font_size) {
+Error GUILabel::set_font_size(int32_t new_font_size) {
font_size = new_font_size;
_queue_line_update();
AssetManager* asset_manager = AssetManager::get_singleton();
- ERR_FAIL_NULL_V_MSG(asset_manager, FAILED, "Failed to get AssetManager singleton for GUITextLabel");
+ ERR_FAIL_NULL_V_MSG(asset_manager, FAILED, "Failed to get AssetManager singleton for GUILabel");
currency_texture = asset_manager->get_currency_texture(font_size);
ERR_FAIL_NULL_V(currency_texture, FAILED);
@@ -362,22 +362,22 @@ Error GUITextLabel::set_font_size(int32_t new_font_size) {
return OK;
}
-void GUITextLabel::set_default_colour(Color const& new_default_colour) {
+void GUILabel::set_default_colour(Color const& new_default_colour) {
if (default_colour != new_default_colour) {
default_colour = new_default_colour;
_queue_line_update();
}
}
-Ref<GFXSpriteTexture> GUITextLabel::get_currency_texture() const {
+Ref<GFXSpriteTexture> GUILabel::get_currency_texture() const {
return currency_texture;
}
-Ref<StyleBoxTexture> GUITextLabel::get_background() const {
+Ref<StyleBoxTexture> GUILabel::get_background() const {
return background;
}
-void GUITextLabel::set_background_texture(Ref<Texture2D> const& new_texture) {
+void GUILabel::set_background_texture(Ref<Texture2D> const& new_texture) {
Ref<StyleBoxTexture> new_background;
if (new_texture.is_valid()) {
@@ -390,7 +390,7 @@ void GUITextLabel::set_background_texture(Ref<Texture2D> const& new_texture) {
set_background_stylebox(new_background);
}
-void GUITextLabel::set_background_stylebox(Ref<StyleBoxTexture> const& new_stylebox_texture) {
+void GUILabel::set_background_stylebox(Ref<StyleBoxTexture> const& new_stylebox_texture) {
if (background != new_stylebox_texture) {
background = new_stylebox_texture;
update_stylebox_border_size();
@@ -398,7 +398,7 @@ void GUITextLabel::set_background_stylebox(Ref<StyleBoxTexture> const& new_style
}
}
-void GUITextLabel::update_stylebox_border_size() {
+void GUILabel::update_stylebox_border_size() {
if (background.is_valid()) {
background->set_texture_margin(SIDE_LEFT, border_size.width);
background->set_texture_margin(SIDE_RIGHT, border_size.width);
@@ -407,11 +407,11 @@ void GUITextLabel::update_stylebox_border_size() {
}
}
-real_t GUITextLabel::get_string_width(String const& string) const {
+real_t GUILabel::get_string_width(String const& string) const {
return font->get_string_size(string, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width;
}
-real_t GUITextLabel::get_segment_width(segment_t const& segment) const {
+real_t GUILabel::get_segment_width(segment_t const& segment) const {
if (string_segment_t const* string_segment = std::get_if<string_segment_t>(&segment)) {
return string_segment->width;
} else if (currency_texture.is_valid()) {
@@ -421,15 +421,15 @@ real_t GUITextLabel::get_segment_width(segment_t const& segment) const {
}
}
-void GUITextLabel::_queue_line_update() {
+void GUILabel::_queue_line_update() {
if (!line_update_queued) {
line_update_queued = true;
- callable_mp(this, &GUITextLabel::_update_lines).call_deferred();
+ callable_mp(this, &GUILabel::_update_lines).call_deferred();
}
}
-void GUITextLabel::_update_lines() {
+void GUILabel::_update_lines() {
line_update_queued = false;
lines.clear();
@@ -453,7 +453,7 @@ void GUITextLabel::_update_lines() {
queue_redraw();
}
-String GUITextLabel::generate_substituted_text(String const& base_text) const {
+String GUILabel::generate_substituted_text(String const& base_text) const {
static const String SUBSTITUTION_MARKER = String::chr(0x24); // $
String result;
@@ -486,7 +486,7 @@ String GUITextLabel::generate_substituted_text(String const& base_text) const {
return result;
}
-std::pair<String, GUITextLabel::colour_instructions_t> GUITextLabel::generate_display_text_and_colour_instructions(
+std::pair<String, GUILabel::colour_instructions_t> GUILabel::generate_display_text_and_colour_instructions(
String const& substituted_text
) const {
static const String COLOUR_MARKER = String::chr(0xA7); // §
@@ -518,7 +518,7 @@ std::pair<String, GUITextLabel::colour_instructions_t> GUITextLabel::generate_di
return { std::move(result), std::move(colour_instructions) };
}
-std::vector<GUITextLabel::line_t> GUITextLabel::generate_lines_and_segments(
+std::vector<GUILabel::line_t> GUILabel::generate_lines_and_segments(
String const& display_text, colour_instructions_t const& colour_instructions
) const {
static constexpr char RESET_COLOUR_CODE = '!';
@@ -562,7 +562,7 @@ std::vector<GUITextLabel::line_t> GUITextLabel::generate_lines_and_segments(
return unwrapped_lines;
}
-void GUITextLabel::separate_lines(
+void GUILabel::separate_lines(
String const& string, Color const& colour, std::vector<line_t>& unwrapped_lines
) const {
static const String NEWLINE_MARKER = "\n";
@@ -585,7 +585,7 @@ void GUITextLabel::separate_lines(
}
}
-void GUITextLabel::separate_currency_segments(
+void GUILabel::separate_currency_segments(
String const& string, Color const& colour, line_t& line
) const {
static const String CURRENCY_MARKER = String::chr(0xA4); // ¤
@@ -618,7 +618,7 @@ void GUITextLabel::separate_currency_segments(
}
}
-std::vector<GUITextLabel::line_t> GUITextLabel::wrap_lines(std::vector<line_t>& unwrapped_lines) const {
+std::vector<GUILabel::line_t> GUILabel::wrap_lines(std::vector<line_t>& unwrapped_lines) const {
std::vector<line_t> wrapped_lines;
const Size2 max_content_size = max_size - 2 * border_size;
@@ -743,7 +743,7 @@ std::vector<GUITextLabel::line_t> GUITextLabel::wrap_lines(std::vector<line_t>&
return wrapped_lines;
}
-void GUITextLabel::adjust_to_content_size() {
+void GUILabel::adjust_to_content_size() {
if (auto_adjust_to_content_size) {
adjusted_rect = {};
diff --git a/extension/src/openvic-extension/classes/GUITextLabel.hpp b/extension/src/openvic-extension/classes/GUILabel.hpp
index 7a1491c..e0982b2 100644
--- a/extension/src/openvic-extension/classes/GUITextLabel.hpp
+++ b/extension/src/openvic-extension/classes/GUILabel.hpp
@@ -10,8 +10,8 @@
#include "openvic-extension/classes/GFXSpriteTexture.hpp"
namespace OpenVic {
- class GUITextLabel : public godot::Control {
- GDCLASS(GUITextLabel, godot::Control)
+ class GUILabel : public godot::Control {
+ GDCLASS(GUILabel, godot::Control)
using colour_instructions_t = std::vector<std::pair<int64_t, char>>;
@@ -55,7 +55,7 @@ namespace OpenVic {
void _notification(int what);
public:
- GUITextLabel();
+ GUILabel();
/* Reset gui_text to nullptr and reset current text. */
void clear();
diff --git a/extension/src/openvic-extension/classes/GUINode.cpp b/extension/src/openvic-extension/classes/GUINode.cpp
index 4d7d33e..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(GUITextLabel, gui_text_label) \
+ F(GUILabel, gui_label) \
F(Panel, panel) \
F(TextureProgressBar, progress_bar) \
F(TextureRect, texture_rect) \
diff --git a/extension/src/openvic-extension/classes/GUINode.hpp b/extension/src/openvic-extension/classes/GUINode.hpp
index 6168e7e..73ca92b 100644
--- a/extension/src/openvic-extension/classes/GUINode.hpp
+++ b/extension/src/openvic-extension/classes/GUINode.hpp
@@ -21,10 +21,10 @@
#include "openvic-extension/classes/GFXMaskedFlagTexture.hpp"
#include "openvic-extension/classes/GFXPieChartTexture.hpp"
#include "openvic-extension/classes/GFXSpriteTexture.hpp"
+#include "openvic-extension/classes/GUILabel.hpp"
#include "openvic-extension/classes/GUIListBox.hpp"
#include "openvic-extension/classes/GUIOverlappingElementsBox.hpp"
#include "openvic-extension/classes/GUIScrollbar.hpp"
-#include "openvic-extension/classes/GUITextLabel.hpp"
namespace OpenVic {
class GUINode : public godot::Control {
@@ -52,7 +52,7 @@ namespace OpenVic {
static godot::Vector2 get_gui_position(godot::String const& gui_scene, godot::String const& gui_position);
static godot::Button* get_button_from_node(godot::Node* node);
- static GUITextLabel* get_gui_text_label_from_node(godot::Node* node);
+ static GUILabel* get_gui_label_from_node(godot::Node* node);
static godot::Panel* get_panel_from_node(godot::Node* node);
static godot::TextureProgressBar* get_progress_bar_from_node(godot::Node* node);
static godot::TextureRect* get_texture_rect_from_node(godot::Node* node);
@@ -62,7 +62,7 @@ namespace OpenVic {
static godot::LineEdit* get_line_edit_from_node(godot::Node* node);
godot::Button* get_button_from_nodepath(godot::NodePath const& path) const;
- GUITextLabel* get_gui_text_label_from_nodepath(godot::NodePath const& path) const;
+ GUILabel* get_gui_label_from_nodepath(godot::NodePath const& path) const;
godot::Panel* get_panel_from_nodepath(godot::NodePath const& path) const;
godot::TextureProgressBar* get_progress_bar_from_nodepath(godot::NodePath const& path) const;
godot::TextureRect* get_texture_rect_from_nodepath(godot::NodePath const& path) const;
diff --git a/extension/src/openvic-extension/register_types.cpp b/extension/src/openvic-extension/register_types.cpp
index eb58cb0..bd50e34 100644
--- a/extension/src/openvic-extension/register_types.cpp
+++ b/extension/src/openvic-extension/register_types.cpp
@@ -6,11 +6,11 @@
#include "openvic-extension/classes/GFXSpriteTexture.hpp"
#include "openvic-extension/classes/GFXMaskedFlagTexture.hpp"
#include "openvic-extension/classes/GFXPieChartTexture.hpp"
+#include "openvic-extension/classes/GUILabel.hpp"
#include "openvic-extension/classes/GUIListBox.hpp"
#include "openvic-extension/classes/GUINode.hpp"
#include "openvic-extension/classes/GUIOverlappingElementsBox.hpp"
#include "openvic-extension/classes/GUIScrollbar.hpp"
-#include "openvic-extension/classes/GUITextLabel.hpp"
#include "openvic-extension/classes/MapMesh.hpp"
#include "openvic-extension/singletons/AssetManager.hpp"
#include "openvic-extension/singletons/Checksum.hpp"
@@ -76,11 +76,11 @@ void initialize_openvic_types(ModuleInitializationLevel p_level) {
ClassDB::register_class<GFXMaskedFlagTexture>();
ClassDB::register_class<GFXPieChartTexture>();
+ ClassDB::register_class<GUILabel>();
ClassDB::register_class<GUIListBox>();
ClassDB::register_class<GUINode>();
ClassDB::register_class<GUIOverlappingElementsBox>();
ClassDB::register_class<GUIScrollbar>();
- ClassDB::register_class<GUITextLabel>();
}
void uninitialize_openvic_types(ModuleInitializationLevel p_level) {
diff --git a/extension/src/openvic-extension/utility/UITools.cpp b/extension/src/openvic-extension/utility/UITools.cpp
index 3fcc837..723fb24 100644
--- a/extension/src/openvic-extension/utility/UITools.cpp
+++ b/extension/src/openvic-extension/utility/UITools.cpp
@@ -15,10 +15,10 @@
#include "openvic-extension/classes/GFXSpriteTexture.hpp"
#include "openvic-extension/classes/GFXMaskedFlagTexture.hpp"
#include "openvic-extension/classes/GFXPieChartTexture.hpp"
+#include "openvic-extension/classes/GUILabel.hpp"
#include "openvic-extension/classes/GUIListBox.hpp"
#include "openvic-extension/classes/GUIOverlappingElementsBox.hpp"
#include "openvic-extension/classes/GUIScrollbar.hpp"
-#include "openvic-extension/classes/GUITextLabel.hpp"
#include "openvic-extension/singletons/AssetManager.hpp"
#include "openvic-extension/singletons/GameSingleton.hpp"
#include "openvic-extension/utility/Utilities.hpp"
@@ -504,22 +504,22 @@ static bool generate_text(generate_gui_args_t&& args) {
const String text_name = Utilities::std_to_godot_string(text.get_name());
- GUITextLabel* text_label = nullptr;
- bool ret = new_control(text_label, text, args.name);
- ERR_FAIL_NULL_V_MSG(text_label, false, vformat("Failed to create GUITextLabel for GUI text %s", text_name));
+ GUILabel* gui_label = nullptr;
+ bool ret = new_control(gui_label, text, args.name);
+ ERR_FAIL_NULL_V_MSG(gui_label, false, vformat("Failed to create GUILabel for GUI text %s", text_name));
- text_label->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
+ gui_label->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
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);
+ if (gui_label->set_gui_text(&text, override_colour_codes) != OK) {
+ UtilityFunctions::push_error("Error initialising GUILabel for GUI text ", text_name);
ret = false;
}
- args.result = text_label;
+ args.result = gui_label;
return ret;
}
diff --git a/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd b/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd
index 90df650..20eb198 100644
--- a/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd
+++ b/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd
@@ -4,36 +4,36 @@ var _active : bool = false
var _incVal : int = 0 # incremental value to see the UI update, replace later by real values
# income
-var _lower_class_label : GUITextLabel
-var _middle_class_label : GUITextLabel
-var _upper_class_label : GUITextLabel
-var _gold_label : GUITextLabel
-var _total_inc_label : GUITextLabel
+var _lower_class_label : GUILabel
+var _middle_class_label : GUILabel
+var _upper_class_label : GUILabel
+var _gold_label : GUILabel
+var _total_inc_label : GUILabel
# debt
-var _national_bank_label : GUITextLabel
-var _total_funds_label : GUITextLabel
-var _debt_val_label : GUITextLabel
-var _interest_val_label : GUITextLabel
+var _national_bank_label : GUILabel
+var _total_funds_label : GUILabel
+var _debt_val_label : GUILabel
+var _interest_val_label : GUILabel
# costs
-var _nat_stock_val_label : GUITextLabel
-var _nat_stock_exp_label : GUITextLabel
-var _mil_cost_val_label : GUITextLabel
-var _overseas_cost_val_label : GUITextLabel
-var _ind_sub_val_label : GUITextLabel
-var _admin_efficiency_label : GUITextLabel
-var _education_exp_label : GUITextLabel
-var _administration_exp_label : GUITextLabel
-var _social_exp_label : GUITextLabel
-var _military_exp_label : GUITextLabel
-var _total_exp_label : GUITextLabel
+var _nat_stock_val_label : GUILabel
+var _nat_stock_exp_label : GUILabel
+var _mil_cost_val_label : GUILabel
+var _overseas_cost_val_label : GUILabel
+var _ind_sub_val_label : GUILabel
+var _admin_efficiency_label : GUILabel
+var _education_exp_label : GUILabel
+var _administration_exp_label : GUILabel
+var _social_exp_label : GUILabel
+var _military_exp_label : GUILabel
+var _total_exp_label : GUILabel
# others
-var _tariffs_percent_label : GUITextLabel
-var _tariff_val_label : GUITextLabel
-var _diplomatic_balance_label : GUITextLabel
-var _balance_label : GUITextLabel
+var _tariffs_percent_label : GUILabel
+var _tariff_val_label : GUILabel
+var _diplomatic_balance_label : GUILabel
+var _balance_label : GUILabel
var _lower_class_chart : GFXPieChartTexture
var _middle_class_chart : GFXPieChartTexture
@@ -55,33 +55,33 @@ func _ready() -> void:
# labels
# income
- _lower_class_label = get_gui_text_label_from_nodepath(^"./country_budget/tax_0_inc")
- _middle_class_label = get_gui_text_label_from_nodepath(^"./country_budget/tax_1_inc")
- _upper_class_label = get_gui_text_label_from_nodepath(^"./country_budget/tax_2_inc")
- _gold_label = get_gui_text_label_from_nodepath(^"./country_budget/gold_inc")
- _total_inc_label = get_gui_text_label_from_nodepath(^"./country_budget/total_inc")
+ _lower_class_label = get_gui_label_from_nodepath(^"./country_budget/tax_0_inc")
+ _middle_class_label = get_gui_label_from_nodepath(^"./country_budget/tax_1_inc")
+ _upper_class_label = get_gui_label_from_nodepath(^"./country_budget/tax_2_inc")
+ _gold_label = get_gui_label_from_nodepath(^"./country_budget/gold_inc")
+ _total_inc_label = get_gui_label_from_nodepath(^"./country_budget/total_inc")
# debt
- _national_bank_label = get_gui_text_label_from_nodepath(^"./country_budget/national_bank_val")
- _total_funds_label = get_gui_text_label_from_nodepath(^"./country_budget/total_funds_val")
- _debt_val_label = get_gui_text_label_from_nodepath(^"./country_budget/debt_val")
- _interest_val_label = get_gui_text_label_from_nodepath(^"./country_budget/interest_val")
+ _national_bank_label = get_gui_label_from_nodepath(^"./country_budget/national_bank_val")
+ _total_funds_label = get_gui_label_from_nodepath(^"./country_budget/total_funds_val")
+ _debt_val_label = get_gui_label_from_nodepath(^"./country_budget/debt_val")
+ _interest_val_label = get_gui_label_from_nodepath(^"./country_budget/interest_val")
# costs
- _nat_stock_val_label = get_gui_text_label_from_nodepath(^"./country_budget/nat_stock_val")
- _nat_stock_exp_label = get_gui_text_label_from_nodepath(^"./country_budget/nat_stock_est")
- _mil_cost_val_label = get_gui_text_label_from_nodepath(^"./country_budget/mil_cost_val")
- _overseas_cost_val_label = get_gui_text_label_from_nodepath(^"./country_budget/overseas_cost_val")
- _ind_sub_val_label = get_gui_text_label_from_nodepath(^"./country_budget/ind_sub_val")
- _admin_efficiency_label = get_gui_text_label_from_nodepath(^"./country_budget/admin_efficiency")
- _education_exp_label = get_gui_text_label_from_nodepath(^"./country_budget/exp_val_0")
- _administration_exp_label = get_gui_text_label_from_nodepath(^"./country_budget/exp_val_1")
- _social_exp_label = get_gui_text_label_from_nodepath(^"./country_budget/exp_val_2")
- _military_exp_label = get_gui_text_label_from_nodepath(^"./country_budget/exp_val_3")
- _total_exp_label = get_gui_text_label_from_nodepath(^"./country_budget/total_exp")
+ _nat_stock_val_label = get_gui_label_from_nodepath(^"./country_budget/nat_stock_val")
+ _nat_stock_exp_label = get_gui_label_from_nodepath(^"./country_budget/nat_stock_est")
+ _mil_cost_val_label = get_gui_label_from_nodepath(^"./country_budget/mil_cost_val")
+ _overseas_cost_val_label = get_gui_label_from_nodepath(^"./country_budget/overseas_cost_val")
+ _ind_sub_val_label = get_gui_label_from_nodepath(^"./country_budget/ind_sub_val")
+ _admin_efficiency_label = get_gui_label_from_nodepath(^"./country_budget/admin_efficiency")
+ _education_exp_label = get_gui_label_from_nodepath(^"./country_budget/exp_val_0")
+ _administration_exp_label = get_gui_label_from_nodepath(^"./country_budget/exp_val_1")
+ _social_exp_label = get_gui_label_from_nodepath(^"./country_budget/exp_val_2")
+ _military_exp_label = get_gui_label_from_nodepath(^"./country_budget/exp_val_3")
+ _total_exp_label = get_gui_label_from_nodepath(^"./country_budget/total_exp")
# others
- _tariffs_percent_label = get_gui_text_label_from_nodepath(^"./country_budget/tariffs_percent")
- _tariff_val_label = get_gui_text_label_from_nodepath(^"./country_budget/tariff_val")
- _diplomatic_balance_label = get_gui_text_label_from_nodepath(^"./country_budget/diplomatic_balance")
- _balance_label = get_gui_text_label_from_nodepath(^"./country_budget/balance")
+ _tariffs_percent_label = get_gui_label_from_nodepath(^"./country_budget/tariffs_percent")
+ _tariff_val_label = get_gui_label_from_nodepath(^"./country_budget/tariff_val")
+ _diplomatic_balance_label = get_gui_label_from_nodepath(^"./country_budget/diplomatic_balance")
+ _balance_label = get_gui_label_from_nodepath(^"./country_budget/balance")
# sliders
# income
diff --git a/game/src/Game/GameSession/NationManagementScreen/PopulationMenu.gd b/game/src/Game/GameSession/NationManagementScreen/PopulationMenu.gd
index 92ae6e2..e078934 100644
--- a/game/src/Game/GameSession/NationManagementScreen/PopulationMenu.gd
+++ b/game/src/Game/GameSession/NationManagementScreen/PopulationMenu.gd
@@ -14,8 +14,8 @@ var _province_list_types : Array[MenuSingleton.ProvinceListEntry]
var _province_list_indices : PackedInt32Array
var _province_list_panels : Array[Panel]
var _province_list_button_icons : Array[GFXSpriteTexture]
-var _province_list_name_labels : Array[GUITextLabel]
-var _province_list_size_labels : Array[GUITextLabel]
+var _province_list_name_labels : Array[GUILabel]
+var _province_list_size_labels : Array[GUILabel]
var _province_list_growth_icons : Array[GFXSpriteTexture]
var _province_list_colony_buttons : Array[Button]
var _province_list_national_focus_icons : Array[GFXSpriteTexture]
@@ -33,19 +33,19 @@ var _pop_list_scrollbar : GUIScrollbar
var _pop_list_scroll_index : int = 0
var _pop_list_rows : Array[Panel]
-var _pop_list_size_labels : Array[GUITextLabel]
+var _pop_list_size_labels : Array[GUILabel]
var _pop_list_type_buttons : Array[Button]
var _pop_list_type_icons : Array[GFXSpriteTexture]
var _pop_list_producing_icons : Array[GFXSpriteTexture]
-var _pop_list_culture_labels : Array[GUITextLabel]
+var _pop_list_culture_labels : Array[GUILabel]
var _pop_list_religion_icons : Array[GFXSpriteTexture]
-var _pop_list_location_labels : Array[GUITextLabel]
-var _pop_list_militancy_labels : Array[GUITextLabel]
-var _pop_list_consciousness_labels : Array[GUITextLabel]
+var _pop_list_location_labels : Array[GUILabel]
+var _pop_list_militancy_labels : Array[GUILabel]
+var _pop_list_consciousness_labels : Array[GUILabel]
var _pop_list_ideology_charts : Array[GFXPieChartTexture]
var _pop_list_issues_charts : Array[GFXPieChartTexture]
var _pop_list_unemployment_progressbars : Array[TextureProgressBar]
-var _pop_list_cash_labels : Array[GUITextLabel]
+var _pop_list_cash_labels : Array[GUILabel]
var _pop_list_life_needs_progressbars : Array[TextureProgressBar]
var _pop_list_everyday_needs_progressbars : Array[TextureProgressBar]
var _pop_list_luxury_needs_progressbars : Array[TextureProgressBar]
@@ -58,7 +58,7 @@ var _pop_list_political_movement_icons : Array[GFXSpriteTexture]
var _pop_list_national_movement_texture_rects : Array[TextureRect]
var _pop_list_national_movement_flags : Array[GFXMaskedFlagTexture]
var _pop_list_size_change_icons : Array[GFXSpriteTexture]
-var _pop_list_literacy_labels : Array[GUITextLabel]
+var _pop_list_literacy_labels : Array[GUILabel]
func _ready() -> void:
GameSingleton.gamestate_updated.connect(_update_info)
@@ -142,9 +142,9 @@ func _generate_province_list_row(index : int, type : MenuSingleton.ProvinceListE
)
_province_list_button_icons[index] = GUINode.get_gfx_sprite_texture_from_node(base_button)
- _province_list_name_labels[index] = GUINode.get_gui_text_label_from_node(entry_panel.get_node(^"./poplist_name"))
+ _province_list_name_labels[index] = GUINode.get_gui_label_from_node(entry_panel.get_node(^"./poplist_name"))
- _province_list_size_labels[index] = GUINode.get_gui_text_label_from_node(entry_panel.get_node(^"./poplist_numpops"))
+ _province_list_size_labels[index] = GUINode.get_gui_label_from_node(entry_panel.get_node(^"./poplist_numpops"))
_province_list_growth_icons[index] = GUINode.get_gfx_sprite_texture_from_node(entry_panel.get_node(^"./growth_indicator"))
@@ -273,7 +273,7 @@ func _setup_distribution_windows() -> void:
_pop_screen_panel.add_child(distribution_panel)
distribution_panel.set_position(distribution_start + distribution_step * Vector2(index % columns, index / columns))
- var name_label : GUITextLabel = GUINode.get_gui_text_label_from_node(distribution_panel.get_node(^"./item_name"))
+ var name_label : GUILabel = GUINode.get_gui_label_from_node(distribution_panel.get_node(^"./item_name"))
if name_label:
name_label.set_text(distribution_names[index])
@@ -318,7 +318,7 @@ func _setup_pop_list() -> void:
height += pop_row_panel.size.y
_pop_list_rows.push_back(pop_row_panel)
- _pop_list_size_labels.push_back(GUINode.get_gui_text_label_from_node(pop_row_panel.get_node(^"./pop_size")))
+ _pop_list_size_labels.push_back(GUINode.get_gui_label_from_node(pop_row_panel.get_node(^"./pop_size")))
var pop_type_button : Button = GUINode.get_button_from_node(pop_row_panel.get_node(^"./pop_type"))
# TODO - open pop details menu on pop type button press
@@ -328,17 +328,17 @@ func _setup_pop_list() -> void:
_pop_list_producing_icons.push_back(GUINode.get_gfx_sprite_texture_from_node(pop_row_panel.get_node(^"./pop_producing_icon")))
- var culture_label : GUITextLabel = GUINode.get_gui_text_label_from_node(pop_row_panel.get_node(^"./pop_nation"))
+ var culture_label : GUILabel = GUINode.get_gui_label_from_node(pop_row_panel.get_node(^"./pop_nation"))
_pop_list_culture_labels.push_back(culture_label)
_pop_list_religion_icons.push_back(GUINode.get_gfx_sprite_texture_from_node(pop_row_panel.get_node(^"./pop_religion")))
- var location_label : GUITextLabel = GUINode.get_gui_text_label_from_node(pop_row_panel.get_node(^"./pop_location"))
+ var location_label : GUILabel = GUINode.get_gui_label_from_node(pop_row_panel.get_node(^"./pop_location"))
_pop_list_location_labels.push_back(location_label)
- _pop_list_militancy_labels.push_back(GUINode.get_gui_text_label_from_node(pop_row_panel.get_node(^"./pop_mil")))
+ _pop_list_militancy_labels.push_back(GUINode.get_gui_label_from_node(pop_row_panel.get_node(^"./pop_mil")))
- _pop_list_consciousness_labels.push_back(GUINode.get_gui_text_label_from_node(pop_row_panel.get_node(^"./pop_con")))
+ _pop_list_consciousness_labels.push_back(GUINode.get_gui_label_from_node(pop_row_panel.get_node(^"./pop_con")))
_pop_list_ideology_charts.push_back(GUINode.get_gfx_pie_chart_texture_from_node(pop_row_panel.get_node(^"./pop_ideology")))
@@ -346,7 +346,7 @@ func _setup_pop_list() -> void:
_pop_list_unemployment_progressbars.push_back(GUINode.get_progress_bar_from_node(pop_row_panel.get_node(^"./pop_unemployment_bar")))
- _pop_list_cash_labels.push_back(GUINode.get_gui_text_label_from_node(pop_row_panel.get_node(^"./pop_cash")))
+ _pop_list_cash_labels.push_back(GUINode.get_gui_label_from_node(pop_row_panel.get_node(^"./pop_cash")))
var pop_list_life_needs_progressbar : TextureProgressBar = GUINode.get_progress_bar_from_node(pop_row_panel.get_node(^"./lifeneed_progress"))
if pop_list_life_needs_progressbar:
@@ -390,7 +390,7 @@ func _setup_pop_list() -> void:
_pop_list_size_change_icons.push_back(GUINode.get_gfx_sprite_texture_from_node(pop_row_panel.get_node(^"./growth_indicator")))
- _pop_list_literacy_labels.push_back(GUINode.get_gui_text_label_from_node(pop_row_panel.get_node(^"./pop_literacy")))
+ _pop_list_literacy_labels.push_back(GUINode.get_gui_label_from_node(pop_row_panel.get_node(^"./pop_literacy")))
func _notification(what : int) -> void:
match what:
@@ -546,11 +546,11 @@ func _update_distributions():
if colour_icon_rect:
colour_icon_rect.set_modulate(distribution_row[slice_colour_key])
- var identifier_label : GUITextLabel = GUINode.get_gui_text_label_from_node(child.get_node(^"./legend_title"))
+ var identifier_label : GUILabel = GUINode.get_gui_label_from_node(child.get_node(^"./legend_title"))
if identifier_label:
identifier_label.set_text(distribution_row[slice_identifier_key])
- var weight_label : GUITextLabel = GUINode.get_gui_text_label_from_node(child.get_node(^"./legend_value"))
+ var weight_label : GUILabel = GUINode.get_gui_label_from_node(child.get_node(^"./legend_value"))
if weight_label:
weight_label.set_text("%s%%" % GUINode.float_to_string_dp(distribution_row[slice_weight_key] * 100.0, 1))
diff --git a/game/src/Game/GameSession/ProvinceOverviewPanel.gd b/game/src/Game/GameSession/ProvinceOverviewPanel.gd
index f953c56..f2669c0 100644
--- a/game/src/Game/GameSession/ProvinceOverviewPanel.gd
+++ b/game/src/Game/GameSession/ProvinceOverviewPanel.gd
@@ -1,13 +1,13 @@
extends GUINode
# Header
-var _province_name_label : GUITextLabel
-var _state_name_label : GUITextLabel
+var _province_name_label : GUILabel
+var _state_name_label : GUILabel
var _slave_status_icon : TextureRect
var _colony_status_button : Button
var _colony_status_button_texture : GFXSpriteTexture
-var _administrative_percentage_label : GUITextLabel
-var _owner_percentage_label : GUITextLabel
+var _administrative_percentage_label : GUILabel
+var _owner_percentage_label : GUILabel
var _province_modifiers_overlapping_elements_box : GUIOverlappingElementsBox
var _terrain_type_texture : GFXSpriteTexture
var _life_rating_bar : TextureProgressBar
@@ -15,21 +15,21 @@ var _controller_flag_texture : GFXMaskedFlagTexture
# Statistics
var _rgo_icon_texture : GFXSpriteTexture
-var _rgo_produced_label : GUITextLabel
-var _rgo_income_label : GUITextLabel
+var _rgo_produced_label : GUILabel
+var _rgo_income_label : GUILabel
var _rgo_employment_percentage_texture : GFXSpriteTexture
-var _rgo_employment_population_label : GUITextLabel
-var _rgo_employment_percentage_label : GUITextLabel
-var _crime_name_label : GUITextLabel
+var _rgo_employment_population_label : GUILabel
+var _rgo_employment_percentage_label : GUILabel
+var _crime_name_label : GUILabel
var _crime_icon_texture : GFXSpriteTexture
-var _crime_fighting_label : GUITextLabel
-var _total_population_label : GUITextLabel
-var _migration_label : GUITextLabel
-var _population_growth_label : GUITextLabel
+var _crime_fighting_label : GUILabel
+var _total_population_label : GUILabel
+var _migration_label : GUILabel
+var _population_growth_label : GUILabel
var _pop_types_piechart : GFXPieChartTexture
var _pop_ideologies_piechart : GFXPieChartTexture
var _pop_cultures_piechart : GFXPieChartTexture
-var _supply_limit_label : GUITextLabel
+var _supply_limit_label : GUILabel
var _cores_overlapping_elements_box : GUIOverlappingElementsBox
# Buildings
@@ -48,7 +48,7 @@ class BuildingSlot:
var _expand_button : Button
var _expanding_icon : TextureRect
var _expanding_progress_bar : TextureProgressBar
- var _expanding_label : GUITextLabel
+ var _expanding_label : GUILabel
func _init(new_slot_index : int, new_slot_node : Control) -> void:
if new_slot_index < 0:
@@ -68,7 +68,7 @@ class BuildingSlot:
else:
icon.hide()
- var building_name := GUINode.get_gui_text_label_from_node(_slot_node.get_node(^"./description"))
+ var building_name := GUINode.get_gui_label_from_node(_slot_node.get_node(^"./description"))
if building_name:
building_name.text = MenuSingleton.get_province_building_identifier(_slot_index)
_expand_button = GUINode.get_button_from_node(_slot_node.get_node(^"./expand"))
@@ -79,7 +79,7 @@ class BuildingSlot:
if _expanding_progress_bar:
_expanding_progress_bar.max_value = 1.0
_expanding_progress_bar.step = _expanding_progress_bar.max_value / 100
- _expanding_label = GUINode.get_gui_text_label_from_node(_slot_node.get_node(^"./expand_text"))
+ _expanding_label = GUINode.get_gui_label_from_node(_slot_node.get_node(^"./expand_text"))
enum ExpansionState { CannotExpand, CanExpand, Preparing, Expanding }
@@ -136,8 +136,8 @@ func _ready() -> void:
close_button.pressed.connect(_on_close_button_pressed)
# Header
- _province_name_label = get_gui_text_label_from_nodepath(^"./province_view/province_view_header/province_name")
- _state_name_label = get_gui_text_label_from_nodepath(^"./province_view/province_view_header/state_name")
+ _province_name_label = get_gui_label_from_nodepath(^"./province_view/province_view_header/province_name")
+ _state_name_label = get_gui_label_from_nodepath(^"./province_view/province_view_header/state_name")
if _state_name_label:
# State names are already translated in the MenuSingleton
_state_name_label.auto_translate = false
@@ -150,8 +150,8 @@ func _ready() -> void:
var admin_icon_texture : GFXSpriteTexture = get_gfx_sprite_texture_from_nodepath(^"./province_view/province_view_header/admin_icon")
if admin_icon_texture:
admin_icon_texture.set_icon_index(MenuSingleton.get_administrative_pop_icon_index())
- _administrative_percentage_label = get_gui_text_label_from_nodepath(^"./province_view/province_view_header/admin_efficiency")
- _owner_percentage_label = get_gui_text_label_from_nodepath(^"./province_view/province_view_header/owner_presence")
+ _administrative_percentage_label = get_gui_label_from_nodepath(^"./province_view/province_view_header/admin_efficiency")
+ _owner_percentage_label = get_gui_label_from_nodepath(^"./province_view/province_view_header/owner_presence")
_province_modifiers_overlapping_elements_box = get_gui_overlapping_elements_box_from_nodepath(^"./province_view/province_view_header/province_modifiers")
if _province_modifiers_overlapping_elements_box and _province_modifiers_overlapping_elements_box.set_gui_child_element_name("province_interface", "prov_state_modifier") != OK:
_province_modifiers_overlapping_elements_box = null # hide province modifiers box since we can't do anything with it
@@ -161,17 +161,17 @@ func _ready() -> void:
# Statistics
_rgo_icon_texture = get_gfx_sprite_texture_from_nodepath(^"./province_view/province_statistics/goods_type")
- _rgo_produced_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/produced")
- _rgo_income_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/income")
+ _rgo_produced_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/produced")
+ _rgo_income_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/income")
_rgo_employment_percentage_texture = get_gfx_sprite_texture_from_nodepath(^"./province_view/province_statistics/employment_ratio")
- _rgo_employment_population_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/rgo_population")
- _rgo_employment_percentage_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/rgo_percent")
- _crime_name_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/crime_name")
+ _rgo_employment_population_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/rgo_population")
+ _rgo_employment_percentage_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/rgo_percent")
+ _crime_name_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/crime_name")
_crime_icon_texture = get_gfx_sprite_texture_from_nodepath(^"./province_view/province_statistics/crime_icon")
- _crime_fighting_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/crimefight_percent")
- _total_population_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/total_population")
- _migration_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/migration")
- _population_growth_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/growth")
+ _crime_fighting_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/crimefight_percent")
+ _total_population_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/total_population")
+ _migration_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/migration")
+ _population_growth_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/growth")
_pop_types_piechart = get_gfx_pie_chart_texture_from_nodepath(^"./province_view/province_statistics/workforce_chart")
_pop_ideologies_piechart = get_gfx_pie_chart_texture_from_nodepath(^"./province_view/province_statistics/ideology_chart")
_pop_cultures_piechart = get_gfx_pie_chart_texture_from_nodepath(^"./province_view/province_statistics/culture_chart")
@@ -183,7 +183,7 @@ func _ready() -> void:
_on_close_button_pressed()
Events.NationManagementScreens.open_nation_management_screen(NationManagement.Screen.POPULATION)
)
- _supply_limit_label = get_gui_text_label_from_nodepath(^"./province_view/province_statistics/supply_limit_label")
+ _supply_limit_label = get_gui_label_from_nodepath(^"./province_view/province_statistics/supply_limit_label")
_cores_overlapping_elements_box = get_gui_overlapping_elements_box_from_nodepath(^"./province_view/province_statistics/core_icons")
if _cores_overlapping_elements_box and _cores_overlapping_elements_box.set_gui_child_element_name("province_interface", "province_core") != OK:
_cores_overlapping_elements_box = null # hide cores box since we can't do anything with it
diff --git a/game/src/Game/GameSession/Topbar.gd b/game/src/Game/GameSession/Topbar.gd
index a173ccd..d6cc358 100644
--- a/game/src/Game/GameSession/Topbar.gd
+++ b/game/src/Game/GameSession/Topbar.gd
@@ -3,21 +3,21 @@ extends GUINode
# Country info
var _country_flag_texture : GFXMaskedFlagTexture
var _country_flag_overlay_texture : GFXSpriteTexture
-var _country_name_label : GUITextLabel
-var _country_rank_label : GUITextLabel
-var _country_prestige_label : GUITextLabel
-var _country_prestige_rank_label : GUITextLabel
-var _country_industrial_power_label : GUITextLabel
-var _country_industrial_power_rank_label : GUITextLabel
-var _country_military_power_label : GUITextLabel
-var _country_military_power_rank_label : GUITextLabel
-var _country_colonial_power_label : GUITextLabel
+var _country_name_label : GUILabel
+var _country_rank_label : GUILabel
+var _country_prestige_label : GUILabel
+var _country_prestige_rank_label : GUILabel
+var _country_industrial_power_label : GUILabel
+var _country_industrial_power_rank_label : GUILabel
+var _country_military_power_label : GUILabel
+var _country_military_power_rank_label : GUILabel
+var _country_colonial_power_label : GUILabel
# Time controls
var _speed_up_button : Button
var _speed_down_button : Button
var _speed_indicator_texture : GFXSpriteTexture
-var _date_label : GUITextLabel
+var _date_label : GUILabel
# NationManagement.Screen-Button
var _nation_management_buttons : Dictionary
@@ -32,48 +32,48 @@ var _production_alert_unemployment_texture : GFXSpriteTexture
# Budget
# TODO - line chart
-var _budget_funds_label : GUITextLabel
+var _budget_funds_label : GUILabel
# Technology
var _technology_progress_bar : TextureProgressBar
-var _technology_current_research_label : GUITextLabel
-var _technology_literacy_label : GUITextLabel
-var _technology_research_points_label : GUITextLabel
+var _technology_current_research_label : GUILabel
+var _technology_literacy_label : GUILabel
+var _technology_research_points_label : GUILabel
# Politics
var _politics_party_icon : TextureRect
-var _politics_party_label : GUITextLabel
-var _politics_suppression_points_label : GUITextLabel
-var _politics_infamy_label : GUITextLabel
+var _politics_party_label : GUILabel
+var _politics_suppression_points_label : GUILabel
+var _politics_infamy_label : GUILabel
var _politics_reforms_texture : GFXSpriteTexture
var _politics_decisions_texture : GFXSpriteTexture
var _politics_election_texture : GFXSpriteTexture
var _politics_rebels_texture : GFXSpriteTexture
# Population
-var _population_total_size_label : GUITextLabel
-var _population_national_foci_label : GUITextLabel
-var _population_militancy_label : GUITextLabel
-var _population_consciousness_label : GUITextLabel
+var _population_total_size_label : GUILabel
+var _population_national_foci_label : GUILabel
+var _population_militancy_label : GUILabel
+var _population_consciousness_label : GUILabel
# Trade
var _trade_imported_textures : Array[GFXSpriteTexture]
var _trade_exported_textures : Array[GFXSpriteTexture]
# Diplomacy
-var _diplomacy_peace_label : GUITextLabel
+var _diplomacy_peace_label : GUILabel
var _diplomacy_war_enemies_overlapping_elements_box : GUIOverlappingElementsBox
-var _diplomacy_diplomatic_points_label : GUITextLabel
+var _diplomacy_diplomatic_points_label : GUILabel
var _diplomacy_alert_colony_texture : GFXSpriteTexture
var _diplomacy_alert_crisis_texture : GFXSpriteTexture
var _diplomacy_alert_sphere_texture : GFXSpriteTexture
var _diplomacy_alert_great_power_texture : GFXSpriteTexture
# Military
-var _military_army_size_label : GUITextLabel
-var _military_navy_size_label : GUITextLabel
-var _military_mobilisation_size_label : GUITextLabel
-var _military_leadership_points_label : GUITextLabel
+var _military_army_size_label : GUILabel
+var _military_navy_size_label : GUILabel
+var _military_mobilisation_size_label : GUILabel
+var _military_leadership_points_label : GUILabel
func _ready() -> void:
GameSingleton.gamestate_updated.connect(_update_info)
@@ -102,15 +102,15 @@ func _ready() -> void:
)
_country_flag_texture = GUINode.get_gfx_masked_flag_texture_from_node(country_flag_button)
_country_flag_overlay_texture = get_gfx_sprite_texture_from_nodepath(^"./topbar/topbar_flag_overlay")
- _country_name_label = get_gui_text_label_from_nodepath(^"./topbar/CountryName")
- _country_rank_label = get_gui_text_label_from_nodepath(^"./topbar/nation_totalrank")
- _country_prestige_label = get_gui_text_label_from_nodepath(^"./topbar/country_prestige")
- _country_prestige_rank_label = get_gui_text_label_from_nodepath(^"./topbar/selected_prestige_rank")
- _country_industrial_power_label = get_gui_text_label_from_nodepath(^"./topbar/country_economic")
- _country_industrial_power_rank_label = get_gui_text_label_from_nodepath(^"./topbar/selected_industry_rank")
- _country_military_power_label = get_gui_text_label_from_nodepath(^"./topbar/country_military")
- _country_military_power_rank_label = get_gui_text_label_from_nodepath(^"./topbar/selected_military_rank")
- _country_colonial_power_label = get_gui_text_label_from_nodepath(^"./topbar/country_colonial_power")
+ _country_name_label = get_gui_label_from_nodepath(^"./topbar/CountryName")
+ _country_rank_label = get_gui_label_from_nodepath(^"./topbar/nation_totalrank")
+ _country_prestige_label = get_gui_label_from_nodepath(^"./topbar/country_prestige")
+ _country_prestige_rank_label = get_gui_label_from_nodepath(^"./topbar/selected_prestige_rank")
+ _country_industrial_power_label = get_gui_label_from_nodepath(^"./topbar/country_economic")
+ _country_industrial_power_rank_label = get_gui_label_from_nodepath(^"./topbar/selected_industry_rank")
+ _country_military_power_label = get_gui_label_from_nodepath(^"./topbar/country_military")
+ _country_military_power_rank_label = get_gui_label_from_nodepath(^"./topbar/selected_military_rank")
+ _country_colonial_power_label = get_gui_label_from_nodepath(^"./topbar/country_colonial_power")
# Time controls
_speed_up_button = get_button_from_nodepath(^"./topbar/button_speedup")
@@ -126,7 +126,7 @@ func _ready() -> void:
if speed_indicator_button:
speed_indicator_button.pressed.connect(_on_play_pause_button_pressed)
_speed_indicator_texture = GUINode.get_gfx_sprite_texture_from_node(speed_indicator_button)
- _date_label = get_gui_text_label_from_nodepath(^"./topbar/DateText")
+ _date_label = get_gui_label_from_nodepath(^"./topbar/DateText")
# Nation management screens
const screen_nodepaths : Dictionary = {
@@ -162,17 +162,17 @@ func _ready() -> void:
_production_alert_unemployment_texture = get_gfx_sprite_texture_from_nodepath(^"./topbar/alert_unemployed_workers")
# Budget
- _budget_funds_label = get_gui_text_label_from_nodepath(^"./topbar/budget_funds")
+ _budget_funds_label = get_gui_label_from_nodepath(^"./topbar/budget_funds")
# Technology
_technology_progress_bar = get_progress_bar_from_nodepath(^"./topbar/topbar_tech_progress")
- _technology_current_research_label = get_gui_text_label_from_nodepath(^"./topbar/tech_current_research")
- _technology_literacy_label = get_gui_text_label_from_nodepath(^"./topbar/tech_literacy_value")
- _technology_research_points_label = get_gui_text_label_from_nodepath(^"./topbar/topbar_researchpoints_value")
+ _technology_current_research_label = get_gui_label_from_nodepath(^"./topbar/tech_current_research")
+ _technology_literacy_label = get_gui_label_from_nodepath(^"./topbar/tech_literacy_value")
+ _technology_research_points_label = get_gui_label_from_nodepath(^"./topbar/topbar_researchpoints_value")
# Politics
_politics_party_icon = get_texture_rect_from_nodepath(^"./topbar/politics_party_icon")
- _politics_party_label = get_gui_text_label_from_nodepath(^"./topbar/politics_ruling_party")
+ _politics_party_label = get_gui_label_from_nodepath(^"./topbar/politics_ruling_party")
var politics_suppression_button : Button = get_button_from_nodepath(^"./topbar/topbar_supression_icon")
if politics_suppression_button:
politics_suppression_button.pressed.connect(
@@ -180,8 +180,8 @@ func _ready() -> void:
# TODO - open the politics menu on the Movements tab
Events.NationManagementScreens.toggle_nation_management_screen(NationManagement.Screen.POLITICS)
)
- _politics_suppression_points_label = get_gui_text_label_from_nodepath(^"./topbar/politics_supressionpoints_value")
- _politics_infamy_label = get_gui_text_label_from_nodepath(^"./topbar/politics_infamy_value")
+ _politics_suppression_points_label = get_gui_label_from_nodepath(^"./topbar/politics_supressionpoints_value")
+ _politics_infamy_label = get_gui_label_from_nodepath(^"./topbar/politics_infamy_value")
var politics_reforms_button : Button = get_button_from_nodepath(^"./topbar/alert_can_do_reforms")
if politics_reforms_button:
politics_reforms_button.pressed.connect(
@@ -209,10 +209,10 @@ func _ready() -> void:
_politics_rebels_texture = GUINode.get_gfx_sprite_texture_from_node(politics_rebels_button)
# Population
- _population_total_size_label = get_gui_text_label_from_nodepath(^"./topbar/population_total_value")
- _population_national_foci_label = get_gui_text_label_from_nodepath(^"./topbar/topbar_focus_value")
- _population_militancy_label = get_gui_text_label_from_nodepath(^"./topbar/population_avg_mil_value")
- _population_consciousness_label = get_gui_text_label_from_nodepath(^"./topbar/population_avg_con_value")
+ _population_total_size_label = get_gui_label_from_nodepath(^"./topbar/population_total_value")
+ _population_national_foci_label = get_gui_label_from_nodepath(^"./topbar/topbar_focus_value")
+ _population_militancy_label = get_gui_label_from_nodepath(^"./topbar/population_avg_mil_value")
+ _population_consciousness_label = get_gui_label_from_nodepath(^"./topbar/population_avg_con_value")
# Trade
const TRADE_GOOD_COUNT : int = 3
@@ -221,9 +221,9 @@ func _ready() -> void:
_trade_exported_textures.push_back(get_gfx_sprite_texture_from_nodepath("./topbar/topbar_export%d" % idx))
# Diplomacy
- _diplomacy_peace_label = get_gui_text_label_from_nodepath(^"./topbar/diplomacy_status")
+ _diplomacy_peace_label = get_gui_label_from_nodepath(^"./topbar/diplomacy_status")
_diplomacy_war_enemies_overlapping_elements_box = get_gui_overlapping_elements_box_from_nodepath(^"./topbar/diplomacy_at_war")
- _diplomacy_diplomatic_points_label = get_gui_text_label_from_nodepath(^"./topbar/diplomacy_diplopoints_value")
+ _diplomacy_diplomatic_points_label = get_gui_label_from_nodepath(^"./topbar/diplomacy_diplopoints_value")
var diplomacy_alert_colony_button : Button = get_button_from_nodepath(^"./topbar/alert_colony")
if diplomacy_alert_colony_button:
diplomacy_alert_colony_button.pressed.connect(
@@ -237,10 +237,10 @@ func _ready() -> void:
_diplomacy_alert_great_power_texture = get_gfx_sprite_texture_from_nodepath(^"./topbar/alert_loosing_gp")
# Military
- _military_army_size_label = get_gui_text_label_from_nodepath(^"./topbar/military_army_value")
- _military_navy_size_label = get_gui_text_label_from_nodepath(^"./topbar/military_navy_value")
- _military_mobilisation_size_label = get_gui_text_label_from_nodepath(^"./topbar/military_manpower_value")
- _military_leadership_points_label = get_gui_text_label_from_nodepath(^"./topbar/military_leadership_value")
+ _military_army_size_label = get_gui_label_from_nodepath(^"./topbar/military_army_value")
+ _military_navy_size_label = get_gui_label_from_nodepath(^"./topbar/military_navy_value")
+ _military_mobilisation_size_label = get_gui_label_from_nodepath(^"./topbar/military_manpower_value")
+ _military_leadership_points_label = get_gui_label_from_nodepath(^"./topbar/military_leadership_value")
_update_info()
_update_speed_controls()