Minor refactoring.

main
Martin Felis 2024-08-15 21:29:01 +02:00
parent 256cd4f1f3
commit ead02217a5
2 changed files with 54 additions and 76 deletions

View File

@ -1,4 +1,4 @@
class_name Game
class_name Main
extends Node3D
@onready var message_container:Control = %MessagesContainer

View File

@ -1,32 +1,27 @@
[gd_scene load_steps=37 format=3 uid="uid://bugqatylloxkl"]
[gd_scene load_steps=32 format=3 uid="uid://ck104ww8vi7f1"]
[ext_resource type="Script" path="res://scenes/game.gd" id="1_uwyoo"]
[ext_resource type="Texture2D" uid="uid://bq3b1hxl5ojh6" path="res://assets/icons/npc_emotes/attention.tres" id="2_4dxur"]
[ext_resource type="PackedScene" uid="uid://2q8dhf61a7os" path="res://assets/characters/engineer.tscn" id="3_gf736"]
[ext_resource type="Script" path="res://scenes/game_scene.gd" id="3_j7rx1"]
[ext_resource type="PackedScene" uid="uid://dhpc2xvlfln7o" path="res://objects/actionable.tscn" id="4_pths5"]
[ext_resource type="Resource" uid="uid://b1gd54koq1h7o" path="res://dialogue/testdialogue.dialogue" id="5_i1opu"]
[ext_resource type="PackedScene" uid="uid://dmagdl5pi6jdj" path="res://world/level.tscn" id="6_svjo8"]
[ext_resource type="PackedScene" uid="uid://dnobr4inhiskv" path="res://assets/3rdparty/kenney/platformer-kit/Models/GLB format/tree-pine.glb" id="7_0tqw3"]
[ext_resource type="PackedScene" uid="uid://m4tk7vhjy310" path="res://assets/3rdparty/kenney/platformer-kit/Models/GLB format/tree.glb" id="8_ivm2f"]
[ext_resource type="PackedScene" uid="uid://cgde10y3e7w86" path="res://assets/3rdparty/kenney/platformer-kit/Models/GLB format/rocks.glb" id="9_0hvyx"]
[ext_resource type="PackedScene" uid="uid://dg1rtct0vrk3p" path="res://assets/3rdparty/kenney/platformer-kit/Models/GLB format/poles.glb" id="10_8fhnl"]
[ext_resource type="PackedScene" uid="uid://cej0a41nm3eh7" path="res://assets/3rdparty/kenney/platformer-kit/Models/GLB format/mushrooms.glb" id="11_ytfwt"]
[ext_resource type="Script" path="res://player.gd" id="13_2wo8v"]
[ext_resource type="Script" path="res://quests/builder_missing_tool_quest.gd" id="14_g3xjj"]
[ext_resource type="PackedScene" uid="uid://dy8vjf760prhq" path="res://assets/characters/rogue.tscn" id="15_2476h"]
[ext_resource type="PackedScene" uid="uid://bo788o53t4rbq" path="res://scenes/startup_scene.tscn" id="16_7jwuc"]
[ext_resource type="Script" path="res://root_ui.gd" id="16_winq7"]
[ext_resource type="Theme" uid="uid://dmk7hc81l8gbw" path="res://ui/ui_theme.tres" id="17_1odts"]
[ext_resource type="Script" path="res://quests/scared_to_walk_in_the_dark.gd" id="18_7v3bk"]
[ext_resource type="Script" path="res://game_ui.gd" id="18_i4pxl"]
[ext_resource type="Script" path="res://ui/game_menu_ui.gd" id="18_lr26g"]
[ext_resource type="Texture2D" uid="uid://c7fu3paj3b4e8" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/cursorSword_silver.png" id="19_mn7wc"]
[ext_resource type="Texture2D" uid="uid://drpl0ql1p3pfk" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/cursorSword_gold.png" id="20_3b2hv"]
[ext_resource type="Texture2D" uid="uid://cq8ypeagpedq" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/cursorSword_bronze.png" id="21_act8d"]
[ext_resource type="Script" path="res://ui/inventory_dialog.gd" id="22_s3l55"]
[ext_resource type="PackedScene" uid="uid://dp3fi0g53qrt2" path="res://ui/item_slot.tscn" id="23_4kchv"]
[ext_resource type="PackedScene" uid="uid://bwui4acukq4x6" path="res://ui/item_grid.tscn" id="24_hfjh5"]
[ext_resource type="Script" path="res://scenes/game.gd" id="1_r138e"]
[ext_resource type="PackedScene" uid="uid://bo788o53t4rbq" path="res://scenes/startup_scene.tscn" id="2_imuae"]
[ext_resource type="Script" path="res://scenes/game_scene.gd" id="3_b4wfs"]
[ext_resource type="Texture2D" uid="uid://bq3b1hxl5ojh6" path="res://assets/icons/npc_emotes/attention.tres" id="4_podjg"]
[ext_resource type="PackedScene" uid="uid://2q8dhf61a7os" path="res://assets/characters/engineer.tscn" id="5_fhc6a"]
[ext_resource type="PackedScene" uid="uid://dhpc2xvlfln7o" path="res://objects/actionable.tscn" id="6_l5an6"]
[ext_resource type="Resource" uid="uid://b1gd54koq1h7o" path="res://dialogue/testdialogue.dialogue" id="7_73ony"]
[ext_resource type="PackedScene" uid="uid://dmagdl5pi6jdj" path="res://world/level.tscn" id="8_14wop"]
[ext_resource type="Script" path="res://player.gd" id="9_kb8c7"]
[ext_resource type="PackedScene" uid="uid://dy8vjf760prhq" path="res://assets/characters/rogue.tscn" id="10_qt4hm"]
[ext_resource type="Script" path="res://quests/builder_missing_tool_quest.gd" id="11_8mftb"]
[ext_resource type="Script" path="res://quests/scared_to_walk_in_the_dark.gd" id="12_q514n"]
[ext_resource type="Script" path="res://root_ui.gd" id="13_h24kl"]
[ext_resource type="Theme" uid="uid://dmk7hc81l8gbw" path="res://ui/ui_theme.tres" id="14_bvivl"]
[ext_resource type="Script" path="res://game_ui.gd" id="15_g7bf1"]
[ext_resource type="Script" path="res://ui/inventory_dialog.gd" id="16_18k4v"]
[ext_resource type="PackedScene" uid="uid://dp3fi0g53qrt2" path="res://ui/item_slot.tscn" id="17_rucv3"]
[ext_resource type="PackedScene" uid="uid://bwui4acukq4x6" path="res://ui/item_grid.tscn" id="18_fihac"]
[ext_resource type="Script" path="res://ui/game_menu_ui.gd" id="19_krapk"]
[ext_resource type="Texture2D" uid="uid://c7fu3paj3b4e8" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/cursorSword_silver.png" id="20_7s1r5"]
[ext_resource type="Texture2D" uid="uid://drpl0ql1p3pfk" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/cursorSword_gold.png" id="21_663i3"]
[ext_resource type="Texture2D" uid="uid://cq8ypeagpedq" path="res://assets/3rdparty/kenney/ui-pack-rpg-expansion/PNG/cursorSword_bronze.png" id="22_le7qn"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_y65pc"]
@ -60,10 +55,10 @@ height = 0.952333
[sub_resource type="SphereShape3D" id="SphereShape3D_wrkyq"]
radius = 0.194932
[node name="Game" type="Node3D"]
script = ExtResource("1_uwyoo")
[node name="Main" type="Node3D"]
script = ExtResource("1_r138e")
[node name="StartupScene" parent="." instance=ExtResource("16_7jwuc")]
[node name="StartupScene" parent="." instance=ExtResource("2_imuae")]
unique_name_in_owner = true
visible = false
@ -76,8 +71,7 @@ shadow_enabled = true
[node name="GameScene" type="Node3D" parent="."]
unique_name_in_owner = true
visible = false
script = ExtResource("3_j7rx1")
script = ExtResource("3_b4wfs")
[node name="WorldEnvironment" type="WorldEnvironment" parent="GameScene"]
environment = SubResource("Environment_v85yo")
@ -99,37 +93,20 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0272007, 0.901301, 0.16839
centered = false
billboard = 1
texture_filter = 0
texture = ExtResource("2_4dxur")
texture = ExtResource("4_podjg")
[node name="Geometry" type="Node3D" parent="GameScene/Merchant"]
transform = Transform3D(0.4, 0, 0, 0, 0.4, 0, 0, 0, 0.4, 0, 0, 0)
[node name="Engineer" parent="GameScene/Merchant/Geometry" instance=ExtResource("3_gf736")]
[node name="Engineer" parent="GameScene/Merchant/Geometry" instance=ExtResource("5_fhc6a")]
[node name="Actionable" parent="GameScene/Merchant" instance=ExtResource("4_pths5")]
dialogue_resource = ExtResource("5_i1opu")
[node name="Actionable" parent="GameScene/Merchant" instance=ExtResource("6_l5an6")]
dialogue_resource = ExtResource("7_73ony")
[node name="CollisionShape3D" type="CollisionShape3D" parent="GameScene/Merchant/Actionable"]
shape = SubResource("SphereShape3D_6nrvr")
[node name="Level" parent="GameScene" instance=ExtResource("6_svjo8")]
[node name="Decorations" type="Node3D" parent="GameScene"]
[node name="tree-pine2" parent="GameScene/Decorations" instance=ExtResource("7_0tqw3")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.754677, 0, 0.0391712)
[node name="tree2" parent="GameScene/Decorations" instance=ExtResource("8_ivm2f")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.80764, 0, -3.13532)
[node name="rocks2" parent="GameScene/Decorations" instance=ExtResource("9_0hvyx")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.3817, -4.76837e-07, -3.3938)
[node name="poles2" parent="GameScene/Decorations" instance=ExtResource("10_8fhnl")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.56186, 0, -3.13331)
[node name="mushrooms2" parent="GameScene/Decorations" instance=ExtResource("11_ytfwt")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.851, 0, 0.798104)
[node name="Level" parent="GameScene" instance=ExtResource("8_14wop")]
[node name="Bridge" type="Node3D" parent="GameScene"]
unique_name_in_owner = true
@ -137,7 +114,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.375699, -0.115042, 0)
[node name="Player" type="CharacterBody3D" parent="GameScene"]
unique_name_in_owner = true
script = ExtResource("13_2wo8v")
script = ExtResource("9_kb8c7")
[node name="MeshInstance3D" type="MeshInstance3D" parent="GameScene/Player"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0)
@ -152,7 +129,7 @@ shape = SubResource("CapsuleShape3D_7kfad")
unique_name_in_owner = true
transform = Transform3D(0.4, 0, 0, 0, 0.4, 0, 0, 0, 0.4, 0, 0, 0)
[node name="Rogue" parent="GameScene/Player/Geometry" instance=ExtResource("15_2476h")]
[node name="Rogue" parent="GameScene/Player/Geometry" instance=ExtResource("10_qt4hm")]
[node name="ActionableDetector" type="Area3D" parent="GameScene/Player"]
unique_name_in_owner = true
@ -166,19 +143,20 @@ shape = SubResource("SphereShape3D_wrkyq")
[node name="Camera3D" type="Camera3D" parent="GameScene/Player"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 0.460138, 0.887848, 0, -0.887848, 0.460138, 0, 2.91421, 1.186)
current = true
[node name="Quests" type="Node" parent="GameScene"]
[node name="BuilderMissingTool" type="Node" parent="GameScene/Quests" groups=["quest_state"]]
unique_name_in_owner = true
script = ExtResource("14_g3xjj")
script = ExtResource("11_8mftb")
[node name="ScaredToWalkInTheDark" type="Node" parent="GameScene/Quests" groups=["quest_state"]]
script = ExtResource("18_7v3bk")
script = ExtResource("12_q514n")
[node name="RootUI" type="CanvasLayer" parent="."]
unique_name_in_owner = true
script = ExtResource("16_winq7")
script = ExtResource("13_h24kl")
[node name="MainMenuUI" type="PanelContainer" parent="RootUI"]
unique_name_in_owner = true
@ -194,7 +172,7 @@ offset_right = 199.0
offset_bottom = 134.5
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("17_1odts")
theme = ExtResource("14_bvivl")
[node name="MarginContainer" type="MarginContainer" parent="RootUI/MainMenuUI"]
layout_mode = 2
@ -265,7 +243,7 @@ offset_right = 291.0
offset_bottom = 144.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("17_1odts")
theme = ExtResource("14_bvivl")
[node name="MarginContainer" type="MarginContainer" parent="RootUI/NewGameUI"]
layout_mode = 2
@ -348,8 +326,8 @@ grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource("17_1odts")
script = ExtResource("18_i4pxl")
theme = ExtResource("14_bvivl")
script = ExtResource("15_g7bf1")
[node name="MessagesContainer" type="MarginContainer" parent="RootUI/GameUI"]
unique_name_in_owner = true
@ -387,8 +365,8 @@ theme_override_constants/margin_left = 40
theme_override_constants/margin_top = 82
theme_override_constants/margin_right = 40
theme_override_constants/margin_bottom = 128
script = ExtResource("22_s3l55")
slot_scene = ExtResource("23_4kchv")
script = ExtResource("16_18k4v")
slot_scene = ExtResource("17_rucv3")
[node name="Panel" type="Panel" parent="RootUI/GameUI/InventoryDialog"]
layout_mode = 2
@ -440,7 +418,7 @@ text = "Recipes"
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
theme = ExtResource("17_1odts")
theme = ExtResource("14_bvivl")
item_count = 2
item_0/text = "Blab"
item_1/text = "Bloobalb"
@ -472,7 +450,7 @@ grow_horizontal = 2
grow_vertical = 2
size_flags_vertical = 3
[node name="IngredientsContainer" parent="RootUI/GameUI/InventoryDialog/Panel/PanelContainer/CraftingUI/HBoxContainer/CraftIngredients/Panel/CenterContainer" instance=ExtResource("24_hfjh5")]
[node name="IngredientsContainer" parent="RootUI/GameUI/InventoryDialog/Panel/PanelContainer/CraftingUI/HBoxContainer/CraftIngredients/Panel/CenterContainer" instance=ExtResource("18_fihac")]
unique_name_in_owner = true
layout_mode = 2
@ -510,7 +488,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="ResultsContainer" parent="RootUI/GameUI/InventoryDialog/Panel/PanelContainer/CraftingUI/HBoxContainer/CraftResult/Panel/CenterContainer" instance=ExtResource("24_hfjh5")]
[node name="ResultsContainer" parent="RootUI/GameUI/InventoryDialog/Panel/PanelContainer/CraftingUI/HBoxContainer/CraftResult/Panel/CenterContainer" instance=ExtResource("18_fihac")]
unique_name_in_owner = true
layout_mode = 2
@ -538,7 +516,7 @@ layout_mode = 2
layout_mode = 2
text = "Backpack"
[node name="InventoryContainer" parent="RootUI/GameUI/InventoryDialog/Panel/PanelContainer/BackpackUI/VBoxContainer" instance=ExtResource("24_hfjh5")]
[node name="InventoryContainer" parent="RootUI/GameUI/InventoryDialog/Panel/PanelContainer/BackpackUI/VBoxContainer" instance=ExtResource("18_fihac")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
@ -558,8 +536,8 @@ offset_right = 199.0
offset_bottom = 215.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("17_1odts")
script = ExtResource("18_lr26g")
theme = ExtResource("14_bvivl")
script = ExtResource("19_krapk")
[node name="MarginContainer" type="MarginContainer" parent="RootUI/GameUI/GameMenuUI"]
layout_mode = 2
@ -654,15 +632,15 @@ layout_mode = 2
[node name="Button2" type="Button" parent="RootUI/GameUI/ToolSlots/PanelContainer/HBoxContainer"]
layout_mode = 2
icon = ExtResource("19_mn7wc")
icon = ExtResource("20_7s1r5")
[node name="Button3" type="Button" parent="RootUI/GameUI/ToolSlots/PanelContainer/HBoxContainer"]
layout_mode = 2
icon = ExtResource("20_3b2hv")
icon = ExtResource("21_663i3")
[node name="Button" type="Button" parent="RootUI/GameUI/ToolSlots/PanelContainer/HBoxContainer"]
layout_mode = 2
icon = ExtResource("21_act8d")
icon = ExtResource("22_le7qn")
[connection signal="visibility_changed" from="GameScene" to="GameScene" method="_on_visibility_changed"]
[connection signal="pressed" from="RootUI/MainMenuUI/MarginContainer/VBoxContainer/MarginContainer/NewGameButton" to="RootUI" method="_on_new_game_button_pressed"]