Hi,
The game is mainly controlled by gamepad.
How can I make a response selected when only the UI/Move being performed?
I just do not want players do button mashing too much and miss a few selections.
How to not default select a response
Re: How to not default select a response
Hi,
You can set the response menu panel's Block Input Duration. When the response menu appears, the player will not be able to select a response until this duration has elapsed.
You can set the response menu panel's Block Input Duration. When the response menu appears, the player will not be able to select a response until this duration has elapsed.
Re: How to not default select a response
Thanks Tony, it is one way to achieve it. I ended up with a inherited StandardUIMenuPanel with a inputsystem to EnableInput()
Edited: A mistake in the code.
Code: Select all
public class ButtonUIMenu : StandardUIMenuPanel
{
ControlMap _Control = null;
bool isShowed = false;
public override void Awake()
{
base.Awake();
_Control = new ControlMap();
_Control.UI.Navigate.performed += _ => ButtonEnableInput();
}
protected override void OnEnable()
{
base.OnEnable();
_Control.UI.Navigate.Enable();
}
protected override void OnDisable()
{
base.OnDisable();
_Control.UI.Navigate.Disable();
}
protected override void ShowResponsesNow(Subtitle subtitle, Response[] responses, Transform target)
{
if (response...
...
...
// as original
DisableInput();
isShowed = true;
}
public void ButtonEnableInput()
{
if (isShowed && s_isInputDisabled)
{
EnableInput();
isShowed = false;
_Control.UI.Navigate.Disable();
}
}
}
Last edited by Fews on Thu Aug 25, 2022 2:17 am, edited 1 time in total.
Re: How to not default select a response
Thanks for sharing your solution!