From 198dc00aebb61de7776d1e0e08b398038c4b9531 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Wed, 22 Nov 2023 17:07:28 +0100 Subject: [PATCH] move keyboard and fix signal tool error --- content/main.tscn | 2 +- content/{ui => system}/keyboard/keyboard.gd | 7 +++++++ content/{ui => system}/keyboard/keyboard.tscn | 2 +- content/ui/components/button/button.gd | 1 - 4 files changed, 9 insertions(+), 3 deletions(-) rename content/{ui => system}/keyboard/keyboard.gd (96%) rename content/{ui => system}/keyboard/keyboard.tscn (94%) diff --git a/content/main.tscn b/content/main.tscn index 381fae9..0832e3b 100644 --- a/content/main.tscn +++ b/content/main.tscn @@ -7,7 +7,7 @@ [ext_resource type="PackedScene" uid="uid://ctltchlf2j2r4" path="res://addons/xr-simulator/XRSimulator.tscn" id="5_3qc8g"] [ext_resource type="Material" uid="uid://bf5ina366dwm6" path="res://assets/materials/sky.material" id="5_wgwf8"] [ext_resource type="PackedScene" uid="uid://83lb5p4e0qk0" path="res://content/scenes/house.tscn" id="8_qkrg7"] -[ext_resource type="PackedScene" uid="uid://lrehk38exd5n" path="res://content/ui/keyboard/keyboard.tscn" id="9_e5n3p"] +[ext_resource type="PackedScene" uid="uid://lrehk38exd5n" path="res://content/system/keyboard/keyboard.tscn" id="9_e5n3p"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_m58yb"] ao_enabled = true diff --git a/content/ui/keyboard/keyboard.gd b/content/system/keyboard/keyboard.gd similarity index 96% rename from content/ui/keyboard/keyboard.gd rename to content/system/keyboard/keyboard.gd index f511f6f..584e526 100644 --- a/content/ui/keyboard/keyboard.gd +++ b/content/system/keyboard/keyboard.gd @@ -23,6 +23,10 @@ func _ready(): for key in row: var button = create_key(key) keys.add_child(button) + + if Engine.is_editor_hint(): + continue + button.on_button_down.connect(func(): _emit_event("key_down", key) ) @@ -32,6 +36,9 @@ func _ready(): keys.columns = key_list[0].size() + if Engine.is_editor_hint(): + return + backspace_button.on_button_down.connect(func(): _emit_event("key_down", KEY_BACKSPACE) ) diff --git a/content/ui/keyboard/keyboard.tscn b/content/system/keyboard/keyboard.tscn similarity index 94% rename from content/ui/keyboard/keyboard.tscn rename to content/system/keyboard/keyboard.tscn index 0e7e822..90b304f 100644 --- a/content/ui/keyboard/keyboard.tscn +++ b/content/system/keyboard/keyboard.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=6 format=3 uid="uid://lrehk38exd5n"] -[ext_resource type="Script" path="res://content/ui/keyboard/keyboard.gd" id="1_maojw"] +[ext_resource type="Script" path="res://content/system/keyboard/keyboard.gd" id="1_maojw"] [ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_xdpwr"] [ext_resource type="Script" path="res://content/ui/menu/grid.gd" id="3_mx544"] [ext_resource type="Script" path="res://content/functions/movable.gd" id="4_86fct"] diff --git a/content/ui/components/button/button.gd b/content/ui/components/button/button.gd index dbcdc4d..6f0562c 100644 --- a/content/ui/components/button/button.gd +++ b/content/ui/components/button/button.gd @@ -21,7 +21,6 @@ var active: bool = false : animation_player.play_backwards("down") @onready var animation_player: AnimationPlayer = $AnimationPlayer -@onready var click_sound: AudioStreamPlayer = $ClickSound func _ready(): if initial_active: