projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added some performance tuning for "autotest" and warp mode
[rocksndiamonds.git]
/
src
/
libgame
/
gadgets.c
diff --git
a/src/libgame/gadgets.c
b/src/libgame/gadgets.c
index ce939a75de69cbad9d507d3a0a34f6c8cc1a422d..6b7d2592f435849b3bd8fb0f8798227278a18ca7 100644
(file)
--- a/
src/libgame/gadgets.c
+++ b/
src/libgame/gadgets.c
@@
-1605,6
+1605,8
@@
boolean HandleGadgets(int mx, int my, int button)
if (gadget_pressed_inside_select_line)
new_gi = NULL;
if (gadget_pressed_inside_select_line)
new_gi = NULL;
+
+ StopTextInput();
}
gadget_pressed =
}
gadget_pressed =
@@
-1706,6
+1708,9
@@
boolean HandleGadgets(int mx, int my, int button)
if (gi->textinput.cursor_position != old_cursor_position)
DrawGadget(gi, DG_PRESSED, gi->direct_draw);
if (gi->textinput.cursor_position != old_cursor_position)
DrawGadget(gi, DG_PRESSED, gi->direct_draw);
+
+ if (press_event)
+ StartTextInput(gi->x, gi->y, gi->width, gi->height);
}
else if (gi->type & GD_TYPE_TEXT_AREA && button != 0 && !motion_status)
{
}
else if (gi->type & GD_TYPE_TEXT_AREA && button != 0 && !motion_status)
{
@@
-1720,6
+1725,9
@@
boolean HandleGadgets(int mx, int my, int button)
if (gi->textarea.cursor_position != old_cursor_position)
DrawGadget(gi, DG_PRESSED, gi->direct_draw);
if (gi->textarea.cursor_position != old_cursor_position)
DrawGadget(gi, DG_PRESSED, gi->direct_draw);
+
+ if (press_event)
+ StartTextInput(gi->x, gi->y, gi->width, gi->height);
}
else if (gi->type & GD_TYPE_SELECTBOX && gi->selectbox.open &&
!keep_selectbox_open)
}
else if (gi->type & GD_TYPE_SELECTBOX && gi->selectbox.open &&
!keep_selectbox_open)
@@
-1750,7
+1758,7
@@
boolean HandleGadgets(int mx, int my, int button)
new_gi->event.type = GD_EVENT_INFO_ENTERING;
new_gi->callback_info(new_gi);
}
new_gi->event.type = GD_EVENT_INFO_ENTERING;
new_gi->callback_info(new_gi);
}
- else if (last_info_gi != NULL)
+ else if (last_info_gi != NULL
&& last_info_gi->mapped
)
{
last_info_gi->event.type = GD_EVENT_INFO_LEAVING;
last_info_gi->callback_info(last_info_gi);
{
last_info_gi->event.type = GD_EVENT_INFO_LEAVING;
last_info_gi->callback_info(last_info_gi);
@@
-2082,7
+2090,11
@@
boolean HandleGadgetsKeyInput(Key key)
gi->type & GD_TYPE_SELECTBOX))
return FALSE;
gi->type & GD_TYPE_SELECTBOX))
return FALSE;
- if (key == KSYM_Return) /* valid for both text input and selectbox */
+ if (key == KSYM_Escape)
+ {
+ StopTextInput();
+ }
+ else if (key == KSYM_Return) /* valid for both text input and selectbox */
{
boolean gadget_changed = ((gi->event_mask & GD_EVENT_TEXT_RETURN) != 0);
{
boolean gadget_changed = ((gi->event_mask & GD_EVENT_TEXT_RETURN) != 0);
@@
-2094,6
+2106,8
@@
boolean HandleGadgetsKeyInput(Key key)
strcpy(gi->textinput.last_value, gi->textinput.value);
else
gadget_changed = FALSE;
strcpy(gi->textinput.last_value, gi->textinput.value);
else
gadget_changed = FALSE;
+
+ StopTextInput();
}
else if (gi->type & GD_TYPE_SELECTBOX)
{
}
else if (gi->type & GD_TYPE_SELECTBOX)
{