From 042ab4383cfb9b747d7b2cf0992546bbd95cef00 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Wed, 8 May 2024 12:22:25 -0400 Subject: Add right click map for diplomacy window --- game/src/Game/GameSession/MapView.gd | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'game/src/Game/GameSession') diff --git a/game/src/Game/GameSession/MapView.gd b/game/src/Game/GameSession/MapView.gd index a83c790..5b3fa04 100644 --- a/game/src/Game/GameSession/MapView.gd +++ b/game/src/Game/GameSession/MapView.gd @@ -13,6 +13,7 @@ const _action_zoom_in : StringName = &"map_zoom_in" const _action_zoom_out : StringName = &"map_zoom_out" const _action_drag : StringName = &"map_drag" const _action_click : StringName = &"map_click" +const _action_right_click : StringName = &"map_right_click" @export var _camera : Camera3D @@ -185,6 +186,10 @@ func _unhandled_input(event : InputEvent) -> void: GameSingleton.set_selected_province(GameSingleton.get_province_index_from_uv_coords(_mouse_pos_map)) else: print("Clicked outside the map!") + elif event.is_action_pressed(_action_right_click): + if _mouse_over_viewport: + if _map_mesh.is_valid_uv_coord(_mouse_pos_map): + Events.NationManagementScreens.open_nation_management_screen(NationManagement.Screen.DIPLOMACY) elif event.is_action_pressed(_action_drag): if _drag_active: push_warning("Drag being activated while already active!") -- cgit v1.2.3-56-ga3b1