diff --git a/.gitmodules b/.gitmodules index ce5ad9e..8ffef69 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "lib/commonlibsse-ng"] path = lib/commonlibsse-ng - url = https://github.com/alandtse/CommonLibVR.git + url = https://github.com/alandtse/CommonLibSSE-NG.git branch = ng [submodule "lib/vcpkg"] path = lib/vcpkg diff --git a/README.md b/README.md index 5fa7b0f..d5e9644 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Inspired by Red Dead Redemption 2's hold-Start-to-open-map mechanic. ## Requirements -- [Skyrim Special Edition](https://store.steampowered.com/app/489830) or Anniversary Edition +- [Skyrim Special Edition](https://store.steampowered.com/app/489830) or Anniversary Edition, runtime 1.5.97, 1.6.x or 1.7.x - [SKSE64](https://skse.silverlock.org/) - [Address Library for SKSE Plugins](https://www.nexusmods.com/skyrimspecialedition/mods/32444) - Optional: [SKSE Menu Framework](https://www.nexusmods.com/skyrimspecialedition/mods/120352) for in-game settings UI @@ -288,7 +288,7 @@ Upload behavior is configured as: - Inspired by the hold-Start-to-open-map mechanic in **Red Dead Redemption 2** - [SKSE](https://skse.silverlock.org/) by the SKSE Team - [Address Library for SKSE plugins](https://www.nexusmods.com/skyrimspecialedition/mods/32444) by [meh321](https://www.nexusmods.com/profile/meh321) -- [CommonLibSSE-NG](https://github.com/alandtse/CommonLibVR) by [alandtse](https://github.com/alandtse) and contributors +- [CommonLibSSE-NG](https://github.com/alandtse/CommonLibSSE-NG) by [alandtse](https://github.com/alandtse) and contributors --- diff --git a/docs/nexus-page.md b/docs/nexus-page.md index 8765c0e..b0790b1 100644 --- a/docs/nexus-page.md +++ b/docs/nexus-page.md @@ -43,7 +43,7 @@ Hold a gamepad button for a configurable duration to jump directly to a menu. Ea [size=4][b][color=#B8953E]Requirements[/color][/b][/size] [list] -[*][url=https://store.steampowered.com/app/489830]Skyrim Special Edition[/url] or Anniversary Edition +[*][url=https://store.steampowered.com/app/489830]Skyrim Special Edition[/url] or Anniversary Edition, runtime 1.5.97, 1.6.x or 1.7.x [*][url=https://skse.silverlock.org/]SKSE64[/url] [*][url=https://www.nexusmods.com/skyrimspecialedition/mods/32444]Address Library for SKSE Plugins[/url] [*]Optional: [url=https://www.nexusmods.com/skyrimspecialedition/mods/120352]SKSE Menu Framework[/url] for in-game settings UI @@ -133,7 +133,7 @@ Logs are written to: [size=4][b]Compatibility[/b][/size] [list] -[*]Compatible with Skyrim SE and AE. +[*]Compatible with Skyrim SE and AE on runtime 1.5.97, 1.6.x and 1.7.x. [*]No ESP/ESL required. [*]Compatible with any mod that does not also intercept the configured gamepad button. [/list] @@ -146,7 +146,7 @@ Logs are written to: [*]Inspired by [b]Red Dead Redemption 2[/b] [*][url=https://skse.silverlock.org/]SKSE[/url] by the SKSE Team [*][url=https://www.nexusmods.com/skyrimspecialedition/mods/32444]Address Library for SKSE plugins[/url] by [url=https://www.nexusmods.com/profile/meh321]meh321[/url] -[*][url=https://github.com/alandtse/CommonLibVR]CommonLibSSE-NG[/url] by [url=https://github.com/alandtse]alandtse[/url] and contributors +[*][url=https://github.com/alandtse/CommonLibSSE-NG]CommonLibSSE-NG[/url] by [url=https://github.com/alandtse]alandtse[/url] and contributors [*][url=https://github.com/codepuncher/HoldFast]Source code: GitHub[/url] [/list] ``` diff --git a/lib/commonlibsse-ng b/lib/commonlibsse-ng index 8c4025b..2a4a8cc 160000 --- a/lib/commonlibsse-ng +++ b/lib/commonlibsse-ng @@ -1 +1 @@ -Subproject commit 8c4025b01fac2bea1bbe73a3a9da7b4fde338343 +Subproject commit 2a4a8ccb3c6c2c032dee376508a58524db0bb6e2 diff --git a/src/InputHandler.h b/src/InputHandler.h index db0dc29..425ce81 100644 --- a/src/InputHandler.h +++ b/src/InputHandler.h @@ -35,8 +35,10 @@ class InputHandler : void SetHoldDuration(float a_duration) noexcept { holdDuration = a_duration; } - // Replace the tracked button list. Entries with action == kNone are excluded by the caller. - // Call before registering the input sink. + /** + * Replace the tracked button list. Entries with action == kNone are + * excluded by the caller. Call before registering the input sink. + */ void SetButtons(std::vector a_configs); /** @@ -50,15 +52,19 @@ class InputHandler : private: InputHandler() = default; - // Game-internal variable controlling which tab the Journal Menu opens on. - // RELOCATION_ID(520167 = SE 1.5.97, 406697 = AE 1.6.x). + /** + * Game-internal variable controlling which tab the Journal Menu opens on. + * RELOCATION_ID(520167 = SE 1.5.97, 406697 = AE 1.6.x and 1.7.x). + */ enum class JournalTab : std::uint32_t { kQuest = 0, kStats = 1, kSystem = 2, - // Sentinel: opens Journal on the System tab then navigates to the MCM overlay. - // Not a real sJournalTabIdx value — kSystem (2) is written to the relocation. + /** + * Sentinel: opens Journal on the System tab then navigates to the MCM overlay. + * Not a real sJournalTabIdx value; kSystem (2) is written to the relocation. + */ kMCM = 3, }; static inline REL::Relocation sJournalTabIdx{ RELOCATION_ID(520167, 406697) }; @@ -94,25 +100,31 @@ class InputHandler : float holdDuration{ kDefaultHoldDuration }; std::vector _buttons; - // Saved tab index to restore sJournalTabIdx after any Journal long-press, so the - // player's next normal Journal open lands on the tab they had before the long-press. - // Restored on Journal close, or immediately as a fail-safe if the Journal never opens. - // _pendingTab: target tab to set via Scaleform on Journal open (QJO compat). - // _lastKnownTab: (QJO only) tab the player was last on when the Journal was open; used to - // counter QJO's forced kSystem override on every Journal open. Updated by the - // GameIsPaused input snapshot whenever the Journal is open (skips kQuest=0, - // the navigation-away transient set by the SWF before CloseMenu). Empty until - // first snapshot fires. - // _qjoInstalled: cached result of QJO presence detection (detected on first Journal open). - // When false/empty, QJO tab-restore logic is skipped entirely. - JournalTab _savedTabIdx{ JournalTab::kQuest }; - bool _tabRestorePending{ false }; - bool _journalOpenDispatched{ false }; + /** + * Restores sJournalTabIdx after any Journal long-press, so the player's next + * normal Journal open lands on the tab they had before the long-press. + * Restored on Journal close, or as a fail-safe if the Journal never opens. + */ + JournalTab _savedTabIdx{ JournalTab::kQuest }; + bool _tabRestorePending{ false }; + bool _journalOpenDispatched{ false }; + /** + * Target tab to set via Scaleform on Journal open (QJO compat). + */ std::optional _pendingTab{}; + /** + * QJO only: counters QJO's forced kSystem override on every Journal open. + * The GameIsPaused input snapshot updates it while the Journal is open, + * skipping kQuest, the transient the SWF sets before CloseMenu. + */ std::optional _lastKnownTab{}; - std::optional _qjoInstalled{}; - std::string _pendingMCMModName; - bool _mcmQuickexit{ false }; - bool _mcmWasOpen{ false }; - bool _mcmModPageSeen{ false }; + /** + * Detected on first Journal open; when false or empty, QJO tab-restore + * logic is skipped entirely. + */ + std::optional _qjoInstalled{}; + std::string _pendingMCMModName; + bool _mcmQuickexit{ false }; + bool _mcmWasOpen{ false }; + bool _mcmModPageSeen{ false }; };