extends Node signal interaction_opened signal interaction_closed var active: bool = false var current_poi: Node = null func open_poi(poi: Node) -> void: active = true current_poi = poi InteractionUI.show_menu(poi.poi_name, _get_main_options()) func _get_main_options() -> Array: return [ { "label": "Erkunden", "action": "explore" }, { "label": "Ausruhen", "action": "rest" }, { "label": "Beenden", "action": "close" }, ] func handle_selection(action: String) -> void: match action: "explore": var text := "Das wurde besucht." if current_poi and current_poi.has_method("get_event_text"): text = current_poi.get_event_text() InteractionUI.show_text(text) "rest": var player := get_tree().get_first_node_in_group("player") if player and player.has_method("heal_full"): player.heal_full() InteractionUI.show_text("Du rastest eine Weile...\nDu fühlst dich erholt.") "close": close() _: # POI-spezifische Aktionen (z.B. Ja/Nein bei einem Portal) if current_poi and current_poi.has_method("handle_interaction_action"): current_poi.handle_interaction_action(action) # Für POIs außerhalb des generischen Menüs (z.B. Portale): Panel mit reinem # Info-Text öffnen, ohne die Erkunden/Ausruhen/Beenden-Optionen. func open_message(poi: Node, title: String, text: String) -> void: active = true current_poi = poi InteractionUI.show_menu(title, []) InteractionUI.show_text(text) func close() -> void: active = false current_poi = null InteractionUI.hide_menu()