simplify check for no keyboard in game key ready

This commit is contained in:
Teatov 2025-08-03 03:28:47 +10:00
parent aa44311c1f
commit dc7f20face
3 changed files with 3 additions and 9 deletions

View File

@ -22,6 +22,7 @@ _typing_label = NodePath("TypingLabel")
_layout_swap_label = NodePath("LayoutSwapLabel")
[node name="InputLabel" type="RichTextLabel" parent="."]
visible = false
layout_mode = 1
offset_left = 14.0
offset_top = 15.0

View File

@ -161,6 +161,7 @@ outline_size = 0
[node name="PlayerPosMarker" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.25, 0)
gizmo_extents = 0.2
[node name="PressLight" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0)

View File

@ -97,16 +97,8 @@ static func sort_func(a: GameKey, b: GameKey) -> bool:
#region builtins
func _ready() -> void:
if (
Engine.is_editor_hint()
and not _keyboard
and get_tree().edited_scene_root is GameKeyboard
):
_keyboard = get_tree().edited_scene_root
load_props(props, position, rotation.y)
elif not _keyboard:
if not _keyboard or not props:
return
_adjacency_light.visible = false
_keyboard.layout_size_changed.connect(_on_keyboard_layout_size_changed)
_keyboard.keys_requested.connect(_on_keyboard_keys_requested)