2525#include " menus.h"
2626
2727CMenus::CColumn CMenus::ms_aBrowserCols[] = { // Localize("Server"); Localize("Type"); Localize("Map"); Localize("Players"); Localize("Ping"); - these strings are localized within CLocConstString
28- {COL_BROWSER_FLAG, -1 , " " , -1 , 4 *16 .0f +3 *2 .0f , 0 , {0 }, {0 }, TEXTALIGN_CENTER},
28+ {COL_BROWSER_FLAG, -1 , " " , -1 , 3 *16 .0f +3 *2 .0f , 0 , {0 }, {0 }, TEXTALIGN_CENTER},
2929 {COL_BROWSER_NAME, IServerBrowser::SORT_NAME, " Server" , 0 , 310 .0f , 0 , {0 }, {0 }, TEXTALIGN_CENTER},
3030 {COL_BROWSER_GAMETYPE, IServerBrowser::SORT_GAMETYPE, " Type" , 1 , 70 .0f , 0 , {0 }, {0 }, TEXTALIGN_CENTER},
3131 {COL_BROWSER_MAP, IServerBrowser::SORT_MAP, " Map" , 1 , 100 .0f , 0 , {0 }, {0 }, TEXTALIGN_CENTER},
3232 {COL_BROWSER_PLAYERS, IServerBrowser::SORT_NUMPLAYERS, " Players" , 1 , 50 .0f , 0 , {0 }, {0 }, TEXTALIGN_CENTER},
33- {COL_BROWSER_PING, IServerBrowser::SORT_PING, " Ping" , 1 , 40 .0f , 0 , {0 }, {0 }, TEXTALIGN_CENTER},
33+ {COL_BROWSER_PING, IServerBrowser::SORT_PING, " Ping" , 1 , 30 .0f , 0 , {0 }, {0 }, TEXTALIGN_CENTER},
3434};
3535
3636CServerFilterInfo CMenus::CBrowserFilter::ms_FilterStandard = {IServerBrowser::FILTER_COMPAT_VERSION|IServerBrowser::FILTER_PURE|IServerBrowser::FILTER_PURE_MAP, 999 , -1 , 0 , {{0 }}, {0 }, {0 }};
@@ -522,11 +522,6 @@ int CMenus::DoBrowserEntry(const void *pID, CUIRect View, const CServerInfo *pEn
522522 UI ()->DoTooltip (&pEntry->m_Flags , &Icon, Localize (" This server is protected by a password." ));
523523 }
524524
525- Rect.VSplitLeft (Rect.h , &Icon, &Rect);
526- Icon.Margin (2 .0f , &Icon);
527- DoIcon (IMAGE_LEVELICONS, s_aDifficultySpriteIds[pEntry->m_ServerLevel ], &Icon);
528- UI ()->DoTooltip (&pEntry->m_ServerLevel , &Icon, s_aDifficultyLabels[pEntry->m_ServerLevel ]);
529-
530525 Rect.VSplitLeft (Rect.h , &Icon, &Rect);
531526 Icon.Margin (2 .0f , &Icon);
532527 DoIcon (IMAGE_BROWSEICONS, pEntry->m_Favorite ? SPRITE_BROWSE_STAR_A : SPRITE_BROWSE_STAR_B, &Icon);
@@ -655,6 +650,7 @@ int CMenus::DoBrowserEntry(const void *pID, CUIRect View, const CServerInfo *pEn
655650 CUIRect Icon;
656651 Button.VSplitLeft (Button.h , &Icon, &Button);
657652 Icon.y -= 0 .5f ;
653+ Icon.Margin (1 .6f , &Icon);
658654 DoGameIcon (pEntry->m_aGameType , &Icon);
659655
660656 // gametype text
@@ -876,7 +872,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
876872 }
877873
878874 // list background
879- View.Draw (vec4 (0 .0f , 0 .0f , 0 .0f , 0 .25f ), 5 .0f , CUIRect::CORNER_L);
875+ View.Draw (vec4 (0 .0f , 0 .0f , 0 .0f , 0 .25f ), 0 .0f , CUIRect::CORNER_L);
880876 {
881877 int Column = COL_BROWSER_PING;
882878 switch (Config ()->m_BrSort )
@@ -898,7 +894,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
898894 CUIRect Rect = View;
899895 Rect.x = CMenus::ms_aBrowserCols[Column].m_Rect .x ;
900896 Rect.w = CMenus::ms_aBrowserCols[Column].m_Rect .w ;
901- Rect.Draw (vec4 (0 .0f , 0 .0f , 0 .0f , 0 .05f ) );
897+ Rect.Draw (vec4 (0 .0f , 0 .0f , 0 .0f , 0 .20f ), 0 . 0f );
902898 }
903899
904900 // update selection based on address if it changed
@@ -1224,7 +1220,6 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
12241220 if (ServerBrowser ()->IsRefreshing () && m_ActivePage != PAGE_LAN)
12251221 {
12261222 char aBuf[128 ];
1227- Status.HSplitTop (ButtonHeight + SpacingH, 0 , &Status);
12281223 str_format (aBuf, sizeof (aBuf), Localize (" %d%% loaded" ), ServerBrowser ()->LoadingProgression ());
12291224 UI ()->DoLabel (&Status, aBuf, 14 .0f , TEXTALIGN_MC);
12301225 }
@@ -1327,7 +1322,7 @@ void CMenus::RenderServerbrowserFriendTab(CUIRect View)
13271322 CUIRect BottomArea;
13281323 const float FontSize = 10 .0f ;
13291324 static bool s_ListExtended[NUM_FRIEND_TYPES] = { 1 , 1 , 0 };
1330- static vec3 s_ListColor[NUM_FRIEND_TYPES] = { vec3 (0 .5f , 1 . 0f , 0 .5f ), vec3 (0 .4f , 0 .4f , 1 .0f ), vec3 (1 . 0f , 0 .5f , 0 .5f ) };
1325+ static vec3 s_ListColor[NUM_FRIEND_TYPES] = { vec3 (0 .06f , 0 . 7f , 0 .2f ), vec3 (0 .2f , 0 .5f , 1 .0f ), vec3 (0 . 6f , 0 .1f , 0 .1f ) };
13311326 const float HeaderHeight = UI ()->GetListHeaderHeight ();
13321327 const float SpacingH = 2 .0f ;
13331328
@@ -1425,7 +1420,7 @@ void CMenus::RenderServerbrowserFriendTab(CUIRect View)
14251420 bool ButtonResult = UI ()->DoButtonLogic (&(s_aFriendButtons[ButtonId%20 ]), &Rect);
14261421 if (m_lFriendList[i][f].m_pServerInfo )
14271422 UI ()->DoTooltip (&(s_aFriendButtons[ButtonId%20 ]), &Rect, Localize (" Double click to join your friend." ));
1428- Rect.Draw (vec4 (s_ListColor[i].r , s_ListColor[i].g , s_ListColor[i].b , Inside ? 0 .5f : 0 .3f ));
1423+ Rect.Draw (vec4 (s_ListColor[i].r , s_ListColor[i].g , s_ListColor[i].b , Inside ? 0 .8f : 0 .5f ));
14291424 Rect.Margin (2 .0f , &Rect);
14301425 Rect.VSplitRight (50 .0f , &Rect, &Icon);
14311426
@@ -1598,55 +1593,55 @@ void CMenus::RenderServerbrowserFilterTab(CUIRect View)
15981593
15991594 // server filter
16001595 ServerFilter.HSplitTop (UI ()->GetListHeaderHeight (), &FilterHeader, &ServerFilter);
1601- FilterHeader.Draw (vec4 (1 , 1 , 1 , 0 .25f ), 4 .0f , CUIRect::CORNER_T );
1602- ServerFilter.Draw (vec4 (0 , 0 , 0 , 0 .15f ), 4 .0f , CUIRect::CORNER_B );
1596+ FilterHeader.Draw (vec4 (0 , 0 , 0 , 0 .0f ), 4 .0f );
1597+ ServerFilter.Draw (vec4 (0 , 0 , 0 , 0 .35f ), 8 .0f );
16031598 UI ()->DoLabel (&FilterHeader, Localize (" Server filter" ), FontSize + 2 .0f , TEXTALIGN_MC);
16041599
16051600 int NewSortHash = FilterInfo.m_SortHash ;
16061601 ServerFilter.HSplitTop (LineSize, &Button, &ServerFilter);
16071602 static int s_BrFilterEmpty = 0 ;
1608- if (DoButton_CheckBox (&s_BrFilterEmpty, Localize (" Has people playing" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_EMPTY, &Button))
1603+ if (DoButton_CheckBox (&s_BrFilterEmpty, Localize (" Has people playing" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_EMPTY, &Button, false , true ))
16091604 NewSortHash ^= IServerBrowser::FILTER_EMPTY;
16101605
16111606 ServerFilter.HSplitTop (LineSize, &Button, &ServerFilter);
16121607 static int s_BrFilterSpectators = 0 ;
1613- if (DoButton_CheckBox (&s_BrFilterSpectators, Localize (" Count players only" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_SPECTATORS, &Button))
1608+ if (DoButton_CheckBox (&s_BrFilterSpectators, Localize (" Count players only" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_SPECTATORS, &Button, false , true ))
16141609 NewSortHash ^= IServerBrowser::FILTER_SPECTATORS;
16151610
16161611 ServerFilter.HSplitTop (LineSize, &Button, &ServerFilter);
16171612 static int s_BrFilterFull = 0 ;
1618- if (DoButton_CheckBox (&s_BrFilterFull, Localize (" Server not full" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_FULL, &Button))
1613+ if (DoButton_CheckBox (&s_BrFilterFull, Localize (" Server not full" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_FULL, &Button, false , true ))
16191614 NewSortHash ^= IServerBrowser::FILTER_FULL;
16201615
16211616 ServerFilter.HSplitTop (LineSize, &Button, &ServerFilter);
16221617 static int s_BrFilterFriends = 0 ;
1623- if (DoButton_CheckBox (&s_BrFilterFriends, Localize (" Show friends only" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_FRIENDS, &Button))
1618+ if (DoButton_CheckBox (&s_BrFilterFriends, Localize (" Show friends only" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_FRIENDS, &Button, false , true ))
16241619 NewSortHash ^= IServerBrowser::FILTER_FRIENDS;
16251620
16261621 ServerFilter.HSplitTop (LineSize, &Button, &ServerFilter);
16271622 static int s_BrFilterBots = 0 ;
1628- if (DoButton_CheckBox (&s_BrFilterBots, Localize (" Hide bots" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_BOTS, &Button))
1623+ if (DoButton_CheckBox (&s_BrFilterBots, Localize (" Hide bots" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_BOTS, &Button, false , true ))
16291624 NewSortHash ^= IServerBrowser::FILTER_BOTS;
16301625
16311626 ServerFilter.HSplitTop (LineSize, &Button, &ServerFilter);
16321627 static int s_BrFilterPw = 0 ;
1633- if (DoButton_CheckBox (&s_BrFilterPw, Localize (" No password" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_PW, &Button))
1628+ if (DoButton_CheckBox (&s_BrFilterPw, Localize (" No password" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_PW, &Button, false , true ))
16341629 NewSortHash ^= IServerBrowser::FILTER_PW;
16351630
16361631 ServerFilter.HSplitTop (LineSize, &Button, &ServerFilter);
16371632 static int s_BrFilterCompatversion = 0 ;
1638- if (DoButton_CheckBox (&s_BrFilterCompatversion, Localize (" Compatible version" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_COMPAT_VERSION, &Button))
1633+ if (DoButton_CheckBox (&s_BrFilterCompatversion, Localize (" Compatible version" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_COMPAT_VERSION, &Button, false , true ))
16391634 NewSortHash ^= IServerBrowser::FILTER_COMPAT_VERSION;
16401635
16411636 ServerFilter.HSplitTop (LineSize, &Button, &ServerFilter);
16421637 const bool Locked = pFilter->Custom () == CBrowserFilter::FILTER_STANDARD;
16431638 static int s_BrFilterPure = 0 ;
1644- if (DoButton_CheckBox (&s_BrFilterPure, Localize (" Standard gametype" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_PURE, &Button, Locked))
1639+ if (DoButton_CheckBox (&s_BrFilterPure, Localize (" Standard gametype" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_PURE, &Button, Locked, true ))
16451640 NewSortHash ^= IServerBrowser::FILTER_PURE;
16461641
16471642 ServerFilter.HSplitTop (LineSize, &Button, &ServerFilter);
16481643 static int s_BrFilterPureMap = 0 ;
1649- if (DoButton_CheckBox (&s_BrFilterPureMap, Localize (" Standard map" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_PURE_MAP, &Button))
1644+ if (DoButton_CheckBox (&s_BrFilterPureMap, Localize (" Standard map" ), FilterInfo.m_SortHash &IServerBrowser::FILTER_PURE_MAP, &Button, false , true ))
16501645 NewSortHash ^= IServerBrowser::FILTER_PURE_MAP;
16511646
16521647 bool UpdateFilter = false ;
@@ -1914,8 +1909,8 @@ void CMenus::RenderDetailInfo(CUIRect View, const CServerInfo *pInfo, const vec4
19141909
19151910 CUIRect ServerHeader;
19161911 View.HSplitTop (UI ()->GetListHeaderHeight (), &ServerHeader, &View);
1917- ServerHeader.Draw (vec4 (1 , 1 , 1 , 0 .25f ), 5 .0f , CUIRect::CORNER_T );
1918- View.Draw (vec4 (0 , 0 , 0 , 0 .15f ), 5 .0f , CUIRect::CORNER_B );
1912+ ServerHeader.Draw (vec4 (0 , 0 , 0 , 0 .0f ), 5 .0f );
1913+ View.Draw (vec4 (0 , 0 , 0 , 0 .35f ), 8 .0f );
19191914 UI ()->DoLabel (&ServerHeader, Localize (" Server details" ), FontSize + 2 .0f , TEXTALIGN_MC);
19201915
19211916 if (!pInfo)
@@ -1930,7 +1925,8 @@ void CMenus::RenderDetailInfo(CUIRect View, const CServerInfo *pInfo, const vec4
19301925 " Difficulty:" };
19311926
19321927 CUIRect LeftColumn, RightColumn;
1933- View.VMargin (2 .0f , &View);
1928+ View.HMargin (8 .0f , &View);
1929+ View.VMargin (8 .0f , &View);
19341930 View.VSplitLeft (70 .0f , &LeftColumn, &RightColumn);
19351931
19361932 for (unsigned int i = 0 ; i < sizeof (s_aLabels) / sizeof (s_aLabels[0 ]); i++)
@@ -1941,31 +1937,24 @@ void CMenus::RenderDetailInfo(CUIRect View, const CServerInfo *pInfo, const vec4
19411937
19421938 // map
19431939 RightColumn.HSplitTop (RowHeight, &Row, &RightColumn);
1944- UI ()->DoLabel (&Row, pInfo->m_aMap , FontSize, TEXTALIGN_LEFT , Row.w , false );
1940+ UI ()->DoLabel (&Row, pInfo->m_aMap , FontSize, TEXTALIGN_RIGHT , Row.w , false );
19451941
19461942 // game type
19471943 RightColumn.HSplitTop (RowHeight, &Row, &RightColumn);
1948- CUIRect Icon;
1949- Row.VSplitLeft (Row.h , &Icon, &Row);
1950- Icon.y -= 2 .0f ;
1951- DoGameIcon (pInfo->m_aGameType , &Icon);
1952- UI ()->DoLabel (&Row, pInfo->m_aGameType , FontSize, TEXTALIGN_LEFT, Row.w , false );
1944+ UI ()->DoLabel (&Row, pInfo->m_aGameType , FontSize, TEXTALIGN_RIGHT, Row.w , false );
19531945
19541946 // version
19551947 RightColumn.HSplitTop (RowHeight, &Row, &RightColumn);
1956- UI ()->DoLabel (&Row, pInfo->m_aVersion , FontSize, TEXTALIGN_LEFT , Row.w , false );
1948+ UI ()->DoLabel (&Row, pInfo->m_aVersion , FontSize, TEXTALIGN_RIGHT , Row.w , false );
19571949
19581950 // difficulty
19591951 RightColumn.HSplitTop (RowHeight, &Row, &RightColumn);
1960- Row.VSplitLeft (Row.h , &Icon, &Row);
1961- Icon.y -= 2 .0f ;
1962- DoIcon (IMAGE_LEVELICONS, s_aDifficultySpriteIds[pInfo->m_ServerLevel ], &Icon);
1963- UI ()->DoLabel (&Row, s_aDifficultyLabels[pInfo->m_ServerLevel ], FontSize, TEXTALIGN_LEFT, Row.w , false );
1952+ UI ()->DoLabel (&Row, s_aDifficultyLabels[pInfo->m_ServerLevel ], FontSize, TEXTALIGN_RIGHT, Row.w , false );
19641953}
19651954
19661955void CMenus::RenderDetailScoreboard (CUIRect View, const CServerInfo *pInfo, int RowCount, const vec4 &TextColor, const vec4 &TextOutlineColor)
19671956{
1968- View.Draw (vec4 (0 , 0 , 0 , 0 .15f ), 5 .0f , RowCount > 0 ? CUIRect::CORNER_B|CUIRect::CORNER_TL : CUIRect::CORNER_B );
1957+ View.Draw (vec4 (0 , 0 , 0 , 0 .35f ), 8 .0f );
19691958 View.Margin (2 .0f , &View);
19701959
19711960 if (!pInfo)
@@ -2093,14 +2082,14 @@ void CMenus::RenderServerbrowserServerDetail(CUIRect View, const CServerInfo *pI
20932082 CUIRect ServerHeader, ServerDetails, ServerScoreboard;
20942083
20952084 // split off a piece to use for scoreboard
2096- View.HSplitTop (80 .0f , &ServerDetails, &ServerScoreboard);
2085+ View.HSplitTop (95 .0f , &ServerDetails, &ServerScoreboard);
20972086
20982087 // server details
20992088 RenderDetailInfo (ServerDetails, pInfo, CUI::ms_DefaultTextColor, CUI::ms_DefaultTextOutlineColor);
21002089
21012090 // server scoreboard
21022091 ServerScoreboard.HSplitTop (UI ()->GetListHeaderHeight (), &ServerHeader, &ServerScoreboard);
2103- ServerHeader.Draw (vec4 (1 , 1 , 1 , 0 .25f ), 4 .0f , CUIRect::CORNER_T );
2092+ ServerHeader.Draw (vec4 (0 , 0 , 0 , 0 .0f ), 4 .0f );
21042093 UI ()->DoLabel (&ServerHeader, Localize (" Scoreboard" ), 12 .0f , TEXTALIGN_MC);
21052094 RenderDetailScoreboard (ServerScoreboard, pInfo, 0 , CUI::ms_DefaultTextColor, CUI::ms_DefaultTextOutlineColor);
21062095}
0 commit comments