diff options
| author | Jakob Fries <jakob.fries@gmail.com> | 2007-07-28 17:55:50 +0000 |
|---|---|---|
| committer | Jakob Fries <jakob.fries@gmail.com> | 2007-07-28 17:55:50 +0000 |
| commit | 7187e692e721fb5752303c2426d35866f2d7b11e (patch) | |
| tree | 608c74c1ecec6df1408dc27ed190f08a5e823cf3 /src/game/client/menu.cpp | |
| parent | e6d5379a7240909dda863260bfef59503c9835a8 (diff) | |
| download | zcatch-7187e692e721fb5752303c2426d35866f2d7b11e.tar.gz zcatch-7187e692e721fb5752303c2426d35866f2d7b11e.zip | |
editbox is now even easier to edit
Diffstat (limited to 'src/game/client/menu.cpp')
| -rw-r--r-- | src/game/client/menu.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/game/client/menu.cpp b/src/game/client/menu.cpp index 04806fbe..133c5fb5 100644 --- a/src/game/client/menu.cpp +++ b/src/game/client/menu.cpp @@ -452,14 +452,13 @@ int ui_do_edit_box(void *id, float x, float y, float w, float h, char *str, int } } - if (k == input::backspace) + if (k == input::backspace && at_index > 0) { - if (at_index > 0) - { - memmove(str + at_index - 1, str + at_index, len - at_index + 1); - at_index--; - } + memmove(str + at_index - 1, str + at_index, len - at_index + 1); + at_index--; } + else if (k == input::delet && at_index < len) + memmove(str + at_index, str + at_index + 1, len - at_index); else if (k == input::enter) ui_clear_last_active_item(); else if (k == input::left && at_index > 0) |