Skip to content

Commit

Permalink
Kill feed - Change to neuropol2 font, white color separator
Browse files Browse the repository at this point in the history
* OGNT killfeed font is neuropol2
* Removed unneeded ClientScheme_KillFeed.res
* Refactor a bit to just use the string directly
* fixes #442
  • Loading branch information
nullsystem committed Jul 7, 2024
1 parent 87c0230 commit 170e416
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 30 deletions.
16 changes: 0 additions & 16 deletions mp/game/neo/resource/ClientScheme_KillFeed.res

This file was deleted.

13 changes: 4 additions & 9 deletions mp/src/game/client/hl2mp/hud_deathnotice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ void CHudDeathNotice::Paint()
}

#ifdef NEO
// TODO (nullsystem): Just create this once rather than every paint
wchar_t assistsPlusSign[64];
g_pVGuiLocalize->ConvertANSIToUnicode(" + ", assistsPlusSign, sizeof(assistsPlusSign));
const int assistsPlusSignWidth = UTIL_ComputeStringWidth(m_hTextFont, assistsPlusSign);

if (g_hFontKillfeed != vgui::INVALID_FONT)
{
m_hTextFont = g_hFontKillfeed;
Expand Down Expand Up @@ -280,7 +275,7 @@ void CHudDeathNotice::Paint()
#ifdef NEO
if (hasAssists)
{
x -= (UTIL_ComputeStringWidth(m_hTextFont, assists) + assistsPlusSignWidth);
x -= (UTIL_ComputeStringWidth(m_hTextFont, assists) + sizeof(" + "));
}
#endif
}
Expand All @@ -296,15 +291,15 @@ void CHudDeathNotice::Paint()
#ifdef NEO
if (hasAssists)
{
SetColorForNoticePlayer(iAssistsTeam);

// Draw +
surface()->DrawSetTextColor(COLOR_NEO_WHITE);
surface()->DrawSetTextPos(x, y);
surface()->DrawSetTextFont(m_hTextFont);
surface()->DrawUnicodeString(assistsPlusSign);
surface()->DrawUnicodeString(L" + ");
surface()->DrawGetTextPos(x, y);

// Draw assists's name
SetColorForNoticePlayer(iAssistsTeam);
surface()->DrawSetTextPos(x, y);
surface()->DrawSetTextFont(m_hTextFont);
surface()->DrawUnicodeString(assists);
Expand Down
11 changes: 6 additions & 5 deletions mp/src/game/client/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,13 @@ void CHud::InitFonts()
g_hFontTrebuchet24 = pScheme->GetFont("CenterPrintText", true);

#ifdef NEO
auto pNeoKillfeedOverrideScheme = vgui::scheme()->GetIScheme(vgui::scheme()->
LoadSchemeFromFile("resource/ClientScheme_KillFeed.res", "KillFeed"));
Assert(pNeoKillfeedOverrideScheme);
if (pNeoKillfeedOverrideScheme)
vgui::HScheme neoscheme = vgui::scheme()->LoadSchemeFromFile(
"resource/ClientScheme_Neo.res", "ClientScheme_Neo");
vgui::IScheme *neoPScheme = vgui::scheme()->GetIScheme(neoscheme);
Assert(neoPScheme);
if (neoPScheme)
{
g_hFontKillfeed = pNeoKillfeedOverrideScheme->GetFont("killfeed");
g_hFontKillfeed = neoPScheme->GetFont("NHudOCRSmall", true);
}

if (g_hFontKillfeed == vgui::INVALID_FONT)
Expand Down

0 comments on commit 170e416

Please sign in to comment.