Skip to content

Commit 039c310

Browse files
M3RT1N99claude
andcommitted
Add 'Show Lifebars Only When Damaged' option
Adds a new HUD setting that hides lifebars on units at full HP. Bars only appear once a unit has taken damage. Provides a noticeable FPS gain in dense crowds where most units are undamaged. Requires the matching binary patch (FAForever/FA-Binary-Patches#151) which exposes the ui_LifebarOnlyDamaged ConVar this option drives via ConExecute. Without that patch the option toggle is a no-op (the ConVar is unrecognised). - lua/options/options.lua: new toggle in the HUD section - lua/ui/help/tooltips.lua: tooltip entry options_gui_lifebar_only_damaged - loc/US/strings_db.lua: OPTIONS_0287 / OPTIONS_0288 strings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1d1530b commit 039c310

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

loc/US/strings_db.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7619,6 +7619,8 @@ OPTIONS_0283="UI Scale"
76197619
OPTIONS_0284="Changes the size of all UI elements. (requires game restart)"
76207620
OPTIONS_0285="Automatic Extractor Selection"
76217621
OPTIONS_0286="After selecting an engineer, hover the mouse over a mass extractor spot to auto preselect a mass extractor for building"
7622+
OPTIONS_0287="Show Lifebars Only When Damaged"
7623+
OPTIONS_0288="When on, lifebars only appear once a unit takes damage. Hides them on full-HP units. Provides an FPS gain in dense crowds."
76227624

76237625
lobui_0414 = "%d Build Restrictions"
76247626
lobui_0415 = "1 Build Restriction"

lua/options/options.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,22 @@ options = {
990990
},
991991
},
992992

993+
{
994+
title = "<LOC OPTIONS_0287>Show Lifebars Only When Damaged",
995+
key = 'gui_lifebar_only_damaged',
996+
type = 'toggle',
997+
default = 0,
998+
set = function(key, value, startup)
999+
ConExecute("ui_LifebarOnlyDamaged " .. tostring(value))
1000+
end,
1001+
custom = {
1002+
states = {
1003+
{ text = "<LOC _Off>", key = 0 },
1004+
{ text = "<LOC _On>", key = 1 },
1005+
},
1006+
},
1007+
},
1008+
9931009
{
9941010
title = "<LOC options_show_player_names_title>Show Player Names",
9951011
key = 'options_show_player_names',

lua/ui/help/tooltips.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,10 @@ Tooltips = {
951951
title = "<LOC OPTIONS_0222>Show Lifebars of Attached Units",
952952
description = "<LOC OPTIONS_0219>Toggles the visibility of lifebars of on screen units (lifebars will still show in tooltip information)",
953953
},
954+
options_gui_lifebar_only_damaged = {
955+
title = "<LOC OPTIONS_0287>Show Lifebars Only When Damaged",
956+
description = "<LOC OPTIONS_0288>When on, lifebars only appear once a unit takes damage. Hides them on full-HP units. Provides an FPS gain in dense crowds.",
957+
},
954958
options_skin_change_on_start = {
955959
title = "<LOC OPTIONS_0211>Use Factional UI Skin",
956960
description = "<LOC OPTIONS_0220>When on, the UI skin will change to match the faction you are playing",

0 commit comments

Comments
 (0)