mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-15 23:50:38 +00:00
Round out the EditBox method backports alongside Set/GetCursorPosition, all reusing state the engine already maintains: - GetUTF8CursorPosition — caret as a character index (vs GetCursorPosition's byte offset), via the engine's own byte->char counter FUN_0077bc80. - ClearHighlightText — drop the selection but keep the caret (collapse selStart/selEnd onto the cursor + highlight-dirty bit). Vanilla can only clear a selection with HighlightText(0,0), which yanks it to offset 0. - HasFocus — pointer identity against VAR_FOCUSED_EDITBOX (the global the engine's SetFocus writes / ClearFocus clears). - HasText — text byte length (+0x338) is non-zero. Registered on the EditBox method registry, so only EditBox frames dispatch them. New offsets: OFF_EDITBOX_TEXT_LENGTH, FUN_EDITBOX_COUNT_CHARS. The module now covers cursor / selection / focus / text-state, so it moves from editbox/Cursor.cpp to editbox/Methods.cpp (namespace EditBox::Methods). Documented in docs/API.md and the README under the Frame widget section. Verified in-game: SetText+SetFocus reports HasFocus/HasText true and both cursor getters 5; an empty box reports both predicates false.