about summary refs log tree commit diff
path: root/src/game/client/menu.cpp
diff options
context:
space:
mode:
authorJakob Fries <jakob.fries@gmail.com>2007-07-28 17:55:50 +0000
committerJakob Fries <jakob.fries@gmail.com>2007-07-28 17:55:50 +0000
commit7187e692e721fb5752303c2426d35866f2d7b11e (patch)
tree608c74c1ecec6df1408dc27ed190f08a5e823cf3 /src/game/client/menu.cpp
parente6d5379a7240909dda863260bfef59503c9835a8 (diff)
downloadzcatch-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.cpp11
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)