SceneTransition Rework completed

feature/fight_system
kziolkowski 6 months ago
parent 16251db248
commit 480d149ede

@ -24,6 +24,7 @@ buses/default_bus_layout="uid://b6dwkmkyb0axk"
[autoload] [autoload]
SceneTransition="*res://scenes/SceneTransition.tscn"
Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd" Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd"
InventoryManager="*res://scripts/CSharp/Common/Inventory/InventoryManager.cs" InventoryManager="*res://scripts/CSharp/Common/Inventory/InventoryManager.cs"
Signal_Debugger="*res://addons/SignalVisualizer/Debugger/SignalDebugger.gd" Signal_Debugger="*res://addons/SignalVisualizer/Debugger/SignalDebugger.gd"

@ -1,95 +1,10 @@
[gd_scene load_steps=7 format=3 uid="uid://bopv10dqm1knc"] [gd_scene load_steps=2 format=3 uid="uid://bopv10dqm1knc"]
[ext_resource type="PackedScene" uid="uid://c6wnoif01ltld" path="res://scenes/Babushka_scene_startMenu.tscn" id="1_15ton"] [ext_resource type="PackedScene" uid="uid://c6wnoif01ltld" path="res://scenes/Babushka_scene_startMenu.tscn" id="1_15ton"]
[ext_resource type="Script" uid="uid://bo2jik2jtuqlw" path="res://scripts/CSharp/Common/SceneManagement/SceneTransitionThreaded.cs" id="1_d3jfo"]
[sub_resource type="Animation" id="Animation_t7str"] [node name="BabushkaSceneBootstrap" type="Node2D"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SceneFadeAnimation/CanvasLayer/ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
[sub_resource type="Animation" id="Animation_e43hv"] [node name="BabushkaSceneStartMenu" parent="." instance=ExtResource("1_15ton")]
resource_name = "fadeIn" _sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_disclaimer.tscn")
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SceneFadeAnimation/CanvasLayer/ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.966667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.966667),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"OnFadeInCompletedThreaded"
}]
}
[sub_resource type="Animation" id="Animation_d3jfo"]
resource_name = "fadeOut"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SceneFadeAnimation/CanvasLayer/ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.966667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5o782"]
_data = {
&"RESET": SubResource("Animation_t7str"),
&"fadeIn": SubResource("Animation_e43hv"),
&"fadeOut": SubResource("Animation_d3jfo")
}
[node name="BabushkaSceneBootstrap" type="Node2D" node_paths=PackedStringArray("animationPlayer")]
script = ExtResource("1_d3jfo")
animationPlayer = NodePath("SceneFadeAnimation")
[node name="BabushkaSceneStartMenu" parent="." node_paths=PackedStringArray("_sceneInstanceParent") instance=ExtResource("1_15ton")]
_sceneInstanceParent = NodePath("../SceneParent")
[node name="SceneParent" type="Node" parent="."] [node name="SceneParent" type="Node" parent="."]
[node name="SceneFadeAnimation" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_5o782")
}
[node name="CanvasLayer" type="CanvasLayer" parent="SceneFadeAnimation"]
[node name="ColorRect" type="ColorRect" parent="SceneFadeAnimation/CanvasLayer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(1, 1, 1, 0)

@ -1,7 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://c02s0c64tm2v"] [gd_scene load_steps=6 format=3 uid="uid://c02s0c64tm2v"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_5otdq"] [ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_5otdq"]
[ext_resource type="PackedScene" uid="uid://gigb28qk8t12" path="res://scenes/Babushka_scene_farm_outside_2d.tscn" id="2_8y0cv"]
[ext_resource type="Texture2D" uid="uid://cou4iy8dhqmsf" path="res://art/indoor/indoor outdoor/muster/TEPPICH FLORAL.png" id="3_8y0cv"] [ext_resource type="Texture2D" uid="uid://cou4iy8dhqmsf" path="res://art/indoor/indoor outdoor/muster/TEPPICH FLORAL.png" id="3_8y0cv"]
[ext_resource type="Script" uid="uid://d2486x6upmwqq" path="res://scripts/GdScript/dialogic_starter.gd" id="4_qjf71"] [ext_resource type="Script" uid="uid://d2486x6upmwqq" path="res://scripts/GdScript/dialogic_starter.gd" id="4_qjf71"]
[ext_resource type="Script" uid="uid://dnipeibppjirs" path="res://scripts/CSharp/Common/NPC/DialogicOverlayStarter.cs" id="5_ihldk"] [ext_resource type="Script" uid="uid://dnipeibppjirs" path="res://scripts/CSharp/Common/NPC/DialogicOverlayStarter.cs" id="5_ihldk"]
@ -9,7 +8,7 @@
[node name="BabushkaSceneDisclaimer" type="Node2D"] [node name="BabushkaSceneDisclaimer" type="Node2D"]
script = ExtResource("1_5otdq") script = ExtResource("1_5otdq")
_sceneToLoad = ExtResource("2_8y0cv") _sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_farm_outside_2d.tscn")
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]

