From ba61ab90a579a70e70bf18219537854f80504470 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Thu, 8 Jan 2026 23:12:02 -0600 Subject: [PATCH] Prepping for other scenes. --- battle/Battle.gd | 1 + battle/Battle.gd.uid | 1 + battle/BattleScene.gd | 1 + battle/BattleScene.gd.uid | 1 + battle/BattleScene.tscn | 15 ++++++++ cooking/Cooking.gd | 1 + cooking/Cooking.gd.uid | 1 + cooking/CookingScene.tscn | 15 ++++++++ {scene => overworld}/OverworldScene.gd | 0 {scene => overworld}/OverworldScene.gd.uid | 0 {scene => overworld}/OverworldScene.tscn | 2 +- overworld/entity/EntityInteractingArea.gd | 2 +- party/Party.gd | 1 + party/Party.gd.uid | 1 + project.godot | 4 ++ save/Save.gd | 1 + save/Save.gd.uid | 1 + scene/RootScene.gd | 5 ++- scene/RootScene.tscn | 16 ++++++-- scene/Scene.gd | 4 +- ui/UI.gd | 1 + ui/UI.tscn | 11 +++++- ui/debugmenu/DebugMenu.gd | 45 ++++++++++++++++++++++ ui/debugmenu/DebugMenu.gd.uid | 1 + ui/debugmenu/DebugMenu.tscn | 38 ++++++++++++++++++ 25 files changed, 159 insertions(+), 10 deletions(-) create mode 100644 battle/Battle.gd create mode 100644 battle/Battle.gd.uid create mode 100644 battle/BattleScene.gd create mode 100644 battle/BattleScene.gd.uid create mode 100644 battle/BattleScene.tscn create mode 100644 cooking/Cooking.gd create mode 100644 cooking/Cooking.gd.uid create mode 100644 cooking/CookingScene.tscn rename {scene => overworld}/OverworldScene.gd (100%) rename {scene => overworld}/OverworldScene.gd.uid (100%) rename {scene => overworld}/OverworldScene.tscn (87%) create mode 100644 party/Party.gd create mode 100644 party/Party.gd.uid create mode 100644 save/Save.gd create mode 100644 save/Save.gd.uid create mode 100644 ui/debugmenu/DebugMenu.gd create mode 100644 ui/debugmenu/DebugMenu.gd.uid create mode 100644 ui/debugmenu/DebugMenu.tscn diff --git a/battle/Battle.gd b/battle/Battle.gd new file mode 100644 index 0000000..418be6f --- /dev/null +++ b/battle/Battle.gd @@ -0,0 +1 @@ +class_name BattleSingleton extends Node \ No newline at end of file diff --git a/battle/Battle.gd.uid b/battle/Battle.gd.uid new file mode 100644 index 0000000..efe6427 --- /dev/null +++ b/battle/Battle.gd.uid @@ -0,0 +1 @@ +uid://btu8nfa8jlyhi diff --git a/battle/BattleScene.gd b/battle/BattleScene.gd new file mode 100644 index 0000000..79e7385 --- /dev/null +++ b/battle/BattleScene.gd @@ -0,0 +1 @@ +class_name BattleScene extends Node3D diff --git a/battle/BattleScene.gd.uid b/battle/BattleScene.gd.uid new file mode 100644 index 0000000..456ea57 --- /dev/null +++ b/battle/BattleScene.gd.uid @@ -0,0 +1 @@ +uid://dihfp05x6pktn diff --git a/battle/BattleScene.tscn b/battle/BattleScene.tscn new file mode 100644 index 0000000..71ad5bb --- /dev/null +++ b/battle/BattleScene.tscn @@ -0,0 +1,15 @@ +[gd_scene format=3 uid="uid://dy54m7dvjgqta"] + +[node name="BattleScene" type="Node3D"] + +[node name="Control" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="Label" type="Label" parent="Control"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 12.0 +text = "Battle" diff --git a/cooking/Cooking.gd b/cooking/Cooking.gd new file mode 100644 index 0000000..9fac8d6 --- /dev/null +++ b/cooking/Cooking.gd @@ -0,0 +1 @@ +class_name CookingSingleton extends Node \ No newline at end of file diff --git a/cooking/Cooking.gd.uid b/cooking/Cooking.gd.uid new file mode 100644 index 0000000..b1348fa --- /dev/null +++ b/cooking/Cooking.gd.uid @@ -0,0 +1 @@ +uid://u8f7eoh24dgr diff --git a/cooking/CookingScene.tscn b/cooking/CookingScene.tscn new file mode 100644 index 0000000..32f5778 --- /dev/null +++ b/cooking/CookingScene.tscn @@ -0,0 +1,15 @@ +[gd_scene format=3 uid="uid://cxkd4frxvt873"] + +[node name="CookingScene" type="Node3D"] + +[node name="Control" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="Label" type="Label" parent="Control"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 12.0 +text = "Cooking" diff --git a/scene/OverworldScene.gd b/overworld/OverworldScene.gd similarity index 100% rename from scene/OverworldScene.gd rename to overworld/OverworldScene.gd diff --git a/scene/OverworldScene.gd.uid b/overworld/OverworldScene.gd.uid similarity index 100% rename from scene/OverworldScene.gd.uid rename to overworld/OverworldScene.gd.uid diff --git a/scene/OverworldScene.tscn b/overworld/OverworldScene.tscn similarity index 87% rename from scene/OverworldScene.tscn rename to overworld/OverworldScene.tscn index 9e6ed9e..1dfeaac 100644 --- a/scene/OverworldScene.tscn +++ b/overworld/OverworldScene.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://c0k1t3tyiaojl"] -[ext_resource type="Script" uid="uid://dpvccegdmn7s6" path="res://scene/OverworldScene.gd" id="1_fa54r"] +[ext_resource type="Script" uid="uid://dpvccegdmn7s6" path="res://overworld/OverworldScene.gd" id="1_fa54r"] [node name="OverworldScene" type="Node3D" node_paths=PackedStringArray("map")] script = ExtResource("1_fa54r") diff --git a/overworld/entity/EntityInteractingArea.gd b/overworld/entity/EntityInteractingArea.gd index ac56e93..704a257 100644 --- a/overworld/entity/EntityInteractingArea.gd +++ b/overworld/entity/EntityInteractingArea.gd @@ -30,4 +30,4 @@ func _onAreaEntered(area:Area3D) -> void: interactableAreas.append(area) func _onAreaExited(area:Area3D) -> void: - interactableAreas.erase(area) \ No newline at end of file + interactableAreas.erase(area) diff --git a/party/Party.gd b/party/Party.gd new file mode 100644 index 0000000..3a08deb --- /dev/null +++ b/party/Party.gd @@ -0,0 +1 @@ +class_name PartySingleton extends Node \ No newline at end of file diff --git a/party/Party.gd.uid b/party/Party.gd.uid new file mode 100644 index 0000000..21b1347 --- /dev/null +++ b/party/Party.gd.uid @@ -0,0 +1 @@ +uid://b0q50hdmo2smp diff --git a/project.godot b/project.godot index 2969797..717d802 100644 --- a/project.godot +++ b/project.godot @@ -24,6 +24,10 @@ QUEST="*res://quest/Quest.tscn" OVERWORLD="*res://overworld/Overworld.gd" SCENE="*res://scene/Scene.gd" CUTSCENE="*res://cutscene/Cutscene.gd" +BATTLE="*res://battle/Battle.gd" +PARTY="*res://party/Party.gd" +COOKING="*res://cooking/Cooking.gd" +SAVE="*res://save/Save.gd" ControllerIcons="*res://addons/controller_icons/ControllerIcons.gd" [debug] diff --git a/save/Save.gd b/save/Save.gd new file mode 100644 index 0000000..1e3f7b8 --- /dev/null +++ b/save/Save.gd @@ -0,0 +1 @@ +class_name SaveSingleton extends Node \ No newline at end of file diff --git a/save/Save.gd.uid b/save/Save.gd.uid new file mode 100644 index 0000000..89f7a18 --- /dev/null +++ b/save/Save.gd.uid @@ -0,0 +1 @@ +uid://dg1hltpck618e diff --git a/scene/RootScene.gd b/scene/RootScene.gd index 4f396f8..74fa49f 100644 --- a/scene/RootScene.gd +++ b/scene/RootScene.gd @@ -2,6 +2,8 @@ class_name RootScene extends Node3D @export var overworld:Node3D = null @export var initial:Node3D = null +@export var battle:Node3D = null +@export var cooking:Node3D = null func _enter_tree() -> void: SCENE.sceneChanged.connect(onSceneChange) @@ -12,7 +14,8 @@ func _exit_tree() -> void: func onSceneChange(newScene:SceneSingleton.SceneType) -> void: print("overworld", overworld) - remove_child(overworld) + if overworld && overworld.get_parent() == self: + remove_child(overworld) remove_child(initial) overworld.visible = false diff --git a/scene/RootScene.tscn b/scene/RootScene.tscn index e0dd927..4bd029e 100644 --- a/scene/RootScene.tscn +++ b/scene/RootScene.tscn @@ -1,15 +1,23 @@ -[gd_scene load_steps=4 format=3 uid="uid://ckkewlcugc8ro"] +[gd_scene load_steps=6 format=3 uid="uid://ckkewlcugc8ro"] [ext_resource type="Script" uid="uid://ml70iui7qpo4" path="res://scene/RootScene.gd" id="1_nky1x"] +[ext_resource type="PackedScene" uid="uid://dy54m7dvjgqta" path="res://battle/BattleScene.tscn" id="2_0idls"] [ext_resource type="PackedScene" uid="uid://bs41nqi3ocih3" path="res://scene/InitialScene.tscn" id="2_hkmoa"] -[ext_resource type="PackedScene" uid="uid://c0k1t3tyiaojl" path="res://scene/OverworldScene.tscn" id="2_o1wvd"] +[ext_resource type="PackedScene" uid="uid://c0k1t3tyiaojl" path="res://overworld/OverworldScene.tscn" id="2_o1wvd"] +[ext_resource type="PackedScene" uid="uid://cxkd4frxvt873" path="res://cooking/CookingScene.tscn" id="5_aj1eq"] -[node name="RootScene" type="Node3D" node_paths=PackedStringArray("overworld", "initial")] +[node name="RootScene" type="Node3D" node_paths=PackedStringArray("overworld", "initial", "battle", "cooking")] script = ExtResource("1_nky1x") overworld = NodePath("OverworldScene") initial = NodePath("InitialScene") +battle = NodePath("BattleScene") +cooking = NodePath("CookingScene") metadata/_custom_type_script = "uid://ml70iui7qpo4" +[node name="InitialScene" parent="." instance=ExtResource("2_hkmoa")] + +[node name="BattleScene" parent="." instance=ExtResource("2_0idls")] + [node name="OverworldScene" parent="." instance=ExtResource("2_o1wvd")] -[node name="InitialScene" parent="." instance=ExtResource("2_hkmoa")] +[node name="CookingScene" parent="." instance=ExtResource("5_aj1eq")] diff --git a/scene/Scene.gd b/scene/Scene.gd index 17b14a8..96cbc64 100644 --- a/scene/Scene.gd +++ b/scene/Scene.gd @@ -3,7 +3,9 @@ class_name SceneSingleton extends Node enum SceneType { UNSET, INITIAL, - OVERWORLD + OVERWORLD, + BATTLE, + COOKING } var currentScene:SceneType = SceneType.UNSET diff --git a/ui/UI.gd b/ui/UI.gd index 1c1acaa..e72585a 100644 --- a/ui/UI.gd +++ b/ui/UI.gd @@ -2,3 +2,4 @@ class_name UISingleton extends Control @export var TEXTBOX: VNTextbox @export var PAUSE: PauseMenu +@export var DEBUG: DebugMenu diff --git a/ui/UI.tscn b/ui/UI.tscn index c3696d4..ce2be25 100644 --- a/ui/UI.tscn +++ b/ui/UI.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=4 format=3 uid="uid://baos0arpiskbp"] +[gd_scene load_steps=5 format=3 uid="uid://baos0arpiskbp"] [ext_resource type="PackedScene" uid="uid://bkx3l0kckf4a8" path="res://ui/component/VNTextbox.tscn" id="1_1mtk3"] [ext_resource type="Script" uid="uid://dq3qyyayugt5l" path="res://ui/UI.gd" id="1_son71"] [ext_resource type="PackedScene" uid="uid://c0i5e2dj11d8c" path="res://ui/pause/PauseMenu.tscn" id="2_atyu8"] +[ext_resource type="PackedScene" uid="uid://b38dr0wkix76t" path="res://ui/debugmenu/DebugMenu.tscn" id="4_u132g"] -[node name="UI" type="Control" node_paths=PackedStringArray("TEXTBOX", "PAUSE")] +[node name="UI" type="Control" node_paths=PackedStringArray("TEXTBOX", "PAUSE", "DEBUG")] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -14,8 +15,14 @@ grow_vertical = 2 script = ExtResource("1_son71") TEXTBOX = NodePath("VNTextbox") PAUSE = NodePath("PauseMenu") +DEBUG = NodePath("DebugMenu") + +[node name="DebugMenu" parent="." instance=ExtResource("4_u132g")] +visible = false +layout_mode = 1 [node name="PauseMenu" parent="." instance=ExtResource("2_atyu8")] +visible = false layout_mode = 1 [node name="VNTextbox" parent="." instance=ExtResource("1_1mtk3")] diff --git a/ui/debugmenu/DebugMenu.gd b/ui/debugmenu/DebugMenu.gd new file mode 100644 index 0000000..e15520f --- /dev/null +++ b/ui/debugmenu/DebugMenu.gd @@ -0,0 +1,45 @@ +class_name DebugMenu extends Control + +@export var btnInitial: Button = null +@export var btnOverworld: Button = null +@export var btnBattle: Button = null +@export var btnCooking: Button = null + +var isClosed:bool = false: + get(): + return !self.visible; + set(value): + self.visible = !value; + +func _enter_tree() -> void: + if btnInitial: + btnInitial.pressed.connect(onInitialPressed) + if btnOverworld: + btnOverworld.pressed.connect(onOverworldPressed) + if btnBattle: + btnBattle.pressed.connect(onBattlePressed) + if btnCooking: + btnCooking.pressed.connect(onCookingPressed) + isClosed = false + +func _exit_tree() -> void: + if btnInitial: + btnInitial.pressed.disconnect(onInitialPressed) + if btnOverworld: + btnOverworld.pressed.disconnect(onOverworldPressed) + if btnBattle: + btnBattle.pressed.disconnect(onBattlePressed) + if btnCooking: + btnCooking.pressed.disconnect(onCookingPressed) + +func onInitialPressed() -> void: + SCENE.setScene(SCENE.SceneType.INITIAL) + +func onOverworldPressed() -> void: + SCENE.setScene(SCENE.SceneType.OVERWORLD) + +func onBattlePressed() -> void: + SCENE.setScene(SCENE.SceneType.BATTLE) + +func onCookingPressed() -> void: + SCENE.setScene(SCENE.SceneType.COOKING) diff --git a/ui/debugmenu/DebugMenu.gd.uid b/ui/debugmenu/DebugMenu.gd.uid new file mode 100644 index 0000000..58fde31 --- /dev/null +++ b/ui/debugmenu/DebugMenu.gd.uid @@ -0,0 +1 @@ +uid://bekdew700opvq diff --git a/ui/debugmenu/DebugMenu.tscn b/ui/debugmenu/DebugMenu.tscn new file mode 100644 index 0000000..c8d5752 --- /dev/null +++ b/ui/debugmenu/DebugMenu.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=2 format=3 uid="uid://b38dr0wkix76t"] + +[ext_resource type="Script" uid="uid://bekdew700opvq" path="res://ui/debugmenu/DebugMenu.gd" id="1_c1p3i"] + +[node name="DebugMenu" type="Control" node_paths=PackedStringArray("btnInitial", "btnOverworld", "btnBattle", "btnCooking")] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_c1p3i") +btnInitial = NodePath("HBoxContainer/InitialScene") +btnOverworld = NodePath("HBoxContainer/OverworldScene") +btnBattle = NodePath("HBoxContainer/BattleScene") +btnCooking = NodePath("HBoxContainer/CookingScene") +metadata/_custom_type_script = "uid://bekdew700opvq" + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="OverworldScene" type="Button" parent="HBoxContainer"] +layout_mode = 2 +text = "Overworld scene" + +[node name="BattleScene" type="Button" parent="HBoxContainer"] +layout_mode = 2 +text = "Battle scene" + +[node name="CookingScene" type="Button" parent="HBoxContainer"] +layout_mode = 2 +text = "Cooking Scene" + +[node name="InitialScene" type="Button" parent="HBoxContainer"] +layout_mode = 2 +text = "Initial scene"