From 08de973e96d661e9deda3ecdbd10092891c29052 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Fri, 26 Apr 2024 14:42:30 +0200 Subject: [PATCH] small fixes --- app/content/system/house/align_reference.gd | 3 +++ app/content/system/house/mini/miniature.gd | 1 - app/content/system/house/mini/miniature.tscn | 1 - app/content/ui/components/button/button.tscn | 25 +++++++++++++++---- app/content/ui/components/input/input.tscn | 8 +++--- app/content/ui/components/panel/panel.tscn | 25 +++++++++++++++---- .../ui/components/tabs/tabs_content.gd | 2 +- app/content/ui/onboarding/onboarding.gd | 3 ++- 8 files changed, 50 insertions(+), 18 deletions(-) diff --git a/app/content/system/house/align_reference.gd b/app/content/system/house/align_reference.gd index c4e1242..23c9f28 100644 --- a/app/content/system/house/align_reference.gd +++ b/app/content/system/house/align_reference.gd @@ -50,6 +50,9 @@ func get_new_transform(): func update_align_reference(): corner1.global_position = Store.house.state.align_position1 corner2.global_position = Store.house.state.align_position2 + + if corner1.global_position == corner2.global_position: + corner2.global_position = corner1.global_position + Vector3(1, 0, 0) corner2.look_at(corner1.global_position, Vector3.UP) corner2.rotate(Vector3.UP, deg_to_rad( - 90)) diff --git a/app/content/system/house/mini/miniature.gd b/app/content/system/house/mini/miniature.gd index 724da7b..77eedba 100644 --- a/app/content/system/house/mini/miniature.gd +++ b/app/content/system/house/mini/miniature.gd @@ -9,7 +9,6 @@ const temperature_gradient = preload ("./temp_gradient.tres") @onready var small_node = $Body/Small @onready var model = $Body/Small/Model @onready var collision_shape = $Body/CollisionShape3D -@onready var toggle_heatmap = $Body/HeatmapButton @onready var entity_select = $Body/EntitySelect enum HeatmapType { diff --git a/app/content/system/house/mini/miniature.tscn b/app/content/system/house/mini/miniature.tscn index f462726..f89f869 100644 --- a/app/content/system/house/mini/miniature.tscn +++ b/app/content/system/house/mini/miniature.tscn @@ -18,7 +18,6 @@ disabled = true [node name="Movable" type="Node" parent="Body"] script = ExtResource("2_x7oed") restricted = true -disabled = null [node name="Small" type="Node3D" parent="Body"] diff --git a/app/content/ui/components/button/button.tscn b/app/content/ui/components/button/button.tscn index 9000ad3..0570053 100644 --- a/app/content/ui/components/button/button.tscn +++ b/app/content/ui/components/button/button.tscn @@ -1,10 +1,25 @@ -[gd_scene load_steps=7 format=3 uid="uid://bsjqdvkt0u87c"] +[gd_scene load_steps=8 format=3 uid="uid://bsjqdvkt0u87c"] [ext_resource type="Script" path="res://content/ui/components/button/button.gd" id="1_74x7g"] -[ext_resource type="Material" uid="uid://crycqex1ucj04" path="res://content/ui/components/panel/panel.material" id="2_28wsr"] +[ext_resource type="Shader" path="res://content/ui/components/panel/glass.gdshader" id="2_db5by"] [ext_resource type="Script" path="res://content/ui/components/panel/panel.gd" id="3_skm86"] -[sub_resource type="QuadMesh" id="QuadMesh_bu2il"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_tulmb"] +resource_local_to_scene = true +render_priority = 10 +shader = ExtResource("2_db5by") +shader_parameter/color = Color(1, 1, 1, 0.3) +shader_parameter/border_color = Color(1, 1, 1, 1) +shader_parameter/edge_color = Color(0, 0, 0, 1) +shader_parameter/size = Vector2(1, 1) +shader_parameter/border_size = 0.01 +shader_parameter/border_fade_in = 0.05 +shader_parameter/border_fade_out = 0.0 +shader_parameter/corner_radius = 0.2 +shader_parameter/roughness = 0.3 +shader_parameter/grain_amount = 0.02 + +[sub_resource type="QuadMesh" id="QuadMesh_hvywi"] size = Vector2(0.04, 0.04) [sub_resource type="BoxShape3D" id="BoxShape3D_xwopm"] @@ -27,8 +42,8 @@ collision_mask = 0 [node name="Panel3D" type="MeshInstance3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.005) -material_override = ExtResource("2_28wsr") -mesh = SubResource("QuadMesh_bu2il") +material_override = SubResource("ShaderMaterial_tulmb") +mesh = SubResource("QuadMesh_hvywi") skeleton = NodePath("../..") script = ExtResource("3_skm86") size = Vector2(0.04, 0.04) diff --git a/app/content/ui/components/input/input.tscn b/app/content/ui/components/input/input.tscn index d135253..039908c 100644 --- a/app/content/ui/components/input/input.tscn +++ b/app/content/ui/components/input/input.tscn @@ -5,7 +5,7 @@ [ext_resource type="FontVariation" uid="uid://d2ofyimg5s65q" path="res://assets/fonts/ui_font_500.tres" id="3_ij5fh"] [ext_resource type="Shader" path="res://content/ui/components/panel/glass.gdshader" id="3_nl02b"] -[sub_resource type="ShaderMaterial" id="ShaderMaterial_ioqea"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_exbug"] resource_local_to_scene = true render_priority = 10 shader = ExtResource("3_nl02b") @@ -20,7 +20,7 @@ shader_parameter/corner_radius = 0.2 shader_parameter/roughness = 0.3 shader_parameter/grain_amount = 0.02 -[sub_resource type="QuadMesh" id="QuadMesh_qgsvu"] +[sub_resource type="QuadMesh" id="QuadMesh_lemta"] size = Vector2(0.15, 0.03) [sub_resource type="BoxShape3D" id="BoxShape3D_x4yp8"] @@ -82,8 +82,8 @@ collision_mask = 6 [node name="Panel3D" type="MeshInstance3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.005) -material_override = SubResource("ShaderMaterial_ioqea") -mesh = SubResource("QuadMesh_qgsvu") +material_override = SubResource("ShaderMaterial_exbug") +mesh = SubResource("QuadMesh_lemta") script = ExtResource("3_3bvrj") size = Vector2(0.15, 0.03) diff --git a/app/content/ui/components/panel/panel.tscn b/app/content/ui/components/panel/panel.tscn index 5dcc34a..ecf1008 100644 --- a/app/content/ui/components/panel/panel.tscn +++ b/app/content/ui/components/panel/panel.tscn @@ -1,14 +1,29 @@ -[gd_scene load_steps=4 format=3 uid="uid://dnam3fe36gg62"] +[gd_scene load_steps=5 format=3 uid="uid://dnam3fe36gg62"] [ext_resource type="Script" path="res://content/ui/components/panel/panel.gd" id="1_2jq4a"] -[ext_resource type="Material" uid="uid://crycqex1ucj04" path="res://content/ui/components/panel/panel.material" id="1_8jj0l"] +[ext_resource type="Shader" path="res://content/ui/components/panel/glass.gdshader" id="1_mpdsy"] -[sub_resource type="QuadMesh" id="QuadMesh_vflbj"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_jbi6t"] +resource_local_to_scene = true +render_priority = 10 +shader = ExtResource("1_mpdsy") +shader_parameter/color = Color(1, 1, 1, 0.3) +shader_parameter/border_color = Color(1, 1, 1, 1) +shader_parameter/edge_color = Color(0, 0, 0, 1) +shader_parameter/size = Vector2(1, 1) +shader_parameter/border_size = 0.01 +shader_parameter/border_fade_in = 0.05 +shader_parameter/border_fade_out = 0.0 +shader_parameter/corner_radius = 0.04 +shader_parameter/roughness = 0.3 +shader_parameter/grain_amount = 0.02 + +[sub_resource type="QuadMesh" id="QuadMesh_vcnnc"] size = Vector2(0.04, 0.04) [node name="Panel" type="MeshInstance3D"] -material_override = ExtResource("1_8jj0l") -mesh = SubResource("QuadMesh_vflbj") +material_override = SubResource("ShaderMaterial_jbi6t") +mesh = SubResource("QuadMesh_vcnnc") script = ExtResource("1_2jq4a") size = Vector2(0.04, 0.04) corner_radius = null diff --git a/app/content/ui/components/tabs/tabs_content.gd b/app/content/ui/components/tabs/tabs_content.gd index 181d298..1dd6b5d 100644 --- a/app/content/ui/components/tabs/tabs_content.gd +++ b/app/content/ui/components/tabs/tabs_content.gd @@ -16,6 +16,6 @@ func _ready(): R.effect(func(_arg): if tabs.selected.value.get_index() == i: add_child(child) - else: + elif child.get_parent() == self: remove_child(child) ) diff --git a/app/content/ui/onboarding/onboarding.gd b/app/content/ui/onboarding/onboarding.gd index d917341..7aac25e 100644 --- a/app/content/ui/onboarding/onboarding.gd +++ b/app/content/ui/onboarding/onboarding.gd @@ -3,9 +3,10 @@ extends Node3D @onready var getting_started_button = $GettingStartedButton @onready var close_button = $CloseButton @onready var camera = $"/root/Main/XROrigin3D/XRCamera3D" -var next_new_position = global_position +var next_new_position = null func _ready(): + next_new_position = global_position if Store.settings.is_loaded() == false: await Store.settings.on_loaded