@@ -1036,27 +1036,35 @@ void CMenus::RenderServerbrowserCommunitiesFilter(CUIRect View)
10361036 const auto &&GetItemName = [&](int ItemIndex) {
10371037 return ServerBrowser ()->Communities ()[ItemIndex].Id ();
10381038 };
1039- const auto &&GetItemDisplayName = [&](int ItemIndex) {
1040- return ServerBrowser ()->Communities ()[ItemIndex].Name ();
1041- };
10421039 const auto &&RenderItem = [&](int ItemIndex, CUIRect Item, const void *pItemId, bool Active) {
1040+ const auto &Community = ServerBrowser ()->Communities ()[ItemIndex];
10431041 const float Alpha = (Active ? 0 .9f : 0 .2f ) + (Ui ()->HotItem () == pItemId ? 0 .1f : 0 .0f );
10441042
1045- CUIRect Icon, Label , FavoriteButton;
1043+ CUIRect Icon, NameLabel, PlayerCountIcon, PlayerCountLabel , FavoriteButton;
10461044 Item.VSplitRight (Item.h , &Item, &FavoriteButton);
1047- Item.Margin (Spacing, &Item);
1048- Item.VSplitLeft (Item.h * 2 .0f , &Icon, &Label);
1049- Label.VSplitLeft (Spacing, nullptr , &Label);
1050-
1051- const char *pItemName = GetItemName (ItemIndex);
1045+ Item.HMargin (Spacing, &Item);
1046+ Item.VSplitLeft (Spacing, nullptr , &Item);
1047+ Item.VSplitRight (1 .0f , &Item, nullptr );
1048+ Item.VSplitLeft (Item.h * 2 .0f , &Icon, &NameLabel);
1049+ NameLabel.VSplitLeft (Spacing, nullptr , &NameLabel);
1050+ NameLabel.VSplitRight (8 .0f , &NameLabel, &PlayerCountIcon);
1051+ NameLabel.VSplitRight (25 .0f , &NameLabel, &PlayerCountLabel);
1052+
1053+ const char *pItemName = Community.Id ();
10521054 const CCommunityIcon *pIcon = m_CommunityIcons.Find (pItemName);
10531055 if (pIcon != nullptr )
10541056 {
10551057 m_CommunityIcons.Render (pIcon, Icon, Active);
10561058 }
10571059
10581060 TextRender ()->TextColor (1 .0f , 1 .0f , 1 .0f , Alpha);
1059- Ui ()->DoLabel (&Label, GetItemDisplayName (ItemIndex), Label.h * CUi::ms_FontmodHeight, TEXTALIGN_ML);
1061+ Ui ()->DoLabel (&NameLabel, Community.Name (), NameLabel.h * CUi::ms_FontmodHeight, TEXTALIGN_ML);
1062+ char aNumPlayersLabel[8 ];
1063+ str_format (aNumPlayersLabel, sizeof (aNumPlayersLabel), " %d" , Community.NumPlayers ());
1064+ Ui ()->DoLabel (&PlayerCountLabel, aNumPlayersLabel, 7 .0f , TEXTALIGN_MR);
1065+ TextRender ()->SetFontPreset (EFontPreset::ICON_FONT);
1066+ Ui ()->DoLabel (&PlayerCountIcon, FONT_ICON_USER, 7 .0f , TEXTALIGN_MC);
1067+ TextRender ()->SetFontPreset (EFontPreset::DEFAULT_FONT);
10601068 TextRender ()->TextColor (TextRender ()->DefaultTextColor ());
10611069
10621070 const bool Favorite = ServerBrowser ()->FavoriteCommunitiesFilter ().Filtered (pItemName);
@@ -1071,6 +1079,8 @@ void CMenus::RenderServerbrowserCommunitiesFilter(CUIRect View)
10711079 ServerBrowser ()->FavoriteCommunitiesFilter ().Add (pItemName);
10721080 }
10731081 }
1082+ GameClient ()->m_Tooltips .DoToolTip (&s_vFavoriteButtonIds[ItemIndex], &FavoriteButton,
1083+ Favorite ? Localize (" Click to remove this community from your favorites." ) : Localize (" Click to add this community to your favorites." ));
10741084 };
10751085
10761086 s_vFavoriteButtonIds.resize (MaxEntries);
0 commit comments