diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-05-08 18:22:25 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-05-08 18:22:25 +0200 |
commit | 042ab4383cfb9b747d7b2cf0992546bbd95cef00 (patch) | |
tree | b52e4b850b0a639ad867cb6a7b155cc6d6c62562 /game/src/Game/GameSession/MapView.gd | |
parent | c29cc0dabe3e3c7d03280e74d2d10fc3cc479c7f (diff) |
Add right click map for diplomacy window
Diffstat (limited to 'game/src/Game/GameSession/MapView.gd')
-rw-r--r-- | game/src/Game/GameSession/MapView.gd | 5 |
1 files changed, 5 insertions, 0 deletions
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!") |