mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Compare commits
4 commits
dcd02b50bb
...
0f12044fcd
Author | SHA1 | Date | |
---|---|---|---|
0f12044fcd | |||
8f2c288698 | |||
4b6f2e22a8 | |||
7bbd51cf73 |
|
@ -424,7 +424,10 @@ void CServerBrowserHttp::Refresh()
|
|||
}
|
||||
bool ServerbrowserParseUrl(NETADDR *pOut, const char *pUrl)
|
||||
{
|
||||
return net_addr_from_url(pOut, pUrl, nullptr, 0) != 0;
|
||||
int Failure = net_addr_from_url(pOut, pUrl, nullptr, 0);
|
||||
if(Failure || pOut->port == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
bool CServerBrowserHttp::Validate(json_value *pJson)
|
||||
{
|
||||
|
|
|
@ -1301,21 +1301,24 @@ float CUi::DoScrollbarV(const void *pId, const CUIRect *pRect, float Current)
|
|||
}
|
||||
else if(HotItem() == pId)
|
||||
{
|
||||
if(MouseButton(0))
|
||||
if(InsideHandle)
|
||||
{
|
||||
if(MouseButton(0))
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = MouseY() - Handle.y;
|
||||
Grabbed = true;
|
||||
}
|
||||
}
|
||||
else if(MouseButtonClicked(0))
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = MouseY() - Handle.y;
|
||||
m_ActiveScrollbarOffset = Handle.h / 2.0f;
|
||||
Grabbed = true;
|
||||
}
|
||||
}
|
||||
else if(MouseButtonClicked(0) && !InsideHandle && InsideRail)
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = Handle.h / 2.0f;
|
||||
Grabbed = true;
|
||||
}
|
||||
|
||||
if(InsideHandle && !MouseButton(0))
|
||||
if(InsideRail && !MouseButton(0))
|
||||
{
|
||||
SetHotItem(pId);
|
||||
}
|
||||
|
@ -1380,19 +1383,22 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
|
|||
}
|
||||
else if(HotItem() == pId)
|
||||
{
|
||||
if(MouseButton(0))
|
||||
if(InsideHandle)
|
||||
{
|
||||
if(MouseButton(0))
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = MouseX() - Handle.x;
|
||||
Grabbed = true;
|
||||
}
|
||||
}
|
||||
else if(MouseButtonClicked(0))
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = MouseX() - Handle.x;
|
||||
m_ActiveScrollbarOffset = Handle.w / 2.0f;
|
||||
Grabbed = true;
|
||||
}
|
||||
}
|
||||
else if(MouseButtonClicked(0) && !InsideHandle && InsideRail)
|
||||
{
|
||||
SetActiveItem(pId);
|
||||
m_ActiveScrollbarOffset = Handle.w / 2.0f;
|
||||
Grabbed = true;
|
||||
}
|
||||
|
||||
if(!pColorInner && (InsideHandle || Grabbed) && (CheckActiveItem(pId) || HotItem() == pId))
|
||||
{
|
||||
|
@ -1400,7 +1406,7 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
|
|||
Handle.y -= 1.5f;
|
||||
}
|
||||
|
||||
if(InsideHandle && !MouseButton(0))
|
||||
if(InsideRail && !MouseButton(0))
|
||||
{
|
||||
SetHotItem(pId);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue