diff --git a/content/functions/movable.gd b/content/functions/movable.gd index 6b2179f..46ad7ad 100644 --- a/content/functions/movable.gd +++ b/content/functions/movable.gd @@ -26,12 +26,11 @@ func _on_grab_move(_event: EventPointer): get_parent().global_position = hit_node.global_position if !lock_rotation: - get_parent().global_rotation = hit_node.global_rotation + get_parent().global_basis = hit_node.global_basis on_move.emit(get_parent().global_position, get_parent().global_rotation) else: on_move.emit(get_parent().global_position, Vector3(0, 0, 0)) - func _on_grab_up(event: EventPointer): event.initiator.node.remove_child(hit_node) diff --git a/content/main.gd b/content/main.gd index e553ded..bc873e1 100644 --- a/content/main.gd +++ b/content/main.gd @@ -50,8 +50,7 @@ func _ready(): return add_child(keyboard) - if event.previous_target == null: - keyboard.global_transform = menu.get_node("AnimationContainer/KeyboardPlace").global_transform + keyboard.global_transform = menu.get_node("AnimationContainer/KeyboardPlace").global_transform ) EventSystem.on_focus_out.connect(func(event): diff --git a/content/system/house/align_reference.tscn b/content/system/house/align_reference.tscn index 428f809..4521894 100644 --- a/content/system/house/align_reference.tscn +++ b/content/system/house/align_reference.tscn @@ -1,9 +1,15 @@ -[gd_scene load_steps=5 format=3 uid="uid://jls16btb8nko"] +[gd_scene load_steps=7 format=3 uid="uid://jls16btb8nko"] [ext_resource type="Script" path="res://content/system/house/align_reference.gd" id="1_8fatp"] [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="CylinderMesh" id="CylinderMesh_k2m3v"] +top_radius = 0.001 +bottom_radius = 0.05 +height = 0.1 [node name="AlignReference" type="Node3D"] script = ExtResource("1_8fatp") @@ -18,6 +24,11 @@ lock_rotation = true [node name="Corner2" parent="Corner1" instance=ExtResource("2_ppkie")] 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") +mesh = SubResource("CylinderMesh_k2m3v") + [node name="Movable" type="Node" parent="Corner1/Corner2"] script = ExtResource("3_7ktdq") lock_rotation = true @@ -26,3 +37,5 @@ lock_rotation = true transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0.5, 0, 0) [node name="Marker3D" type="Marker3D" parent="Edge"] + +[editable path="Corner1/Corner2"] diff --git a/content/system/house/house.tscn b/content/system/house/house.tscn index adc5680..b17ab66 100644 --- a/content/system/house/house.tscn +++ b/content/system/house/house.tscn @@ -23,4 +23,5 @@ restricted = true lock_rotation = true [node name="AlignReference" parent="." instance=ExtResource("3_e1tcn")] +visible = false disabled = true diff --git a/content/system/house/room/room.gd b/content/system/house/room/room.gd index 6b654db..ea0b908 100644 --- a/content/system/house/room/room.gd +++ b/content/system/house/room/room.gd @@ -50,23 +50,4 @@ func get_aabb(): min_pos.y = room_floor.position.y max_pos.y = room_ceiling.position.y - return AABB(to_global(min_pos), to_global(max_pos) - to_global(min_pos)) - -func _save(): - return { - "corners": wall_corners.get_children().map(func(corner): return corner.position), - "name": name - } - -func _load(data): - await ready - return - - name = data["name"] - - state_machine.change_to("Edit") - - for corner in data["corners"]: - state_machine.current_state.add_corner(corner) - - state_machine.change_to("View") + return AABB(to_global(min_pos), to_global(max_pos) - to_global(min_pos)) \ No newline at end of file diff --git a/content/ui/menu/room/views/rooms.gd b/content/ui/menu/room/views/rooms.gd index ade009c..5efc268 100644 --- a/content/ui/menu/room/views/rooms.gd +++ b/content/ui/menu/room/views/rooms.gd @@ -15,7 +15,7 @@ var selected_room = null: set(value): if selected_room != null && value == null: room_button.label = "add" - input.text = "New Room %s" % (rooms_map.get_child_count() + 1) + input.text = "Room %s" % (rooms_map.get_child_count() + 1) if selected_room != null: var old_room = get_room(selected_room) diff --git a/content/ui/menu/room/views/rooms.tscn b/content/ui/menu/room/views/rooms.tscn index fe5a321..d666af7 100644 --- a/content/ui/menu/room/views/rooms.tscn +++ b/content/ui/menu/room/views/rooms.tscn @@ -17,4 +17,4 @@ icon = true [node name="Input" parent="." instance=ExtResource("2_hstw7")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.12, 0.005, 0.27) -text = "" +text = "Room 1"