Skip to content

Commit

Permalink
[QOL, FIX] Some important fixes
Browse files Browse the repository at this point in the history
[+] When adding a font there's now a check was this font added before or not.
[*] Use Coolvetica font as default from game files
[*] A more clear customization namings
[*] Updated README
  • Loading branch information
VanderCat committed Jul 10, 2022
1 parent f3054a9 commit 55e7bca
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
7 changes: 3 additions & 4 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ I made this mod because i was in need a more "pro" hud i could not find myself.
- [Size](https://github.com/VanderCat/YourHUD/blob/main/img/SettingsFonts.jpg?raw=true)
- [Font](https://github.com/VanderCat/YourHUD/blob/main/img/SettingsFonts.jpg?raw=true)
- [Colors](https://github.com/VanderCat/YourHUD/blob/main/img/SettingsColors.jpg?raw=true)
- TF2-esque playername showcase (but more like vanilla)

## Planned Features
- TF2-esque playername showcase
- Show player state (dead or alive) on mini scoreboard
- Change HUD elements align

# Broken
- To use coolvetica default font you need to download and install it in system (bcs it's not free 😒)
- You can just alter font in settings though
- or [download](https://dl.dafont.com/dl/?f=coolvetica) it and install (Coolvetica RG)
- ~~To use coolvetica default font you need to download and install it in system (bcs it's not free 😒)~~
- Turns out there's already font in the game's files! HUD will be using it from now on.

# Installation
Download it on [steam workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=2744847052)
Expand Down
40 changes: 23 additions & 17 deletions lua/autorun/client/YourHUDSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ else
available={
{
DisplayName="Default",
font="Coolvetica Rg",
font="Coolvetica",
size=128
},
{
DisplayName="Default Min",
font="Coolvetica Rg",
font="Coolvetica",
size=64
},
{
DisplayName="Default Small",
font="Coolvetica Rg",
font="Coolvetica",
size=32
}
},
Expand Down Expand Up @@ -235,21 +235,21 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
combo:SetSortItems(false)
combo:SetValue("[SELECT]")

combo:AddChoice("HP")
combo:AddChoice("HP Low")
combo:AddChoice("Health")
combo:AddChoice("Low Health")
combo:AddSpacer()

combo:AddChoice("Damage Indicator")
combo:AddChoice("D. Indicator Transition")
combo:AddChoice("Damage Indicator Fade")
combo:AddChoice("Heal Indicator")
combo:AddChoice("H. Indicator Transition")
combo:AddChoice("Heal Indicator Fade")
combo:AddSpacer()

combo:AddChoice("Ammo")
combo:AddChoice("Ammo Low")
combo:AddChoice("Low Ammo")
combo:AddSpacer()

combo:AddChoice("Ammo Reserve")
combo:AddChoice("Clip")
combo:AddChoice("Ammo Alternative")
combo:AddChoice("Armor")

Expand Down Expand Up @@ -283,10 +283,10 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
panel:AddItem(FontList)
local applycombo = vgui.Create("DComboBox",btnpanel)
applycombo:Dock(FILL)
applycombo:AddChoice("Text Main", "FontHUD", true)
applycombo:AddChoice("Text Small", "FontHUDsmall")
applycombo:AddChoice("Text PlayerName", "FontHUDtarget")
applycombo:AddChoice("Text PlayerHP", "FontHUDtargetSmall")
applycombo:AddChoice("Health and Ammo", "FontHUD", true)
applycombo:AddChoice("Armor, Clip, Alt, Damage", "FontHUDsmall")
applycombo:AddChoice("Player Name", "FontHUDtarget")
applycombo:AddChoice("Player Health", "FontHUDtargetSmall")
panel:AddItem(applycombo)
local btnpanel = vgui.Create("DPanel")
local apply = vgui.Create("DButton",btnpanel)
Expand All @@ -304,7 +304,7 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
else
size = 64
end
surface.CreateFont(data, {font = "Coolvetica Rg",size = size})
surface.CreateFont(data, {font = "Coolvetica",size = size})
else
if (YourHUDdebug) then
PrintTable(fonts.available)
Expand All @@ -321,7 +321,7 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
function remove.DoClick()
local id, data = applycombo:GetSelected()
local k, v = FontList:GetSelectedLine()
if k == nil then fonts.available = {{DisplayName="Default",font="Coolvetica Rg",size=128},{DisplayName="Default Min",font="Coolvetica Rg",size=64}} return end
if k == nil then fonts.available = {{DisplayName="Default",font="Coolvetica",size=128},{DisplayName="Default Min",font="Coolvetica",size=64}} return end
fonts.available[k] = nil
if fonts.selected[data] > #fonts.available then
fonts.selected[data] = #fonts.available
Expand Down Expand Up @@ -364,10 +364,16 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
local strike = FontCreator:CheckBox("Strikeout")
strike:SetTooltip("Add a strike through")
strike:SetValue(false)
local Save = FontCreator:Button("Save")
local Save = FontCreator:Button("Add")
function Save.DoClick()
local name = DisplayName:GetValue()
for k, v in pairs(fonts.available) do
if v.DisplayName == name then
fonts.available[k] = nil
end
end
table.insert(fonts.available, {
DisplayName = DisplayName:GetValue(),
DisplayName = name,
font = FontName:GetValue(),
size = size:GetValue(),
weight = weight:GetValue(),
Expand Down

0 comments on commit 55e7bca

Please sign in to comment.