diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-06-13 08:22:37 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-06-13 08:22:37 +0000 |
| commit | 69511102de9b0f3ec6ad555baf2a01d9ee1c3dfd (patch) | |
| tree | ebef66e5ab0cfd16e96026d8ac8d5a708eb68219 /src/game/editor/ed_editor.cpp | |
| parent | 9254ca61f1e459cbaf137ce4511332365da9c225 (diff) | |
| download | zcatch-69511102de9b0f3ec6ad555baf2a01d9ee1c3dfd.tar.gz zcatch-69511102de9b0f3ec6ad555baf2a01d9ee1c3dfd.zip | |
improved the font system even futher. utf8 is now used everywhere. it uses less memory as well
Diffstat (limited to 'src/game/editor/ed_editor.cpp')
| -rw-r--r-- | src/game/editor/ed_editor.cpp | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp index 7a8a1ae7..d56a0506 100644 --- a/src/game/editor/ed_editor.cpp +++ b/src/game/editor/ed_editor.cpp @@ -18,6 +18,7 @@ extern "C" { #include <game/client/render.hpp> #include "ed_editor.hpp" +#include <game/client/lineinput.hpp> static int checker_texture = 0; static int background_texture = 0; @@ -209,44 +210,7 @@ int ui_do_edit_box(void *id, const RECT *rect, char *str, int str_size, float fo for(int i = 0; i < inp_num_events(); i++) { len = strlen(str); - - INPUT_EVENT e = inp_get_event(i); - char c = e.ch; - int k = e.key; - - if (at_index > len) - at_index = len; - - if (!(c >= 0 && c < 32) && c != 127) - { - if (len < str_size - 1 && at_index < str_size - 1) - { - memmove(str + at_index + 1, str + at_index, len - at_index + 1); - str[at_index] = c; - at_index++; - } - } - - if(e.flags&INPFLAG_PRESS) - { - if (k == KEY_BACKSPACE && at_index > 0) - { - memmove(str + at_index - 1, str + at_index, len - at_index + 1); - at_index--; - } - else if (k == KEY_DELETE && at_index < len) - memmove(str + at_index, str + at_index + 1, len - at_index); - else if (k == KEY_RETURN) - ui_clear_last_active_item(); - else if (k == KEY_LEFT && at_index > 0) - at_index--; - else if (k == KEY_RIGHT && at_index < len) - at_index++; - else if (k == KEY_HOME) - at_index = 0; - else if (k == KEY_END) - at_index = len; - } + LINEINPUT::manipulate(inp_get_event(i), str, str_size, &len, &at_index); } r = 1; |