fix doubled input responses in some menus

decimal marker weights
This commit is contained in:
minenice55
2024-01-21 20:10:45 -05:00
parent 029991656c
commit 607818e3be
6 changed files with 625 additions and 111 deletions

View File

@ -74,7 +74,7 @@ namespace HeavenStudio
private bool logoRevealed;
private bool menuMode, snsRevealed, playMenuRevealed, exiting, firstPress, usingMouse;
private bool menuMode, snsRevealed, playMenuRevealed, exiting, firstPress, usingMouse, waitingForButtonUp;
private Animator menuAnim, selectedDisplayAnim;
private Selectable currentSelectable, mouseSelectable;
@ -241,9 +241,9 @@ namespace HeavenStudio
targetBopBeat += 1;
}
if (menuMode && !(exiting || GlobalGameManager.IsShowingDialog))
var controller = PlayerInput.GetInputController(1);
if (menuMode && !(exiting || GlobalGameManager.IsShowingDialog || firstPress || waitingForButtonUp))
{
var controller = PlayerInput.GetInputController(1);
if (playMenuRevealed)
{
if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch)
@ -282,11 +282,21 @@ namespace HeavenStudio
}
}
}
else if (!firstPress)
else
{
UpdateSelectable(controller);
}
}
if (waitingForButtonUp)
{
if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch)
{
if (controller.GetActionUp(PlayerInput.CurrentControlStyle, (int)InputController.ActionsPad.East, out _))
{
waitingForButtonUp = false;
}
}
}
if (firstPress) firstPress = false;
}
@ -556,6 +566,8 @@ namespace HeavenStudio
campaignOption.sprite = campaignOff;
}
firstPress = true;
waitingForButtonUp = true;
playPanel.SetActive(true);
playMenuRevealed = true;
SoundByte.PlayOneShot("ui/UISelect");
@ -572,6 +584,7 @@ namespace HeavenStudio
public void PlayPanelAccept()
{
if (waitingForButtonUp) return;
if (exiting) return;
exiting = true;
SoundByte.PlayOneShot("ui/UIEnter");