diff --git a/Source/Client/Input/TextInputBuffer.cpp b/Source/Client/Input/TextInputBuffer.cpp index 01cd21d..d7e6cb8 100644 --- a/Source/Client/Input/TextInputBuffer.cpp +++ b/Source/Client/Input/TextInputBuffer.cpp @@ -209,8 +209,27 @@ void TextInputBuffer::MoveForward(unsigned codePage) { this->cursor = static_cast(CharNextExA(static_cast(codePage), begin + position, 0) - begin); } } - // OFFSET: 0x00ACE5E0 +// FUNCTION: fn_17789 +void TextInputBuffer::AdvanceCursor(int delta) { + const unsigned length = static_cast(this->text.size()); + unsigned cursor = static_cast(this->cursor); + if (cursor == length) { + return; + } + if (cursor > length) { + this->cursor = static_cast(length); + } else { + unsigned next = cursor + static_cast(delta); + if (next <= length) { + this->cursor = static_cast(next); + } + } + if ((static_cast(GetKeyState(VK_SHIFT)) >> 8) == 0) { + this->anchor = this->cursor; + } +} + // OFFSET: 0x00ACE620 // FUNCTION: fn_17790 void TextInputBuffer::RetreatCursor(int delta) {