@ -1007,7 +1007,7 @@ _timelinesToPlay = PackedStringArray("quest1_ducks_start", "quest1_ducks_end", "
[node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") instance=ExtResource("1_7wfwe")] [node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") instance=ExtResource("1_7wfwe")]
z_index = 1 z_index = 1
position = Vector2(3180, 2125) position = Vector2(-2031, 2949)
_fieldParent = NodePath("../Farm visuals/FieldParent") _fieldParent = NodePath("../Farm visuals/FieldParent")
_hoe = ExtResource("28_6b2nr") _hoe = ExtResource("28_6b2nr")
_wateringCan = ExtResource("28_ipqaa") _wateringCan = ExtResource("28_ipqaa")

@ -1,4 +1,4 @@
[gd_scene load_steps=31 format=3 uid="uid://bm21nqepnwaik"] [gd_scene load_steps=32 format=3 uid="uid://bm21nqepnwaik"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_3vr4f"] [ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_3vr4f"]
[ext_resource type="Texture2D" uid="uid://cnhsxxps2cw5" path="res://art/indoor/room export/Room_01_table.png" id="2_ubg3a"] [ext_resource type="Texture2D" uid="uid://cnhsxxps2cw5" path="res://art/indoor/room export/Room_01_table.png" id="2_ubg3a"]
@ -194,6 +194,10 @@ _data = {
resource_local_to_scene = true resource_local_to_scene = true
radius = 300.0 radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_yd2gv"]
resource_local_to_scene = true
radius = 472.086
[node name="IndoorTest" type="Node2D"] [node name="IndoorTest" type="Node2D"]
y_sort_enabled = true y_sort_enabled = true
script = ExtResource("1_3vr4f") script = ExtResource("1_3vr4f")
@ -537,6 +541,9 @@ _followNode = NodePath("../Vesna/CharacterBody2D")
position = Vector2(-4855, 32) position = Vector2(-4855, 32)
_id = 0 _id = 0
[node name="CollisionShape3D" parent="VesnasRoomDoor/Area2D" index="0"]
shape = SubResource("CircleShape2D_yd2gv")
[node name="OutsideDoor" parent="." instance=ExtResource("11_gpagp")] [node name="OutsideDoor" parent="." instance=ExtResource("11_gpagp")]
position = Vector2(929, 32) position = Vector2(929, 32)
_id = 1 _id = 1
@ -551,3 +558,4 @@ _id = 1
[editable path="Vesna"] [editable path="Vesna"]
[editable path="Yeli"] [editable path="Yeli"]
[editable path="Yeli/InteractionArea"] [editable path="Yeli/InteractionArea"]
[editable path="VesnasRoomDoor"]

@ -2,7 +2,6 @@
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_c6eln"] [ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_c6eln"]
[ext_resource type="Texture2D" uid="uid://cugtxcfuds31r" path="res://art/indoor/Babushka_bg_01.png" id="2_j25a2"] [ext_resource type="Texture2D" uid="uid://cugtxcfuds31r" path="res://art/indoor/Babushka_bg_01.png" id="2_j25a2"]
[ext_resource type="PackedScene" uid="uid://bm21nqepnwaik" path="res://scenes/Babushka_scene_indoor_common_room.tscn" id="2_oejul"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="8_phqdf"] [ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="8_phqdf"]
[ext_resource type="Texture2D" uid="uid://cop1vjvhwlsec" path="res://art/indoor/room export/Room_01_shelf.png" id="13_11fdt"] [ext_resource type="Texture2D" uid="uid://cop1vjvhwlsec" path="res://art/indoor/room export/Room_01_shelf.png" id="13_11fdt"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="18_3gevq"] [ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="18_3gevq"]
@ -16,10 +15,14 @@ size = Vector2(3836, 1086)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2spkc"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_2spkc"]
size = Vector2(238.25, 189.75) size = Vector2(238.25, 189.75)
[sub_resource type="CircleShape2D" id="CircleShape2D_2spkc"]
resource_local_to_scene = true
radius = 509.071
[node name="VesnasRoom" type="Node2D"] [node name="VesnasRoom" type="Node2D"]
y_sort_enabled = true y_sort_enabled = true
script = ExtResource("1_c6eln") script = ExtResource("1_c6eln")
_sceneToLoad = ExtResource("2_oejul") _sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_indoor_common_room.tscn")
[node name="Colliders" type="Node2D" parent="."] [node name="Colliders" type="Node2D" parent="."]
position = Vector2(1297, 5292) position = Vector2(1297, 5292)
@ -39,7 +42,7 @@ position = Vector2(-2892, -1168)
shape = SubResource("RectangleShape2D_l0jrn") shape = SubResource("RectangleShape2D_l0jrn")
[node name="TopCollider" type="StaticBody2D" parent="Colliders"] [node name="TopCollider" type="StaticBody2D" parent="Colliders"]
position = Vector2(2440.5, -1061) position = Vector2(2448.75, -595)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Colliders/TopCollider"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Colliders/TopCollider"]
position = Vector2(-2892, -1168) position = Vector2(-2892, -1168)
@ -92,11 +95,16 @@ _followNode = NodePath("../Vesna/CharacterBody2D")
[node name="CanvasLayer" parent="." instance=ExtResource("24_xwo8y")] [node name="CanvasLayer" parent="." instance=ExtResource("24_xwo8y")]
[node name="BedInteraction" parent="." instance=ExtResource("8_phqdf")] [node name="BedInteraction" parent="." instance=ExtResource("8_phqdf")]
position = Vector2(-1560, 158) position = Vector2(-1429, 487)
[node name="DoorInteraction" parent="." instance=ExtResource("8_phqdf")] [node name="DoorInteraction" parent="." instance=ExtResource("8_phqdf")]
position = Vector2(777, 201) position = Vector2(777, 201)
_id = 0
[node name="CollisionShape3D" parent="DoorInteraction/Area2D" index="0"]
shape = SubResource("CircleShape2D_2spkc")
[connection signal="Interacted" from="DoorInteraction" to="." method="LoadScene"] [connection signal="Interacted" from="DoorInteraction" to="." method="LoadScene"]
[editable path="Vesna"] [editable path="Vesna"]
[editable path="DoorInteraction"]

