Bit more cleanup
This commit is contained in:
@@ -17,17 +17,15 @@ config/icon="res://icon.svg"
|
||||
|
||||
[autoload]
|
||||
|
||||
DEBUG="*res://scenes/Singletons/Debug.tscn"
|
||||
BATTLE="*res://scripts/Singleton/Battle.gd"
|
||||
CUTSCENE="*res://scripts/Singleton/Cutscene.gd"
|
||||
COOKING="*res://scripts/Singleton/Cooking.gd"
|
||||
ITEM="*res://scripts/Singleton/Item.gd"
|
||||
OVERWORLD="*res://scripts/Singleton/Overworld.gd"
|
||||
PAUSE="*res://scripts/Singleton/Pause.gd"
|
||||
QUEST="*res://scenes/Singletons/Quest.tscn"
|
||||
SCENE_MANAGER="*res://scripts/Singleton/SceneManager.gd"
|
||||
VN="*res://scenes/Singletons/VN.tscn"
|
||||
UI="*res://scenes/Singletons/UI.tscn"
|
||||
VN="*res://scripts/Singleton/VN.gd"
|
||||
|
||||
[dotnet]
|
||||
|
||||
|
@@ -1,12 +1,16 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://w1q5eoiejmy3"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bimrljk1rn7af" path="res://scenes/UI/SubsceneUI.tscn" id="1_yqorp"]
|
||||
[gd_scene format=3 uid="uid://w1q5eoiejmy3"]
|
||||
|
||||
[node name="MainMenu" type="Node"]
|
||||
|
||||
[node name="SubsceneUI" parent="." instance=ExtResource("1_yqorp")]
|
||||
[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
|
||||
|
||||
[node name="Label" type="Label" parent="SubsceneUI"]
|
||||
[node name="Label" type="Label" parent="Control"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
|
@@ -1,9 +1,16 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://tmbx2kit0jyq"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://tmbx2kit0jyq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://pcncoc6wum4q" path="res://scripts/Scene/OverworldScene.gd" id="1_rfscu"]
|
||||
[ext_resource type="PackedScene" uid="uid://dx6fv8n4jl5ku" path="res://scenes/Maps/TestMap/TestMap.tscn" id="2_puia7"]
|
||||
[ext_resource type="PackedScene" uid="uid://bimrljk1rn7af" path="res://scenes/UI/SubsceneUI.tscn" id="3_gacct"]
|
||||
[ext_resource type="PackedScene" uid="uid://bfioi52hjn2kf" path="res://scenes/UI/QuestMenu.tscn" id="3_puia7"]
|
||||
|
||||
[node name="Overworld" type="Node3D"]
|
||||
script = ExtResource("1_rfscu")
|
||||
|
||||
[node name="Some-map" parent="." instance=ExtResource("2_puia7")]
|
||||
|
||||
[node name="SubsceneUI" parent="." instance=ExtResource("3_gacct")]
|
||||
|
||||
[node name="QuestMenu" parent="SubsceneUI" instance=ExtResource("3_puia7")]
|
||||
layout_mode = 1
|
||||
|
@@ -1,19 +0,0 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://klfo3l0dxlht"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d36d3fnpi8y30" path="res://scripts/Singleton/Debug.gd" id="1_5spvt"]
|
||||
[ext_resource type="PackedScene" uid="uid://bimrljk1rn7af" path="res://scenes/UI/SubsceneUI.tscn" id="2_5o7yr"]
|
||||
[ext_resource type="PackedScene" uid="uid://verg13jtqwvh" path="res://scenes/UI/DebugMenu.tscn" id="2_c2xgb"]
|
||||
|
||||
[node name="Debug" type="Node"]
|
||||
script = ExtResource("1_5spvt")
|
||||
|
||||
[node name="SubsceneUI" parent="." instance=ExtResource("2_5o7yr")]
|
||||
layer = 3
|
||||
|
||||
[node name="DebugMenu" parent="SubsceneUI" instance=ExtResource("2_c2xgb")]
|
||||
layout_mode = 0
|
||||
anchors_preset = 0
|
||||
anchor_bottom = 0.0
|
||||
offset_right = 207.0
|
||||
offset_bottom = 206.0
|
||||
grow_vertical = 1
|
@@ -1,6 +1,22 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cs3kmmd0rfm8w"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cs3kmmd0rfm8w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d0060jeyftia7" path="res://scripts/Singleton/Quest.gd" id="1_v2h4q"]
|
||||
[ext_resource type="Script" uid="uid://dn0kxbe85n40f" path="res://scripts/Quest/Quest.gd" id="2_n4ii1"]
|
||||
[ext_resource type="Script" uid="uid://db4yhcxyhiosq" path="res://scripts/Quest/QuestStage.gd" id="3_1ynnx"]
|
||||
[ext_resource type="Script" uid="uid://de1ao4huhy0hm" path="res://scripts/Quest/QuestObjective.gd" id="3_l8p7p"]
|
||||
|
||||
[node name="Quest" type="Node"]
|
||||
[node name="QuestSystem" type="Node"]
|
||||
script = ExtResource("1_v2h4q")
|
||||
|
||||
[node name="Quests" type="Node" parent="."]
|
||||
|
||||
[node name="Some Quest" type="Node" parent="Quests"]
|
||||
script = ExtResource("2_n4ii1")
|
||||
|
||||
[node name="Find Ingredients" type="Node" parent="Quests/Some Quest"]
|
||||
script = ExtResource("3_1ynnx")
|
||||
stageName = "Find Ingredients"
|
||||
|
||||
[node name="Find Onion" type="Node" parent="Quests/Some Quest/Find Ingredients"]
|
||||
script = ExtResource("3_l8p7p")
|
||||
objectiveName = "Find Onions"
|
||||
|
@@ -1,6 +1,9 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b5bwpsh0gcicf"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://b5bwpsh0gcicf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dahhuhiu8u88b" path="res://scripts/Singleton/UI.gd" id="1_g3au4"]
|
||||
[ext_resource type="PackedScene" uid="uid://verg13jtqwvh" path="res://scenes/UI/DebugMenu.tscn" id="2_is0g4"]
|
||||
[ext_resource type="PackedScene" uid="uid://bfioi52hjn2kf" path="res://scenes/UI/QuestMenu.tscn" id="2_mpokx"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkx3l0kckf4a8" path="res://scenes/UI/VNTextbox.tscn" id="3_btpxp"]
|
||||
|
||||
[node name="UI" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -9,29 +12,24 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1_g3au4")
|
||||
metadata/_custom_type_script = "uid://dahhuhiu8u88b"
|
||||
|
||||
[node name="LayerGame" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
[node name="QuestMenu" parent="." instance=ExtResource("2_mpokx")]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
anchors_preset = 0
|
||||
|
||||
[node name="LayerVN" type="Control" parent="."]
|
||||
[node name="VNTextbox" parent="." instance=ExtResource("3_btpxp")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="LayerDebug" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
[node name="DebugMenu" parent="." instance=ExtResource("2_is0g4")]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
anchors_preset = 0
|
||||
anchor_bottom = 0.0
|
||||
offset_right = 207.0
|
||||
offset_bottom = 206.0
|
||||
grow_vertical = 1
|
||||
|
@@ -1,14 +0,0 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://b6pl1cq5y05ad"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://benvf7v4p4i2l" path="res://scripts/Singleton/VN.gd" id="1_01fad"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkx3l0kckf4a8" path="res://scenes/UI/VNTextbox.tscn" id="2_adm0d"]
|
||||
[ext_resource type="PackedScene" uid="uid://bimrljk1rn7af" path="res://scenes/UI/SubsceneUI.tscn" id="2_hxsm8"]
|
||||
|
||||
[node name="VN" type="Node"]
|
||||
script = ExtResource("1_01fad")
|
||||
|
||||
[node name="SubsceneUI" parent="." instance=ExtResource("2_hxsm8")]
|
||||
layer = 1
|
||||
|
||||
[node name="VNTextbox" parent="SubsceneUI" instance=ExtResource("2_adm0d")]
|
||||
layout_mode = 1
|
@@ -1,42 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dqf0j61ukvqco"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://dm7ee4aqjr2dl" path="res://ui/UI Theme.tres" id="1_jnmec"]
|
||||
|
||||
[node name="PauseMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_jnmec")
|
||||
|
||||
[node name="HSplitContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_jnmec")
|
||||
|
||||
[node name="Panel2" type="PanelContainer" parent="HSplitContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme = ExtResource("1_jnmec")
|
||||
|
||||
[node name="VSplitContainer" type="VBoxContainer" parent="HSplitContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme = ExtResource("1_jnmec")
|
||||
|
||||
[node name="Panel" type="PanelContainer" parent="HSplitContainer/VSplitContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme = ExtResource("1_jnmec")
|
||||
|
||||
[node name="Panel2" type="PanelContainer" parent="HSplitContainer/VSplitContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme = ExtResource("1_jnmec")
|
40
scenes/UI/QuestMenu.tscn
Normal file
40
scenes/UI/QuestMenu.tscn
Normal file
@@ -0,0 +1,40 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bfioi52hjn2kf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cbsrw36kkucje" path="res://scripts/UI/QuestMenu.gd" id="1_a7vj2"]
|
||||
|
||||
[node name="QuestMenu" type="Panel"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_a7vj2")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Quests" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Quests"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ItemList" type="ItemList" parent="VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(250, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 3
|
||||
item_count = 2
|
||||
item_0/text = "Quest Name 1"
|
||||
item_1/text = "Quest Name 2"
|
||||
|
||||
[node name="Control" type="Control" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
@@ -1,13 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bimrljk1rn7af"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://x3cc7wsnn0xd" path="res://scripts/UI/SubsceneUI.gd" id="1_m23s2"]
|
||||
|
||||
[node name="SubsceneUI" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_m23s2")
|
||||
metadata/_custom_type_script = "uid://x3cc7wsnn0xd"
|
@@ -1,11 +0,0 @@
|
||||
class_name BattleStartEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
|
||||
var battle:Battle;
|
||||
|
||||
func _init(battle:Battle):
|
||||
super._init();
|
||||
self.battle = battle;
|
||||
|
||||
func start() -> void:
|
||||
super.start();
|
||||
getSystems().BATTLE.startBattle(self.battle);
|
@@ -1 +0,0 @@
|
||||
uid://e3ybjhvx0u1j
|
@@ -1,11 +0,0 @@
|
||||
class_name CookingStartEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
const CookingGame = preload("res://scripts/Cooking/CookingGame.gd");
|
||||
|
||||
var cook:CookingGame;
|
||||
|
||||
func _init(cook:CookingGame) -> void:
|
||||
self.cook = cook;
|
||||
|
||||
func start() -> void:
|
||||
getSystems().COOKING.setCookingGame(self.cook);
|
||||
getSystems().SCENE.setScene(SceneSystem.DawnScene.COOKING);
|
@@ -1 +0,0 @@
|
||||
uid://cvgjwamgxd47o
|
@@ -1,42 +0,0 @@
|
||||
class_name Cutscene
|
||||
const CutsceneEvent = preload("res://scripts/Cutscene/CutsceneEvent.gd");
|
||||
|
||||
var queue:Array[CutsceneEvent] = [];
|
||||
var cutsceneSystem = null;
|
||||
|
||||
func setupCutscene() -> void:
|
||||
print_debug("Cutscene setup has not been overriden");
|
||||
pass
|
||||
|
||||
func update(delta:float) -> void:
|
||||
if queue.size() == 0:
|
||||
return
|
||||
|
||||
var item = queue[0]
|
||||
if !item.started:
|
||||
item.start()
|
||||
item.started = true
|
||||
|
||||
item.update(delta)
|
||||
|
||||
if item.isDone():
|
||||
item.end()
|
||||
queue.erase(item)
|
||||
|
||||
pass
|
||||
|
||||
func add(items:Array[CutsceneEvent]) -> void:
|
||||
for item in items:
|
||||
item.cutscene = self
|
||||
queue.append(item)
|
||||
|
||||
func clear() -> void:
|
||||
if queue.size() == 0:
|
||||
return
|
||||
|
||||
var item = queue[0]
|
||||
if item.started:
|
||||
item.end()
|
||||
item.started = false
|
||||
|
||||
queue.clear()
|
@@ -1 +0,0 @@
|
||||
uid://dyjbgcpycptxj
|
@@ -1,25 +0,0 @@
|
||||
class_name CutsceneEvent
|
||||
|
||||
var started:bool = false;
|
||||
var cutscene = null;
|
||||
|
||||
func _init() -> void:
|
||||
pass
|
||||
|
||||
func start() -> void:
|
||||
started = true
|
||||
|
||||
func update(delta:float) -> void:
|
||||
pass
|
||||
|
||||
func isDone() -> bool:
|
||||
return true
|
||||
|
||||
func end() -> void:
|
||||
pass
|
||||
|
||||
func reset() -> void:
|
||||
started = false
|
||||
|
||||
func getCutscene():
|
||||
return cutscene
|
@@ -1 +0,0 @@
|
||||
uid://chb6031ke0xeg
|
@@ -1,17 +0,0 @@
|
||||
class_name CutsceneChangeEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
|
||||
var getCutscene:Callable
|
||||
var cutsceneNext:Cutscene
|
||||
|
||||
func _init(getCutscene:Callable) -> void:
|
||||
super._init();
|
||||
self.getCutscene = getCutscene;
|
||||
|
||||
func start() -> void:
|
||||
super.start();
|
||||
self.cutsceneNext = self.getCutscene.call(self);
|
||||
|
||||
func end() -> void:
|
||||
self.cutsceneNext.setupCutscene();
|
||||
self.cutsceneNext.start();
|
||||
getSystems().CUTSCENE.setCurrentCutscene(self.cutsceneNext);
|
@@ -1 +0,0 @@
|
||||
uid://crnwlun27bocw
|
@@ -1,73 +0,0 @@
|
||||
class_name CutsceneConcurrentEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
|
||||
enum ConcurrentType {
|
||||
SEQUENTIAL,
|
||||
PARALLEL,
|
||||
FIRST_DONE
|
||||
}
|
||||
|
||||
var events:Array[CutsceneEvent] = []
|
||||
var type:ConcurrentType = ConcurrentType.SEQUENTIAL
|
||||
var current:int = 0
|
||||
|
||||
func _init(t:ConcurrentType, evts:Array[CutsceneEvent]) -> void:
|
||||
super._init();
|
||||
self.events = evts;
|
||||
self.type = t;
|
||||
|
||||
func update(delta:float) -> void:
|
||||
if self.type == ConcurrentType.PARALLEL:
|
||||
for event in self.events:
|
||||
if !event.started:
|
||||
event.start()
|
||||
event.started = true
|
||||
|
||||
if !event.isDone():
|
||||
event.update(delta)
|
||||
|
||||
if event.isDone():
|
||||
event.end()
|
||||
|
||||
elif self.type == ConcurrentType.FIRST_DONE:
|
||||
for event in self.events:
|
||||
if !event.started:
|
||||
event.start()
|
||||
event.started = true
|
||||
|
||||
event.update(delta)
|
||||
|
||||
if event.isDone():
|
||||
event.end()
|
||||
break
|
||||
|
||||
elif self.type == ConcurrentType.SEQUENTIAL:
|
||||
if self.current >= self.events.size():
|
||||
return;
|
||||
|
||||
var evt = self.events[self.current]
|
||||
if !evt.started:
|
||||
evt.start()
|
||||
evt.started = true
|
||||
|
||||
evt.update(delta)
|
||||
|
||||
if evt.isDone():
|
||||
evt.end()
|
||||
self.current += 1
|
||||
|
||||
func isDone() -> bool:
|
||||
if self.type == ConcurrentType.SEQUENTIAL:
|
||||
return self.current >= self.events.size();
|
||||
elif self.type == ConcurrentType.PARALLEL:
|
||||
for evt in self.events:
|
||||
if !evt.isDone():
|
||||
return false;
|
||||
return true;
|
||||
elif self.type == ConcurrentType.FIRST_DONE:
|
||||
for evt in self.events:
|
||||
if evt.isDone():
|
||||
return true;
|
||||
return false;
|
||||
|
||||
printerr("Invalid ConcurrentType")
|
||||
return false;
|
@@ -1 +0,0 @@
|
||||
uid://bwait88cm8pvd
|
@@ -1,32 +0,0 @@
|
||||
class_name CutsceneIfEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
|
||||
var eventTrue:CutsceneEvent
|
||||
var eventFalse:CutsceneEvent
|
||||
var condition:Callable
|
||||
var result:bool = false
|
||||
|
||||
func _init(cond:Callable, evtTrue:CutsceneEvent, evtFalse:CutsceneEvent) -> void:
|
||||
super._init();
|
||||
condition = cond;
|
||||
eventTrue = evtTrue;
|
||||
eventFalse = evtFalse;
|
||||
|
||||
func start() -> void:
|
||||
super.start();
|
||||
result = self.condition.call(self);
|
||||
|
||||
if result:
|
||||
eventTrue.start();
|
||||
else:
|
||||
eventFalse.start();
|
||||
|
||||
func getEvent() -> CutsceneEvent:
|
||||
if result:
|
||||
return eventTrue;
|
||||
return eventFalse;
|
||||
|
||||
func update(delta:float) -> void:
|
||||
getEvent().update(delta);
|
||||
|
||||
func isDone() -> bool:
|
||||
return getEvent().isDone();
|
@@ -1 +0,0 @@
|
||||
uid://2txg4eswrh0q
|
@@ -1,15 +0,0 @@
|
||||
class_name CutscenePauseEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
|
||||
var pauseType:PauseSystem.PauseType;
|
||||
var pauseEntities:Array = [];
|
||||
|
||||
func _init(
|
||||
type:PauseSystem.PauseType,
|
||||
entities:Array = [],
|
||||
) -> void:
|
||||
super._init();
|
||||
self.pauseType = type;
|
||||
self.pauseEntities = entities;
|
||||
|
||||
func start() -> void:
|
||||
PAUSE.pause(self.pauseType, self.pauseEntities);
|
@@ -1 +0,0 @@
|
||||
uid://dj1kkm2vvvr2d
|
@@ -1,10 +0,0 @@
|
||||
class_name CutscenePrintEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
|
||||
var text:String = ""
|
||||
|
||||
func _init(text:String) -> void:
|
||||
super._init()
|
||||
self.text = text
|
||||
|
||||
func start() -> void:
|
||||
print(self.text)
|
@@ -1 +0,0 @@
|
||||
uid://cknkpwqllg7nc
|
@@ -1,13 +0,0 @@
|
||||
class_name CutsceneWaitEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
|
||||
var wait:float = 0.0
|
||||
|
||||
func _init(time:float) -> void:
|
||||
super._init()
|
||||
self.wait = time
|
||||
|
||||
func update(delta:float) -> void:
|
||||
self.wait -= delta
|
||||
|
||||
func isDone() -> bool:
|
||||
return self.wait <= 0.0
|
@@ -1 +0,0 @@
|
||||
uid://cskwko5oqqq4m
|
@@ -1,43 +0,0 @@
|
||||
class_name CutsceneWhileEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
|
||||
var events:Array[CutsceneEvent] = []
|
||||
var callback:Callable
|
||||
var current:int = 0
|
||||
|
||||
func _init(callback:Callable, evt:Array[CutsceneEvent]) -> void:
|
||||
super._init();
|
||||
self.events = evt;
|
||||
self.callback = callback;
|
||||
|
||||
func shouldLoop() -> bool:
|
||||
return self.callback.call(self)
|
||||
|
||||
func update(delta:float) -> void:
|
||||
if self.current >= self.events.size():
|
||||
return;
|
||||
|
||||
var evt = self.events[self.current]
|
||||
if !evt.started:
|
||||
evt.start()
|
||||
evt.started = true
|
||||
|
||||
evt.update(delta)
|
||||
|
||||
if evt.isDone():
|
||||
evt.end()
|
||||
self.current += 1
|
||||
|
||||
if self.current < self.events.size():
|
||||
return
|
||||
|
||||
if !self.shouldLoop():
|
||||
return
|
||||
|
||||
self.current = 0
|
||||
for event in self.events:
|
||||
event.reset()
|
||||
|
||||
func isDone() -> bool:
|
||||
if self.shouldLoop():
|
||||
return false;
|
||||
return self.current >= self.events.size();
|
@@ -1 +0,0 @@
|
||||
uid://cx4uqll85m28i
|
@@ -1,13 +0,0 @@
|
||||
class_name OverworldChangeDirectionEvent extends "res://scripts/Cutscene/Event/Entity/OverworldEntityEvent.gd"
|
||||
|
||||
var direction:OverworldEntity.Direction;
|
||||
|
||||
func _init(
|
||||
entity:OverworldEntity,
|
||||
direction:OverworldEntity.Direction,
|
||||
) -> void:
|
||||
super._init(entity);
|
||||
self.direction = direction;
|
||||
|
||||
func start() -> void:
|
||||
entity.direction = direction;
|
@@ -1 +0,0 @@
|
||||
uid://cu82did0twmkm
|
@@ -1,10 +0,0 @@
|
||||
class_name OverworldEntityEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
const OverworldEntity = preload("res://scripts/Entity/OverworldEntity.gd");
|
||||
|
||||
var entity:OverworldEntity;
|
||||
|
||||
func _init(
|
||||
entity:OverworldEntity,
|
||||
) -> void:
|
||||
super._init();
|
||||
self.entity = entity;
|
@@ -1 +0,0 @@
|
||||
uid://dmmguqphbe34j
|
@@ -1,15 +0,0 @@
|
||||
class_name TextboxEvent extends "res://scripts/Cutscene/CutsceneEvent.gd"
|
||||
|
||||
var text:String;
|
||||
|
||||
func _init(
|
||||
text:String
|
||||
) -> void:
|
||||
super._init();
|
||||
self.text = text;
|
||||
|
||||
func start() -> void:
|
||||
VN.getTextbox().setText(self.text);
|
||||
|
||||
func isDone() -> bool:
|
||||
return VN.getTextbox().isClosed;
|
@@ -1 +0,0 @@
|
||||
uid://dypv7erj66kbs
|
@@ -1,29 +0,0 @@
|
||||
class_name OverworldConversationEvent extends "res://scripts/Cutscene/Cutscene.gd"
|
||||
const OverworldEntity = preload("res://scripts/Entity/OverworldEntity.gd");
|
||||
const TextboxEvent = preload("res://scripts/Cutscene/Event/VisualNovel/TextboxEvent.gd");
|
||||
const PauseEvent = preload("res://scripts/Cutscene/Event/CutscenePauseEvent.gd");
|
||||
const OverworldChangeDirectionEvent = preload("res://scripts/Cutscene/Event/Entity/OverworldChangeDirectionEvent.gd");
|
||||
|
||||
var speaker:OverworldEntity;
|
||||
var interacted:OverworldEntity;
|
||||
var texts:Array[String];
|
||||
|
||||
func _init(speaker:OverworldEntity, interacted:OverworldEntity, texts:Array[String]) -> void:
|
||||
self.speaker = speaker;
|
||||
self.interacted = interacted;
|
||||
self.texts = texts;
|
||||
|
||||
func setupCutscene() -> void:
|
||||
var dirSpeaker = speaker.getDirectionToFace(interacted.position);
|
||||
var dirInteracted = interacted.getDirectionToFace(speaker.position);
|
||||
|
||||
add([
|
||||
OverworldChangeDirectionEvent.new(speaker, dirSpeaker),
|
||||
OverworldChangeDirectionEvent.new(interacted, dirInteracted),
|
||||
PauseEvent.new(PauseSystem.PauseType.ENTITY_PAUSED, [ speaker, interacted ]),
|
||||
]);
|
||||
|
||||
for text in texts:
|
||||
add([ TextboxEvent.new(text) ]);
|
||||
|
||||
add([ PauseEvent.new(PauseSystem.PauseType.NOT_PAUSED) ]);
|
@@ -1 +0,0 @@
|
||||
uid://cywuvoi5v4fe3
|
@@ -1,10 +0,0 @@
|
||||
class_name TestCutscene extends "res://scripts/Cutscene/Scene/OverworldConversationEvent.gd"
|
||||
|
||||
func _init(speaker:OverworldEntity, interacted:OverworldEntity ) -> void:
|
||||
super(
|
||||
speaker,
|
||||
interacted,
|
||||
[
|
||||
"Hello, my name is GREEN and I am an NPC."
|
||||
]
|
||||
);
|
@@ -1 +0,0 @@
|
||||
uid://btxgv85qst1jy
|
@@ -1,8 +0,0 @@
|
||||
class_name QuestObjective
|
||||
|
||||
var name:String
|
||||
|
||||
func _init(
|
||||
name:String
|
||||
):
|
||||
self.name = name;
|
@@ -1 +0,0 @@
|
||||
uid://bakmt6ufpq33o
|
@@ -1,36 +1,3 @@
|
||||
class_name Quest
|
||||
const QuestObjective = preload("res://scripts/Quest/Objective/QuestObjective.gd");
|
||||
class_name Quest extends Node
|
||||
|
||||
enum QuestState {
|
||||
NOT_STARTED,
|
||||
ACTIVE,
|
||||
INACTIVE,
|
||||
FINISHED
|
||||
};
|
||||
|
||||
var questName:String;
|
||||
var questState:QuestState = QuestState.NOT_STARTED;
|
||||
var objectives:Array[QuestObjective] = [];
|
||||
var currentObjective = -1;
|
||||
|
||||
func _init(
|
||||
questName:String,
|
||||
objectives:Array[QuestObjective]
|
||||
) -> void:
|
||||
self.questName = questName;
|
||||
self.objectives = objectives;
|
||||
|
||||
func getState() -> QuestState:
|
||||
return questState;
|
||||
|
||||
func start():
|
||||
print("Starting quest: " + questName);
|
||||
questState = QuestState.ACTIVE;
|
||||
currentObjective = 0;
|
||||
|
||||
func nextObjective():
|
||||
currentObjective = currentObjective + 1;
|
||||
if currentObjective >= objectives.size():
|
||||
questState = QuestState.FINISHED;
|
||||
return null;
|
||||
return objectives[currentObjective];
|
||||
@export var questName:String = "Some quest"
|
@@ -1 +1 @@
|
||||
uid://kuxak18kbjr5
|
||||
uid://dn0kxbe85n40f
|
||||
|
@@ -1,6 +0,0 @@
|
||||
class_name QuestExample extends "res://scripts/Quest/Quest.gd"
|
||||
|
||||
func _init() -> void:
|
||||
super("Example Quest", [
|
||||
QuestObjective.new("Test")
|
||||
]);
|
@@ -1 +0,0 @@
|
||||
uid://cg3piglr8rbfs
|
9
scripts/Quest/QuestObjective.gd
Normal file
9
scripts/Quest/QuestObjective.gd
Normal file
@@ -0,0 +1,9 @@
|
||||
class_name QuestObjective extends Node
|
||||
|
||||
enum Type {
|
||||
Item,
|
||||
}
|
||||
|
||||
@export var objectiveName:String = "Some objective"
|
||||
|
||||
@export var objectiveType:Type = Type.Item
|
1
scripts/Quest/QuestObjective.gd.uid
Normal file
1
scripts/Quest/QuestObjective.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://de1ao4huhy0hm
|
3
scripts/Quest/QuestStage.gd
Normal file
3
scripts/Quest/QuestStage.gd
Normal file
@@ -0,0 +1,3 @@
|
||||
class_name QuestStage extends Node
|
||||
|
||||
@export var stageName:String = "Some stage"
|
1
scripts/Quest/QuestStage.gd.uid
Normal file
1
scripts/Quest/QuestStage.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://db4yhcxyhiosq
|
@@ -1,22 +0,0 @@
|
||||
extends Node
|
||||
|
||||
var currentCutscene:Cutscene = null;
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if PAUSE.getPauseState() == PAUSE.PauseType.FULLY_PAUSED:
|
||||
return;
|
||||
|
||||
if currentCutscene != null:
|
||||
currentCutscene.update(delta);
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if currentCutscene != null:
|
||||
currentCutscene.clear();
|
||||
|
||||
func setCurrentCutscene(cutscene:Cutscene) -> void:
|
||||
if currentCutscene != null:
|
||||
currentCutscene.clear();
|
||||
|
||||
currentCutscene = cutscene;
|
||||
cutscene.cutsceneSystem = self;
|
||||
currentCutscene.setupCutscene();
|
@@ -1 +1,13 @@
|
||||
class_name QuestSystem extends Node
|
||||
class_name QuestSystem extends Node
|
||||
|
||||
var quests:Array[Quest]
|
||||
|
||||
func _ready() -> void:
|
||||
_updateQuests()
|
||||
pass
|
||||
|
||||
func _updateQuests() -> void:
|
||||
quests = []
|
||||
for quest in $Quests.get_children():
|
||||
if quest is Quest:
|
||||
quests.append(quest)
|
@@ -1,25 +1,5 @@
|
||||
class_name UISystem extends Control
|
||||
|
||||
enum Layer {
|
||||
Game,
|
||||
VN,
|
||||
Test,
|
||||
Debug
|
||||
}
|
||||
|
||||
func addSubscene(subscene:Control, layer:Layer) -> void:
|
||||
subscene.originalParent.remove_child.call_deferred(subscene)
|
||||
|
||||
match layer:
|
||||
Layer.Game:
|
||||
$LayerGame.add_child.call_deferred(subscene)
|
||||
Layer.Debug:
|
||||
$LayerDebug.add_child.call_deferred(subscene)
|
||||
Layer.VN:
|
||||
$LayerVN.add_child.call_deferred(subscene)
|
||||
_:
|
||||
push_error("Invalid layer: " + str(layer))
|
||||
return
|
||||
|
||||
func removeSubscene(subscene:Control) -> void:
|
||||
subscene.get_parent().remove_child(subscene)
|
||||
func _process(delta: float) -> void:
|
||||
# This needs to always be at the end of the parent node's tree
|
||||
get_parent().move_child(self, get_parent().get_child_count() - 1)
|
||||
|
@@ -4,7 +4,7 @@ const VNTextbox = preload("res://scripts/UI/VNTextbox.gd")
|
||||
var vnTextbox:VNTextbox = null
|
||||
|
||||
func _ready() -> void:
|
||||
vnTextbox = $SubsceneUI/VNTextbox
|
||||
vnTextbox = UI.get_node("VNTextbox")
|
||||
|
||||
func getTextbox() -> VNTextbox:
|
||||
return vnTextbox
|
||||
|
@@ -1,6 +1,8 @@
|
||||
class_name DebugMenu extends VBoxContainer
|
||||
|
||||
func _ready() -> void:
|
||||
hide()
|
||||
|
||||
$MainMenu.connect("pressed", _on_MainMenu_pressed);
|
||||
$OverworldOption/Overworld.connect("pressed", _on_Overworld_pressed);
|
||||
$Quests.connect("pressed", _on_Quests_pressed);
|
||||
@@ -13,15 +15,23 @@ func _ready() -> void:
|
||||
$OverworldOption/MapDropdown.add_item(map, i);
|
||||
i = i + 1;
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("debug"):
|
||||
print("Debug key pressed")
|
||||
if is_visible():
|
||||
hide()
|
||||
else:
|
||||
show()
|
||||
|
||||
func _on_MainMenu_pressed():
|
||||
SCENE_MANAGER.setScene("MainMenu");
|
||||
DEBUG.hideMenu()
|
||||
hide()
|
||||
|
||||
func _on_Overworld_pressed():
|
||||
var keys:Array[String] = OVERWORLD.MAPS.keys()
|
||||
OVERWORLD.setMap(keys[$OverworldOption/MapDropdown.selected])
|
||||
SCENE_MANAGER.setScene("Overworld");
|
||||
DEBUG.hideMenu()
|
||||
hide()
|
||||
|
||||
func _on_Quests_pressed():
|
||||
print("Quests pressed")
|
||||
|
6
scripts/UI/QuestMenu.gd
Normal file
6
scripts/UI/QuestMenu.gd
Normal file
@@ -0,0 +1,6 @@
|
||||
class_name QuestMenu extends Control
|
||||
|
||||
func _ready() -> void:
|
||||
$VBoxContainer/HBoxContainer/ItemList.clear()
|
||||
for quest in QUEST.quests:
|
||||
$VBoxContainer/HBoxContainer/ItemList.add_item(quest.questName)
|
1
scripts/UI/QuestMenu.gd.uid
Normal file
1
scripts/UI/QuestMenu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cbsrw36kkucje
|
@@ -1,15 +0,0 @@
|
||||
class_name SubsceneUI extends Control
|
||||
|
||||
@export var layer:UISystem.Layer = UISystem.Layer.Game;
|
||||
var originalParent:Node = null
|
||||
|
||||
func _ready() -> void:
|
||||
originalParent = self.get_parent()
|
||||
originalParent.tree_exiting.connect(onParentExiting)
|
||||
UI.addSubscene(self, layer)
|
||||
|
||||
func onParentExiting() -> void:
|
||||
if originalParent:
|
||||
originalParent.tree_exiting.disconnect(onParentExiting)
|
||||
UI.removeSubscene(self)
|
||||
originalParent = null
|
@@ -1 +0,0 @@
|
||||
uid://x3cc7wsnn0xd
|
Reference in New Issue
Block a user