From af95006827ec45c1662d6c73e95e4b2ee4edf867 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Mon, 29 Jan 2024 12:37:25 +0100 Subject: [PATCH] bug fixes --- content/entities/light/light.gd | 3 ++- content/entities/light/light.tscn | 2 -- content/system/house/align_reference.gd | 8 +++++++- content/system/house/align_reference.tscn | 5 +++-- content/system/house/house.gd | 3 +++ content/ui/menu/menu.gd | 6 ------ content/ui/menu/room/views/rooms.gd | 7 +++++-- content/ui/menu/settings/settings_menu.gd | 8 ++++++-- export_presets.cfg | 4 ++-- lib/events/event_key.gd | 2 +- 10 files changed, 29 insertions(+), 19 deletions(-) diff --git a/content/entities/light/light.gd b/content/entities/light/light.gd index 7535a73..11af630 100644 --- a/content/entities/light/light.gd +++ b/content/entities/light/light.gd @@ -26,7 +26,8 @@ func _ready(): set_state(stateInfo["state"] == "on") if stateInfo.has("attributes") && stateInfo["attributes"].has("effect_list") && stateInfo["attributes"]["effect_list"].size() > 0: - mode_label.text = stateInfo["attributes"]["effect"] + if stateInfo["attributes"].has("effect") && stateInfo["attributes"]["effect"] != null: + mode_label.text = stateInfo["attributes"]["effect"] mode_next.on_button_down.connect(func(): var index = stateInfo["attributes"]["effect_list"].find(stateInfo["attributes"]["effect"]) diff --git a/content/entities/light/light.tscn b/content/entities/light/light.tscn index 33f586e..45d9921 100644 --- a/content/entities/light/light.tscn +++ b/content/entities/light/light.tscn @@ -70,8 +70,6 @@ height = 0.005 [node name="Light" type="StaticBody3D" groups=["entity"]] collision_mask = 0 script = ExtResource("1_ykxy3") -color_off = null -color_on = null [node name="CollisionShape3D" type="CollisionShape3D" parent="."] shape = SubResource("SphereShape3D_ukj14") diff --git a/content/system/house/align_reference.gd b/content/system/house/align_reference.gd index 204d810..4773c5a 100644 --- a/content/system/house/align_reference.gd +++ b/content/system/house/align_reference.gd @@ -27,6 +27,9 @@ func _ready(): corner2.get_node("Movable").on_move.connect(func(position, rotation): edge.align_to_corners(corner1.global_position, corner2.global_position) + + corner2.look_at(corner1.global_position, Vector3.UP) + corner2.rotate(Vector3.UP, deg_to_rad(-90)) ) corner2.get_node("Movable").restrict_movement = func(new_position): @@ -40,7 +43,7 @@ func update_initial_positions(): edge.align_to_corners(corner1.global_position, corner2.global_position) marker.global_transform = House.body.transform -func get_new_transform(old_transform: Transform3D): +func get_new_transform(): marker.scale = Vector3(1, 1, 1) return marker.global_transform @@ -48,6 +51,9 @@ func update_align_reference(): corner1.global_position = Store.house.align_position1 corner2.global_position = Store.house.align_position2 + corner2.look_at(corner1.global_position, Vector3.UP) + corner2.rotate(Vector3.UP, deg_to_rad(-90)) + edge.align_to_corners(corner1.global_position, corner2.global_position) func update_store(): diff --git a/content/system/house/align_reference.tscn b/content/system/house/align_reference.tscn index 4521894..bd8f98d 100644 --- a/content/system/house/align_reference.tscn +++ b/content/system/house/align_reference.tscn @@ -4,7 +4,8 @@ [ext_resource type="PackedScene" uid="uid://brf6mm2gxj7y2" path="res://content/system/house/room/wall_corner.tscn" id="2_ppkie"] [ext_resource type="PackedScene" uid="uid://dlj5chj7ndgua" path="res://content/system/house/room/wall_edge.tscn" id="3_6o3xn"] [ext_resource type="Script" path="res://content/functions/movable.gd" id="3_7ktdq"] -[ext_resource type="Material" uid="uid://dxyuncqxagt28" path="res://content/system/house/room/walls_mini.tres" id="4_jkpj4"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_64dod"] [sub_resource type="CylinderMesh" id="CylinderMesh_k2m3v"] top_radius = 0.001 @@ -26,7 +27,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0) [node name="MeshInstance3D" parent="Corner1/Corner2" index="1"] transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0, 0, 0) -material_override = ExtResource("4_jkpj4") +material_override = SubResource("StandardMaterial3D_64dod") mesh = SubResource("CylinderMesh_k2m3v") [node name="Movable" type="Node" parent="Corner1/Corner2"] diff --git a/content/system/house/house.gd b/content/system/house/house.gd index c02470c..d957a3b 100644 --- a/content/system/house/house.gd +++ b/content/system/house/house.gd @@ -210,11 +210,13 @@ func update_mini_view(): func edit_reference(): fixing_reference = false + align_reference.visible = true align_reference.disabled = false func fix_reference(): fixing_reference = true align_reference.disabled = false + align_reference.visible = true align_reference.update_initial_positions() func save_reference(): @@ -224,6 +226,7 @@ func save_reference(): align_reference.global_transform = align_transform align_reference.disabled = true + align_reference.visible = false align_reference.update_initial_positions() align_reference.update_store() diff --git a/content/ui/menu/menu.gd b/content/ui/menu/menu.gd index 6af6f86..90642d9 100644 --- a/content/ui/menu/menu.gd +++ b/content/ui/menu/menu.gd @@ -1,16 +1,10 @@ extends Node3D -const Proxy = preload("res://lib/utils/proxy.gd") const Notification = preload("res://content/ui/components/notification/notification.tscn") -@onready var menu_root = $AnimationContainer -@onready var content = $AnimationContainer/Content -@onready var nav = $AnimationContainer/Navigation @onready var animation_player = $AnimationPlayer @onready var notify_place = $AnimationContainer/NotifyPlace -var selected_nav = null - var show_menu := false: set(value): show_menu = value diff --git a/content/ui/menu/room/views/rooms.gd b/content/ui/menu/room/views/rooms.gd index 535fa4d..2ab4392 100644 --- a/content/ui/menu/room/views/rooms.gd +++ b/content/ui/menu/room/views/rooms.gd @@ -41,9 +41,12 @@ var edit_room = false: room_button.label = "edit" func _ready(): - Store.house.on_loaded.connect(func(): + if Store.house.is_loaded(): _generate_room_map() - ) + else: + Store.house.on_loaded.connect(func(): + _generate_room_map() + ) room_button.on_button_down.connect(func(): if selected_room == null: diff --git a/content/ui/menu/settings/settings_menu.gd b/content/ui/menu/settings/settings_menu.gd index 9ddc2a0..382245c 100644 --- a/content/ui/menu/settings/settings_menu.gd +++ b/content/ui/menu/settings/settings_menu.gd @@ -33,10 +33,14 @@ func _ready(): credits_instance.global_position = + label.to_global(label.position + Vector3(0.1, 0, -0.15)) ) - Store.settings.on_loaded.connect(func(): + if Store.settings.is_loaded(): input_url.text = Store.settings.url input_token.text = Store.settings.token - ) + else: + Store.settings.on_loaded.connect(func(): + input_url.text = Store.settings.url + input_token.text = Store.settings.token + ) button_connect.on_button_down.connect(func(): var url = input_url.text diff --git a/export_presets.cfg b/export_presets.cfg index a0d5431..3117478 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -248,8 +248,8 @@ architectures/armeabi-v7a=false architectures/arm64-v8a=true architectures/x86=false architectures/x86_64=false -version/code=8 -version/name="v0.2.1" +version/code=9 +version/name="v0.3.0" package/unique_name="de.nitwel.$genname" package/name="Immersive Home" package/signed=true diff --git a/lib/events/event_key.gd b/lib/events/event_key.gd index 9f6b535..6f5276f 100644 --- a/lib/events/event_key.gd +++ b/lib/events/event_key.gd @@ -12,7 +12,7 @@ static func key_to_string(key: Key, caps: bool = false, apply_to: String = "") - KEY_ASCIITILDE: apply_to += "~" KEY_SLASH: apply_to += "/" KEY_BACKSLASH: apply_to += "\\" - KEY_COLON: apply_to += ";" + KEY_COLON: apply_to += ":" KEY_COMMA: apply_to += "," KEY_PERIOD: apply_to += "." KEY_MINUS: apply_to += "-"