Skip to content

Commit

Permalink
Merge pull request ddnet#7316 from dobrykafe/pr-server-info-colors
Browse files Browse the repository at this point in the history
server info: show clanmates in different color
  • Loading branch information
Robyt3 authored Oct 7, 2023
2 parents 093edb7 + 0838fd9 commit a91374b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/game/client/components/menus_browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1085,9 +1085,25 @@ void CMenus::RenderServerbrowserInfoScoreboard(CUIRect View, const CServerInfo *
CUIRect Skin, Name, Clan, Score, Flag;
Name = Item.m_Rect;

ColorRGBA Color = CurrentClient.m_FriendState == IFriends::FRIEND_NO ?
ColorRGBA(1.0f, 1.0f, 1.0f, (i % 2 + 1) * 0.05f) :
ColorRGBA(0.5f, 1.0f, 0.5f, 0.15f + (i % 2 + 1) * 0.05f);
ColorRGBA Color;
const float Alpha = (i % 2 + 1) * 0.05f;
switch(CurrentClient.m_FriendState)
{
case IFriends::FRIEND_NO:
Color = ColorRGBA(1.0f, 1.0f, 1.0f, Alpha);
break;
case IFriends::FRIEND_PLAYER:
Color = ColorRGBA(0.5f, 1.0f, 0.5f, 0.15f + Alpha);
break;
case IFriends::FRIEND_CLAN:
Color = ColorRGBA(0.4f, 0.4f, 1.0f, 0.15f + Alpha);
break;
default:
dbg_assert(false, "Invalid friend state");
dbg_break();
break;
}

Name.Draw(Color, IGraphics::CORNER_ALL, 4.0f);
Name.VSplitLeft(1.0f, nullptr, &Name);
Name.VSplitLeft(34.0f, &Score, &Name);
Expand Down

0 comments on commit a91374b

Please sign in to comment.