inventory soort van
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://b71qdaj8exhbs"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://Scripts/GUI-item.gd" id="1_5hhdw"]
|
||||||
|
|
||||||
|
[node name="SubViewportContainer" type="SubViewportContainer"]
|
||||||
|
script = ExtResource("1_5hhdw")
|
||||||
|
|
||||||
|
[node name="SubViewport" type="SubViewport" parent="."]
|
||||||
|
own_world_3d = true
|
||||||
|
transparent_bg = true
|
||||||
|
handle_input_locally = false
|
||||||
|
size = Vector2i(100, 100)
|
||||||
|
render_target_update_mode = 4
|
||||||
|
|
||||||
|
[node name="Camera3D" type="Camera3D" parent="SubViewport"]
|
||||||
|
|
||||||
|
[node name="Item Position" type="Node3D" parent="SubViewport/Camera3D"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.25)
|
||||||
|
|
||||||
|
[node name="OmniLight3D" type="OmniLight3D" parent="SubViewport/Camera3D"]
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://d2run4kti7u53"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://Scripts/Gui.gd" id="1_nawr5"]
|
||||||
|
|
||||||
|
[node name="Gui" type="CanvasLayer"]
|
||||||
|
script = ExtResource("1_nawr5")
|
||||||
|
|
||||||
|
[node name="Control" type="Control" parent="."]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
mouse_filter = 2
|
||||||
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
|
[node name="BottleService" type="VFlowContainer" parent="Control"]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 11
|
||||||
|
anchor_left = 1.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_left = -200.0
|
||||||
|
grow_horizontal = 0
|
||||||
|
grow_vertical = 2
|
||||||
|
size_flags_horizontal = 8
|
||||||
|
size_flags_vertical = 8
|
||||||
|
alignment = 2
|
||||||
|
|
||||||
|
[node name="Panel" type="Panel" parent="Control/BottleService"]
|
||||||
|
visible = false
|
||||||
|
custom_minimum_size = Vector2(200, 100)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="RichTextLabel" type="RichTextLabel" parent="Control/BottleService/Panel"]
|
||||||
|
custom_minimum_size = Vector2(200, 100)
|
||||||
|
layout_mode = 2
|
||||||
|
offset_top = 4.0
|
||||||
|
offset_right = 200.0
|
||||||
|
offset_bottom = 104.0
|
||||||
|
text = "Je moeder"
|
||||||
|
|
||||||
|
[node name="Button" type="Button" parent="Control/BottleService/Panel/RichTextLabel"]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 1
|
||||||
|
anchor_left = 1.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
offset_left = -22.0
|
||||||
|
offset_bottom = 31.0
|
||||||
|
grow_horizontal = 0
|
||||||
|
text = "✕"
|
||||||
|
|
||||||
|
[node name="HFlowContainer" type="HFlowContainer" parent="Control"]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 2
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_top = -100.0
|
||||||
|
offset_right = 1000.0
|
||||||
|
grow_vertical = 0
|
||||||
+2
-49
@@ -18,7 +18,7 @@
|
|||||||
[ext_resource type="AudioStream" uid="uid://wphketv7cs0b" path="res://Audio/D.mp3" id="15_k8hy3"]
|
[ext_resource type="AudioStream" uid="uid://wphketv7cs0b" path="res://Audio/D.mp3" id="15_k8hy3"]
|
||||||
[ext_resource type="AudioStream" uid="uid://csa4bd0pvp5as" path="res://Audio/pianomuziek.mp3" id="17_1cw2k"]
|
[ext_resource type="AudioStream" uid="uid://csa4bd0pvp5as" path="res://Audio/pianomuziek.mp3" id="17_1cw2k"]
|
||||||
[ext_resource type="FontFile" uid="uid://ba6teo1asddxo" path="res://Fonts/Galimer-ExtraLight.ttf" id="17_7yj1s"]
|
[ext_resource type="FontFile" uid="uid://ba6teo1asddxo" path="res://Fonts/Galimer-ExtraLight.ttf" id="17_7yj1s"]
|
||||||
[ext_resource type="Script" path="res://Scripts/Gui.gd" id="18_80vxw"]
|
[ext_resource type="PackedScene" uid="uid://d2run4kti7u53" path="res://GUI.tscn" id="19_3ubs2"]
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4hp81"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4hp81"]
|
||||||
transparency = 1
|
transparency = 1
|
||||||
@@ -288,53 +288,6 @@ stream = ExtResource("17_1cw2k")
|
|||||||
volume_db = -6.191
|
volume_db = -6.191
|
||||||
autoplay = true
|
autoplay = true
|
||||||
|
|
||||||
[node name="Gui" type="CanvasLayer" parent="." index="18"]
|
[node name="Gui" parent="." index="18" instance=ExtResource("19_3ubs2")]
|
||||||
script = ExtResource("18_80vxw")
|
|
||||||
|
|
||||||
[node name="Control" type="Control" parent="Gui" index="0"]
|
|
||||||
layout_mode = 3
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
mouse_filter = 2
|
|
||||||
metadata/_edit_use_anchors_ = true
|
|
||||||
|
|
||||||
[node name="BottleService" type="VFlowContainer" parent="Gui/Control" index="0"]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 11
|
|
||||||
anchor_left = 1.0
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
offset_left = -200.0
|
|
||||||
grow_horizontal = 0
|
|
||||||
grow_vertical = 2
|
|
||||||
size_flags_horizontal = 8
|
|
||||||
size_flags_vertical = 8
|
|
||||||
alignment = 2
|
|
||||||
|
|
||||||
[node name="Panel" type="Panel" parent="Gui/Control/BottleService" index="0"]
|
|
||||||
visible = false
|
|
||||||
custom_minimum_size = Vector2(200, 100)
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="RichTextLabel" type="RichTextLabel" parent="Gui/Control/BottleService/Panel" index="0"]
|
|
||||||
custom_minimum_size = Vector2(200, 100)
|
|
||||||
layout_mode = 2
|
|
||||||
offset_top = 4.0
|
|
||||||
offset_right = 200.0
|
|
||||||
offset_bottom = 104.0
|
|
||||||
text = "Je moeder"
|
|
||||||
|
|
||||||
[node name="Button" type="Button" parent="Gui/Control/BottleService/Panel/RichTextLabel" index="1"]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 1
|
|
||||||
anchor_left = 1.0
|
|
||||||
anchor_right = 1.0
|
|
||||||
offset_left = -22.0
|
|
||||||
offset_bottom = 31.0
|
|
||||||
grow_horizontal = 0
|
|
||||||
text = "✕"
|
|
||||||
|
|
||||||
[connection signal="input_event" from="FlashLight/FlashLight" to="Player" method="_on_flash_light_input_event"]
|
[connection signal="input_event" from="FlashLight/FlashLight" to="Player" method="_on_flash_light_input_event"]
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
extends SubViewportContainer
|
||||||
|
|
||||||
|
func add_item(mesh: Node):
|
||||||
|
$"SubViewport/Camera3D/Item Position".add_child(mesh)
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
if $"SubViewport/Camera3D/Item Position".get_child_count() > 0:
|
||||||
|
$"SubViewport/Camera3D/Item Position".get_child(0).rotation.y += delta
|
||||||
@@ -28,6 +28,18 @@ func message(msg: String, title: String = ""):
|
|||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
timer += delta
|
timer += delta
|
||||||
|
#$"Control/HFlowContainer/SubViewportContainer/SubViewport/Camera3D/Item Position".get_child(0).rotation.y += delta
|
||||||
|
#$Control/SubViewportContainer/SubViewport/Camera3D/sleutel.rotation.y += delta
|
||||||
|
|
||||||
|
func add_item(mesh: Node):
|
||||||
|
var subviewport = preload("res://GUI-item.tscn").instantiate()
|
||||||
|
$Control/HFlowContainer.add_child(subviewport)
|
||||||
|
subviewport.add_item(mesh)
|
||||||
|
print_tree()
|
||||||
|
|
||||||
|
func clear_items():
|
||||||
|
for child in $Control/HFlowContainer.get_children():
|
||||||
|
child.queue_free()
|
||||||
|
|
||||||
func _on_close_pressed(node):
|
func _on_close_pressed(node):
|
||||||
node.get_parent().queue_free()
|
node.get_parent().queue_free()
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ var combination
|
|||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
combination = randi() % 10000
|
combination = randi() % 10000
|
||||||
|
print(combination)
|
||||||
$".."/CombiCode.mesh.text = "%04d" % combination #met leading 0'en
|
$".."/CombiCode.mesh.text = "%04d" % combination #met leading 0'en
|
||||||
|
|
||||||
func get_number():
|
func get_number():
|
||||||
|
|||||||
@@ -20,3 +20,4 @@ func _on_sleutel_input_event(_camera, event, _position, _normal, _shape_idx):
|
|||||||
$Kast/Drawer/Sleutel.visible = false
|
$Kast/Drawer/Sleutel.visible = false
|
||||||
get_node("../Player").has_key = true
|
get_node("../Player").has_key = true
|
||||||
get_node("../Player/Pickup").playing = true
|
get_node("../Player/Pickup").playing = true
|
||||||
|
$"../Gui".add_item(preload("res://Objects/sleutel.tscn").instantiate())
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ func _on_lock_input_event(_camera, event, _position, _normal, _shape_idx):
|
|||||||
$Deur.visible = false
|
$Deur.visible = false
|
||||||
$Lock.visible = false
|
$Lock.visible = false
|
||||||
$Lock/DeurOpen.playing = true
|
$Lock/DeurOpen.playing = true
|
||||||
|
$"../Gui".clear_items()
|
||||||
|
|
||||||
|
|
||||||
func _on_lever_input_event(_camera, event, _position, _normal, _shape_idx):
|
func _on_lever_input_event(_camera, event, _position, _normal, _shape_idx):
|
||||||
|
|||||||
Reference in New Issue
Block a user