aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game
diff options
context:
space:
mode:
author BrickPi <ajmach6@gmail.com>2024-11-04 23:33:44 +0100
committer BrickPi <ajmach6@gmail.com>2024-11-04 23:33:51 +0100
commit05f564d918ea939e5844262c74154c005d279bed (patch)
tree3f3d60e6c408deb1c54bfb3a10ef47700e593fdd /game/src/Game
parent7f7510cd3c3541b596d97eff8ade42e819d82c85 (diff)
tech schools
Diffstat (limited to 'game/src/Game')
-rw-r--r--game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd23
1 files changed, 22 insertions, 1 deletions
diff --git a/game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd b/game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
index 97c3390..3d2275b 100644
--- a/game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
+++ b/game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
@@ -4,6 +4,9 @@ var _active : bool = false
const _screen : NationManagement.Screen = NationManagement.Screen.TECHNOLOGY
+var _tech_school : GUILabel
+var _tech_school_modifiers : GUIOverlappingElementsBox
+
func _ready() -> void:
GameSingleton.gamestate_updated.connect(_update_info)
@@ -11,6 +14,11 @@ func _ready() -> void:
add_gui_element("country_technology", "country_technology")
+ _tech_school = get_gui_label_from_nodepath(^"./country_technology/administration_type")
+ _tech_school_modifiers = get_gui_overlapping_elements_box_from_nodepath(^"./country_technology/school_bonus_icons")
+ if _tech_school_modifiers:
+ _tech_school_modifiers.set_gui_child_element_name("country_technology", "school_icon_window")
+
var close_button : GUIIconButton = get_gui_icon_button_from_nodepath(^"./country_technology/close_button")
if close_button:
close_button.pressed.connect(Events.NationManagementScreens.close_nation_management_screen.bind(_screen))
@@ -28,7 +36,20 @@ func _on_update_active_nation_management_screen(active_screen : NationManagement
func _update_info() -> void:
if _active:
- # TODO - update UI state
+ var info : Dictionary = MenuSingleton.get_technology_menu_info()
+ if _tech_school:
+ _tech_school.set_text(info.get("tech_school"))
+
+ if _tech_school_modifiers:
+ var mod_names : Array = info.get("tech_school_mod_names")
+ var mod_values : Array = info.get("tech_school_mod_values")
+ var mod_icons : Array = info.get("tech_school_mod_icons")
+ var mod_count = mod_names.size()
+ _tech_school_modifiers.set_child_count(mod_count)
+ for i in range(mod_count):
+ get_gui_icon_from_nodepath("./country_technology/school_bonus_icons/school_icon_window_{x}/main_icon".format({"x": i})).set_icon_index(mod_icons[i])
+ get_gui_icon_from_nodepath("./country_technology/school_bonus_icons/school_icon_window_{x}/plusminus_icon".format({"x": i})).set_icon_index(2 if mod_values[i] > 0 else 1)
+
show()
else:
hide()