aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/GameSession/NationManagementScreen/ProductionMenu.gd
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-02-02 21:19:21 +0100
committer hop311 <hop3114@gmail.com>2024-02-19 20:17:31 +0100
commit1455861632cd50f48f6e8ef8c50004087eff36f1 (patch)
tree5ce200d70f5f12d76dfd489ed06a6bb88204fd1c /game/src/Game/GameSession/NationManagementScreen/ProductionMenu.gd
parent576986af57db806af284bbc05a799e72f113f35c (diff)
Basic Nation Management Screen frameworknation-management-screens
Diffstat (limited to 'game/src/Game/GameSession/NationManagementScreen/ProductionMenu.gd')
-rw-r--r--game/src/Game/GameSession/NationManagementScreen/ProductionMenu.gd34
1 files changed, 34 insertions, 0 deletions
diff --git a/game/src/Game/GameSession/NationManagementScreen/ProductionMenu.gd b/game/src/Game/GameSession/NationManagementScreen/ProductionMenu.gd
new file mode 100644
index 0000000..938f8e7
--- /dev/null
+++ b/game/src/Game/GameSession/NationManagementScreen/ProductionMenu.gd
@@ -0,0 +1,34 @@
+extends GUINode
+
+var _active : bool = false
+
+const _screen : NationManagement.Screen = NationManagement.Screen.PRODUCTION
+
+func _ready() -> void:
+ GameSingleton.gamestate_updated.connect(_update_info)
+
+ Events.NationManagementScreens.update_active_nation_management_screen.connect(_on_update_active_nation_management_screen)
+
+ add_gui_element("country_production", "country_production")
+
+ var close_button : Button = get_button_from_nodepath(^"./country_production/close_button")
+ if close_button:
+ close_button.pressed.connect(Events.NationManagementScreens.close_nation_management_screen.bind(_screen))
+
+ _update_info()
+
+func _notification(what : int) -> void:
+ match what:
+ NOTIFICATION_TRANSLATION_CHANGED:
+ _update_info()
+
+func _on_update_active_nation_management_screen(active_screen : NationManagement.Screen) -> void:
+ _active = active_screen == _screen
+ _update_info()
+
+func _update_info() -> void:
+ if _active:
+ # TODO - update UI state
+ show()
+ else:
+ hide()