aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-08-10 13:00:54 +0200
committer Hop311 <hop3114@gmail.com>2023-08-10 13:00:54 +0200
commit4c43951e70aaa2e7265d3b3f3c4964c048b9328d (patch)
treec6d46df1686710ccacd63ceb16d687cb55877457 /game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
parent505176d9cabe76cff7cdac6b4d4ef1c77ccb00d9 (diff)
PieChart data and image now come from c++ layer
Diffstat (limited to 'game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd')
-rw-r--r--game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd11
1 files changed, 6 insertions, 5 deletions
diff --git a/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd b/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
index 04a035c..0220be2 100644
--- a/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
+++ b/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
@@ -7,6 +7,8 @@ extends PanelContainer
@export var _rgo_icon_texture_rect : TextureRect
@export var _rgo_name_label : Label
@export var _buildings_container : Container
+@export var _pop_type_chart : PieChart
+@export var _pop_ideology_chart : PieChart
@export var _pop_culture_chart : PieChart
const _missing_suffix : String = "_MISSING"
@@ -114,6 +116,10 @@ func _update_info() -> void:
_total_population_label.text = Localisation.tr_number(_province_info.get(GameSingleton.get_province_info_total_population_key(), 0))
+ _pop_type_chart.set_to_distribution(_province_info.get(GameSingleton.get_province_info_pop_types_key(), {}))
+ _pop_ideology_chart.set_to_distribution(_province_info.get(GameSingleton.get_province_info_pop_ideologies_key(), {}))
+ _pop_culture_chart.set_to_distribution(_province_info.get(GameSingleton.get_province_info_pop_cultures_key(), {}))
+
_rgo_name_label.text = _province_info.get(GameSingleton.get_province_info_rgo_key(),
GameSingleton.get_province_info_rgo_key() + _missing_suffix)
_rgo_icon_texture_rect.texture = GameSingleton.get_good_icon_texture(_rgo_name_label.text)
@@ -122,11 +128,6 @@ func _update_info() -> void:
for i in max(buildings.size(), _building_rows.size()):
_set_building_row(i, buildings[i] if i < buildings.size() else {})
- #PLACEHOLDER for updating piechart
- _pop_culture_chart.addOrReplaceLabel("NORTH_GERMAN",50,"North German Culture",Color.DIM_GRAY)
- _pop_culture_chart.addOrReplaceLabel("FRENCH",25,"French Culture",Color.BLUE)
- _pop_culture_chart.addOrReplaceLabel("SOUTH_GERMAN",7,"South German Culture",Color.FIREBRICK)
-
show()
else:
hide()