From 210d98666ca63c671c22b6a835392978adad5a0c Mon Sep 17 00:00:00 2001 From: PsychoGod Date: Tue, 10 May 2011 20:16:22 +0300 Subject: [PATCH] Scroll fix, protect scrolling 2 windows at the same time --- src/game/client/components/menus_browser.cpp | 4 ++-- src/game/client/components/menus_demo.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 1245a50bf..09c8c4943 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -154,9 +154,9 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) int ScrollNum = NumServers-Num+1; if(ScrollNum > 0) { - if(Input()->KeyPresses(KEY_MOUSE_WHEEL_UP)) + if(Input()->KeyPresses(KEY_MOUSE_WHEEL_UP) && UI()->MouseInside(&View)) s_ScrollValue -= 3.0f/ScrollNum; - if(Input()->KeyPresses(KEY_MOUSE_WHEEL_DOWN)) + if(Input()->KeyPresses(KEY_MOUSE_WHEEL_DOWN) && UI()->MouseInside(&View)) s_ScrollValue += 3.0f/ScrollNum; } else diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 7f2a7186e..1539f3a67 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -289,9 +289,9 @@ void CMenus::UiDoListboxStart(const void *pID, const CUIRect *pRect, float RowHe Num = 0; if(Num > 0) { - if(Input()->KeyPresses(KEY_MOUSE_WHEEL_UP)) + if(Input()->KeyPresses(KEY_MOUSE_WHEEL_UP) && UI()->MouseInside(&View)) gs_ListBoxScrollValue -= 3.0f/Num; - if(Input()->KeyPresses(KEY_MOUSE_WHEEL_DOWN)) + if(Input()->KeyPresses(KEY_MOUSE_WHEEL_DOWN) && UI()->MouseInside(&View)) gs_ListBoxScrollValue += 3.0f/Num; if(gs_ListBoxScrollValue < 0.0f) gs_ListBoxScrollValue = 0.0f;