Add Activate on launch features to SekiroTool - #48
Open
gonlad-x wants to merge 4 commits into
Open
Conversation
Port TarnishedTool's Activate On Launch feature: ActivateOnLaunchManager for persisted settings storage, per-tool feature checklist, and the same lifecycle-driven architecture as TarnishedTool/SilkySouls3 - a master enable toggle, a singleton settings window opened via a bound command from SettingsViewModel (with reuse/Activate() instead of spawning duplicates), and AppStart/Attached/Loaded/GameStart state subscriptions matching the reference implementation. Feature list for Sekiro: - Player: Infinite Confetti/Gachiin, One Shot Health/Posture, No Goods/ Emblem Consume, Infinite Revival, Player Hide/Silent, Infinite Poise, No Death (+ ex-killbox variant), No Damage, and a Damage Multiplier value (defaults to 1.0, matching PlayerViewModel's default) instead of the relative increase/decrease toggles TarnishedTool uses. - Target: Enable Target Options. - Travel: Unlock All Idols, wired to TravelViewModel's existing UnlockIdolsCommand. - New Game Cycle: Auto Set NG+7, Demon Bell on/off, No Kuro's Charm on/off. No Enemies or Boss Skips sections - those are one-shot actions tied to specific fight state rather than persistent toggles, and didn't fit the Activate On Launch model cleanly for this game.
- Move Enable Target Options from AppStart to Loaded. The property setter it calls (TargetService.ToggleTargetHook -> ChangeIdolIcon) allocates and immediately executes shellcode built with offsets that are only resolved once PatchChecker.Initialize/AllocCodeCave have run - which is guaranteed by the time Loaded fires, but not by AppStart if the tool is opened after the game is already running. That gap reliably crashed the game. - Move Auto Set NG+7 from GameStart to AppStart. It was previously primed on the same GameStart event that PlayerViewModel's own OnGameStart handler reads it on, and since PlayerViewModel subscribes to GameStart first, its check always ran before the flag was set - the option could never actually trigger.
PlayerViewModel's OnGameLoaded reapply block called TogglePlayerNoGoodsConsume for IsNoEmblemConsumeEnabled instead of TogglePlayerNoEmblemsConsume - a copy-paste typo. The property's own setter was correct, so toggling the checkbox mid-session worked, but the reapply path that runs on every load (which is what Activate On Launch's priming depends on entirely) silently re-toggled No Goods Consume a second time instead of ever touching emblem consumption.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It follows the same architecture as TarnishedTool. I tested all options and they appear to work as expected.
I also added Enable target options as an activable on launch feature (it it activated when the game is loaded, not when the tool is attached), as well as DB/NKC event flags (because I am lazy and do not like going to the bell to ring it on each practice run).
Finally, a small fix for No Emblem Consume.