mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-03 03:24:29 +00:00
Add text input support: safe uint16_t* to wstring conversion
Replace unsafe (wchar_t*)pchText casts with uint16_to_wstring() in all keyboard callbacks. The direct cast is incorrect on platforms where wchar_t is 4 bytes (Linux/macOS). New helpers in StringHelpers route through u16string for proper UTF-16 to wchar_t conversion. - Add uint16_len, uint16_to_u16string, uint16_to_wstring to StringHelpers - Fix casts in AnvilMenu, CreateWorldMenu, DebugCreateSchematic, DebugSetCamera, LaunchMoreOptionsMenu, SignEntryMenu - Truncate sign text to 15 chars in SignEntryMenu - Move m_bIgnoreInput reset after if-block in LaunchMoreOptionsMenu
This commit is contained in:
@@ -146,7 +146,7 @@ int UIScene_DebugCreateSchematic::KeyboardCompleteCallback(void* lpParam,
|
||||
InputManager.GetText(pchText);
|
||||
|
||||
if (pchText[0] != 0) {
|
||||
std::wstring value = (wchar_t*)pchText;
|
||||
std::wstring value = uint16_to_wstring(pchText);
|
||||
int iVal = 0;
|
||||
if (!value.empty()) iVal = _fromString<int>(value);
|
||||
switch (pClass->m_keyboardCallbackControl) {
|
||||
|
||||
Reference in New Issue
Block a user