Prepping for other scenes.
This commit is contained in:
1
battle/Battle.gd
Normal file
1
battle/Battle.gd
Normal file
@@ -0,0 +1 @@
|
|||||||
|
class_name BattleSingleton extends Node
|
||||||
1
battle/Battle.gd.uid
Normal file
1
battle/Battle.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://btu8nfa8jlyhi
|
||||||
1
battle/BattleScene.gd
Normal file
1
battle/BattleScene.gd
Normal file
@@ -0,0 +1 @@
|
|||||||
|
class_name BattleScene extends Node3D
|
||||||
1
battle/BattleScene.gd.uid
Normal file
1
battle/BattleScene.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dihfp05x6pktn
|
||||||
15
battle/BattleScene.tscn
Normal file
15
battle/BattleScene.tscn
Normal file
@@ -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"
|
||||||
1
cooking/Cooking.gd
Normal file
1
cooking/Cooking.gd
Normal file
@@ -0,0 +1 @@
|
|||||||
|
class_name CookingSingleton extends Node
|
||||||
1
cooking/Cooking.gd.uid
Normal file
1
cooking/Cooking.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://u8f7eoh24dgr
|
||||||
15
cooking/CookingScene.tscn
Normal file
15
cooking/CookingScene.tscn
Normal file
@@ -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"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://c0k1t3tyiaojl"]
|
[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")]
|
[node name="OverworldScene" type="Node3D" node_paths=PackedStringArray("map")]
|
||||||
script = ExtResource("1_fa54r")
|
script = ExtResource("1_fa54r")
|
||||||
1
party/Party.gd
Normal file
1
party/Party.gd
Normal file
@@ -0,0 +1 @@
|
|||||||
|
class_name PartySingleton extends Node
|
||||||
1
party/Party.gd.uid
Normal file
1
party/Party.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://b0q50hdmo2smp
|
||||||
@@ -24,6 +24,10 @@ QUEST="*res://quest/Quest.tscn"
|
|||||||
OVERWORLD="*res://overworld/Overworld.gd"
|
OVERWORLD="*res://overworld/Overworld.gd"
|
||||||
SCENE="*res://scene/Scene.gd"
|
SCENE="*res://scene/Scene.gd"
|
||||||
CUTSCENE="*res://cutscene/Cutscene.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"
|
ControllerIcons="*res://addons/controller_icons/ControllerIcons.gd"
|
||||||
|
|
||||||
[debug]
|
[debug]
|
||||||
|
|||||||
1
save/Save.gd
Normal file
1
save/Save.gd
Normal file
@@ -0,0 +1 @@
|
|||||||
|
class_name SaveSingleton extends Node
|
||||||
1
save/Save.gd.uid
Normal file
1
save/Save.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dg1hltpck618e
|
||||||
@@ -2,6 +2,8 @@ class_name RootScene extends Node3D
|
|||||||
|
|
||||||
@export var overworld:Node3D = null
|
@export var overworld:Node3D = null
|
||||||
@export var initial:Node3D = null
|
@export var initial:Node3D = null
|
||||||
|
@export var battle:Node3D = null
|
||||||
|
@export var cooking:Node3D = null
|
||||||
|
|
||||||
func _enter_tree() -> void:
|
func _enter_tree() -> void:
|
||||||
SCENE.sceneChanged.connect(onSceneChange)
|
SCENE.sceneChanged.connect(onSceneChange)
|
||||||
@@ -12,6 +14,7 @@ func _exit_tree() -> void:
|
|||||||
|
|
||||||
func onSceneChange(newScene:SceneSingleton.SceneType) -> void:
|
func onSceneChange(newScene:SceneSingleton.SceneType) -> void:
|
||||||
print("overworld", overworld)
|
print("overworld", overworld)
|
||||||
|
if overworld && overworld.get_parent() == self:
|
||||||
remove_child(overworld)
|
remove_child(overworld)
|
||||||
remove_child(initial)
|
remove_child(initial)
|
||||||
|
|
||||||
|
|||||||
@@ -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="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://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")
|
script = ExtResource("1_nky1x")
|
||||||
overworld = NodePath("OverworldScene")
|
overworld = NodePath("OverworldScene")
|
||||||
initial = NodePath("InitialScene")
|
initial = NodePath("InitialScene")
|
||||||
|
battle = NodePath("BattleScene")
|
||||||
|
cooking = NodePath("CookingScene")
|
||||||
metadata/_custom_type_script = "uid://ml70iui7qpo4"
|
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="OverworldScene" parent="." instance=ExtResource("2_o1wvd")]
|
||||||
|
|
||||||
[node name="InitialScene" parent="." instance=ExtResource("2_hkmoa")]
|
[node name="CookingScene" parent="." instance=ExtResource("5_aj1eq")]
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ class_name SceneSingleton extends Node
|
|||||||
enum SceneType {
|
enum SceneType {
|
||||||
UNSET,
|
UNSET,
|
||||||
INITIAL,
|
INITIAL,
|
||||||
OVERWORLD
|
OVERWORLD,
|
||||||
|
BATTLE,
|
||||||
|
COOKING
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentScene:SceneType = SceneType.UNSET
|
var currentScene:SceneType = SceneType.UNSET
|
||||||
|
|||||||
1
ui/UI.gd
1
ui/UI.gd
@@ -2,3 +2,4 @@ class_name UISingleton extends Control
|
|||||||
|
|
||||||
@export var TEXTBOX: VNTextbox
|
@export var TEXTBOX: VNTextbox
|
||||||
@export var PAUSE: PauseMenu
|
@export var PAUSE: PauseMenu
|
||||||
|
@export var DEBUG: DebugMenu
|
||||||
|
|||||||
11
ui/UI.tscn
11
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="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="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://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
|
layout_mode = 3
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@@ -14,8 +15,14 @@ grow_vertical = 2
|
|||||||
script = ExtResource("1_son71")
|
script = ExtResource("1_son71")
|
||||||
TEXTBOX = NodePath("VNTextbox")
|
TEXTBOX = NodePath("VNTextbox")
|
||||||
PAUSE = NodePath("PauseMenu")
|
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")]
|
[node name="PauseMenu" parent="." instance=ExtResource("2_atyu8")]
|
||||||
|
visible = false
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
|
|
||||||
[node name="VNTextbox" parent="." instance=ExtResource("1_1mtk3")]
|
[node name="VNTextbox" parent="." instance=ExtResource("1_1mtk3")]
|
||||||
|
|||||||
45
ui/debugmenu/DebugMenu.gd
Normal file
45
ui/debugmenu/DebugMenu.gd
Normal file
@@ -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)
|
||||||
1
ui/debugmenu/DebugMenu.gd.uid
Normal file
1
ui/debugmenu/DebugMenu.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bekdew700opvq
|
||||||
38
ui/debugmenu/DebugMenu.tscn
Normal file
38
ui/debugmenu/DebugMenu.tscn
Normal file
@@ -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"
|
||||||
Reference in New Issue
Block a user