Restore broken cheats, fix hotkey, and optimize ESP for current SOTF/BepInEx - #36
Open
CrossiiDev-Studio wants to merge 1 commit into
Open
Restore broken cheats, fix hotkey, and optimize ESP for current SOTF/BepInEx#36CrossiiDev-Studio wants to merge 1 commit into
CrossiiDev-Studio wants to merge 1 commit into
Conversation
Optimize ESP and UI hot paths, fix menu hotkey on German layouts, properly disable cheat side effects on world exit, and document the fork changes in the README.
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.
Maintenance update for current Sons of the Forest / BepInEx 6 IL2CPP builds: restore broken cheats, fix unreliable menu hotkey behavior (especially on German keyboards), harden cheat cleanup when leaving a world, and reduce ESP/UI allocation overhead.
Fixes
Menu hotkey — Default set to Backslash (German ^ key). Also accepts BackQuote / Caret. Input is checked before cheat updates and again in OnGUI, so exceptions in cheats cannot block opening the menu.
IL2CPP lifecycle — Added proper IntPtr constructor for SotfMain and safer GameObject setup; added startup/toggle logs for debugging.
World exit cleanup — Cheats with side effects now truly disable (SpeedyRun console, Instant/Infinite Build, CaveLight, NoCold, NoFallDamage, GodMode max health, held-item hack) instead of only clearing Enabled flags.
Infinite Ammo — Restored by refilling the held ranged weapon magazine via RangedWeaponItemInstanceModule.
Infinite Logs — Restored via HeldOnlyItemController.InfiniteHack, synced with Infinite Build so the toggles do not override each other incorrectly.
No Fall Damage — Applied on toggle instead of every-frame polling.
Performance
ESP — Early exit when no category is active; actor labels use lookup maps instead of large switches; shared GUIContent + cached distance strings to reduce GC.
ESP UX — Turning off the master ESP toggle no longer clears category selections every frame.
Item ID window — Rebuilds the filtered list only when the search query changes.
Update loop — Removed empty/broken update calls from the hot path.
Docs / build
README updated with fork changelog, corrected config path (SOTF_ModMenu.cfg), and build notes.
Optional post-build copy to BepInEx/plugins (only if the target folder exists).
Test plan
Open/close menu with ^ (Backslash) on a German keyboard; confirm log lines SotfMain started / Mod menu opened
Toggle Infinite Ammo with a ranged weapon equipped; magazine stays full while firing
Toggle Infinite Logs / Infinite Build; held logs/sticks are not consumed; disabling one does not break the other if still enabled
Enable SpeedyRun / CaveLight / GodMode, return to main menu; side effects are cleared
Enable ESP categories, disable master ESP, re-enable; category selections remain
Open “Show all ID’s”, type a search; no hitching / list updates only on query change