aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/GameSession/NationManagementScreen/DiplomacyMenu.gd
diff options
context:
space:
mode:
Diffstat (limited to 'game/src/Game/GameSession/NationManagementScreen/DiplomacyMenu.gd')
-rw-r--r--game/src/Game/GameSession/NationManagementScreen/DiplomacyMenu.gd34
1 files changed, 34 insertions, 0 deletions
diff --git a/game/src/Game/GameSession/NationManagementScreen/DiplomacyMenu.gd b/game/src/Game/GameSession/NationManagementScreen/DiplomacyMenu.gd
new file mode 100644
index 0000000..fb11a31
--- /dev/null
+++ b/game/src/Game/GameSession/NationManagementScreen/DiplomacyMenu.gd
@@ -0,0 +1,34 @@
+extends GUINode
+
+var _active : bool = false
+
+const _screen : NationManagement.Screen = NationManagement.Screen.DIPLOMACY
+
+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_diplomacy", "country_diplomacy")
+
+ var close_button : Button = get_button_from_nodepath(^"./country_diplomacy/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()