feat: Add an option to disable automatic camera centering #1921
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!1921
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/disable-camera-centering"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a setting to disable automatic camera centering
Add “Disable camera centering” under Controls so the camera stops turning toward the direction you move. This keeps it from fighting native mouse look.
The setting defaults to Off, saves your choice, and applies immediately. Manual camera controls, explicit re-centering, and scripted camera movements still work.
Thanks, this is a nice option and the shape is right: default Off, a live row (no restart flag, preset-exempt), the ini key comes out as
disable_camera_centeringfrom the row name, and the hook is a runtime check inside the lifted camera update, so toggling it in the menu takes effect at once (after one re-lift to get the hook in). I checked the anchor and the join label against a local lift of the supported build: each is found exactly once in that function, and thex25 = x26before the jump matches what an existing path into the same join already does, so the skip looks consistent.A few things before merge:
vk_api.hand in therx_option(44, 0)literal inhost/mouse_native.c. Worth agreeing on a number now (45?) so it doesn't collide silently.patch_camera_centeringis pure string work and easy to cover without the game: a small synthetic body with the anchor and the join, checking the hook goes in once right after the anchor, a second run changes nothing, the extern is added, and it returns None when the anchor or the join is missing or appears twice. If you add a test file, give itRUN_ALL_ARGS(#1822). The two fixture edits (test_framegen_preset,test_rumble_menu) are needed because they compileset_row, and they look right.Nits inline.
Nit: this table is for rows whose numbers are "not the obvious one"; this one is plain 0 Off / 1 On, which the line after the table already covers. Fine to drop it here (the readme row and paragraph are the right place for it).
#1560 also takes 44 (
HOS_OPT_SKIP_TITLE). One of the two needs a different number; if it's this one, the literal inhost/mouse_native.cchanges with it.Nit, optional: the other options the game thread reads through
rx_option(Mouse camera, Invert mouse vertical, Text speed) are read straight fromoptsinvk_replay.cpp's lambda. Doing the same here (if (id == HOS_OPT_DISABLE_CAMERA_CENTERING) return opts.disable_camera_centering;) would drop the atomic, its two stores, the accessor, and the fixture lines in the two tests. The atomic isn't wrong, just more than its neighbours do.@ -145,0 +152,4 @@" /* (nx2/oot_patches.py: disable camera centering) */\n")def patch_camera_centering(source):This could use a small game-free test (synthetic body with the anchor and the join): hook inserted once after the anchor, idempotent on a second run, extern added, and None when the anchor or the join is missing or appears twice.
Thanks for the update. Checked
2dcf210->109bffeagainst our earlier points:vk_api.hand therx_option(45, 0)literal inhost/mouse_native.c. That clears #1560 (44) and main (0-9, 16-22, 24-28, 32-35, 40-43). Whichever of the two lands second should still rebase against the other's enum.tests/test_camera_centering.pycovers the hook going in once after the anchor, the second run changing nothing, the extern, and None for a missing or doubled anchor/join, a missing camera function and an unterminated body. It declaresRUN_ALL_ARGS.optsin thevk_replay.cpplambda, so the atomic is gone, and thedocs/development.mdrow is dropped.Nothing else new in the merge. Once the in-game notes and screenshot are in, I have no further concerns from the code side.
Make follow-up
Z-targetting: works as intended
Swimming: works as intended
Crawlspaces: works as intended
Epona: untested