Cleanup previous refactor, fix floor count

This commit is contained in:
2025-03-10 21:04:28 -07:00
parent a1c26ed7fb
commit ed12c1cf15
7 changed files with 48 additions and 48 deletions

View File

@@ -4,7 +4,6 @@ using Chickensoft.Introspection;
using Godot;
using Zennysoft.Game.Abstractions;
using Zennysoft.Ma.Adapter;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
@@ -56,85 +55,85 @@ public partial class InGameAudio : Node
public void Setup()
{
InGameAudioLogic = new InGameAudioLogic();
InGameAudioLogic = new InGameAudioLogic();
}
public void OnResolved()
{
InGameAudioLogic.Set(AppRepo);
InGameAudioLogic.Set(GameEventDepot);
InGameAudioLogic.Set(Player);
InGameAudioLogic.Set(GameRepo);
InGameAudioLogic.Set(AppRepo);
InGameAudioLogic.Set(GameEventDepot);
InGameAudioLogic.Set(Player);
InGameAudioLogic.Set(GameRepo);
InGameAudioBinding = InGameAudioLogic.Bind();
InGameAudioBinding = InGameAudioLogic.Bind();
InGameAudioBinding
.Handle((in InGameAudioLogic.Output.PlayOverworldMusic _) => StartOverworldMusic())
.Handle((in InGameAudioLogic.Output.PlayDungeonThemeAMusic _) => StartDungeonThemeA())
.Handle((in InGameAudioLogic.Output.PlayMenuScrollSound _) => PlayMenuScrollSound())
.Handle((in InGameAudioLogic.Output.PlayEquipSound _) => PlayEquipSound())
.Handle((in InGameAudioLogic.Output.PlayMenuBackSound _) => PlayMenuBackSound())
.Handle((in InGameAudioLogic.Output.PlayInventorySortedSound _) => PlayInventorySortedSound())
.Handle((in InGameAudioLogic.Output.PlayHealingItemSound _) => PlayHealingItemSound())
.Handle((in InGameAudioLogic.Output.PlayTeleportSound _) => PlayTeleportSound())
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackSound _) => { PlayerAttackSFX.Stop(); PlayerAttackSFX.Play(); })
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackWallSound _) => { PlayerAttackWallSFX.Stop(); PlayerAttackWallSFX.Play(); });
InGameAudioBinding
.Handle((in InGameAudioLogic.Output.PlayOverworldMusic _) => StartOverworldMusic())
.Handle((in InGameAudioLogic.Output.PlayDungeonThemeAMusic _) => StartDungeonThemeA())
.Handle((in InGameAudioLogic.Output.PlayMenuScrollSound _) => PlayMenuScrollSound())
.Handle((in InGameAudioLogic.Output.PlayEquipSound _) => PlayEquipSound())
.Handle((in InGameAudioLogic.Output.PlayMenuBackSound _) => PlayMenuBackSound())
.Handle((in InGameAudioLogic.Output.PlayInventorySortedSound _) => PlayInventorySortedSound())
.Handle((in InGameAudioLogic.Output.PlayHealingItemSound _) => PlayHealingItemSound())
.Handle((in InGameAudioLogic.Output.PlayTeleportSound _) => PlayTeleportSound())
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackSound _) => { PlayerAttackSFX.Stop(); PlayerAttackSFX.Play(); })
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackWallSound _) => { PlayerAttackWallSFX.Stop(); PlayerAttackWallSFX.Play(); });
InGameAudioLogic.Start();
InGameAudioLogic.Start();
}
public void OnExitTree()
{
InGameAudioLogic.Stop();
InGameAudioBinding.Dispose();
InGameAudioLogic.Stop();
InGameAudioBinding.Dispose();
}
private void StartOverworldMusic()
{
OverworldBgm.Stop();
OverworldBgm.FadeIn();
OverworldBgm.Stop();
OverworldBgm.FadeIn();
}
private void StartDungeonThemeA()
{
OverworldBgm.FadeOut();
DungeonThemeABgm.Stop();
DungeonThemeABgm.FadeIn();
OverworldBgm.FadeOut();
DungeonThemeABgm.Stop();
DungeonThemeABgm.FadeIn();
}
private void PlayMenuScrollSound()
{
MenuScrollSFX.Stop();
MenuScrollSFX.Play();
MenuScrollSFX.Stop();
MenuScrollSFX.Play();
}
private void PlayEquipSound()
{
EquipSFX.Stop();
EquipSFX.Play();
EquipSFX.Stop();
EquipSFX.Play();
}
private void PlayMenuBackSound()
{
MenuBackSFX.Stop();
MenuBackSFX.Play();
MenuBackSFX.Stop();
MenuBackSFX.Play();
}
private void PlayInventorySortedSound()
{
InventorySortedSFX.Stop();
InventorySortedSFX.Play();
InventorySortedSFX.Stop();
InventorySortedSFX.Play();
}
private void PlayHealingItemSound()
{
HealingItemSFX.Stop();
HealingItemSFX.Play();
HealingItemSFX.Stop();
HealingItemSFX.Play();
}
private void PlayTeleportSound()
{
TeleportSFX.Stop();
TeleportSFX.Play();
TeleportSFX.Stop();
TeleportSFX.Play();
}
}