@ -1,13 +1,11 @@
[gd_scene load_steps=5 format=3 uid="uid://c6wnoif01ltld"] [gd_scene load_steps=4 format=3 uid="uid://c6wnoif01ltld"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_fj2fh"] [ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_fj2fh"]
[ext_resource type="PackedScene" uid="uid://c02s0c64tm2v" path="res://scenes/Babushka_scene_disclaimer.tscn" id="2_r0y6o"]
[ext_resource type="Texture2D" uid="uid://c7atj6ohlmir3" path="res://art/ui/StartScreen/titlescreen.png" id="3_r0y6o"] [ext_resource type="Texture2D" uid="uid://c7atj6ohlmir3" path="res://art/ui/StartScreen/titlescreen.png" id="3_r0y6o"]
[ext_resource type="Texture2D" uid="uid://du612t3xytly3" path="res://art/ui/StartScreen/babushkalog_white.png" id="4_dl0t1"] [ext_resource type="Texture2D" uid="uid://du612t3xytly3" path="res://art/ui/StartScreen/babushkalog_white.png" id="4_dl0t1"]
[node name="BabushkaSceneStartMenu" type="Node2D"] [node name="BabushkaSceneStartMenu" type="Node2D"]
script = ExtResource("1_fj2fh") script = ExtResource("1_fj2fh")
_sceneToLoad = ExtResource("2_r0y6o")
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]

