diff options
| author | Omri <omrih.e@protonmail.com> | 2026-03-02 00:00:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-02 00:00:08 +0200 |
| commit | 0d33cfbdbc4c3a80528bd263ce6e53be85340713 (patch) | |
| tree | f4640efcc7d8ba60e3f925eda1d1e2cba9b33c36 /Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp | |
| parent | 34d398cf1b3aa1bfa22a2e4ba434d8b6b63b3dc3 (diff) | |
| parent | 071d4f65998d617440ade95bd291e47a6a220c59 (diff) | |
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp')
| -rw-r--r-- | Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp index 6910dd65..33f41994 100644 --- a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp @@ -1242,6 +1242,15 @@ void UIScene_SkinSelectMenu::handlePackIndexChanged() updatePackDisplay(); } +std::wstring fakeWideToRealWide(const wchar_t* original) +{ + const char* name = reinterpret_cast<const char*>(original); + int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0); + std::wstring wName(len, 0); + MultiByteToWideChar(CP_UTF8, 0, name, -1, &wName[0], len); + return wName.c_str(); +} + void UIScene_SkinSelectMenu::updatePackDisplay() { m_currentPackCount = app.m_dlcManager.getPackCount(DLCManager::e_DLCType_Skin) + SKIN_SELECT_MAX_DEFAULTS; @@ -1249,7 +1258,9 @@ void UIScene_SkinSelectMenu::updatePackDisplay() if(m_packIndex >= SKIN_SELECT_MAX_DEFAULTS) { DLCPack *thisPack = app.m_dlcManager.getPack(m_packIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin); - setCentreLabel(thisPack->getName().c_str()); + // Fix the incorrect string type on title to display correctly + setCentreLabel(fakeWideToRealWide(thisPack->getName().c_str())); + //setCentreLabel(thisPack->getName().c_str()); } else { @@ -1268,7 +1279,9 @@ void UIScene_SkinSelectMenu::updatePackDisplay() if(nextPackIndex >= SKIN_SELECT_MAX_DEFAULTS) { DLCPack *thisPack = app.m_dlcManager.getPack(nextPackIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin); - setRightLabel(thisPack->getName().c_str()); + // Fix the incorrect string type on title to display correctly + setRightLabel(fakeWideToRealWide(thisPack->getName().c_str())); + //setRightLabel(thisPack->getName().c_str()); } else { @@ -1287,7 +1300,9 @@ void UIScene_SkinSelectMenu::updatePackDisplay() if(previousPackIndex >= SKIN_SELECT_MAX_DEFAULTS) { DLCPack *thisPack = app.m_dlcManager.getPack(previousPackIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin); - setLeftLabel(thisPack->getName().c_str()); + // Fix the incorrect string type on title to display correctly + setLeftLabel(fakeWideToRealWide(thisPack->getName().c_str())); + //setLeftLabel(thisPack->getName().c_str()); } else { |
