Skip to content

Commit a971616

Browse files
committed
add: scoreboard colors
1 parent 6952949 commit a971616

File tree

4 files changed

+54
-7
lines changed

4 files changed

+54
-7
lines changed

src/engine/shared/config_pulse.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MACRO_CONFIG_INT(ClHoverMessagesHistory, p_hover_messages_history, 0, 0, 1, CFGF
3737
MACRO_CONFIG_INT(ClHoverMessagesMaxHistory, p_hover_message_max_history, 15, 1, 40, CFGFLAG_CLIENT | CFGFLAG_SAVE, "")
3838
MACRO_CONFIG_INT(ClHoverMessagesMaxNotifications, p_hover_message_max_notifications, 10, 1, 40, CFGFLAG_CLIENT | CFGFLAG_SAVE, "")
3939

40-
MACRO_CONFIG_INT(ClTrailStyle, p_toggle_trails, 0, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "")
40+
MACRO_CONFIG_INT(ClTrailStyle, p_toggle_trails, 0, 0, 3, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Player trail style (0 = off, 1 = sparkle, 2 = ring, 3 = rainbow)")
4141
MACRO_CONFIG_INT(ClPlayerIdleAura, p_idle_aura, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "")
4242

4343

@@ -64,4 +64,6 @@ MACRO_CONFIG_INT(ClHammerHitEffectSound, p_effect_sound_hammerhit, 1, 0, 1, CFGF
6464
MACRO_CONFIG_INT(ClJumpEffect, p_effect_jump, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "toggles hammer hit effect")
6565
MACRO_CONFIG_INT(ClJumpEffectSound, p_effect_sound_jump, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "toggles jump effect sound")
6666

67-
67+
//Scoreboard
68+
MACRO_CONFIG_COL(ClFoeColor, p_blacklist_p_color, 65457, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Blacklist players color")
69+
MACRO_CONFIG_COL(ClFriendColor, p_friend_color, 7995321, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Friends color")

src/game/client/components/comp_pulse/menus_macro.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@
4343
} \
4444
}
4545

46+
#define COLORPICKER(rect, section, title, config_var, default_color) \
47+
DoLine_ColorPicker(&rect, ColorPickerLineSize, ColorPickerLabelSize, ColorPickerLineSpacing, &section, Localize(title), config_var, default_color, false)
48+
49+

src/game/client/components/comp_pulse/menus_pulse.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ void CMenus::RenderSettingsPulse(CUIRect MainView)
378378
DRAW_BOX(RightSection, ScoreboardRect, 140.0f, defaultCol, 10.0f);
379379
s_ScrollRegion.AddRect(ScoreboardRect);
380380
BOX_LABEL(ScoreboardRect, Section, "Scoreboard Settings", 40.0f, 10.0f);
381+
static CButtonContainer s_FoeColor, s_FriendColor;
382+
ColorRGBA DefaultCol = ColorRGBA(1.0f, 1.0f, 1.0f, 1.f);
383+
COLORPICKER(s_FoeColor, ScoreboardRect, "Foe Color In Scoreboard", &g_Config.m_ClFoeColor, DefaultCol);
384+
COLORPICKER(s_FriendColor, ScoreboardRect, "Friend Color In Scoreboard", &g_Config.m_ClFriendColor, DefaultCol);
381385

382386
CKeyInfo Key;
383387
FIND_KEY_BINDING(Key, "toggle_scoreboard_menu");

src/game/client/components/scoreboard.cpp

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,26 @@ bool CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,
691691
{
692692
TextRender()->TextColor(color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClAuthedPlayerColor)));
693693
}
694+
//PulseStuff===========
695+
if(ClientData.m_AuthLevel)
696+
{
697+
ColorRGBA Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClAuthedPlayerColor));
698+
TextRender()->TextColor(Color);
699+
}
700+
else if(ClientData.m_Friend)
701+
{
702+
ColorRGBA Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClFriendColor));
703+
TextRender()->TextColor(Color);
704+
}
705+
706+
TextRender()->SetCursor(&Cursor, NameOffset, Row.y + (Row.h - FontSize) / 2.f, FontSize, TEXTFLAG_RENDER | TEXTFLAG_ELLIPSIS_AT_END);
707+
if(ClientData.m_Foe)
708+
{
709+
ColorRGBA Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClFoeColor));
710+
TextRender()->TextColor(Color);
711+
}
712+
713+
694714
if(g_Config.m_ClShowIds)
695715
{
696716
char aClientId[16];
@@ -709,14 +729,31 @@ bool CScoreboard::RenderScoreboard(CUIRect Scoreboard, int Team, int CountStart,
709729

710730
// clan
711731
{
712-
if(GameClient()->m_aLocalIds[g_Config.m_ClDummy] >= 0 && str_comp(ClientData.m_aClan, GameClient()->m_aClients[GameClient()->m_aLocalIds[g_Config.m_ClDummy]].m_aClan) == 0)
732+
// clan
733+
734+
if(str_comp(ClientData.m_aClan, GameClient()->m_aClients[GameClient()->m_aLocalIds[g_Config.m_ClDummy]].m_aClan) == 0)
713735
{
714-
TextRender()->TextColor(color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClSameClanColor)));
736+
ColorRGBA Color = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClSameClanColor));
737+
TextRender()->TextColor(Color);
738+
739+
std::string SpecialClan = "Inner peace";
740+
if(ClientData.m_aClan == SpecialClan)
741+
{
742+
float Time = LocalTime();
743+
float PulseSpeed = 0.2f;
744+
float PulseIntensity = 0.5f;
745+
746+
float Hue = fmod(Time * PulseSpeed, 1.0f);
747+
float Saturation = 0.8f + 0.2f * sinf(Time * PulseSpeed * 2.0f);
748+
float Value = 0.8f + 0.2f * sinf(Time * PulseSpeed * 1.5f);
749+
750+
ColorRGBA Special = color_cast<ColorRGBA>(ColorHSVA(Hue, Saturation, Value));
751+
TextRender()->TextColor(Special);
752+
}
715753
}
716754
else
717-
{
718-
TextRender()->TextColor(TextColor);
719-
}
755+
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
756+
720757
CTextCursor Cursor;
721758
TextRender()->SetCursor(&Cursor, ClanOffset + (ClanLength - minimum(TextRender()->TextWidth(FontSize, ClientData.m_aClan), ClanLength)) / 2.0f, Row.y + (Row.h - FontSize) / 2.0f, FontSize, TEXTFLAG_RENDER | TEXTFLAG_ELLIPSIS_AT_END);
722759
Cursor.m_LineWidth = ClanLength;

0 commit comments

Comments
 (0)