poi.tscn now uses the checkerboard debug texture instead of the ruins
sprite, and poi.gd gained a marker_color export (multiplied into the
existing visited/undiscovered dimming) so each POI marker can be
tinted a distinct color. Six instances placed inside region k=0's
wedge (angle ~12-48°, radius ~18-38, clear of the border walls),
tagged with the "region1_pois" group, in red/orange/yellow/green/
blue/purple.
Simplified InteractionManager's "Erkunden" content to a plain
placeholder ("Das wurde besucht.") instead of the old random
animal-track flavor text, and removed the now-dead handle_explore()
submenu it drove. Added InteractionManager.open_message() for POIs
that need an info popup without the explore/rest/close menu.
New poi_gate.gd/.tscn: a portal placed near region k=0's table-edge
border. Checks whether every POI in "region1_pois" has been visited;
if not, shows a "not yet" message, otherwise teleports the player to
target_position (the center) — a one-way shortcut past the border
wall rather than an opening in it, matching the "explore everything,
then unlock the way onward" progression the user described (this
pattern will repeat per outer region later).
Verified headless: all 6 POIs register in the group with correct
names/colors, gate refuses the transition at 0/6 and 5/6 visited and
allows it at 6/6, and the teleport lands the player exactly on
target_position.
49 lines
1.3 KiB
GDScript
Executable File
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)
|