mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed so that the scrollwheel works in the server browser
This commit is contained in:
parent
f3a60b6df9
commit
e988e3c161
|
@ -987,6 +987,18 @@ static void menu2_render_serverbrowser(RECT main_view)
|
|||
ui2_hmargin(&scroll, 5.0f, &scroll);
|
||||
scrollvalue = ui2_do_scrollbar_v(&scrollbar, &scroll, scrollvalue);
|
||||
|
||||
int scrollnum = num_servers-num;
|
||||
if(scrollnum > 0)
|
||||
{
|
||||
if(inp_key_presses(KEY_MOUSE_WHEEL_UP))
|
||||
scrollvalue -= 1.0f/scrollnum;
|
||||
if(inp_key_presses(KEY_MOUSE_WHEEL_DOWN))
|
||||
scrollvalue += 1.0f/scrollnum;
|
||||
|
||||
if(scrollvalue < 0) scrollvalue = 0;
|
||||
if(scrollvalue > 1) scrollvalue = 1;
|
||||
}
|
||||
|
||||
int start = (int)((num_servers-num)*scrollvalue);
|
||||
if(start < 0)
|
||||
start = 0;
|
||||
|
|
Loading…
Reference in a new issue