mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(uxassist): poll shortcuts after native input updates
Dispatch shortcut polling from VFInput.OnUpdate's postfix so key-down events use fresh modifier and typing state. Keep regular feature updates in the plugin Update loop.
This commit is contained in:
1 parent
82f6f53fa8
commit
1cbda9a1d6
3 files changed
+19
-1
No files matched your search
@@ -34,6 +34,17 @@ public class GameLogic : PatchImpl<GameLogic>
|
||||
OnDataLoaded.InvokeSafe(UXAssist.Logger, nameof(OnDataLoaded));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Harmony postfix for <see cref="VFInput.OnUpdate"/>.
|
||||
/// Dispatches mod updates after the game has refreshed its input state.
|
||||
/// </summary>
|
||||
[HarmonyPostfix, HarmonyPriority(Priority.Last)]
|
||||
[HarmonyPatch(typeof(VFInput), nameof(VFInput.OnUpdate))]
|
||||
public static void VFInput_OnUpdate_Postfix()
|
||||
{
|
||||
UXAssist.OnInputUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Harmony postfix for <see cref="GameMain.Begin"/>.
|
||||
/// Raises <see cref="OnGameBegin"/>.
|
||||
|
||||
@@ -287,13 +287,19 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
|
||||
GameLogicProc.Enable(false);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
internal static void OnInputUpdate()
|
||||
{
|
||||
if (VFInput.inputing) return;
|
||||
ModFeatureRegistry.OnInputUpdateAll();
|
||||
if (DSPGame.IsMenuDemo) return;
|
||||
GamePatch.OnInputUpdate();
|
||||
PlayerPatch.OnInputUpdate();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (VFInput.inputing) return;
|
||||
if (DSPGame.IsMenuDemo) return;
|
||||
ModFeatureRegistry.OnUpdateAll();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user