Scripts: keyboard/mouse prompt icons for the newer retail game (WIP) #1604
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1604
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1604"
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?
@zohaiblazuli on GitHub · 2026-11-24 18:10 UTC · original
zohaiblazuli:kbm-icon-library→main· +1866 −0 · 34 files · 3 commits · openThe newer retail game shows Xbox buttons (A, B, X, Y …) in every prompt, even when it is played with XCL's keyboard and mouse mapping. This PR adds a script that replaces the game's button-icon library with keycaps and mouse icons for the keys XCL actually maps (A = ENTER, B = ESC, X = Q, Y = E, …), and docs covering how it was worked out. It changes nothing in XCL: the icons reach the game through XCL's existing overlay, as a patched copy of one archive in the title's XCL data folder. The game folder is never written, and no game data is in the diff.
In the game under XCL (account prompt, 2560×1440 window). Top: the game's own icons. Bottom: this PR. Right: Y / E held; the game's own press animation and tint apply to the new icons.
Evidence: the Xbox build has no keyboard/mouse icons (checked so far)
From
python scripts/kbm_icons/survey.py <game>\data.rpf <game>\packs.rpf(reads only; entries found by content):data.rpf(481 MB)input_iconsMain_Button_N, all Xbox pad buttonsplatform_xbsxonlypacks.rpf(4.8 GB)generic_movie,hud,map_scripted_movie) all load that one library.DEVICE_PREFIXES) starts with a single empty entry: one icon set, no second device.Press animation (the game's own, applied to the keycaps)
The game's ActionScript class
InputIconV2animates whatever icon it places, so the keycaps get the same motion with nothing added. The GIFs replay its per-frame tables at 30 fps, with the press colours measured in the game:Master copy of the icons
docs/kbm-icons/icons-master.svgis the master file: one<symbol id="Main_Button_N">per icon the game exports, and it opens as the sheet above. The build reads it.If you change the icons, please post your updated
icons-master.svg(and a picture of it) in this PR, so everyone can see each icon set side by side.Method (details and all numbers in
docs/kbm-icons/README.md)platform_xbsx.input_icons, indata.rpf: 38 vector symbolsMain_Button_N, no bitmaps. The archive's table of contents is encrypted, but each entry is a plain zlib stream, so the movie is found by content. Nothing is decrypted.InputIconV2class (table above). The icons scale about the point (32, 32).Design system
docs/kbm-icons/design-system/is the whole design system as plain files, so anyone can adjust it:README.md: rules, the key mapping and the screens.tokens.json/tokens.css: colours, type and spacing, measured from the game's 4K frames.What is in it
scripts/kbm_icons/build_library.py: finds the icon library in the user'sdata.rpf, rebuilds it from the master SVG and writes the patched copy. It resolves and checks both output paths before writing. Each output is staged in a unique temporary file.scripts/test_kbm_icon_outputs.pycovers both output flags, Windows junctions and pre-existing hard links.scripts/kbm_icons/keycaps.py: the icon designs; writesicons-master.svgand the Icon library preview.scripts/kbm_icons/motion.py: the Prompt motion preview, built from the game's tables.scripts/kbm_icons/survey.py: lists the UI movies and icon libraries in an archive (the evidence above).docs/kbm-icons/README.md: how to try it, the method, the measurements and what is unchecked.docs/kbm-icons/icons-master.svg: the master copy of the icons.docs/kbm-icons/design-system/: the design system.README.md: one line under Controls pointing to the docs.Try it (needs Python 3.10+ and
pip install fonttools):Delete that
overlay\data.rpfto undo.The scripts, docs, design system and generated master SVG put the diff over the usual size, and that's deliberate: this is one feature that has to be reviewed and iterated as a whole, and it is meant to stay a single draft where everyone working on it can find it. Splitting it into the usual parts can happen before anything is merged.
Tested
rustc 1.94.0.cargo build --workspace && cargo test --workspace -- --test-threads=4at the base commit,upstream/main9e3831e: 776 passed, 0 failed, 41 ignored (20 test binaries). SKIPPED on this adapter:gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows). The PR changes no Rust code, so the counts are those of the tree it adds files to.XCL_NETWORK=0), with the overlay copy written bybuild_library.pyfrom this branch:Eand↵ ENTERin place of Y and A;--offsetit scans the archive and finds the entry (9 s).11e95c8on Windows, Python 3.12.6.python -B -m unittest discover -s scripts -p 'test_*.py' -vran 19 tests with 19 passed, 0 failed and 0 skipped. Both output flags rejected paths into the game folder, including through a junction. The hard-link test verified the original file stayed intact.build_library.pywith both output flags pointing into a temporary directory. Both outputs were created from the retail archive and the source SHA-256 stayed the same.Regression run
crates/xcl/src.Not tested
game+0x23cf683(a null write), at 568 s and 509 s. So the settings screens, the HUD and the map, which use the same library, were not reached. The crash isn't caused by this PR, but it blocks checking it.SHIFT,TAB,CTRL, the mouse icons, the WASD and arrow clusters, and the hold ring around a wide key, in the game.data.rpfversions, layouts other than QWERTY (Q, E and WASD are read by key position), and screen sizes other than a 2560×1440 window.AI use
InputIconV2animation, measured the colours and spacing in the game, designed the icons, wrote the scripts, docs and design system, ran the tests and wrote this description. I directed the design and reviewed the results from the in-game captures.🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-24 20:22 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@gut0to on GitHub · 2026-11-24 18:15 UTC · original
On
scripts/kbm_icons/build_library.pyline 444 (outdated):--movie-outis written before the game-folder check, which only validates--out, so pointing it into the game modifies the original installation despite the stated guarantee. The--outcheck also comparesabspathstrings without resolving symlinks, so a junction or symlink can target the game and bypass it. Please resolve and validate both destinations before either write. AI-assisted review; I checked both paths in this diff.@gut0to on GitHub · 2026-11-24 18:24 UTC · original
On
scripts/kbm_icons/build_library.pyline 444 (outdated):--movie-outis still written before the game-folder guard, which only checks--out, so this option can write inside the game. The--outcheck also uses lexicalabspathpaths and can be bypassed through a junction/symlink into the game. Please resolve and validate both output destinations before either write. AI-assisted review; I rechecked both paths on this head.@zohaiblazuli on GitHub · 2026-11-24 18:25 UTC · original
On
scripts/kbm_icons/build_library.pyline 444 (outdated):Have some patience
@zohaiblazuli on GitHub · 2026-11-24 18:30 UTC · original
On
scripts/kbm_icons/build_library.pyline 444 (outdated):Thanks for catching both write paths. Commit
11e95c8resolves and validates--outand--movie-outbefore writing either file. Both outputs now use uniquely created temporary files.The new regression tests cover both flags, a Windows junction into the game folder, and pre-existing hard links. I also generated both outputs from the retail archive in a temporary directory and verified that the source SHA-256 stayed the same.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.