diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-11-21 17:07:57 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-11-21 17:08:13 +0200 |
| commit | 242dec6cb636be957fe1c13415762f1e204deef7 (patch) | |
| tree | b0a3c7e1281932abe73f40041082cacd10e28cd4 /map.gd | |
| parent | 015e7c2d4f237c7a4f6dec21680f1726ca2fa9dc (diff) | |
Refactor map
Diffstat (limited to 'map.gd')
| -rw-r--r-- | map.gd | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -4,23 +4,15 @@ extends CanvasLayer @onready var top: Top = get_tree().root.get_node("Top") var active_map_room: MapRoom -@export var inactive_color: Color -@export var active_color: Color - func _ready(): hide_map() func set_active_name(map_room_name: String): - if active_map_room: - active_map_room.color = inactive_color + if active_map_room: active_map_room.unhighlight() - if has_node(map_room_name): - active_map_room = get_node(map_room_name) - else: - active_map_room = null + active_map_room = get_node_or_null(map_room_name) - if active_map_room: - active_map_room.color = active_color + if active_map_room: active_map_room.highlight() func show_map(): visible = true |
