aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Gone2Daly <71726742+Gone2Daly@users.noreply.github.com>2023-04-13 17:37:35 +0200
committer Gone2Daly <71726742+Gone2Daly@users.noreply.github.com>2023-04-13 17:37:35 +0200
commit7523c42190c9211ea65db3b00b9476487c61052a (patch)
tree766a114cbd91d54b492705e56b07d910a17df8d0
parent7a84dc859a991ebb385df205a6d74b5de8ec6980 (diff)
Fix click minimap
Fix for not being able to move camera just by click on minimap
-rw-r--r--game/src/GameSession/Minimap.gd4
1 files changed, 4 insertions, 0 deletions
diff --git a/game/src/GameSession/Minimap.gd b/game/src/GameSession/Minimap.gd
index d633fdf..d904b3d 100644
--- a/game/src/GameSession/Minimap.gd
+++ b/game/src/GameSession/Minimap.gd
@@ -21,6 +21,10 @@ func _unhandled_input(event : InputEvent):
var pos_clicked := get_local_mouse_position() / size - Vector2(0.5, 0.5)
if abs(pos_clicked.x) < 0.5 and abs(pos_clicked.y) < 0.5:
minimap_clicked.emit(pos_clicked)
+ if event != InputEventMouseMotion and Input.is_action_pressed(_action_click):
+ var pos_clicked := get_local_mouse_position() / size - Vector2(0.5, 0.5)
+ if abs(pos_clicked.x) < 0.5 and abs(pos_clicked.y) < 0.5:
+ minimap_clicked.emit(pos_clicked)
# Returns the point on the line going through p and q with the specific x coord
func _intersect_x(p : Vector2, q : Vector2, x : float) -> Vector2: