WIP: feat(modapi): select custom usable items from the native L menu #2340

Closed
snaildev99 wants to merge 6 commits from snaildev99/Longshot:feat/usable-items-l-menu into mod-api
Contributor

Summary

Mods can put a distinct usable item in the native L shortcut alongside the game's own equipment. After A confirms the row, the equipped HUD shows its icon and optional count. Reopening L focuses that item. Selecting a native item restores its action.

The content phase supplies an owned pouch item, a selector row and icon assets. The script calls items.registerUsable, checks items.isSelected and can set the displayed ammo or charge with items.setUsableCount. A display count of zero is valid. A value of -1 hides the number. While equipped, a custom item can handle ZL and ZR without activating the previously equipped native item. To reproduce with a fresh mod, follow A usable item in the L menu. It covers creating Signal Stone, providing its selector and inventory data and icons, granting it, and checking A, B, the HUD count and the handoff to the native Hookshot. A plain game build has no Signal Stone until you create and enable the mod.

This targets the proposal's mod-api integration branch. Held models, hand poses, custom use animations and save-slot persistence are separate work. The three local test items exercise the API and are not shipped with the change.

Testing

Tested: Windows, GeForce RTX 3090, NVIDIA 610.88, adult Link on Death Mountain Trail. The development build ran the native L shortcut sorted by type. Confirmed three items, fired a tool with ammo, toggled a reusable beacon and charged and released a wand. Reopened L and pressed A without moving the stick for each custom item and the real Hookshot. Checked rendered HUD icons and equipped highlights, cancelled a preview and switched back to the Hookshot. The automated in-game scenario passed and a second interactive controller playtest confirmed smooth switching. The standalone mod also loaded on a copy of an existing save.

The submitted branch is based on the current API, uses the current hook schema, and releases its registrations when input permission is revoked. The native adapter regression, the mod-tools fake-game regression, the standalone pad harness, schema generation and 41 hook checks pass on the submitted branch. A completed full host-suite pass has yet to be recorded. Its pad placement check also fails on the unmodified target branch because it looks for a removed stick-direction call.

The latest interactive Slot 2 playtest passed on the controller-enabled development build. On the published API code at 40f54c909, the separate automated in-game run stopped at the fixture's independent item ownership check before it reached the selector assertions. The documentation update compiles and links both Signal Stone modules with longshot mod check. The new example has not had a separate in-game run.

Still to test:

  • Resolve the automated fixture ownership setup and repeat the selector checks on the published integration build. Finish the host suite.
  • Try recent-order sorting, child Link and Linux controller input by hand. Confirm that opening L returns to an eligible selected row.

Measurements

Verdict: The functional test went from a stale donor icon and cursor to four distinct, correct selections on the development build. The numbers below are functional observations. Frame-time parity has not yet been measured.

By-type menu test Before: mod-api @ 8da9fe53e After: tested development branch at tree f98e64d46115
Custom usable items whose scripted behavior was exercised No custom activation API on the target branch 3 of 3
Reopen and confirm the selected row without moving the stick The earlier prototype returned to the donor or first row 4 of 4, including the native Hookshot
HUD count Earlier prototype showed Uzi ammo on other items Ammo fell from 30 to 19, Beacon hid the number and the idle wand showed 0

Risks

