Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Assembly-CSharp/Global/Booster/BoosterSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void SetBoosterState(Int32 currentCharacterStateIndex)
}
}

public void ShowWaringDialog(BoosterType type, Action callback = null)
public void ShowWarningDialog(BoosterType type, Action callback = null)
{
if (this.needComfirmType == BoosterType.None
&& (PersistenSingleton<UIManager>.Instance.IsPlayerControlEnable || PersistenSingleton<UIManager>.Instance.State == UIManager.UIState.Config)
Expand Down
6 changes: 3 additions & 3 deletions Assembly-CSharp/Global/Config/ConfigUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ private void OnBoosterPanelKeyConfirm(GameObject go)
if (Configuration.Cheats.MasterSkill)
{
FF9Sfx.FF9SFX_Play(103);
PersistenSingleton<UIManager>.Instance.Booster.ShowWaringDialog(BoosterType.MasterSkill, AfterBoosterFinish);
PersistenSingleton<UIManager>.Instance.Booster.ShowWarningDialog(BoosterType.MasterSkill, AfterBoosterFinish);
hitpointScreenButton.KeyCommand = Control.None;
WarningDialogHitPoint.SetActive(true);
}
Expand All @@ -836,7 +836,7 @@ private void OnBoosterPanelKeyConfirm(GameObject go)
if (Configuration.Cheats.LvMax)
{
FF9Sfx.FF9SFX_Play(103);
PersistenSingleton<UIManager>.Instance.Booster.ShowWaringDialog(BoosterType.LvMax, AfterBoosterFinish);
PersistenSingleton<UIManager>.Instance.Booster.ShowWarningDialog(BoosterType.LvMax, AfterBoosterFinish);
hitpointScreenButton.KeyCommand = Control.None;
WarningDialogHitPoint.SetActive(true);
}
Expand All @@ -851,7 +851,7 @@ private void OnBoosterPanelKeyConfirm(GameObject go)
if (Configuration.Cheats.GilMax)
{
FF9Sfx.FF9SFX_Play(103);
PersistenSingleton<UIManager>.Instance.Booster.ShowWaringDialog(BoosterType.GilMax, AfterBoosterFinish);
PersistenSingleton<UIManager>.Instance.Booster.ShowWarningDialog(BoosterType.GilMax, AfterBoosterFinish);
hitpointScreenButton.KeyCommand = Control.None;
WarningDialogHitPoint.SetActive(true);
}
Expand Down
16 changes: 16 additions & 0 deletions Assembly-CSharp/Global/Hono/HonoInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,22 @@ public Boolean IsInputUp(Control index)
return this.isInputUp[indexInt];
}

/// <summary>
/// [DV] L3 and R3 are working with XInputDotNetPure if Steam Input is activated ! (need to simulate a XBOX controller)
/// </summary>

public Boolean IsL3Pressed()
{
return UnityXInput.XInputManager.Instance.CurrentState.Buttons.LeftStick == ButtonState.Pressed
&& UnityXInput.XInputManager.Instance.PreviousState.Buttons.LeftStick == ButtonState.Released;
}

public Boolean IsR3Pressed()
{
return UnityXInput.XInputManager.Instance.CurrentState.Buttons.RightStick == ButtonState.Pressed
&& UnityXInput.XInputManager.Instance.PreviousState.Buttons.RightStick == ButtonState.Released;
}

public Vector2 GetAxis()
{
return this.AxisValue();
Expand Down
39 changes: 25 additions & 14 deletions Assembly-CSharp/Global/UI/UIKey/UIKeyTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public void HandleBoosterButton(BoosterType triggerType = BoosterType.None)
return;
if (PersistenSingleton<UIManager>.Instance.State == UIManager.UIState.Title || PersistenSingleton<UIManager>.Instance.State == UIManager.UIState.PreEnding || (PersistenSingleton<UIManager>.Instance.State == UIManager.UIState.Ending || !MBG.IsNull && !MBG.Instance.IsFinishedForDisableBooster()))
return;
if (UnityXInput.Input.GetKeyDown(KeyCode.F1) || triggerType == BoosterType.HighSpeedMode)
if (UnityXInput.Input.GetKeyDown(KeyCode.F1) || triggerType == BoosterType.HighSpeedMode || IsStickCheatTriggered("HighSpeedMode"))
{
if (!Configuration.Cheats.SpeedMode)
{
Expand All @@ -211,7 +211,7 @@ public void HandleBoosterButton(BoosterType triggerType = BoosterType.None)
PersistenSingleton<UIManager>.Instance.Booster.SetBoosterHudIcon(BoosterType.HighSpeedMode, flag);
PersistenSingleton<UIManager>.Instance.Booster.SetBoosterButton(BoosterType.HighSpeedMode, flag);
}
if (UnityXInput.Input.GetKeyDown(KeyCode.F2) || triggerType == BoosterType.BattleAssistance)
if (UnityXInput.Input.GetKeyDown(KeyCode.F2) || triggerType == BoosterType.BattleAssistance || IsStickCheatTriggered("BattleAssistance"))
{
if (!Configuration.Cheats.BattleAssistance)
{
Expand All @@ -227,7 +227,7 @@ public void HandleBoosterButton(BoosterType triggerType = BoosterType.None)
PersistenSingleton<UIManager>.Instance.Booster.SetBoosterHudIcon(BoosterType.BattleAssistance, flag);
PersistenSingleton<UIManager>.Instance.Booster.SetBoosterButton(BoosterType.BattleAssistance, flag);
}
if (UnityXInput.Input.GetKeyDown(KeyCode.F3) || triggerType == BoosterType.Attack9999)
if (UnityXInput.Input.GetKeyDown(KeyCode.F3) || triggerType == BoosterType.Attack9999 || IsStickCheatTriggered("Attack9999"))
{
if (!Configuration.Cheats.Attack9999)
{
Expand All @@ -241,7 +241,7 @@ public void HandleBoosterButton(BoosterType triggerType = BoosterType.None)
PersistenSingleton<UIManager>.Instance.Booster.SetBoosterHudIcon(BoosterType.Attack9999, flag);
PersistenSingleton<UIManager>.Instance.Booster.SetBoosterButton(BoosterType.Attack9999, flag);
}
if (UnityXInput.Input.GetKeyDown(KeyCode.F4) || triggerType == BoosterType.NoRandomEncounter)
if (UnityXInput.Input.GetKeyDown(KeyCode.F4) || triggerType == BoosterType.NoRandomEncounter || IsStickCheatTriggered("NoRandomEncounter"))
{
if (!Configuration.Cheats.NoRandomEncounter)
{
Expand All @@ -268,7 +268,7 @@ public void HandleBoosterButton(BoosterType triggerType = BoosterType.None)

if (!FF9StateSystem.Settings.IsMasterSkill)
{
PersistenSingleton<UIManager>.Instance.Booster.ShowWaringDialog(BoosterType.MasterSkill);
PersistenSingleton<UIManager>.Instance.Booster.ShowWarningDialog(BoosterType.MasterSkill);
}
else
{
Expand All @@ -285,7 +285,7 @@ public void HandleBoosterButton(BoosterType triggerType = BoosterType.None)
return;
}

PersistenSingleton<UIManager>.Instance.Booster.ShowWaringDialog(BoosterType.LvMax);
PersistenSingleton<UIManager>.Instance.Booster.ShowWarningDialog(BoosterType.LvMax);
}
if (UnityXInput.Input.GetKeyDown(KeyCode.F7) && (PersistenSingleton<UIManager>.Instance.State == UIManager.UIState.FieldHUD || PersistenSingleton<UIManager>.Instance.State == UIManager.UIState.WorldHUD || PersistenSingleton<UIManager>.Instance.State == UIManager.UIState.Pause))
{
Expand All @@ -296,7 +296,7 @@ public void HandleBoosterButton(BoosterType triggerType = BoosterType.None)
return;
}

PersistenSingleton<UIManager>.Instance.Booster.ShowWaringDialog(BoosterType.GilMax);
PersistenSingleton<UIManager>.Instance.Booster.ShowWarningDialog(BoosterType.GilMax);
}
if (Configuration.Control.SoftReset && ((UnityXInput.Input.GetKeyDown(KeyCode.F8) && PersistenSingleton<UIManager>.Instance.IsPause) || SoftResetKeyPSXDown))
{ // Soft Reset
Expand Down Expand Up @@ -352,13 +352,9 @@ public void HandleBoosterButton(BoosterType triggerType = BoosterType.None)
SceneDirector.Replace("Title", SceneTransition.FadeOutToBlack_FadeIn, true);
return;
}
if (UnityXInput.Input.GetKeyDown(KeyCode.F9) && Configuration.Control.TurboDialog)
{
if (TurboKey)
TurboKey = false;
else
TurboKey = true;
}

if ((UnityXInput.Input.GetKeyDown(KeyCode.F9) || IsStickCheatTriggered("TurboDialog")) && Configuration.Control.TurboDialog)
TurboKey = !TurboKey;
}

[DllImport("user32.dll")]
Expand Down Expand Up @@ -938,6 +934,21 @@ private Boolean ShouldTurboDialog(List<Control> confirmKeys)
return false;
}

private Boolean IsStickCheatTriggered(String cheatName)
{
if (HonoInputManager.Instance.IsL3Pressed())
{
if (String.Equals(Configuration.Control.L3BindCheat, cheatName, StringComparison.OrdinalIgnoreCase))
return true;
}
if (HonoInputManager.Instance.IsR3Pressed())
{
if (String.Equals(Configuration.Control.R3BindCheat, cheatName, StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
}

private void Start()
{
UICamera.onNavigate = (UICamera.KeyCodeDelegate)Delegate.Combine(UICamera.onNavigate, (UICamera.KeyCodeDelegate)OnKeyNavigate);
Expand Down
2 changes: 2 additions & 0 deletions Assembly-CSharp/Memoria/Configuration/Access/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ The PSX movement algorithm is different than the remaster's movement algorithm
public static Boolean PSXMovementMethod => Instance._control.PSXMovementMethod;
public static Boolean AlwaysCaptureGamepad => Instance._control.AlwaysCaptureGamepad;
public static Boolean SwapConfirmCancel => Instance._control.SwapConfirmCancel;
public static String L3BindCheat => Instance._control.L3BindCheat;
public static String R3BindCheat => Instance._control.R3BindCheat;
}
}
}
6 changes: 5 additions & 1 deletion Assembly-CSharp/Memoria/Configuration/Memoria.ini
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ AlternateControls = 0
; WrapSomeMenus (default 1) 0 = Don't wrap selection in menu that don't natively wrap it / 1 = Wrap selection for easing menu navigation
; BattleAutoConfirm (default 1) 0 = Confirm needs to be pressed repeatedly / 1 = Holding Confirm will automatically validate commands during battle and progress the battle result screen
; TurboDialog (default 1) F9 - Toggles the automatic skipping of basic dialogs. Alternatively Holding Shift + Confirm or Right Bumper + Confirm also skips dialogs automatically.
; SoftReset (default 1) [Pause + F8] / [L1+R1 + L2+R2 + start + select (PSX)] - Back to Main Menu instantly # [DV]: I've used this feature hundreds of times and never had a problem... but be careful, bugs can happen!
; SoftReset (default 1) [Pause + F8] / [L1+R1 + L2+R2 + start + select (PSX)] - Back to Main Menu instantly
; PSXScrollingMethod (default 1) 0 = Use the native Steam scrolling pattern / 1 = Scroll lists with the same behaviour as the PSX version
; PSXMovementMethod (default 1) 0 = Use the native Steam move pathing method, which makes movements faster on sloping paths / 1 = Use the PSX move pathing method
; AlwaysCaptureGamepad (default 1) 0 = Gamepad inputs are ignored when the game windows doesn't have focus / 1 = Gamepad inputs are always in effect
; SwapConfirmCancel (default 0) 0 = Confirm and Cancel inputs are the PSX buttons X and O respectively (western norm) / 1 = Confirm and Cancel inputs are the PSX buttons O and X respectively (Japanese norm)
; L3BindCheat (default "HighSpeedMode") Binds a cheat to the L3 button / Values available => HighSpeedMode, BattleAssistance, Attack9999, NoRandomEncounter, TurboDialog or you can left it empty.
; R3BindCheat (default "TurboDialog") Binds a cheat to the R3 button / Values available => HighSpeedMode, BattleAssistance, Attack9999, NoRandomEncounter, TurboDialog or you can left it empty.
Enabled = 1
KeyBindings = "W","A","S","D","Backspace","Alpha1"
DisableMouse = 0
Expand All @@ -123,6 +125,8 @@ PSXScrollingMethod = 1
PSXMovementMethod = 1
AlwaysCaptureGamepad = 1
SwapConfirmCancel = 0
L3BindCheat = HighSpeedMode
R3BindCheat = TurboDialog

[AnalogControl]
; StickThreshold (default 10) 0->100, threshold under which there is no movement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ private sealed class ControlSection : IniSection
public readonly IniValue<Boolean> PSXMovementMethod;
public readonly IniValue<Boolean> AlwaysCaptureGamepad;
public readonly IniValue<Boolean> SwapConfirmCancel;
public readonly IniValue<String> L3BindCheat;
public readonly IniValue<String> R3BindCheat;

public ControlSection() : base(nameof(ControlSection), true)
{
Expand All @@ -52,6 +54,8 @@ public ControlSection() : base(nameof(ControlSection), true)
PSXMovementMethod = BindBoolean(nameof(PSXMovementMethod), false);
AlwaysCaptureGamepad = BindBoolean(nameof(AlwaysCaptureGamepad), true);
SwapConfirmCancel = BindBoolean(nameof(SwapConfirmCancel), false);
L3BindCheat = BindString(nameof(L3BindCheat), "HighSpeedMode");
R3BindCheat = BindString(nameof(R3BindCheat), "TurboDialog");
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion Memoria.Launcher/Ini/Memoria.ini
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ AlternateControls = 0
; WrapSomeMenus (default 1) 0 = Don't wrap selection in menu that don't natively wrap it / 1 = Wrap selection for easing menu navigation
; BattleAutoConfirm (default 1) 0 = Confirm needs to be pressed repeatedly / 1 = Holding Confirm will automatically validate commands during battle and progress the battle result screen
; TurboDialog (default 1) F9 - Toggles the automatic skipping of basic dialogs. Alternatively Holding Shift + Confirm or Right Bumper + Confirm also skips dialogs automatically.
; SoftReset (default 1) [Pause + F8] / [L1+R1 + L2+R2 + start + select (PSX)] - Back to Main Menu instantly # [DV]: I've used this feature hundreds of times and never had a problem... but be careful, bugs can happen!
; SoftReset (default 1) [Pause + F8] / [L1+R1 + L2+R2 + start + select (PSX)] - Back to Main Menu instantly
; PSXScrollingMethod (default 1) 0 = Use the native Steam scrolling pattern / 1 = Scroll lists with the same behaviour as the PSX version
; PSXMovementMethod (default 1) 0 = Use the native Steam move pathing method, which makes movements faster on sloping paths / 1 = Use the PSX move pathing method
; AlwaysCaptureGamepad (default 1) 0 = Gamepad inputs are ignored when the game windows doesn't have focus / 1 = Gamepad inputs are always in effect
; SwapConfirmCancel (default 0) 0 = Confirm and Cancel inputs are the PSX buttons X and O respectively (western norm) / 1 = Confirm and Cancel inputs are the PSX buttons O and X respectively (Japanese norm)
; L3BindCheat (default "HighSpeedMode") Binds a cheat to the L3 button / Values available => HighSpeedMode, BattleAssistance, Attack9999, NoRandomEncounter, TurboDialog or you can left it empty.
; R3BindCheat (default "TurboDialog") Binds a cheat to the R3 button / Values available => HighSpeedMode, BattleAssistance, Attack9999, NoRandomEncounter, TurboDialog or you can left it empty.
Enabled = 1
KeyBindings = "W","A","S","D","Backspace","Alpha1"
DisableMouse = 0
Expand All @@ -123,6 +125,8 @@ PSXScrollingMethod = 1
PSXMovementMethod = 1
AlwaysCaptureGamepad = 1
SwapConfirmCancel = 0
L3BindCheat = HighSpeedMode
R3BindCheat = TurboDialog

[AnalogControl]
; StickThreshold (default 10) 0->100, threshold under which there is no movement
Expand Down
12 changes: 6 additions & 6 deletions Memoria.XInputDotNetPure/GamePad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ public static GamePadState GetState(PlayerIndex playerIndex, GamePadDeadZone dea
if ((jslState.buttons & (int)JSL.Button.Options) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.Start;
if ((jslState.buttons & (int)JSL.Button.TouchpadClick) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.Back;
if ((jslState.buttons & (int)JSL.Button.Minus) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.Back;
if ((jslState.buttons & (int)JSL.Button.ZL) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.LeftThumb;
if ((jslState.buttons & (int)JSL.Button.ZR) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.RightThumb;
if ((jslState.buttons & (int)JSL.Button.L) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.LeftShoulder;
if ((jslState.buttons & (int)JSL.Button.R) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.RightShoulder;
if ((jslState.buttons & (int)JSL.Button.L) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.LeftShoulder; // L1
if ((jslState.buttons & (int)JSL.Button.R) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.RightShoulder; // R1
if ((jslState.buttons & (int)JSL.Button.LClick) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.LeftThumb; // L3
if ((jslState.buttons & (int)JSL.Button.RClick) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.RightThumb; // R3
if ((jslState.buttons & (int)JSL.Button.PS) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.Guide;
if ((jslState.buttons & (int)JSL.Button.S) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.A;
if ((jslState.buttons & (int)JSL.Button.E) != 0) rawState.Gamepad.wButtons |= (ushort)ButtonsConstants.B;
Expand All @@ -387,8 +387,8 @@ public static GamePadState GetState(PlayerIndex playerIndex, GamePadDeadZone dea
rawState.Gamepad.sThumbRX = (short)Utils.Clamp((int)(jslState.stickRX * short.MaxValue + rawState.Gamepad.sThumbRX), short.MinValue, short.MaxValue);
rawState.Gamepad.sThumbRY = (short)Utils.Clamp((int)(jslState.stickRY * short.MaxValue + rawState.Gamepad.sThumbRY), short.MinValue, short.MaxValue);

rawState.Gamepad.bLeftTrigger = (byte)Utils.Clamp((int)(jslState.lTrigger * byte.MaxValue + rawState.Gamepad.bLeftTrigger), byte.MinValue, byte.MaxValue);
rawState.Gamepad.bRightTrigger = (byte)Utils.Clamp((int)(jslState.rTrigger * byte.MaxValue + rawState.Gamepad.bRightTrigger), byte.MinValue, byte.MaxValue);
rawState.Gamepad.bLeftTrigger = (byte)Utils.Clamp((int)(jslState.lTrigger * byte.MaxValue + rawState.Gamepad.bLeftTrigger), byte.MinValue, byte.MaxValue); // L2
rawState.Gamepad.bRightTrigger = (byte)Utils.Clamp((int)(jslState.rTrigger * byte.MaxValue + rawState.Gamepad.bRightTrigger), byte.MinValue, byte.MaxValue); // R2
}
result = Utils.Success;
}
Expand Down