Things are mostly fixed, but dialogue isn't disappearing

This commit is contained in:
2024-09-07 16:34:31 -07:00
parent b470a9d2fe
commit 872f246a23
9 changed files with 92 additions and 75 deletions

View File

@@ -30,8 +30,6 @@ public partial class Game : Node3D, IGame
[Node] public Control MiniMap { get; set; } = default!;
[Node] public NavigationRegion3D NavigationRegion { get; set; } = default!;
[Node] public Area3D Teleport { get; set; } = default!;
[Node] public IDungeonFloor Overworld { get; set; } = default!;
@@ -73,7 +71,6 @@ public partial class Game : Node3D, IGame
})
.Handle((in GameLogic.Output.LoadNextFloor _) =>
{
SetPauseMode(true);
AnimationPlayer.Play("wait_and_load");
var currentFloor = Floors.ElementAt(_currentFloor);
currentFloor.CallDeferred(MethodName.QueueFree, []);
@@ -101,8 +98,6 @@ public partial class Game : Node3D, IGame
private void AnimationPlayer_AnimationStarted(StringName animName)
{
SetPauseMode(true);
var newFloor = Floors.ElementAt(_currentFloor + 1);
newFloor.CallDeferred(nameof(newFloor.InitializeDungeon), []);
newFloor.Show();
@@ -113,7 +108,6 @@ public partial class Game : Node3D, IGame
var spawnPoints = GetTree().GetNodesInGroup("Exit").OfType<Marker3D>();
Teleport.GlobalPosition = spawnPoints.Last().GlobalPosition;
_currentFloor++;
SetPauseMode(false);
}
public override void _Process(double delta)

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=18 format=3 uid="uid://33ek675mfb5n"]
[gd_scene load_steps=16 format=3 uid="uid://33ek675mfb5n"]
[ext_resource type="Script" path="res://src/game/Game.cs" id="1_ytcii"]
[ext_resource type="PackedScene" uid="uid://cfecvvav8kkp6" path="res://src/player/Player.tscn" id="3_kk6ly"]
@@ -10,12 +10,9 @@
[ext_resource type="PackedScene" uid="uid://b40sstnic41dw" path="res://src/map/dungeon/floors/Floor3.tscn" id="8_87yk1"]
[ext_resource type="PackedScene" uid="uid://c3ek5i43cl0r5" path="res://src/map/Teleport.tscn" id="9_nwu7r"]
[ext_resource type="PackedScene" uid="uid://xb02opiwelet" path="res://src/dialog/DialogueTest.tscn" id="10_kejri"]
[ext_resource type="Resource" uid="uid://bw086h2dmhraf" path="res://src/dialog/TestDialogue.dialogue" id="11_4jbgd"]
[sub_resource type="Environment" id="Environment_fke5g"]
[sub_resource type="NavigationMesh" id="NavigationMesh_xligp"]
[sub_resource type="Animation" id="Animation_nc1gg"]
length = 0.001
tracks/0/type = "value"
@@ -73,14 +70,12 @@ _data = {
process_mode = 3
script = ExtResource("1_ytcii")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_fke5g")
[node name="Player" parent="." instance=ExtResource("3_kk6ly")]
process_mode = 1
transform = Transform3D(0.0871905, 0, -0.996192, 0, 1, 0, 0.996192, 0, 0.0871905, -11.0585, -2.7998, -6.0685)
MoveSpeed = 8.0
Acceleration = 4.0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.4456, 1.22144)
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_fke5g")
[node name="MiniMap" parent="." instance=ExtResource("6_owlf4")]
unique_name_in_owner = true
@@ -88,6 +83,7 @@ visible = false
[node name="InventoryMenu" parent="." instance=ExtResource("4_wk8gw")]
unique_name_in_owner = true
process_mode = 3
visible = false
[node name="OmniLight3D" type="OmniLight3D" parent="."]
@@ -96,25 +92,17 @@ layers = 3
omni_range = 163.618
omni_attenuation = -0.183
[node name="NavigationRegion" type="NavigationRegion3D" parent="."]
unique_name_in_owner = true
navigation_mesh = SubResource("NavigationMesh_xligp")
[node name="Overworld" parent="." instance=ExtResource("5_4hqe8")]
unique_name_in_owner = true
visible = false
[node name="Floor1" parent="." instance=ExtResource("6_75lk5")]
unique_name_in_owner = true
visible = false
[node name="Floor2" parent="." instance=ExtResource("7_1sm5s")]
unique_name_in_owner = true
visible = false
[node name="Floor3" parent="." instance=ExtResource("8_87yk1")]
unique_name_in_owner = true
visible = false
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
@@ -138,5 +126,4 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 900, 900, 900)
disable_mode = 2
[node name="Panel" parent="." instance=ExtResource("10_kejri")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.42724, 0, -7.22283)
DialogueResource = ExtResource("11_4jbgd")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.42724, 0.203153, -2.07301)

View File

@@ -38,6 +38,8 @@ public interface IGameRepo : IDisposable
public AutoProp<int> HPBarValue { get; }
public AutoProp<int> VTBarValue { get; }
bool IsWithinDialogueSpace { get; set; }
}
public class GameRepo : IGameRepo
@@ -72,6 +74,8 @@ public class GameRepo : IGameRepo
public AutoProp<int> VTBarValue { get; }
public bool IsWithinDialogueSpace { get; set; }
private bool _disposedValue;
public GameRepo()
@@ -83,6 +87,7 @@ public class GameRepo : IGameRepo
_equippedWeapon = new Weapon();
HPBarValue = new AutoProp<int>(0);
VTBarValue = new AutoProp<int>(0);
IsWithinDialogueSpace = false;
}
public void Pause()