Mods need distinct inventory identities and selector entries. Reusing a donor's native assignable identity can also change how the game resolves that donor. Custom selection is session-local. The host reserves both triggers while a custom item is selected, and waits for release at handoff. Fixed HUD overrides and native-only menus should keep their normal behavior. Disabling the mod releases its registrations.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. Targets the current mod-api integration branch for this API.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Screenshots of the same spot on main and here, for a change that shows on screen.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary Mods can put a distinct usable item in the native L shortcut alongside the game's own equipment. After A confirms the row, the equipped HUD shows its icon and optional count. Reopening L focuses that item. Selecting a native item restores its action. The content phase supplies an owned pouch item, a selector row and icon assets. The script calls `items.registerUsable`, checks `items.isSelected` and can set the displayed ammo or charge with `items.setUsableCount`. A display count of zero is valid. A value of -1 hides the number. While equipped, a custom item can handle ZL and ZR without activating the previously equipped native item. To reproduce with a fresh mod, follow [A usable item in the L menu](https://git.magicbean.dev/snaildev99/Longshot/src/commit/d29b5b629cd774e00cc9282522e2f9711d2480dd/assets/modding/docs/api-guide.md#a-usable-item-in-the-l-menu). It covers creating Signal Stone, providing its selector and inventory data and icons, granting it, and checking A, B, the HUD count and the handoff to the native Hookshot. A plain game build has no Signal Stone until you create and enable the mod. This targets the proposal's `mod-api` integration branch. Held models, hand poses, custom use animations and save-slot persistence are separate work. The three local test items exercise the API and are not shipped with the change. ## Testing **Tested:** Windows, GeForce RTX 3090, NVIDIA 610.88, adult Link on Death Mountain Trail. The development build ran the native L shortcut sorted by type. Confirmed three items, fired a tool with ammo, toggled a reusable beacon and charged and released a wand. Reopened L and pressed A without moving the stick for each custom item and the real Hookshot. Checked rendered HUD icons and equipped highlights, cancelled a preview and switched back to the Hookshot. The automated in-game scenario passed and a second interactive controller playtest confirmed smooth switching. The standalone mod also loaded on a copy of an existing save. The submitted branch is based on the current API, uses the current hook schema, and releases its registrations when input permission is revoked. The native adapter regression, the mod-tools fake-game regression, the standalone pad harness, schema generation and 41 hook checks pass on the submitted branch. A completed full host-suite pass has yet to be recorded. Its pad placement check also fails on the unmodified target branch because it looks for a removed stick-direction call. The latest interactive Slot 2 playtest passed on the controller-enabled development build. On the published API code at `40f54c909`, the separate automated in-game run stopped at the fixture's independent item ownership check before it reached the selector assertions. The documentation update compiles and links both Signal Stone modules with `longshot mod check`. The new example has not had a separate in-game run. **Still to test:** - Resolve the automated fixture ownership setup and repeat the selector checks on the published integration build. Finish the host suite. - Try recent-order sorting, child Link and Linux controller input by hand. Confirm that opening L returns to an eligible selected row. ## Measurements **Verdict:** The functional test went from a stale donor icon and cursor to four distinct, correct selections on the development build. The numbers below are functional observations. Frame-time parity has not yet been measured. | By-type menu test | Before: mod-api @ 8da9fe53e | After: tested development branch at tree f98e64d46115 | |---|---|---| | Custom usable items whose scripted behavior was exercised | No custom activation API on the target branch | 3 of 3 | | Reopen and confirm the selected row without moving the stick | The earlier prototype returned to the donor or first row | 4 of 4, including the native Hookshot | | HUD count | Earlier prototype showed Uzi ammo on other items | Ammo fell from 30 to 19, Beacon hid the number and the idle wand showed 0 | ## Risks Mods need distinct inventory identities and selector entries. Reusing a donor's native assignable identity can also change how the game resolves that donor. Custom selection is session-local. The host reserves both triggers while a custom item is selected, and waits for release at handoff. Fixed HUD overrides and native-only menus should keep their normal behavior. Disabling the mod releases its registrations. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. Targets the current `mod-api` integration branch for this API. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [ ] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
feat(modapi): select custom usable items from the native L menu
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
93f31547df
Assisted-by: OpenAI Codex
Author
Contributor

Tested in game: Windows, RTX 3090, NVIDIA 610.88, adult Death Mountain Trail. Confirmed Uzi, Beacon and Pulse Wand, checked their distinct HUD icons and counts, reopened and reconfirmed all three without stick input, then equipped and used the native Hookshot. Automated development build passed 1/1 and manual switching was confirmed. The current mod-api integration rerun is listed separately in Testing.

Tested in game: Windows, RTX 3090, NVIDIA 610.88, adult Death Mountain Trail. Confirmed Uzi, Beacon and Pulse Wand, checked their distinct HUD icons and counts, reopened and reconfirmed all three without stick input, then equipped and used the native Hookshot. Automated development build passed 1/1 and manual switching was confirmed. The current mod-api integration rerun is listed separately in Testing.
Author
Contributor

The submitted branch passes the native adapter, fake-game and direct pad tests, the schema check and 41 hook checks. The older controller placement assertion also fails on the unmodified target. Integration play and the full suite are in progress.

The submitted branch passes the native adapter, fake-game and direct pad tests, the schema check and 41 hook checks. The older controller placement assertion also fails on the unmodified target. Integration play and the full suite are in progress.
docs(modapi): walk through adding a usable L-menu item
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 15s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
9ad27a4afa
Assisted-by: OpenAI Codex
Author
Contributor

Recorded the successful manual controller playtest and the separate fixture result. Added a fresh-mod walkthrough for reviewers. The gameplay test mod stays local.

Recorded the successful manual controller playtest and the separate fixture result. Added a fresh-mod walkthrough for reviewers. The gameplay test mod stays local.
snaildev99 force-pushed feat/usable-items-l-menu from 9ad27a4afa
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 15s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to d29b5b629c
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 31s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-25 07:41:58 +00:00
Compare
Author
Contributor

Closing in favor of #2528, which carries Quick Select Items on the Rust Mod API and stacks on controller PR #2516. Item testing and review continue there.

Closing in favor of #2528, which carries Quick Select Items on the Rust Mod API and stacks on controller PR #2516. Item testing and review continue there.
snaildev99 closed this pull request 2026-11-25 23:05:59 +00:00
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 31s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2340
No description provided.