Skip to content
Open
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
2 changes: 2 additions & 0 deletions loc/US/strings_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7620,6 +7620,8 @@ OPTIONS_0283="UI Scale"
OPTIONS_0284="Changes the size of all UI elements. (requires game restart)"
OPTIONS_0285="Automatic Extractor Selection"
OPTIONS_0286="After selecting an engineer, hover the mouse over a mass extractor spot to auto preselect a mass extractor for building"
OPTIONS_0287="Show Lifebars Only When Damaged"
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."

lobui_0414 = "%d Build Restrictions"
lobui_0415 = "1 Build Restriction"
Expand Down
16 changes: 16 additions & 0 deletions lua/options/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,22 @@ options = {
},
},

{
title = "<LOC OPTIONS_0287>Show Lifebars Only When Damaged",
key = 'gui_lifebar_only_damaged',
Comment on lines +994 to +995
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use unique LOC IDs; OPTIONS_0287 is already in use.

Line 994 reuses OPTIONS_0287, which is already referenced at Line 657 for Factories Default to Repeat Build. This will cause the existing option label to be overwritten/mislabeled once localization is updated.

💡 Suggested fix
-                title = "<LOC OPTIONS_0287>Show Lifebars Only When Damaged",
+                title = "<LOC OPTIONS_0330>Show Lifebars Only When Damaged",

Also update:

  • lua/ui/help/tooltips.lua to use new unique IDs for this tooltip pair.
  • loc/US/strings_db.lua to define the new IDs (for example OPTIONS_0330 / OPTIONS_0331).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
title = "<LOC OPTIONS_0287>Show Lifebars Only When Damaged",
key = 'gui_lifebar_only_damaged',
title = "<LOC OPTIONS_0330>Show Lifebars Only When Damaged",
key = 'gui_lifebar_only_damaged',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/options/options.lua` around lines 994 - 995, The LOC tag OPTIONS_0287 is
duplicated; change the title LOC tag for the option with key
'gui_lifebar_only_damaged' to a new unique ID (e.g., OPTIONS_0330) and update
its paired tooltip LOC ID (e.g., OPTIONS_0331) wherever referenced (the tooltip
pair for the same option), then add those new IDs and text entries to the
strings_db locale file so the label and tooltip are unique and won't overwrite
the existing OPTIONS_0287 entry used by the "Factories Default to Repeat Build"
option.

type = 'toggle',
default = 0,
set = function(key, value, startup)
ConExecute("ui_LifebarOnlyDamaged " .. tostring(value))
end,
custom = {
states = {
{ text = "<LOC _Off>", key = 0 },
{ text = "<LOC _On>", key = 1 },
},
},
},

{
title = "<LOC options_show_player_names_title>Show Player Names",
key = 'options_show_player_names',
Expand Down
4 changes: 4 additions & 0 deletions lua/ui/help/tooltips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,10 @@ Tooltips = {
title = "<LOC OPTIONS_0222>Show Lifebars of Attached Units",
description = "<LOC OPTIONS_0219>Toggles the visibility of lifebars of on screen units (lifebars will still show in tooltip information)",
},
options_gui_lifebar_only_damaged = {
title = "<LOC OPTIONS_0287>Show Lifebars Only When Damaged",
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.",
},
options_skin_change_on_start = {
title = "<LOC OPTIONS_0211>Use Factional UI Skin",
description = "<LOC OPTIONS_0220>When on, the UI skin will change to match the faction you are playing",
Expand Down
Loading