Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions game/src/Systems/Session/Map/MapView.gd
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,13 @@ func _ready() -> void:


func _notification(what: int) -> void:
if what == NOTIFICATION_WM_MOUSE_EXIT:
_mouse_over_viewport = false
province_unhovered.emit()
match what:
NOTIFICATION_WM_MOUSE_ENTER:
_mouse_over_viewport = true
queue_province_hover_update()
NOTIFICATION_WM_MOUSE_EXIT, NOTIFICATION_WM_WINDOW_FOCUS_OUT:
_mouse_over_viewport = false
province_unhovered.emit()


func _world_to_map_coords(pos: Vector3) -> Vector2:
Expand Down Expand Up @@ -261,7 +265,6 @@ var _cardinal_movement_vector := Vector2.ZERO

func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
_mouse_over_viewport = true
queue_province_hover_update()

elif event.is_action(_action_north) or event.is_action(_action_south)\
Expand Down Expand Up @@ -340,10 +343,6 @@ func _process(delta: float) -> void:
if _cardinal_movement_vector != Vector2.ZERO and get_window().gui_get_focus_owner() != null:
_cardinal_movement_vector = Vector2.ZERO

if _is_viewport_inactive():
Comment thread
BrickPi marked this conversation as resolved.
_mouse_over_viewport = false
province_unhovered.emit()

_viewport_dims = Vector2(GameSettings.get_game_resolution())
# Process movement
_movement_process(delta)
Expand Down
Loading