Skip to content

Commit

Permalink
Fixed a few color issues
Browse files Browse the repository at this point in the history
Fixed #27
Fixed #29
  • Loading branch information
YoYo178 committed May 25, 2024
1 parent 95a307d commit 48ab739
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions mp/src/game/client/ff/hud/ff_hud_chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ ConVar cl_chat_color_default("cl_chat_color_default", "255 170 0", FCVAR_ARCHIVE

// customizable team colors!

// unassigned shouldn't really be needed, right?
//ConVar cl_teamcolor_unassigned("cl_teamcolor_unassigned", "204 204 204", FCVAR_CLIENTDLL | FCVAR_ARCHIVE, "Defines the unassigned team's color in chat and killfeed.");
ConVar cl_teamcolor_unassigned("cl_teamcolor_unassigned", "204 204 204", FCVAR_CLIENTDLL | FCVAR_ARCHIVE, "Defines the unassigned team's color in chat and killfeed.");
ConVar cl_teamcolor_spec("cl_teamcolor_spec", "204 204 204", FCVAR_CLIENTDLL | FCVAR_ARCHIVE, "Defines the spectator team's color in chat and killfeed.");

ConVar cl_teamcolor_blue("cl_teamcolor_blue", "153 204 255", FCVAR_CLIENTDLL | FCVAR_ARCHIVE, "Defines the blue team's color in chat and killfeed.");
Expand Down Expand Up @@ -70,6 +69,8 @@ CON_COMMAND(cl_teamcolors_reset, "Resets the client's custom team color definiti
Msg("Team colors were successfully reset to use the old team colors!\n");
}
}

cl_teamcolor_unassigned.SetValue("204 204 204");
}

// customizable team colors!
Expand Down Expand Up @@ -145,6 +146,7 @@ Color GetCustomClientColor(int iPlayerIndex, int iTeamIndex/* = -1*/)
switch (iTeam)
{
case TEAM_UNASSIGNED:
bValid = sscanf(cl_teamcolor_unassigned.GetString(), "%i %i %i", &r, &g, &b) == 3;
break;
case TEAM_SPECTATOR:
{
Expand Down
6 changes: 3 additions & 3 deletions mp/src/game/client/ff/hud/ff_hud_deathnotice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void CHudDeathNotice::Paint()
int yStart = GetClientModeFFNormal()->GetDeathMessageStartHeight();

surface()->DrawSetTextFont( m_hTextFont );
surface()->DrawSetTextColor( GameResources()->GetTeamColor( 0 ) );
surface()->DrawSetTextColor( GetCustomClientColor( -1, 0 ) );

int iCount = m_DeathNotices.Count();
for ( int i = 0; i < iCount; i++ )
Expand Down Expand Up @@ -447,7 +447,7 @@ void CHudDeathNotice::Paint()
if (iconBuildable)
{
x += 5;
iconBuildable->DrawSelf( x, y - (iconBuildableTall / 4), iconBuildableWide, iconBuildableTall, Color(GameResources()->GetTeamColor(iVictimTeam)) );
iconBuildable->DrawSelf( x, y - (iconBuildableTall / 4), iconBuildableWide, iconBuildableTall, GetCustomClientColor( -1, iVictimTeam ) );
}
}
}
Expand All @@ -469,7 +469,7 @@ void CHudDeathNotice::DrawPlayerAndAssister( int &x, int &y, wchar_t* playerName
surface()->DrawUnicodeString( DEATHNOTICE_ASSIST_SEPARATOR );

float assisterColorModifier = hud_deathnotice_assister_color_modifier.GetFloat();
Color assisterColor = GameResources()->GetTeamColor( iAssisterTeam );
Color assisterColor = GetCustomClientColor( -1, iAssisterTeam );
assisterColor.SetColor(
assisterColor.r() * assisterColorModifier,
assisterColor.g() * assisterColorModifier,
Expand Down

0 comments on commit 48ab739

Please sign in to comment.