Jonas Reith c6d7e6c84e Restructure project into boot/autoload/world/player folders
Flat root layout replaced with a domain-based structure:
- autoload/    the two existing singleton scripts (InteractionManager,
               InteractionUI) — grouped by role, matching project.godot's
               [autoload] section
- world/       the flying island: terrain.gd, and world/poi/ for the POI
               marker + gate scripts/scenes
- player/      everything about the player as a character: player.gd/.tscn,
               camera_rig.gd (it only exists to follow the player)
- boot/        created empty for now, will hold the opening/menu screens

main.tscn renamed to world/island.tscn — "main" stops making sense once
the actual run/main_scene becomes a boot screen (next commit). Verified
via grep that main.tscn was referenced nowhere else by path (only by UID
elsewhere, which self-heals).

Every .gd got its .uid sidecar moved alongside it. Two ext_resource
entries had no UID (poi_gate.tscn's own script ref, and island.tscn's
ref to poi_gate.tscn) and needed their path= fixed by hand; everything
else is UID-based and resolved itself after a project reimport.

Also removed two untracked-looking but actually committed editor temp
files (preview_scene.tscn*.tmp, leftovers from the unused hterrain
addon, referenced nowhere).

Verified headless: all 8 affected scenes (island, poi, poi_gate,
player, interaction_ui, and the three debug prototypes that reference
moved files) load with exit code 0. No behavior change, pure move.
2026-08-27 09:18:17 +02:00

49 lines
1.3 KiB
GDScript
Executable File

extends Area3D
@export var poi_name: String = "Ruinen"
@export var marker_color: Color = Color.WHITE
@onready var sprite: AnimatedSprite3D = $AnimatedSprite3D
@onready var name_label: Label3D = $Billboard/NameLabel
@onready var prompt: Label3D = $Billboard/InteractionPrompt
var player_nearby: bool = false
var visited: bool = false
func _ready() -> void:
prompt.visible = false
prompt.text = "[F] Interact"
_update_visuals()
body_entered.connect(_on_body_entered)
body_exited.connect(_on_body_exited)
func _update_visuals() -> void:
if visited:
name_label.text = poi_name
sprite.modulate = marker_color
name_label.modulate = Color(1.0, 1.0, 1.0, 1.0)
else:
name_label.text = "???"
# Ausgegraut, behält aber die Kennfarbe
sprite.modulate = marker_color * Color(0.4, 0.4, 0.4, 1.0)
name_label.modulate = Color(0.6, 0.6, 0.6, 1.0)
func _on_body_entered(body: Node3D) -> void:
if body.is_in_group("player"):
player_nearby = true
prompt.text = "[F] Interact"
prompt.visible = true
func _on_body_exited(body: Node3D) -> void:
if body.is_in_group("player"):
player_nearby = false
prompt.visible = false
func _input(event: InputEvent) -> void:
if player_nearby and Input.is_action_just_pressed("interact"):
# Beim ersten Besuch entdecken
if not visited:
visited = true
_update_visuals()
InteractionManager.open_poi(self)