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:
soarqin committed 2026-09-13 23:36:06 +08:00
1 parent 82f6f53fa8
commit 1cbda9a1d6
3 files changed
+19 -1

No files matched your search

+11
View File
@@ -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"/>.
+7 -1
View File
@@ -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();
}
}