Skip to content

Commit 55e7bca

Browse files
committed
[QOL, FIX] Some important fixes
[+] 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
1 parent f3054a9 commit 55e7bca

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

README.MD

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ I made this mod because i was in need a more "pro" hud i could not find myself.
2525
- [Size](https://github.com/VanderCat/YourHUD/blob/main/img/SettingsFonts.jpg?raw=true)
2626
- [Font](https://github.com/VanderCat/YourHUD/blob/main/img/SettingsFonts.jpg?raw=true)
2727
- [Colors](https://github.com/VanderCat/YourHUD/blob/main/img/SettingsColors.jpg?raw=true)
28+
- TF2-esque playername showcase (but more like vanilla)
2829

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

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

3938
# Installation
4039
Download it on [steam workshop](https://steamcommunity.com/sharedfiles/filedetails/?id=2744847052)

lua/autorun/client/YourHUDSettings.lua

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ else
2222
available={
2323
{
2424
DisplayName="Default",
25-
font="Coolvetica Rg",
25+
font="Coolvetica",
2626
size=128
2727
},
2828
{
2929
DisplayName="Default Min",
30-
font="Coolvetica Rg",
30+
font="Coolvetica",
3131
size=64
3232
},
3333
{
3434
DisplayName="Default Small",
35-
font="Coolvetica Rg",
35+
font="Coolvetica",
3636
size=32
3737
}
3838
},
@@ -235,21 +235,21 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
235235
combo:SetSortItems(false)
236236
combo:SetValue("[SELECT]")
237237

238-
combo:AddChoice("HP")
239-
combo:AddChoice("HP Low")
238+
combo:AddChoice("Health")
239+
combo:AddChoice("Low Health")
240240
combo:AddSpacer()
241241

242242
combo:AddChoice("Damage Indicator")
243-
combo:AddChoice("D. Indicator Transition")
243+
combo:AddChoice("Damage Indicator Fade")
244244
combo:AddChoice("Heal Indicator")
245-
combo:AddChoice("H. Indicator Transition")
245+
combo:AddChoice("Heal Indicator Fade")
246246
combo:AddSpacer()
247247

248248
combo:AddChoice("Ammo")
249-
combo:AddChoice("Ammo Low")
249+
combo:AddChoice("Low Ammo")
250250
combo:AddSpacer()
251251

252-
combo:AddChoice("Ammo Reserve")
252+
combo:AddChoice("Clip")
253253
combo:AddChoice("Ammo Alternative")
254254
combo:AddChoice("Armor")
255255

@@ -283,10 +283,10 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
283283
panel:AddItem(FontList)
284284
local applycombo = vgui.Create("DComboBox",btnpanel)
285285
applycombo:Dock(FILL)
286-
applycombo:AddChoice("Text Main", "FontHUD", true)
287-
applycombo:AddChoice("Text Small", "FontHUDsmall")
288-
applycombo:AddChoice("Text PlayerName", "FontHUDtarget")
289-
applycombo:AddChoice("Text PlayerHP", "FontHUDtargetSmall")
286+
applycombo:AddChoice("Health and Ammo", "FontHUD", true)
287+
applycombo:AddChoice("Armor, Clip, Alt, Damage", "FontHUDsmall")
288+
applycombo:AddChoice("Player Name", "FontHUDtarget")
289+
applycombo:AddChoice("Player Health", "FontHUDtargetSmall")
290290
panel:AddItem(applycombo)
291291
local btnpanel = vgui.Create("DPanel")
292292
local apply = vgui.Create("DButton",btnpanel)
@@ -304,7 +304,7 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
304304
else
305305
size = 64
306306
end
307-
surface.CreateFont(data, {font = "Coolvetica Rg",size = size})
307+
surface.CreateFont(data, {font = "Coolvetica",size = size})
308308
else
309309
if (YourHUDdebug) then
310310
PrintTable(fonts.available)
@@ -321,7 +321,7 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
321321
function remove.DoClick()
322322
local id, data = applycombo:GetSelected()
323323
local k, v = FontList:GetSelectedLine()
324-
if k == nil then fonts.available = {{DisplayName="Default",font="Coolvetica Rg",size=128},{DisplayName="Default Min",font="Coolvetica Rg",size=64}} return end
324+
if k == nil then fonts.available = {{DisplayName="Default",font="Coolvetica",size=128},{DisplayName="Default Min",font="Coolvetica",size=64}} return end
325325
fonts.available[k] = nil
326326
if fonts.selected[data] > #fonts.available then
327327
fonts.selected[data] = #fonts.available
@@ -364,10 +364,16 @@ hook.Add( "PopulateToolMenu", "YourHUDSettingsHook", function()
364364
local strike = FontCreator:CheckBox("Strikeout")
365365
strike:SetTooltip("Add a strike through")
366366
strike:SetValue(false)
367-
local Save = FontCreator:Button("Save")
367+
local Save = FontCreator:Button("Add")
368368
function Save.DoClick()
369+
local name = DisplayName:GetValue()
370+
for k, v in pairs(fonts.available) do
371+
if v.DisplayName == name then
372+
fonts.available[k] = nil
373+
end
374+
end
369375
table.insert(fonts.available, {
370-
DisplayName = DisplayName:GetValue(),
376+
DisplayName = name,
371377
font = FontName:GetValue(),
372378
size = size:GetValue(),
373379
weight = weight:GetValue(),

0 commit comments

Comments
 (0)