diff options
Diffstat (limited to 'src/client/ui/ui.c')
-rw-r--r-- | src/client/ui/ui.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/client/ui/ui.c b/src/client/ui/ui.c index 29da482..89c3fd9 100644 --- a/src/client/ui/ui.c +++ b/src/client/ui/ui.c @@ -142,6 +142,7 @@ void UI_ForceMenuOff(void) Key_SetDest(Key_GetDest() & ~KEY_MENU); uis.menuDepth = 0; uis.activeMenu = NULL; + uis.mouseTracker = NULL; uis.transparent = qfalse; } @@ -169,6 +170,7 @@ void UI_PopMenu(void) } uis.activeMenu = uis.layers[uis.menuDepth - 1]; + uis.mouseTracker = NULL; uis.transparent = qfalse; for (i = uis.menuDepth - 1; i >= 0; i--) { @@ -384,9 +386,14 @@ qboolean UI_DoHitTest(void) return qfalse; } - if (!(item = Menu_HitTest(uis.activeMenu))) { - return qfalse; + if (uis.mouseTracker) { + item = uis.mouseTracker; + } else { + if (!(item = Menu_HitTest(uis.activeMenu))) { + return qfalse; + } } + if (!UI_IsItemSelectable(item)) { return qfalse; } @@ -511,10 +518,10 @@ void UI_StartSound(menuSound_t sound) /* ================= -UI_Keydown +UI_KeyEvent ================= */ -void UI_Keydown(int key) +void UI_KeyEvent(int key, qboolean down) { menuSound_t sound; @@ -522,6 +529,13 @@ void UI_Keydown(int key) return; } + if (!down) { + if (key == K_MOUSE1) { + uis.mouseTracker = NULL; + } + return; + } + sound = Menu_Keydown(uis.activeMenu, key); UI_StartSound(sound); |