Skip to content

Item wheel for the R/L item row, and Cycle items (Gameplay, off by default) - #57

Merged
pixl27 merged 1 commit into
pixl27:mainfrom
samaBR85:feat/item-wheel
Nov 16, 2026
Merged

pixl27 merged 1 commit into
pixl27:mainfrom
samaBR85:feat/item-wheel

Conversation

@samaBR85

@samaBR85 samaBR85 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

The item wheel, adult Link, names in Portuguese

Summary:

  • Item wheel (Gameplay, off by default): holding R or L shows the item row as a wheel, Twilight Princess style. Point at an item with either stick (or the mouse) and let go: it is on ZR at once. Pages of 8 slots, one set for child Link and one for adult Link; Left/Right or the mouse wheel turn the page, Y takes an item up to move it, B puts it back. The layout is kept in wheel_layout.txt beside relink_options.ini.
  • Cycle items (Gameplay, Basic by default): a quick tap of R or L changes the ZR item without opening the row: Last used swaps with the item that was on ZR before, whatever it is; Basic goes through the bow and arrows, the bottles or the spells; +Bombs; +Tools (hookshot, hammer, slingshot, boomerang). Holding R or L still opens the row (or the wheel).
  • The wheel shows the game's own item icons, item names in the game's language (language.txt) and the item row's own sounds, made from the player's RomFS at every build into <game folder>/wheel/. Nothing of the game is in the repository.

Why:
Getting to one item in the R/L row means tapping through all the others. This is a port of the item wheel from Longshot (MagicBeanDev/Longshot#822, originally Hookshot), which players there tested and used. With the row off nothing changes: no hook acts, nothing is drawn or recorded.

How it fits ReLink:

  • host: host/oot_wheel.c (new) is the wheel's state, pages and input, instant equip through PouchMgr::setAssignableItem / getAssignableItem, and Cycle items; nx2/oot_patches.py calls hos_wheel_menu_tick first in f_802f1380 (each menu screen's update); host/nn_hid.c hands it the pad; host/nn_audio.c plays the row's sounds; host/display.c the mouse; host/hos_mem.c gets hos_mem_region (the pouch lives in an address region); host/hos_main.c publishes Link's age with the inventory counts.
  • renderer: Longshot draws the wheel with Dear ImGui. ReLink's menu is GDI, so gpu/vk/vk_wheel.cpp draws the wheel on the CPU (shapes anti-aliased by distance, text with GDI) into a picture that gpu/vk/vk_framegen.cpp lays over the scene before the HUD, blurred and dimmed (three small compute passes built with Sirit at run time). vk_draw.cpp copies the gameplay upscale's output while the row is on; vk_replay.cpp covers the window texture while the wheel is open.
  • build: nx2/wheel_assets.py keeps the icons' ASTC blocks as they are (zstandard only, no image library), decoded at run time by suyu's ASTC decoder; nx2/wheel_names.py and nx2/wheel_sounds.py read the messages and the row's sounds. Without them the wheel shows English labels, silently.
  • vk ABI: MkwVkHost.wheel (MKWVK_API_VERSION 11); option ids 40 and 41.

One fix over Longshot's: two bottles of the same content (two fairies) are two places of the row with one name; the wheel took one for a stale copy of the other, never knew the whole row, and its survey stuck between them (items missing from the wheel). They are two items now. And, as on Hookshot: the bottles are in the inventory's order (read at each opening), and a bottle moved with Y keeps its own slot (each bottle's slot is its content's; the ones left over fill the bottle slots still empty).

Tested on Windows 11, RTX 4070 SUPER, on ReLink 0.7.5 to 0.7.6, rebased on 0.7.7 (builds):

  • the wheel as child and adult, turning pages, moving an item with Y, names in Portuguese, instant equip, the mouse
  • Cycle items Last used, Basic, +Bombs and +Tools with R and L taps
  • a pouch with two bottles of the same content: every item on the wheel, the bottles in the inventory's order, two bottles swapped with Y, each fairy chosen
  • the game holds its 60 fps cap with the wheel closed and open (the frames behind the open wheel are the game's paused ones)

Not tested: Linux (the mouse part of the wheel is a stub there, the stick works), AMD and Intel GPUs.

…meplay, off by default)

Ported from Longshot (MagicBeanDev/Longshot#822, from Hookshot): hold R or L for a wheel of the items, pages of 8 slots per
age, the game's own icons, names and sounds; Cycle items changes the ZR item with a tap of R or L. ReLink draws its menu
with GDI, so the wheel is drawn on the CPU (gpu/vk/vk_wheel.cpp) and laid over the scene blurred and dimmed
(vk_framegen.cpp). The icons keep the game's ASTC blocks (nx2/wheel_assets.py, zstandard only) and are decoded by suyu's
decoder at run time.

Co-authored-by: tapxgamestudio <311386025+tapxgamestudio-coder@users.noreply.github.com>
Co-authored-by: getzabelz <7135417+getzabelz@users.noreply.github.com>

Feito com Claude Code
@Yel1oww Yel1oww mentioned this pull request Nov 15, 2026
@pixl27
pixl27 merged commit 146d5a7 into pixl27:main Nov 16, 2026
@pixl27

pixl27 commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Merged, and released in 0.7.8. Thanks for this one, it's a real addition.

What I tested in game before merging (RTX 3060 Ti, a player's save at Lake Hylia, scripted pad input): the wheel opens on R and on L, with the game's icons, counts and names (French here); an item pointed at with the stick is put on ZR when R is let go (the HUD shows it); Y picks an item up and puts it down in another slot; D-pad Right turns the page. With both rows off (the default) nothing of it runs.

On top of your commit, as said in the review: vk_api.h kept as it was (the wheel's state goes through an existing call, so players keep their prepared shaders), Cycle items off by default like the wheel, the 64-bit size check in the sounds file, and comments that don't name other projects (the readme's License section carries the origin).

Not tested here: the mouse on the wheel, Linux, AMD and Intel cards. One thing I noticed: the very first time the wheel opens in a session, the game's own row shows for about a second while the icons load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants