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
46 changes: 22 additions & 24 deletions game/neo/resource/ClientScheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -2568,53 +2568,51 @@ Scheme
//"additive" "1"
}
}
// The ammo and vitals panels' fonts, looked up proportional so they scale with the panels at every resolution
NHudBullets
{
"1"
{
"name" "NOCR"
"tall" "38"
"weight" "0"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "480 599"
"additive" "1"
}
"2"
{
"name" "NOCR"
"tall" "40"
"tall" "21"
"weight" "0"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "600 767"
"antialias" "1"
"additive" "1"
}
"3"
}
NHudFireMode
{
"1"
{
"name" "NOCR"
"tall" "44"
"tall" "25"
"weight" "0"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "768 1023"
"antialias" "1"
"additive" "1"
}
"4"
}
NHudAmmoReserve
{
"1"
{
"name" "NOCR"
"tall" "50"
"weight" "0"
"name" "Neuropol2"
"tall" "11"
"weight" "600"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "1024 1199"
"antialias" "1"
"additive" "1"
}
"5"
}
NHudPanelText
{
"1"
{
"name" "NOCR"
"tall" "68"
"weight" "0"
"name" "Neuropol2"
"tall" "9"
"weight" "600"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "1200 6000"
"antialias" "1"
"additive" "1"
}
Expand Down
22 changes: 11 additions & 11 deletions game/neo/scripts/HudLayout.res
Original file line number Diff line number Diff line change
Expand Up @@ -847,19 +847,19 @@
"text_xpos" "194"
"text_ypos" "2"
"digit_as_number" "0"
"digit_xpos" "24"
"digit_ypos" "6"
"digit_max_width" "150"
"digit_xpos" "30"
"digit_ypos" "10"
"digit_max_width" "146"
"digit2_xpos" "194"
"digit2_ypos" "16"
"digit2_ypos" "19"
"icon_xpos" "3"
"icon_ypos" "5"
"icon_ypos" "8"
"ammo_text_color" "255 255 255 100"
"ammo_color" "255 255 255 150"
"emptied_ammo_color" "255 255 255 50"
"heatbar_xpos" "23"
"heatbar_ypos" "12"
"heatbar_w" "172"
"heatbar_xpos" "30"
"heatbar_ypos" "16"
"heatbar_w" "146"
"heatbar_h" "11"
"heat_color" "255 50 50 200"
}
Expand All @@ -881,7 +881,7 @@
"healthtext_ypos" "2"
"healthbar_xpos" "86"
"healthbar_ypos" "4"
"healthbar_w" "90"
"healthbar_w" "86"
"healthbar_h" "6"
"healthnum_xpos" "198"
"healthnum_ypos" "2"
Expand All @@ -891,7 +891,7 @@
"camotext_ypos" "12"
"camobar_xpos" "86"
"camobar_ypos" "14"
"camobar_w" "90"
"camobar_w" "86"
"camobar_h" "6"
"camonum_xpos" "198"
"camonum_ypos" "12"
Expand All @@ -901,7 +901,7 @@
"sprinttext_ypos" "22"
"sprintbar_xpos" "86"
"sprintbar_ypos" "24"
"sprintbar_w" "90"
"sprintbar_w" "86"
"sprintbar_h" "6"
"sprintnum_xpos" "198"
"sprintnum_ypos" "22"
Expand Down
30 changes: 20 additions & 10 deletions src/game/client/neo/ui/neo_hud_ammo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,24 @@ void CNEOHud_Ammo::ApplySchemeSettings(vgui::IScheme* pScheme)

LoadControlSettings("scripts/HudLayout.res");

m_hSmallTextFont = pScheme->GetFont("NHudOCRSmall");
m_hBulletFont = pScheme->GetFont("NHudBullets");
m_hTextFont = pScheme->GetFont("NHudOCR");
m_hSmallTextFont = pScheme->GetFont("NHudPanelText", true);
m_hBulletFont = pScheme->GetFont("NHudBullets", true);
m_hFireModeFont = pScheme->GetFont("NHudFireMode", true);
m_hTextFont = pScheme->GetFont("NHudAmmoReserve", true);

// A custom ClientScheme.res from before these fonts existed: use the fonts they replaced
if (!m_hSmallTextFont)
{
m_hSmallTextFont = pScheme->GetFont("NHudOCRSmall");
}
if (!m_hFireModeFont)
{
m_hFireModeFont = pScheme->GetFont("NHudBullets");
}
if (!m_hTextFont)
{
m_hTextFont = pScheme->GetFont("NHudOCR");
}

surface()->GetScreenSize(m_resX, m_resY);
SetBounds(0, 0, m_resX, m_resY);
Expand Down Expand Up @@ -137,8 +152,6 @@ void CNEOHud_Ammo::DrawAmmo() const
wchar_t unicodeClipsText[maxLen]{ L'\0' };
g_pVGuiLocalize->ConvertANSIToUnicode(clipsText, unicodeClipsText, sizeof(unicodeClipsText));

