NS-18: fix gdlint (line length, const order/naming)
parent
b043e8ac45
commit
fd52cf9386
|
|
@ -4,15 +4,14 @@ extends Node3D
|
|||
## prototype terminal (X/Z, inclusive). Server `POST …/interact` remains authoritative.
|
||||
|
||||
const ProtoIx = preload("res://scripts/prototype_interaction_constants.gd")
|
||||
const EMISSION_DIM := 0.12
|
||||
const EMISSION_BRIGHT := 7.0
|
||||
|
||||
@export var marker_paths: Array[NodePath] = [^"MarkerA", ^"MarkerB"]
|
||||
|
||||
var _player: CharacterBody3D
|
||||
var _mat: StandardMaterial3D
|
||||
|
||||
const _emission_dim := 0.12
|
||||
const _emission_bright := 7.0
|
||||
|
||||
|
||||
func setup_player(player: CharacterBody3D) -> void:
|
||||
_player = player
|
||||
|
|
@ -23,7 +22,7 @@ func _ready() -> void:
|
|||
_mat.albedo_color = Color(0.1, 0.32, 0.9)
|
||||
_mat.emission_enabled = true
|
||||
_mat.emission = Color(0.3, 0.6, 1.0)
|
||||
_mat.emission_energy_multiplier = _emission_dim
|
||||
_mat.emission_energy_multiplier = EMISSION_DIM
|
||||
for p in marker_paths:
|
||||
var mi := get_node_or_null(p) as MeshInstance3D
|
||||
if mi:
|
||||
|
|
@ -38,4 +37,4 @@ func _process(_delta: float) -> void:
|
|||
var dist_sq: float = dx * dx + dz * dz
|
||||
var r: float = ProtoIx.interaction_radius()
|
||||
var in_range: bool = dist_sq <= r * r
|
||||
_mat.emission_energy_multiplier = _emission_bright if in_range else _emission_dim
|
||||
_mat.emission_energy_multiplier = EMISSION_BRIGHT if in_range else EMISSION_DIM
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ func _ready() -> void:
|
|||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
# _input (not _unhandled_input): unhandled often misses keys in the embedded Game view / focus quirks.
|
||||
# Action `interact` is bound to E in project.godot; fallback keeps physical E for odd layouts.
|
||||
# Use _input: _unhandled_input often misses keys in the embedded Game dock / focus quirks.
|
||||
# `interact` is in project.godot; KEY_E fallback for odd layouts.
|
||||
if event.is_action_pressed("interact"):
|
||||
_post_interact()
|
||||
elif event is InputEventKey:
|
||||
|
|
|
|||
Loading…
Reference in New Issue