fix: Skin pack names truncated to first letter after 4JLibs upgrade#1518
Open
dtentiion wants to merge 1 commit intoMCLCE:mainfrom
Open
fix: Skin pack names truncated to first letter after 4JLibs upgrade#1518dtentiion wants to merge 1 commit intoMCLCE:mainfrom
dtentiion wants to merge 1 commit intoMCLCE:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 librariescommit, 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".Root Cause
The old 4JLibs had a bug in
STO_DLC.cppwhereswprintf(data.szDisplayName, 256, L"%s", hFind.cFileName)used lowercase%sinstead of%S. In wideswprintf, lowercase%sexpects a wide string but received a narrow one, so the narrow bytes got reinterpreted as wide characters producing garbage inszDisplayName.To work around this, commit
90504b14added afakeWideToRealWide()helper inUIScene_SkinSelectMenu.cppthat cast the wide buffer back toconst char*and ranMultiByteToWideCharto undo the damage. This worked correctly with the broken lib.The new 4JLibs fixed
%sto%S, soszDisplayNamenow contains a proper wide string. ButfakeWideToRealWidewas still applied on top, so it reinterprets the correct wide stringL"Birthday Skin Pack"(bytes:42 00 69 00 72 00 ...) as a narrow string, hits the00after the first character, and truncates to just"B".Fix
Removed
fakeWideToRealWide()and its three call sites inupdatePackDisplay(). The commented-out original calls were already there showing the correct approach. Pack names are now passed directly tosetCentreLabel,setRightLabel, andsetLeftLabel.AI Use Disclosure
No AI was used in the development of this pull request.