diff options
author | Hop311 <Hop3114@gmail.com> | 2024-08-30 23:29:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-30 23:29:57 +0200 |
commit | f54e454afb90f8868e7c62529e2a388fdaadf20b (patch) | |
tree | f19dbcdfe613397e86dc52cc34e0a443bd0f3e96 /game/src/Game/GameSession/NationManagementScreen | |
parent | 855e5b087459da19caf230cf22d99462680b268e (diff) | |
parent | d7672f406406eea46625bc725690651f28211e19 (diff) |
Merge pull request #251 from OpenVicProject/gui-text-label
Add GUILabel (colour code + currency icon support)
Diffstat (limited to 'game/src/Game/GameSession/NationManagementScreen')
-rw-r--r-- | game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd | 150 | ||||
-rw-r--r-- | game/src/Game/GameSession/NationManagementScreen/PopulationMenu.gd | 50 |
2 files changed, 96 insertions, 104 deletions
diff --git a/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd b/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd index 42f0791..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 : Label -var _middle_class_label : Label -var _upper_class_label : Label -var _gold_label : Label -var _total_inc_label : Label +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 : Label -var _total_funds_label : Label -var _debt_val_label : Label -var _interest_val_label : Label +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 : Label -var _nat_stock_exp_label : Label -var _mil_cost_val_label : Label -var _overseas_cost_val_label : Label -var _ind_sub_val_label : Label -var _admin_efficiency_label : Label -var _education_exp_label : Label -var _administration_exp_label : Label -var _social_exp_label : Label -var _military_exp_label : Label -var _total_exp_label : Label +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 : Label -var _tariff_val_label : Label -var _diplomatic_balance_label : Label -var _balance_label : Label +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,92 +55,92 @@ func _ready() -> void: # labels # income - _lower_class_label = get_label_from_nodepath(^"./country_budget/tax_0_inc") - _middle_class_label = get_label_from_nodepath(^"./country_budget/tax_1_inc") - _upper_class_label = get_label_from_nodepath(^"./country_budget/tax_2_inc") - _gold_label = get_label_from_nodepath(^"./country_budget/gold_inc") - _total_inc_label = get_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_label_from_nodepath(^"./country_budget/national_bank_val") - _total_funds_label = get_label_from_nodepath(^"./country_budget/total_funds_val") - _debt_val_label = get_label_from_nodepath(^"./country_budget/debt_val") - _interest_val_label = get_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_label_from_nodepath(^"./country_budget/nat_stock_val") - _nat_stock_exp_label = get_label_from_nodepath(^"./country_budget/nat_stock_est") - _mil_cost_val_label = get_label_from_nodepath(^"./country_budget/mil_cost_val") - _overseas_cost_val_label = get_label_from_nodepath(^"./country_budget/overseas_cost_val") - _ind_sub_val_label = get_label_from_nodepath(^"./country_budget/ind_sub_val") - _admin_efficiency_label = get_label_from_nodepath(^"./country_budget/admin_efficiency") - _education_exp_label = get_label_from_nodepath(^"./country_budget/exp_val_0") - _administration_exp_label = get_label_from_nodepath(^"./country_budget/exp_val_1") - _social_exp_label = get_label_from_nodepath(^"./country_budget/exp_val_2") - _military_exp_label = get_label_from_nodepath(^"./country_budget/exp_val_3") - _total_exp_label = get_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_label_from_nodepath(^"./country_budget/tariffs_percent") - _tariff_val_label = get_label_from_nodepath(^"./country_budget/tariff_val") - _diplomatic_balance_label = get_label_from_nodepath(^"./country_budget/diplomatic_balance") - _balance_label = get_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 var _lower_class_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/tax_0_slider") if _lower_class_slider and _lower_class_label: - _lower_class_slider.value_changed.connect(func(value : int) -> void: _lower_class_label.text = "%s£" % value) + _lower_class_slider.value_changed.connect(func(value : int) -> void: _lower_class_label.text = "%s¤" % GUINode.float_to_string_dp(value, 3 if abs(value) < 1000 else 1)) _lower_class_slider.emit_value_changed() var _middle_class_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/tax_1_slider") if _middle_class_slider and _middle_class_label: - _middle_class_slider.value_changed.connect(func(value : int) -> void: _middle_class_label.text = "%s£" % value) + _middle_class_slider.value_changed.connect(func(value : int) -> void: _middle_class_label.text = "%s¤" % GUINode.float_to_string_dp(value, 3 if abs(value) < 1000 else 1)) _middle_class_slider.emit_value_changed() var _upper_class_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/tax_2_slider") if _upper_class_slider and _upper_class_label: - _upper_class_slider.value_changed.connect(func(value : int) -> void: _upper_class_label.text = "%s£" % value) + _upper_class_slider.value_changed.connect(func(value : int) -> void: _upper_class_label.text = "%s¤" % GUINode.float_to_string_dp(value, 3 if abs(value) < 1000 else 1)) _upper_class_slider.emit_value_changed() # costs var _land_stockpile_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/land_stockpile_slider") if _land_stockpile_slider and _mil_cost_val_label: - _land_stockpile_slider.value_changed.connect(func(value : int) -> void: _mil_cost_val_label.text = "%s£" % value) + _land_stockpile_slider.value_changed.connect(func(value : int) -> void: _mil_cost_val_label.text = "%s¤" % GUINode.float_to_string_dp(value, 2)) _land_stockpile_slider.emit_value_changed() var _naval_stockpile_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/naval_stockpile_slider") if _naval_stockpile_slider and _overseas_cost_val_label: - _naval_stockpile_slider.value_changed.connect(func(value : int) -> void: _overseas_cost_val_label.text = "%s£" % value) + _naval_stockpile_slider.value_changed.connect(func(value : int) -> void: _overseas_cost_val_label.text = "%s¤" % GUINode.float_to_string_dp(value, 1)) _naval_stockpile_slider.emit_value_changed() var _projects_stockpile_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/projects_stockpile_slider") if _projects_stockpile_slider: if _nat_stock_val_label: - _projects_stockpile_slider.value_changed.connect(func(value : int) -> void: _nat_stock_val_label.text = "%s£" % value) + _projects_stockpile_slider.value_changed.connect(func(value : int) -> void: _nat_stock_val_label.text = "%s¤" % GUINode.float_to_string_dp_dynamic(value)) if _nat_stock_exp_label: - _projects_stockpile_slider.value_changed.connect(func(value : int) -> void: _nat_stock_exp_label.text = "%s£" % value) + _projects_stockpile_slider.value_changed.connect(func(value : int) -> void: _nat_stock_exp_label.text = "%s¤" % GUINode.float_to_string_dp_dynamic(value)) _projects_stockpile_slider.emit_value_changed() var _exp_0_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/exp_0_slider") if _exp_0_slider and _education_exp_label: - _exp_0_slider.value_changed.connect(func(value : int) -> void: _education_exp_label.text = "%s£" % value) + _exp_0_slider.value_changed.connect(func(value : int) -> void: _education_exp_label.text = "%s¤" % GUINode.float_to_string_dp_dynamic(value)) _exp_0_slider.emit_value_changed() var _exp_1_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/exp_1_slider") if _exp_1_slider: if _administration_exp_label: - _exp_1_slider.value_changed.connect(func(value : int) -> void: _administration_exp_label.text = "%s£" % value) + _exp_1_slider.value_changed.connect(func(value : int) -> void: _administration_exp_label.text = "%s¤" % GUINode.float_to_string_dp_dynamic(value)) if _admin_efficiency_label: - _exp_1_slider.value_changed.connect(func(value : int) -> void: _admin_efficiency_label.text = "%s%%" % value) + _exp_1_slider.value_changed.connect(func(value : int) -> void: _admin_efficiency_label.text = "%s%%" % GUINode.float_to_string_dp(value, 1)) _exp_1_slider.emit_value_changed() var _exp_2_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/exp_2_slider") if _exp_2_slider and _social_exp_label: - _exp_2_slider.value_changed.connect(func(value : int) -> void: _social_exp_label.text = "%s£" % value) + _exp_2_slider.value_changed.connect(func(value : int) -> void: _social_exp_label.text = "%s¤" % GUINode.float_to_string_dp_dynamic(value)) _exp_2_slider.emit_value_changed() var _exp_3_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/exp_3_slider") if _exp_3_slider and _military_exp_label: - _exp_3_slider.value_changed.connect(func(value : int) -> void: _military_exp_label.text = "%s£" % value) + _exp_3_slider.value_changed.connect(func(value : int) -> void: _military_exp_label.text = "%s¤" % GUINode.float_to_string_dp_dynamic(value)) _exp_3_slider.emit_value_changed() # others var _tariff_slider : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/tariff_slider") if _tariff_slider: if _tariff_val_label: - _tariff_slider.value_changed.connect(func(value : int) -> void: _tariff_val_label.text = "%s£" % value) + _tariff_slider.value_changed.connect(func(value : int) -> void: _tariff_val_label.text = "%s¤" % GUINode.float_to_string_dp_dynamic(value)) if _tariffs_percent_label: - _tariff_slider.value_changed.connect(func(value : int) -> void: _tariffs_percent_label.text = "%s%%" % value) + _tariff_slider.value_changed.connect(func(value : int) -> void: _tariffs_percent_label.text = "%s%%" % GUINode.float_to_string_dp(value, 1)) _tariff_slider.emit_value_changed() # debt buttons @@ -188,38 +188,36 @@ func _update_info() -> void: if _active: if _gold_label: - _gold_label.text = "%s£" % (_incVal - (_incVal % 7)) + _gold_label.text = "%s¤" % GUINode.float_to_string_dp(_incVal - (_incVal % 7), 1) if _total_inc_label: - _total_inc_label.text = "%s£" % _incVal + _total_inc_label.text = "%s¤" % GUINode.float_to_string_dp_dynamic(_incVal) if _national_bank_label: - _national_bank_label.text = "%s£" % (_incVal * 2) + _national_bank_label.text = "%s¤" % GUINode.float_to_string_suffixed(_incVal * 2) if _total_funds_label: - _total_funds_label.text = "%s£" % (_incVal * 3) + _total_funds_label.text = "%s¤" % GUINode.float_to_string_suffixed(_incVal * 3) if _debt_val_label: - _debt_val_label.text = "%s£" % (_incVal * 4) + _debt_val_label.text = "%s¤" % GUINode.float_to_string_dp(_incVal * 4, 1) if _interest_val_label: - _interest_val_label.text = "%s£" % (_incVal * 5) + _interest_val_label.text = "%s¤" % GUINode.float_to_string_dp(_incVal * 5, 2) if _ind_sub_val_label: - _ind_sub_val_label.text = "%s£" % (_incVal * 6) + _ind_sub_val_label.text = "%s¤" % GUINode.float_to_string_dp(_incVal * 6, 1) if _diplomatic_balance_label: - _diplomatic_balance_label.text = "%s£" % (_incVal * 8) + # TODO - check colours and +/- when non-zero + _diplomatic_balance_label.text = "§Y%s¤" % GUINode.float_to_string_dp(_incVal * 8, 1) if _total_exp_label: - _total_exp_label.text = "%s£" % (_incVal + 1) + _total_exp_label.text = "%s¤" % GUINode.float_to_string_dp_dynamic(_incVal + 1) if _balance_label: - _balance_label.text = "%s£" % _incVal - _balance_label.add_theme_color_override(&"font_color", - Color.DARK_GREEN if _incVal > 0 else - (Color.RED if _incVal < 0 else Color.BLACK) - ) + var balance : float = _incVal * 2.5 + _balance_label.text = "§%s%s¤" % ["G+" if balance > 0.0 else "R" if balance < 0.0 else "Y+", GUINode.float_to_string_dp_dynamic(balance)] # TODO - set strata tax and debt charts # TODO - update sliders to reflect changes in limits diff --git a/game/src/Game/GameSession/NationManagementScreen/PopulationMenu.gd b/game/src/Game/GameSession/NationManagementScreen/PopulationMenu.gd index ad15fbb..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[Label] -var _province_list_size_labels : Array[Label] +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[Label] +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[Label] +var _pop_list_culture_labels : Array[GUILabel] var _pop_list_religion_icons : Array[GFXSpriteTexture] -var _pop_list_location_labels : Array[Label] -var _pop_list_militancy_labels : Array[Label] -var _pop_list_consciousness_labels : Array[Label] +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[Label] +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[Label] +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_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_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,9 +273,9 @@ 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 : Label = GUINode.get_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.text = distribution_names[index] + name_label.set_text(distribution_names[index]) distribution_chart = GUINode.get_gfx_pie_chart_texture_from_node(distribution_panel.get_node(^"./chart")) distribution_list = GUINode.get_gui_listbox_from_node(distribution_panel.get_node(^"./member_names")) @@ -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_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,21 +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 : Label = GUINode.get_label_from_node(pop_row_panel.get_node(^"./pop_nation")) - if culture_label: - culture_label.set_text_overrun_behavior(TextServer.OVERRUN_TRIM_ELLIPSIS) + 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 : Label = GUINode.get_label_from_node(pop_row_panel.get_node(^"./pop_location")) - if location_label: - location_label.set_text_overrun_behavior(TextServer.OVERRUN_TRIM_ELLIPSIS) + 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_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_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"))) @@ -350,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_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: @@ -394,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_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: @@ -462,7 +458,6 @@ func _update_province_list(scroll_index : int = -1) -> void: GUINode.format_province_name(province_list_info[name_key]) if type == MenuSingleton.LIST_ENTRY_PROVINCE else province_list_info[name_key] ) - _province_list_name_labels[index].set_text_overrun_behavior(TextServer.OVERRUN_TRIM_ELLIPSIS) if _province_list_size_labels[index]: _province_list_size_labels[index].set_text(GUINode.int_to_string_suffixed(province_list_info[size_key])) @@ -551,12 +546,11 @@ func _update_distributions(): if colour_icon_rect: colour_icon_rect.set_modulate(distribution_row[slice_colour_key]) - var identifier_label : Label = GUINode.get_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_overrun_behavior(TextServer.OVERRUN_TRIM_ELLIPSIS) identifier_label.set_text(distribution_row[slice_identifier_key]) - var weight_label : Label = GUINode.get_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)) |