Skip to content

fix: Skin pack names truncated to first letter after 4JLibs upgrade#1518

Open
dtentiion wants to merge 1 commit intoMCLCE:mainfrom
dtentiion:pr/fix-skin-pack-names
Open

fix: Skin pack names truncated to first letter after 4JLibs upgrade#1518
dtentiion wants to merge 1 commit intoMCLCE:mainfrom
dtentiion:pr/fix-skin-pack-names

Conversation

@dtentiion
Copy link
Copy Markdown
Contributor

@dtentiion dtentiion commented Apr 16, 2026

Description

Fixes skin pack tab labels in the skin selector showing only the first character of each pack name (e.g. "B" instead of "Birthday Skin Pack") after the 4JLibs library upgrade.

Changes

Previous Behavior

After the feat: Upgrade to 4JLibs libraries commit, every skin pack tab in the skin selector displayed only the first letter of the pack name. For example, "Birthday Skin Pack" showed as "B", "Battle & Beasts" showed as "B", "Doctor Who Skins Volume I" showed as "D".

Screenshot 2026-04-16 015309

Root Cause

The old 4JLibs had a bug in STO_DLC.cpp where swprintf(data.szDisplayName, 256, L"%s", hFind.cFileName) used lowercase %s instead of %S. In wide swprintf, lowercase %s expects a wide string but received a narrow one, so the narrow bytes got reinterpreted as wide characters producing garbage in szDisplayName.

To work around this, commit 90504b14 added a fakeWideToRealWide() helper in UIScene_SkinSelectMenu.cpp that cast the wide buffer back to const char* and ran MultiByteToWideChar to undo the damage. This worked correctly with the broken lib.

The new 4JLibs fixed %s to %S, so szDisplayName now contains a proper wide string. But fakeWideToRealWide was still applied on top, so it reinterprets the correct wide string L"Birthday Skin Pack" (bytes: 42 00 69 00 72 00 ...) as a narrow string, hits the 00 after the first character, and truncates to just "B".

Fix

Removed fakeWideToRealWide() and its three call sites in updatePackDisplay(). The commented-out original calls were already there showing the correct approach. Pack names are now passed directly to setCentreLabel, setRightLabel, and setLeftLabel.

Screenshot 2026-04-16 022137

AI Use Disclosure

No AI was used in the development of this pull request.

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.

1 participant