Scroll fix, protect scrolling 2 windows at the same time

This commit is contained in:
PsychoGod 2011-05-10 20:16:22 +03:00 committed by oy
parent 896ef2f235
commit 210d98666c
2 changed files with 4 additions and 4 deletions

View file

@ -154,9 +154,9 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
int ScrollNum = NumServers-Num+1; int ScrollNum = NumServers-Num+1;
if(ScrollNum > 0) 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; 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; s_ScrollValue += 3.0f/ScrollNum;
} }
else else

View file

@ -289,9 +289,9 @@ void CMenus::UiDoListboxStart(const void *pID, const CUIRect *pRect, float RowHe
Num = 0; Num = 0;
if(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; 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; gs_ListBoxScrollValue += 3.0f/Num;
if(gs_ListBoxScrollValue < 0.0f) gs_ListBoxScrollValue = 0.0f; if(gs_ListBoxScrollValue < 0.0f) gs_ListBoxScrollValue = 0.0f;