fix(prompts): Auto picks the face by the pad's SDL type, not its name alone #1125
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1125
Loading…
Reference in a new issue
No description provided.
Delete branch "gab9281/Longshot:fix/prompts-auto-pad-type"
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?
Type: fix · Risk: low · Tested on: Linux, Radeon 680M (RADV); Windows build under Wine · Needs: Windows, any GPU, a PlayStation pad
Why
With Button prompts on Auto, the game shows the icons of the controller you play with. It picked them from the controller's name alone, so a PlayStation pad that the system names "Wireless Controller" (a DualShock 4 or a DualSense on some Linux drivers and over Bluetooth on Windows) got the Xbox's icons, and so did any pad whose name says nothing (Steam Input's "Steam Virtual Gamepad" in front of a PlayStation pad). SDL knows the kind of pad from its USB ids, or through Steam Input from the pad behind the stand-in: Auto now asks it.
See #413 (Auto choosing the face there).
How to reproduce
Seen on: any OS, a DualShock 4 or DualSense that SDL names "Wireless Controller" (or through Steam Input)
Settings and switches: Button prompts: Auto
Steps: start the game with that pad, look at
prompts: auto:in longshot_log.txt and at any button iconExpected: the PlayStation's icons
Actual:
prompts: auto: controller "Wireless Controller": xbox, the Xbox's iconsWhat changed
Auto picks the face by the pad's name when it says the maker's buttons (Steam Deck, Steam Controller, DualSense, DualShock, PlayStation, Nintendo, Switch, Joy-Con), else by the type SDL gives it, else the Xbox's as before. The menu's hint for Auto says "from its type and name", in every language.
face_of_type(SDL3's and SDL2's numbers; the Switch's throughhd_rumble_kind,host/hd_rumble.h),face_of_padandauto_faceinhost/prompts.c; the log line now readsprompts: auto: controller "<name>" (SDL<n> type <t>): <face>host/pad_sdl.ckeeps each pad's SDL type, read once when it opens (pads[i].type, also used for HD rumble), andhos_sdl_pad_first(name, cap, &type, &sdl)hands it with the SDL it came from (replaceshos_sdl_pad_first_name); the prompts no longer load SDL themselveshn_prompts' Auto line ingpu/vk/vk_menu.cppand its 13 translations ingpu/vk/menu_i18n.hdocs/images/guide/manifest.json: the Graphics image reviewed again and kept (the Auto help line is on the Gameplay tab, not in that view;gpu/vk/vk_internal.hchanged on main with #1107'stest_vram_bytes(), a declaration only, which already failed this check on main @71b1edd8): the reviewed hashes advance,scripts/check_guide_screenshots.py --review-sourcespassestests/test_prompt_auto_face.py(31 names and types, SDL3 and SDL2, a brand name over another type, no SDL),tests/test_mods_size_table.py's stub,tests/test_menu_i18n.pyMeasurements
Verdict: nothing to measure: the type is read once when a pad opens (before, the name was copied at each poll, as it still is).
Flags and settings
None: no row, ini key or switch is added or changed;
button_promptskeeps its values, and only the Auto choice's help line under Button prompts reads differently.Testing
Tested:
tests/test_prompt_auto_face.py,tests/test_menu_i18n.py;tests/run_all.py: 586 passed, 15 failed, 74 skipped; the 15 also fail on main @6c8d6e6a(17 there: test_bug_report and test_hardware_report besides), none reads the promptsprompts: auto: controller "DualSense Wireless Controller" (SDL3 type 6): ps5, then the PS5's iconshost/prompts.candhost/pad_sdl.ccompile without warnings for Windows (llvm-mingw) and LinuxNot tested: a pad SDL names "Wireless Controller" (the one here is named by its model); SDL2 builds in the game; a live change and Auto on native Windows (under Wine, the chosen PS5 face loaded from a Chinese-named user folder with zh-Hans: see the comment)
Must be tested:
prompts: auto: controller "…" (SDL3 type 5 or 6): ps4 or ps5in longshot_log.txt and the PlayStation's icons (by hand: a tester with the pad)Risks
What could break: a pad that SDL types as a PlayStation's or a Switch's but that has an Xbox layout, and whose name says nothing, now gets that face; the name still wins when it names a maker
Turning it off: pick the face in Button prompts instead of Auto, or revert the commit
Compatibility: Nothing changes (longshot_options.ini keeps its values)
Issues
See #413
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
https://claude.ai/code/session_015KgSKmCc7pkXGyByWtmErh
Tested in game: Linux (CachyOS, kernel 7.3.4), Radeon 680M on RADV (Mesa 26.2.6), a DualSense over USB, the kokiri-start save in Link's house: Button prompts on Auto picked the PS5's (log: prompts: auto: controller "DualSense Wireless Controller" (SDL3 type 6): ps5), then Xbox, Switch and Steam Deck set live through the control bridge each changed the icons. Windows under Wine: running now.
0a3408d4e1d531947e7aWindows build (llvm-mingw cross-build of this PR with #1125 and #1126 together,
v3.0.0-rc.5-21-g67bf65fe) under Wine on Linux, Radeon 680M (RADV, Mesa 26.2.6): a user folder with a Chinese name,HOS_LANGUAGE=zh-Hans,button_prompts=4(PlayStation 5) seeded, as in #413 and #897:The chosen face is read from the non-ASCII user folder (not Auto), and the layouts are found whole. Not covered under Wine: a live change (the control bridge's named pipe can't be reached from Linux) and Auto with a pad (Wine doesn't pass the DualSense through here); native Windows with a PlayStation pad is still in Must be tested.
Guide screenshotsfails on main @71b1edd8too (gpu/vk/vk_internal.h, from #1107); #1125's second commit records the review that clears it.WIP: fix(prompts): Auto picks the face by the pad's SDL type, not its name aloneto fix(prompts): Auto picks the face by the pad's SDL type, not its name aloneAuto, checked with emulated controllers (uinput virtual pads with each pad's USB ids and name, on a clean build of this PR with #1126 and #1184; Linux, SDL3; Button prompts = Auto, restart for each):
Each line is the run's own
prompts: auto: controller …line, followed byprompts: <face> icons. Not covered: a real pad over Bluetooth, Steam Input's virtual pad, and Windows (the Test Farm run on #1184).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.