Add UI click sounds (#22410)

* Add UI click sounds

* tweaks

* Significant cleanup

* Audio options and numerous fixes

* Fix the remaining UI elements

* new click sound

---------

Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
metalgearsloth
2023-12-29 15:43:36 +11:00
committed by GitHub
parent 5f7e92a2d7
commit 4023134cf0
19 changed files with 179 additions and 21 deletions

View File

@@ -285,7 +285,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
private void OnWindowOpened()
{
if (ActionButton != null)
ActionButton.Pressed = true;
ActionButton.SetClickPressed(true);
SearchAndDisplay();
}
@@ -293,7 +293,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
private void OnWindowClosed()
{
if (ActionButton != null)
ActionButton.Pressed = false;
ActionButton.SetClickPressed(false);
}
public void OnStateExited(GameplayState state)

View File

@@ -355,6 +355,7 @@ public sealed class ActionButton : Control, IEntityControl
{
base.MouseEntered();
UserInterfaceManager.HoverSound();
_beingHovered = true;
DrawModeChanged();
}

View File

@@ -127,14 +127,12 @@ public sealed class AdminUIController : UIController, IOnStateEntered<GameplaySt
private void OnWindowOpen()
{
if (AdminButton != null)
AdminButton.Pressed = true;
AdminButton?.SetClickPressed(true);
}
private void OnWindowClosed()
{
if (AdminButton != null)
AdminButton.Pressed = false;
AdminButton?.SetClickPressed(false);
}
private void OnWindowDisposed()

View File

@@ -121,6 +121,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
LobbyAHelpButton.Pressed = pressed;
}
UIManager.ClickSound();
UnreadAHelpRead();
}

View File

@@ -184,7 +184,7 @@ public sealed class CharacterUIController : UIController, IOnStateEntered<Gamepl
if (CharacterButton != null)
{
CharacterButton.Pressed = !_window.IsOpen;
CharacterButton.SetClickPressed(!_window.IsOpen);
}
if (_window.IsOpen)

View File

@@ -51,8 +51,8 @@ public sealed class EscapeUIController : UIController, IOnStateEntered<GameplayS
EscapeButton.OnPressed += EscapeButtonOnOnPressed;
}
private void ActivateButton() => EscapeButton!.Pressed = true;
private void DeactivateButton() => EscapeButton!.Pressed = false;
private void ActivateButton() => EscapeButton!.SetClickPressed(true);
private void DeactivateButton() => EscapeButton!.SetClickPressed(false);
public void OnStateEntered(GameplayState state)
{

View File

@@ -139,12 +139,13 @@ public sealed class GuidebookUIController : UIController, IOnStateEntered<LobbyS
if (_guideWindow.IsOpen)
{
UIManager.ClickSound();
_guideWindow.Close();
return;
}
if (GuidebookButton != null)
GuidebookButton.Pressed = !_guideWindow.IsOpen;
GuidebookButton.SetClickPressed(!_guideWindow.IsOpen);
if (guides == null)
{

View File

@@ -243,7 +243,9 @@ public sealed class InventoryUIController : UIController, IOnStateEntered<Gamepl
}
UpdateInventoryHotbar(_playerInventory);
_inventoryHotbar.Visible = !_inventoryHotbar.Visible;
var shouldBeVisible = !_inventoryHotbar.Visible;
_inventoryHotbar.Visible = shouldBeVisible;
}
// Neuron Activation

View File

@@ -172,10 +172,12 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
return;
if (_sandbox.SandboxAllowed && _window.IsOpen != true)
{
UIManager.ClickSound();
_window.OpenCentered();
}
else
{
UIManager.ClickSound();
_window.Close();
}
}