Re-implement audio managers

This commit is contained in:
2025-09-08 23:24:33 -07:00
parent d830a05d98
commit 4f1251d402
185 changed files with 1747 additions and 1673 deletions

View File

@@ -30,8 +30,6 @@ public partial class InventoryMenu : Control, IInventoryMenu
[Dependency] public IMap _map => this.DependOn<IMap>();
[Dependency] public IGameEventDepot GameEventDepot => this.DependOn<IGameEventDepot>();
private InventoryPageNumber _currentPageNumber = InventoryPageNumber.FirstPage;
private string ITEM_SLOT_SCENE = "res://src/ui/inventory_menu/ItemSlot.tscn";
@@ -162,8 +160,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
{
HideUserActionPrompt();
ShowInventoryInfo();
GameEventDepot.OnMenuBackedOut();
Autoload.InGameAudio.Cancel.Play();
Autoload.AudioManager.Play(SoundEffect.Cancel);
}
else
{
@@ -181,7 +178,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
Player.Stats.BonusAttack.Sync -= BonusAttack_Sync;
Player.Stats.BonusDefense.Sync -= BonusDefense_Sync;
_gameRepo.CloseInventory();
Autoload.InGameAudio.Cancel.Play();
Autoload.AudioManager.Play(SoundEffect.Cancel);
}
}
@@ -203,8 +200,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
SetToUnselectedStyle(ItemSlots.ElementAt(oldIndex));
SetToSelectedStyle(ItemSlots.ElementAt(newIndex));
GameEventDepot.OnMenuScrolled();
Autoload.InGameAudio.MoveThroughOptions.Play();
Autoload.AudioManager.Play(SoundEffect.MoveThroughOptions);
_currentIndex = newIndex;
}
@@ -218,15 +214,14 @@ public partial class InventoryMenu : Control, IInventoryMenu
SetToUnselectedStyle(ItemSlots.ElementAt(oldIndex));
SetToSelectedStyle(ItemSlots.ElementAt(newIndex));
GameEventDepot.OnMenuScrolled();
Autoload.InGameAudio.MoveThroughOptions.Play();
Autoload.AudioManager.Play(SoundEffect.MoveThroughOptions);
_currentIndex = newIndex;
}
if (@event.IsActionPressed(GameInputs.UiAccept))
{
DisplayUserActionPrompt();
Autoload.InGameAudio.Select.Play();
Autoload.AudioManager.Play(SoundEffect.Select);
}
if (@event.IsActionPressed(GameInputs.InventorySort))
@@ -234,7 +229,6 @@ public partial class InventoryMenu : Control, IInventoryMenu
inventory.Sort();
if (_currentIndex > inventory.Items.Count - 1)
_currentIndex = inventory.Items.Count - 1;
GameEventDepot.OnInventorySorted();
RefreshInventoryScreen();
}
}
@@ -327,8 +321,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
_currentIndex = 0;
_currentPageNumber = pageToChangeTo;
await RefreshInventoryScreen();
GameEventDepot.OnMenuScrolled();
Autoload.InGameAudio.MoveThroughOptions.Play();
Autoload.AudioManager.Play(SoundEffect.MoveThroughOptions);
}
private async void PopulateInventory()