Skip to content
Closed
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 .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

---

Expand Down
6 changes: 3 additions & 3 deletions docs/nexus-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand All @@ -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]
```
2 changes: 1 addition & 1 deletion lib/commonlibsse-ng
Submodule commonlibsse-ng updated 729 files
62 changes: 37 additions & 25 deletions src/InputHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ButtonConfig> a_configs);

/**
Expand All @@ -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<std::uint32_t*> sJournalTabIdx{ RELOCATION_ID(520167, 406697) };
Expand Down Expand Up @@ -94,25 +100,31 @@ class InputHandler :
float holdDuration{ kDefaultHoldDuration };
std::vector<ButtonState> _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<JournalTab> _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<JournalTab> _lastKnownTab{};
std::optional<bool> _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<bool> _qjoInstalled{};
std::string _pendingMCMModName;
bool _mcmQuickexit{ false };
bool _mcmWasOpen{ false };
bool _mcmModPageSeen{ false };
};
Loading