@ -0,0 +1,123 @@
[gd_scene load_steps=6 format=3 uid="uid://cxvdb2w1sxui4"]
[ext_resource type="Script" uid="uid://bo2jik2jtuqlw" path="res://scripts/CSharp/Common/SceneManagement/SceneTransitionThreaded.cs" id="1_e0bkc"]
[sub_resource type="Animation" id="Animation_t7str"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SceneFadeAnimation/ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SceneFadeAnimation/ColorRect:mouse_filter")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [2]
}
[sub_resource type="Animation" id="Animation_e43hv"]
resource_name = "fadeIn"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SceneFadeAnimation/ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.966667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SceneFadeAnimation/ColorRect:mouse_filter")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.2),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [2, 0]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.966667),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"OnFadeInCompletedThreaded"
}]
}
[sub_resource type="Animation" id="Animation_d3jfo"]
resource_name = "fadeOut"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SceneFadeAnimation/ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.966667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SceneFadeAnimation/ColorRect:mouse_filter")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.0333333, 0.966667),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [0, 2]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5o782"]
_data = {
&"RESET": SubResource("Animation_t7str"),
&"fadeIn": SubResource("Animation_e43hv"),
&"fadeOut": SubResource("Animation_d3jfo")
}
[node name="SceneTransition" type="CanvasLayer" node_paths=PackedStringArray("animationPlayer")]
script = ExtResource("1_e0bkc")
animationPlayer = NodePath("SceneFadeAnimation")
[node name="SceneFadeAnimation" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_5o782")
}
[node name="ColorRect" type="ColorRect" parent="SceneFadeAnimation"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(1, 1, 1, 0)

@ -1,7 +1,7 @@
using Godot; using Godot;
namespace Babushka.scripts.CSharp.Common.SceneManagement; namespace Babushka.scripts.CSharp.Common.SceneManagement;
public partial class SceneTransitionThreaded : Node2D public partial class SceneTransitionThreaded : CanvasLayer
{ {
public static SceneTransitionThreaded Instance { get; private set; } public static SceneTransitionThreaded Instance { get; private set; }

@ -1,4 +1,3 @@
using System.Threading.Tasks;
using Babushka.scripts.CSharp.Common.SceneManagement; using Babushka.scripts.CSharp.Common.SceneManagement;
using Godot; using Godot;
@ -6,27 +5,13 @@ namespace Babushka.scripts.CSharp.Common;
public partial class SceneTransition : Node public partial class SceneTransition : Node
{ {
[Export] private PackedScene _sceneToLoad;
[Export] private string[] _sceneNamesToLoad; [Export] private string[] _sceneNamesToLoad;
[Export] private int _sceneIndex; [Export] private int _sceneIndex;
[Export] private Node? _sceneInstanceParent;
[Export] private bool _unloadSelf = true; [Export] private bool _unloadSelf = true;
// todo: remove and replace with indexed system
public void LoadScene() public void LoadScene()
{ {
Node sceneInstance = _sceneToLoad.Instantiate(); LoadSceneAtIndex(0);
if(_sceneInstanceParent != null)
_sceneInstanceParent.AddChild(sceneInstance);
else
{
GetTree().Root.AddChild(sceneInstance);
}
if (_unloadSelf)
{
QueueFree();
}
} }
public void LoadSceneAtIndex(int index) public void LoadSceneAtIndex(int index)

Loading…
Cancel
Save