aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-08-17 20:25:25 +0200
committer GitHub <noreply@github.com>2023-08-17 20:25:25 +0200
commitaa9961b27a4859f088b037dd8037accb4e3119be (patch)
treee93af9cabfbefc6ea089a153399e04d74e4b605a /game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
parentff0d38b5d53fa95609f2587a2be5205f0c0d3118 (diff)
parent9a086523513994b0183d5f7d479b2f82412177f6 (diff)
Merge pull request #146 from Nemrav/piechart2
Add Piecharts (gd 4.1)
Diffstat (limited to 'game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd')
-rw-r--r--game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd7
1 files changed, 7 insertions, 0 deletions
diff --git a/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd b/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
index 9a3690e..0220be2 100644
--- a/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
+++ b/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
@@ -7,6 +7,9 @@ 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"
@@ -113,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)