summaryrefslogtreecommitdiffstats
path: root/map.gd
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-11-21 21:38:49 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-11-21 21:39:07 +0200
commit6824649c8961b8aa695b6be805401fa357a61793 (patch)
tree0441c52355be55518cd74a08b363740d78a093df /map.gd
parent242dec6cb636be957fe1c13415762f1e204deef7 (diff)
Improve map
Diffstat (limited to 'map.gd')
-rw-r--r--map.gd17
1 files changed, 10 insertions, 7 deletions
diff --git a/map.gd b/map.gd
index 4f39972..425dee4 100644
--- a/map.gd
+++ b/map.gd
@@ -10,17 +10,20 @@ func _ready():
func set_active_name(map_room_name: String):
if active_map_room: active_map_room.unhighlight()
- active_map_room = get_node_or_null(map_room_name)
+ active_map_room = get_node_or_null("Rooms/" + map_room_name)
- if active_map_room: active_map_room.highlight()
+ if active_map_room:
+ active_map_room.highlight()
+ var pos = active_map_room.position
+ var size = get_viewport().get_visible_rect().size
+ var delta = Vector2(size.x / 2, size.y / 2)
+ $Rooms.position = -pos + delta - active_map_room.size / 2
+ #$Rooms.position = -pos + Vector2(10, 10)
func show_map():
visible = true
- $UnpauseButton.mouse_filter = Control.MOUSE_FILTER_STOP
+ get_tree().call_group("ui_movement", "set_visible", false)
func hide_map():
visible = false
- $UnpauseButton.mouse_filter = Control.MOUSE_FILTER_IGNORE
-
-func _on_unpause_button_pressed() -> void:
- Input.action_press("menu")
+ get_tree().call_group("ui_movement", "set_visible", true)