From: terencehill Date: Sat, 21 Jan 2012 21:54:07 +0000 (+0100) Subject: After a menu item has lost the focus by pressing TAB, put the focus again on that... X-Git-Tag: xonotic-v0.7.0~55^2~14^2~2 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=48ac91f6da68bc9bf9ee0f0b0d53d9f7c1787333 After a menu item has lost the focus by pressing TAB, put the focus again on that item on mouse move --- diff --git a/qcsrc/menu/item/inputcontainer.c b/qcsrc/menu/item/inputcontainer.c index e1b14d3b16..f1529752e1 100644 --- a/qcsrc/menu/item/inputcontainer.c +++ b/qcsrc/menu/item/inputcontainer.c @@ -134,6 +134,8 @@ float InputContainer_mouseDrag(entity me, vector pos) } float InputContainer_mouseMove(entity me, vector pos) { + if(me.mouseFocusedChild != me.focusedChild) // if the keyboard moved the focus away + me.mouseFocusedChild = NULL; // force focusing if(me._changeFocusXY(me, pos)) if(SUPER(InputContainer).mouseMove(me, pos)) return 1; diff --git a/qcsrc/menu/item/nexposee.c b/qcsrc/menu/item/nexposee.c index 02f1224252..ef4b17d0ea 100644 --- a/qcsrc/menu/item/nexposee.c +++ b/qcsrc/menu/item/nexposee.c @@ -263,7 +263,7 @@ float Nexposee_mouseMove(entity me, vector pos) if(me.animationState == 0) { if(me.mouseFocusedChild) - if(me.mouseFocusedChild != e) + if(me.mouseFocusedChild != e || me.mouseFocusedChild != me.selectedChild) me.selectedChild = me.mouseFocusedChild; return 1; } diff --git a/qcsrc/menu/xonotic/charmap.c b/qcsrc/menu/xonotic/charmap.c index 0e375c9cc4..6966aaf481 100644 --- a/qcsrc/menu/xonotic/charmap.c +++ b/qcsrc/menu/xonotic/charmap.c @@ -64,7 +64,7 @@ float XonoticCharmap_mouseMove(entity me, vector coords) return 0; } c = y * 16 + x; - if(c != me.mouseSelectedCharacterCell) + if(c != me.mouseSelectedCharacterCell || me.mouseSelectedCharacterCell != me.selectedCharacterCell) me.mouseSelectedCharacterCell = me.selectedCharacterCell = c; return 1; }