Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 37 additions & 16 deletions src/game/client/neo/ui/neo_scoreboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ void CNEOScoreBoard::OnMainLoop(const NeoUI::Mode eMode)
const CNEOScoreBoardPlayer *pPlayerInfo = &m_playersInfo[i];
const bool bIsPlaying = (pPlayerInfo->iTeam >= FIRST_GAME_TEAM);
const bool bIsDMPlaying = false == bIsTeamplay && bIsPlaying;
const bool bIsMuted = pPlayerInfo->bMuted && false == pPlayerInfo->bBot;
iInPlaying += (bIsPlaying);

const bool bDMNotThisSide = bIsDMPlaying &&
Expand Down Expand Up @@ -947,6 +948,15 @@ void CNEOScoreBoard::OnMainLoop(const NeoUI::Mode eMode)
m_uiCtx.dPanel.x + m_uiCtx.dPanel.wide,
m_uiCtx.dPanel.y + m_uiCtx.iLayoutY + m_uiCtx.layout.iRowTall);
}
else if (bIsMuted)
{
vgui::surface()->DrawSetColor(COLOR_MUTE_BG);
vgui::surface()->DrawFilledRect(
m_uiCtx.dPanel.x,
m_uiCtx.dPanel.y + m_uiCtx.iLayoutY,
m_uiCtx.dPanel.x + m_uiCtx.dPanel.wide,
m_uiCtx.dPanel.y + m_uiCtx.iLayoutY + m_uiCtx.layout.iRowTall);
}

// Ping/BOT
if (pPlayerInfo->iPing >= 0)
Expand Down Expand Up @@ -990,26 +1000,15 @@ void CNEOScoreBoard::OnMainLoop(const NeoUI::Mode eMode)
pAvatarImg->Paint();
}
}
// Voice mute icon - layered over avatar, only do for actual players
if (pPlayerInfo->bMuted && false == pPlayerInfo->bBot)
if (bIsMuted && pAvatarImg)
{
// Slightly redden the avatar
if (pAvatarImg)
{
vgui::surface()->DrawSetColor(100, 0, 0, 75);
vgui::surface()->DrawFilledRect(
m_uiCtx.rWidgetArea.x0,
m_uiCtx.rWidgetArea.y0,
m_uiCtx.rWidgetArea.x0 + m_uiCtx.irWidgetTall,
m_uiCtx.rWidgetArea.y0 + m_uiCtx.irWidgetTall);
}
NeoUI::Texture("vgui/hud/voice_mute",
vgui::surface()->DrawSetColor(100, 0, 0, 75);
vgui::surface()->DrawFilledRect(
m_uiCtx.rWidgetArea.x0,
m_uiCtx.rWidgetArea.y0,
m_uiCtx.irWidgetTall,
m_uiCtx.irWidgetTall,
"",
NeoUI::TEXTUREOPTFLAGS_DONOTCROPTOPANEL);
m_uiCtx.rWidgetArea.x0 + m_uiCtx.irWidgetTall,
m_uiCtx.rWidgetArea.y0 + m_uiCtx.irWidgetTall);
}
if (iCurTeam >= FIRST_GAME_TEAM)
{
Expand Down Expand Up @@ -1050,6 +1049,28 @@ void CNEOScoreBoard::OnMainLoop(const NeoUI::Mode eMode)
}
NeoUI::Label(wszText);

// Voice mute icon - after name, only do for actual players
if (bIsMuted)
{
const auto *pFontI = &m_uiCtx.fonts[m_uiCtx.eFont];

int iNameWide = 0, iNameTall = 0;
vgui::surface()->GetTextSize(pFontI->hdl, wszText, iNameWide, iNameTall);

const int iMuteIconWH = (m_uiCtx.irWidgetTall * 0.75f);
const int iStartX = m_uiCtx.rWidgetArea.x0 + iNameWide + (2 * m_uiCtx.iMarginX);
if ((iStartX + iMuteIconWH) < m_uiCtx.rWidgetArea.x1)
{
NeoUI::Texture("vgui/hud/voice_mute",
iStartX,
m_uiCtx.rWidgetArea.y0 + ((m_uiCtx.irWidgetTall - iMuteIconWH) / 2.0f),
iMuteIconWH,
iMuteIconWH,
"",
NeoUI::TEXTUREOPTFLAGS_DONOTCROPTOPANEL);
}
}

if (iCurTeam >= FIRST_GAME_TEAM)
{
// Ready-up (Hidden when not used)
Expand Down
1 change: 1 addition & 0 deletions src/game/client/neo/ui/neo_theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define COLOR_ALMOST_BLACK Color(15, 15, 15, 255)
#define COLOR_BLACK_TRANSPARENT Color(0, 0, 0, 190)
#define COLOR_DARK_RED Color(180, 32, 32, 255)
#define COLOR_MUTE_BG Color(140, 20, 20, 25)
#define COLOR_NEOPANELMICTEST Color(30, 90, 30, 255)
#define COLOR_NEOPANELACCENTBG Color(40, 0, 0, 255)

Expand Down