diff --git a/ui/IconButton.gd b/ui/IconButton.gd index 7b9fdad..75ca542 100644 --- a/ui/IconButton.gd +++ b/ui/IconButton.gd @@ -1,3 +1,4 @@ +@tool class_name IconButton extends Control @@ -142,6 +143,11 @@ func _blocked_by_modal() -> bool: func _gui_input(event: InputEvent) -> void: + # @tool runs this in the editor too, where a click on the canvas would + # emit `pressed` at whatever it is wired to. The glyph is what we want + # visible there, not the behaviour. + if Engine.is_editor_hint(): + return if _blocked_by_modal(): return if event is InputEventScreenTouch: diff --git a/ui/NeonPanel.gd b/ui/NeonPanel.gd index 55803ab..1fb1e36 100644 --- a/ui/NeonPanel.gd +++ b/ui/NeonPanel.gd @@ -1,3 +1,4 @@ +@tool class_name NeonPanel extends Control @@ -39,6 +40,12 @@ var design_centre: Vector2 = Vector2.ZERO func _ready() -> void: + # _fit_to_screen() below rewrites offset_left/right/top/bottom. Under + # @tool that runs against the editor viewport, overwriting the authored + # layout and dirtying the scene, so the card previews at its authored + # size and is only ever fitted at runtime. + if Engine.is_editor_hint(): + return # Fitting adjusts the four offsets around a fixed centre, which is only # meaningful for a card pinned to a point - both anchor pairs collapsed, # as a centred dialog's are. A panel stretched between different anchors diff --git a/ui/TouchJoystick.gd b/ui/TouchJoystick.gd index 78056a6..a16c48e 100644 --- a/ui/TouchJoystick.gd +++ b/ui/TouchJoystick.gd @@ -1,3 +1,4 @@ +@tool class_name TouchJoystick extends Control @@ -40,6 +41,11 @@ var knob_pos: Vector2 = Vector2.ZERO func _ready() -> void: + # _relayout() writes max_radius, which is @export - under @tool that + # would persist a computed value into the scene. The preview uses the + # authored radius instead; only a running game refits. + if Engine.is_editor_hint(): + return # Dialogs release every spring-loaded stick through one compositional # contract, without NarrationBanner knowing scene paths or joystick roles. add_to_group("touch_joysticks")