Decompile fn_17789 (TextInputBuffer::AdvanceCursor)
Batch #1387 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_17789 TextInputBuffer::AdvanceCursor: logic confirmed by peer review Peer-reviewed-by: Yommy Reviewed-by: ragnarok-clanker
This commit is contained in:
parent
359512c225
commit
4595841b32
1 changed files with 20 additions and 1 deletions
|
|
@ -209,8 +209,27 @@ void TextInputBuffer::MoveForward(unsigned codePage) {
|
|||
this->cursor = static_cast<int>(CharNextExA(static_cast<WORD>(codePage), begin + position, 0) - begin);
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00ACE5E0
|
||||
// FUNCTION: fn_17789
|
||||
void TextInputBuffer::AdvanceCursor(int delta) {
|
||||
const unsigned length = static_cast<unsigned>(this->text.size());
|
||||
unsigned cursor = static_cast<unsigned>(this->cursor);
|
||||
if (cursor == length) {
|
||||
return;
|
||||
}
|
||||
if (cursor > length) {
|
||||
this->cursor = static_cast<int>(length);
|
||||
} else {
|
||||
unsigned next = cursor + static_cast<unsigned>(delta);
|
||||
if (next <= length) {
|
||||
this->cursor = static_cast<int>(next);
|
||||
}
|
||||
}
|
||||
if ((static_cast<unsigned short>(GetKeyState(VK_SHIFT)) >> 8) == 0) {
|
||||
this->anchor = this->cursor;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00ACE620
|
||||
// FUNCTION: fn_17790
|
||||
void TextInputBuffer::RetreatCursor(int delta) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue