aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-02-24 14:17:07 +0100
committer hop311 <hop3114@gmail.com>2024-02-24 14:17:07 +0100
commit843edde55306e3fbdb5e37ef9b7c09c7b53f50c4 (patch)
tree487fea19d42106c08b60f5bba99bc76485073002 /game/src/Game
parent5d7c6eafe35e2c6e952bc0b3f91d27d760c8e75e (diff)
Added GUIScrollbar and GFXCorneredTileSupportingTexturescrollbar
Diffstat (limited to 'game/src/Game')
-rw-r--r--game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd14
-rw-r--r--game/src/Game/GameSession/ProvinceOverviewPanel.gd6
2 files changed, 17 insertions, 3 deletions
diff --git a/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd b/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd
index 7158333..0717c60 100644
--- a/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd
+++ b/game/src/Game/GameSession/NationManagementScreen/BudgetMenu.gd
@@ -15,6 +15,20 @@ func _ready() -> void:
if close_button:
close_button.pressed.connect(Events.NationManagementScreens.close_nation_management_screen.bind(_screen))
+ # Scrollbar test code
+ var test_scrollbar : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/tax_0_slider")
+ var test_label : Label = get_label_from_nodepath(^"./country_budget/tax_0_inc")
+ test_scrollbar.value_changed.connect(func(value : int) -> void: test_label.text = str(value))
+ test_scrollbar.set_range_limits(20, 80)
+ test_scrollbar.emit_value_changed()
+
+ var tariff_scrollbar : GUIScrollbar = get_gui_scrollbar_from_nodepath(^"./country_budget/tariff_slider")
+ var tariff_label : Label = get_label_from_nodepath(^"./country_budget/tariffs_percent")
+ tariff_scrollbar.value_changed.connect(func(value : int) -> void: tariff_label.text = "%s%%" % GUINode.float_to_formatted_string(value, 1))
+ tariff_scrollbar.set_limits(-100, 100)
+ tariff_scrollbar.set_range_limits(-45, 80)
+ tariff_scrollbar.emit_value_changed()
+
_update_info()
func _notification(what : int) -> void:
diff --git a/game/src/Game/GameSession/ProvinceOverviewPanel.gd b/game/src/Game/GameSession/ProvinceOverviewPanel.gd
index bf3c3dc..32f9600 100644
--- a/game/src/Game/GameSession/ProvinceOverviewPanel.gd
+++ b/game/src/Game/GameSession/ProvinceOverviewPanel.gd
@@ -309,14 +309,14 @@ func _update_info() -> void:
if _rgo_income_label:
# TODO - add £ sign and replace placeholder with actual value
- _rgo_income_label.text = GameSingleton.float_to_formatted_string(12.34567)
+ _rgo_income_label.text = GUINode.float_to_formatted_string(12.34567, 3)
if _rgo_employment_percentage_texture:
pass
if _rgo_employment_population_label:
# TODO - replace placeholder with actual value
- _rgo_employment_population_label.text = GameSingleton.int_to_formatted_string(_province_info.get(_province_info_total_population_key, 0) / 10)
+ _rgo_employment_population_label.text = GUINode.int_to_formatted_string(_province_info.get(_province_info_total_population_key, 0) / 10)
if _rgo_employment_percentage_label:
pass
@@ -331,7 +331,7 @@ func _update_info() -> void:
pass
if _total_population_label:
- _total_population_label.text = GameSingleton.int_to_formatted_string(_province_info.get(_province_info_total_population_key, 0))
+ _total_population_label.text = GUINode.int_to_formatted_string(_province_info.get(_province_info_total_population_key, 0))
if _migration_label:
pass