summaryrefslogtreecommitdiffstats
path: root/pause_menu_map.gd
blob: 2f01ab4f59613453a74ad50dccadc7f11a4713d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class_name PauseMenuMap
extends PauseMenuPage

var active_map_room: MapRoom

func _on_tree_entered() -> void:
	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)
		position = -pos + delta - active_map_room.size / 2

func set_room_name(n: String):
	if active_map_room: active_map_room.unhighlight()
	active_map_room = get_node_or_null(n)