int clipsTextWidth, clipsTextHeight;
surface()->GetTextSize(m_hTextFont, unicodeClipsText, clipsTextWidth, clipsTextHeight);
surface()->DrawSetTextFont(m_hTextFont);

surface()->GetTextSize(m_hTextFont, unicodeClipsText, fontWidth, fontHeight);
Expand All @@ -147,7 +160,6 @@ void CNEOHud_Ammo::DrawAmmo() const
}

const char* ammoChar = nullptr;
int fireModeWidth = 0, fireModeHeight = 0;
int magSizeMax = 0;
int magSizeCurrent = 0;

Expand Down Expand Up @@ -175,11 +187,9 @@ void CNEOHud_Ammo::DrawAmmo() const
wchar_t unicodeFireModeText[2]{ L'\0' };
g_pVGuiLocalize->ConvertANSIToUnicode(fireModeText, unicodeFireModeText, sizeof(unicodeFireModeText));

surface()->DrawSetTextFont(m_hBulletFont);
surface()->DrawSetTextFont(m_hFireModeFont);
surface()->DrawSetTextPos(icon_xpos + xpos, icon_ypos + ypos);
surface()->DrawPrintText(unicodeFireModeText, V_wcslen(unicodeFireModeText));

surface()->GetTextSize(m_hBulletFont, unicodeFireModeText, fireModeWidth, fireModeHeight);
}
} else
{
Expand Down Expand Up @@ -302,7 +312,7 @@ void CNEOHud_Ammo::DrawHeatMeter(C_NEOBaseCombatWeapon* activeWep) const
if (activeWep->GetPrimaryAmmoCount() == 0)
{
surface()->DrawSetTextFont(m_hSmallTextFont);
surface()->DrawSetTextPos(heatbar_xpos + xpos, (heatbar_ypos + ypos) - 22);
surface()->DrawSetTextPos(heatbar_xpos + xpos, text_ypos + ypos);
surface()->DrawPrintText(L"OVERHEAT", 8);
}

Expand Down
22 changes: 10 additions & 12 deletions src/game/client/neo/ui/neo_hud_ammo.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ class CNEOHud_Ammo : public CNEOHud_ChildElement, public CHudElement, public vgu
vgui::HFont m_hSmallTextFont = 0;
vgui::HFont m_hTextFont = 0;
vgui::HFont m_hBulletFont = 0;
vgui::HFont m_hFireModeFont = 0;

int m_resX, m_resY;
int m_smallFontWidth, m_smallFontHeight;
int m_fontWidth;
int m_bulletFontWidth, m_bulletFontHeight;

CPanelAnimationVarAliasType(int, xpos, "xpos", "r203", "proportional_xpos");
CPanelAnimationVarAliasType(int, ypos, "ypos", "446", "proportional_ypos");
Expand All @@ -54,22 +52,22 @@ class CNEOHud_Ammo : public CNEOHud_ChildElement, public CHudElement, public vgu

CPanelAnimationVarAliasType(int, text_xpos, "text_xpos", "194", "proportional_xpos");
CPanelAnimationVarAliasType(int, text_ypos, "text_ypos", "2", "proportional_ypos");
CPanelAnimationVarAliasType(int, digit_xpos, "digit_xpos", "24", "proportional_xpos");
CPanelAnimationVarAliasType(int, digit_ypos, "digit_ypos", "6", "proportional_ypos");
CPanelAnimationVarAliasType(int, digit_xpos, "digit_xpos", "30", "proportional_xpos");
CPanelAnimationVarAliasType(int, digit_ypos, "digit_ypos", "10", "proportional_ypos");
CPanelAnimationVarAliasType(bool, digit_as_number, "digit_as_number", "0", "bool");
CPanelAnimationVarAliasType(int, digit_max_width, "digit_max_width", "150", "proportional_xpos");
CPanelAnimationVarAliasType(int, digit_max_width, "digit_max_width", "146", "proportional_xpos");
CPanelAnimationVarAliasType(int, digit2_xpos, "digit2_xpos", "194", "proportional_xpos");
CPanelAnimationVarAliasType(int, digit2_ypos, "digit2_ypos", "16", "proportional_ypos");
CPanelAnimationVarAliasType(int, digit2_ypos, "digit2_ypos", "19", "proportional_ypos");
CPanelAnimationVarAliasType(int, icon_xpos, "icon_xpos", "3", "proportional_xpos");
CPanelAnimationVarAliasType(int, icon_ypos, "icon_ypos", "5", "proportional_ypos");
CPanelAnimationVarAliasType(int, icon_ypos, "icon_ypos", "8", "proportional_ypos");
CPanelAnimationVar(Color, ammo_text_color, "ammo_text_color", "255 255 255 100");
CPanelAnimationVar(Color, ammo_color, "ammo_color", "255 255 255 150");
CPanelAnimationVar(Color, emptied_ammo_color, "emptied_ammo_color", "255 255 255 50");

CPanelAnimationVarAliasType(int, heatbar_xpos, "heatbar_xpos", "45", "proportional_xpos");
CPanelAnimationVarAliasType(int, heatbar_ypos, "heatbar_ypos", "12", "proportional_ypos");
CPanelAnimationVarAliasType(float, heatbar_w, "heatbar_w", "150", "proportional_float");
CPanelAnimationVarAliasType(float, heatbar_h, "heatbar_h", "15", "proportional_float");
CPanelAnimationVarAliasType(int, heatbar_xpos, "heatbar_xpos", "30", "proportional_xpos");
CPanelAnimationVarAliasType(int, heatbar_ypos, "heatbar_ypos", "16", "proportional_ypos");
CPanelAnimationVarAliasType(float, heatbar_w, "heatbar_w", "146", "proportional_float");
CPanelAnimationVarAliasType(float, heatbar_h, "heatbar_h", "11", "proportional_float");
CPanelAnimationVar(Color, heat_color, "heat_color", "255 50 50 200");

private:
Expand Down
7 changes: 6 additions & 1 deletion src/game/client/neo/ui/neo_hud_health_thermoptic_aux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ void CNEOHud_HTA::ApplySchemeSettings(vgui::IScheme* pScheme)

LoadControlSettings("scripts/HudLayout.res");

m_hFont = pScheme->GetFont("NHudOCRSmall");
m_hFont = pScheme->GetFont("NHudPanelText", true);
if (!m_hFont)
{
// A custom ClientScheme.res from before NHudPanelText existed
m_hFont = pScheme->GetFont("NHudOCRSmall");
}
m_hFontBuildInfo = pScheme->GetFont("Default");

surface()->GetScreenSize(m_resX, m_resY);
Expand Down
6 changes: 3 additions & 3 deletions src/game/client/neo/ui/neo_hud_health_thermoptic_aux.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CNEOHud_HTA : public CNEOHud_ChildElement, public CHudElement, public vgui
CPanelAnimationVarAliasType(int, healthtext_ypos, "healthtext_ypos", "2", "proportional_ypos");
CPanelAnimationVarAliasType(int, healthbar_xpos, "healthbar_xpos", "86", "proportional_xpos");
CPanelAnimationVarAliasType(int, healthbar_ypos, "healthbar_ypos", "4", "proportional_ypos");
CPanelAnimationVarAliasType(float, healthbar_w, "healthbar_w", "93", "proportional_float");
CPanelAnimationVarAliasType(float, healthbar_w, "healthbar_w", "86", "proportional_float");
CPanelAnimationVarAliasType(float, healthbar_h, "healthbar_h", "6", "proportional_float");
CPanelAnimationVarAliasType(int, healthnum_xpos, "healthnum_xpos", "198", "proportional_xpos");
CPanelAnimationVarAliasType(int, healthnum_ypos, "healthnum_ypos", "2", "proportional_ypos");
Expand All @@ -64,7 +64,7 @@ class CNEOHud_HTA : public CNEOHud_ChildElement, public CHudElement, public vgui
CPanelAnimationVarAliasType(int, camotext_ypos, "camotext_ypos", "12", "proportional_ypos");
CPanelAnimationVarAliasType(int, camobar_xpos, "camobar_xpos", "86", "proportional_xpos");
CPanelAnimationVarAliasType(int, camobar_ypos, "camobar_ypos", "14", "proportional_ypos");
CPanelAnimationVarAliasType(float, camobar_w, "camobar_w", "93", "proportional_float");
CPanelAnimationVarAliasType(float, camobar_w, "camobar_w", "86", "proportional_float");
CPanelAnimationVarAliasType(float, camobar_h, "camobar_h", "6", "proportional_float");
CPanelAnimationVarAliasType(int, camonum_xpos, "camonum_xpos", "198", "proportional_xpos");
CPanelAnimationVarAliasType(int, camonum_ypos, "camonum_ypos", "12", "proportional_ypos");
Expand All @@ -75,7 +75,7 @@ class CNEOHud_HTA : public CNEOHud_ChildElement, public CHudElement, public vgui
CPanelAnimationVarAliasType(int, sprinttext_ypos, "sprinttext_ypos", "22", "proportional_ypos");
CPanelAnimationVarAliasType(int, sprintbar_xpos, "sprintbar_xpos", "86", "proportional_xpos");
CPanelAnimationVarAliasType(int, sprintbar_ypos, "sprintbar_ypos", "24", "proportional_ypos");
CPanelAnimationVarAliasType(float, sprintbar_w, "sprintbar_w", "93", "proportional_float");
CPanelAnimationVarAliasType(float, sprintbar_w, "sprintbar_w", "86", "proportional_float");
CPanelAnimationVarAliasType(float, sprintbar_h, "sprintbar_h", "6", "proportional_float");
CPanelAnimationVarAliasType(int, sprintnum_xpos, "sprintnum_xpos", "198", "proportional_xpos");
CPanelAnimationVarAliasType(int, sprintnum_ypos, "sprintnum_ypos", "22", "proportional_ypos");
Expand Down
Loading