Commit Graph

10 Commits

Author SHA1 Message Date
MatthewBeshay
95e0a14b36 refactor: use convStringToWstring for text input instead of uint16 helpers
GetText now returns UTF-8 directly so callers go through simdutf via
convStringToWstring(). Remove dead uint16_to_wstring helpers.
2026-03-30 14:10:14 +11:00
MatthewBeshay
e89198f56c fix: sign entry crash and remove blocking callback workaround
- Initialize m_iEditingLine to 0 in SignEntryMenu constructor
  (was uninitialized, causing out-of-bounds array access)
- Add bounds check on m_iEditingLine before array access in callback
- Only truncate sign text if longer than 15 chars (avoid padding)
- Remove manual KeyboardCompleteSeedCallback call in
  LaunchMoreOptionsMenu (no longer needed since RequestKeyboard
  now fires callbacks asynchronously from Tick)
2026-03-30 13:41:54 +11:00
MatthewBeshay
1ead072c45 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
2026-03-30 12:46:50 +11:00
Tropical
b9d18bf641 TU19: merge Minecraft.Client/Platform/Common/UI 2026-03-22 11:44:26 -05:00
Tropical
4dd9b683bf format Platform/Common/UI 2026-03-22 04:25:54 -05:00
notmatthewbeshay
0249bfd2bf Fix Linux build warnings 2026-03-14 04:37:55 +11:00
notmatthewbeshay
1265358aec Use standard dialog ID arrays in common UI 2026-03-11 15:38:52 +11:00
notmatthewbeshay
d285f41969 Use standard types in keyboard request APIs 2026-03-11 15:38:47 +11:00
notmatthewbeshay
b4a005fb8c Remove Win32 callback types from launch menus 2026-03-11 15:38:43 +11:00
Tropical
ad1e8369bc refactor: move Common to Platform/Common 2026-03-09 00:17:42 -05:00