Compare commits

...

6 commits

Author SHA1 Message Date
KebsCS b6fc318d4f
Merge 8aa8c4ee01 into 0f12044fcd 2024-09-15 05:48:51 -05:00
Dennis Felsing 0f12044fcd
Merge pull request #8956 from Robyt3/UI-Scrollbar-Rail-HotItem
Fix scrollbar rail clicking being active while popups open
2024-09-15 10:21:41 +00:00
Robert Müller 8f2c288698 Fix scrollbar rail clicking being active while popups open
Scrollbars are now also set as the hot item when the rail is hovered and the rail clicking function is now only enabled for the scrollbar that is the hot item.

Closes #8954.
2024-09-15 11:45:22 +02:00
Dennis Felsing 4b6f2e22a8
Merge pull request #8955 from furo321/url-master-parsing
Don't allow URLs without port from the masterserver
2024-09-15 09:28:43 +00:00
furo 7bbd51cf73 Don't allow URLs without port from the masterserver 2024-09-15 11:04:48 +02:00
KebsCS 8aa8c4ee01
Fix clan nameplate alignment 2024-09-15 02:32:58 +02:00
3 changed files with 31 additions and 20 deletions

View file

@ -424,7 +424,10 @@ void CServerBrowserHttp::Refresh()
} }
bool ServerbrowserParseUrl(NETADDR *pOut, const char *pUrl) 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) bool CServerBrowserHttp::Validate(json_value *pJson)
{ {

View file

@ -172,10 +172,12 @@ void CNamePlates::RenderNameplate(vec2 Position, const CNetObj_PlayerInfo *pPlay
if(g_Config.m_ClNameplatesClan) if(g_Config.m_ClNameplatesClan)
{ {
YOffset -= FontSizeClan;
if(NamePlate.m_ClanTextContainerIndex.Valid()) if(NamePlate.m_ClanTextContainerIndex.Valid())
{
YOffset -= FontSizeClan;
TextRender()->RenderTextContainer(NamePlate.m_ClanTextContainerIndex, TColor, TOutlineColor, Position.x - TextRender()->GetBoundingBoxTextContainer(NamePlate.m_ClanTextContainerIndex).m_W / 2.0f, YOffset); TextRender()->RenderTextContainer(NamePlate.m_ClanTextContainerIndex, TColor, TOutlineColor, Position.x - TextRender()->GetBoundingBoxTextContainer(NamePlate.m_ClanTextContainerIndex).m_W / 2.0f, YOffset);
} }
}
if(g_Config.m_ClNameplatesFriendMark && ClientData.m_Friend) if(g_Config.m_ClNameplatesFriendMark && ClientData.m_Friend)
{ {

View file

@ -1300,6 +1300,8 @@ float CUi::DoScrollbarV(const void *pId, const CUIRect *pRect, float Current)
} }
} }
else if(HotItem() == pId) else if(HotItem() == pId)
{
if(InsideHandle)
{ {
if(MouseButton(0)) if(MouseButton(0))
{ {
@ -1308,14 +1310,15 @@ float CUi::DoScrollbarV(const void *pId, const CUIRect *pRect, float Current)
Grabbed = true; Grabbed = true;
} }
} }
else if(MouseButtonClicked(0) && !InsideHandle && InsideRail) else if(MouseButtonClicked(0))
{ {
SetActiveItem(pId); SetActiveItem(pId);
m_ActiveScrollbarOffset = Handle.h / 2.0f; m_ActiveScrollbarOffset = Handle.h / 2.0f;
Grabbed = true; Grabbed = true;
} }
}
if(InsideHandle && !MouseButton(0)) if(InsideRail && !MouseButton(0))
{ {
SetHotItem(pId); SetHotItem(pId);
} }
@ -1379,6 +1382,8 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
} }
} }
else if(HotItem() == pId) else if(HotItem() == pId)
{
if(InsideHandle)
{ {
if(MouseButton(0)) if(MouseButton(0))
{ {
@ -1387,12 +1392,13 @@ float CUi::DoScrollbarH(const void *pId, const CUIRect *pRect, float Current, co
Grabbed = true; Grabbed = true;
} }
} }
else if(MouseButtonClicked(0) && !InsideHandle && InsideRail) else if(MouseButtonClicked(0))
{ {
SetActiveItem(pId); SetActiveItem(pId);
m_ActiveScrollbarOffset = Handle.w / 2.0f; m_ActiveScrollbarOffset = Handle.w / 2.0f;
Grabbed = true; Grabbed = true;
} }
}
if(!pColorInner && (InsideHandle || Grabbed) && (CheckActiveItem(pId) || HotItem() == pId)) 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; Handle.y -= 1.5f;
} }
if(InsideHandle && !MouseButton(0)) if(InsideRail && !MouseButton(0))
{ {
SetHotItem(pId); SetHotItem(pId);
} }