Add 'Show Lifebars Only When Damaged' option#7085
Add 'Show Lifebars Only When Damaged' option#7085M3RT1N99 wants to merge 2 commits intoFAForever:developfrom
Conversation
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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdded a new UI toggle to show lifebars only after units take damage, plus its localization strings and a help tooltip describing the behavior and FPS impact. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lua/options/options.lua`:
- Around line 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.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e4083ba8-81d2-4308-b2d3-5d9707b46d4d
📒 Files selected for processing (3)
loc/US/strings_db.lualua/options/options.lualua/ui/help/tooltips.lua
| title = "<LOC OPTIONS_0287>Show Lifebars Only When Damaged", | ||
| key = 'gui_lifebar_only_damaged', |
There was a problem hiding this comment.
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.luato use new unique IDs for this tooltip pair.loc/US/strings_db.luato define the new IDs (for exampleOPTIONS_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.
| 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.
Summary
Adds a new HUD toggle "Show Lifebars Only When Damaged" 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.
https://discord.com/channels/197033481883222026/1492294267492634674
Requires
FAForever/FA-Binary-Patches#151 — the binary patch that exposes the
ui_LifebarOnlyDamagedConVar that this option drives viaConExecute. Without that patch the option toggle is a no-op (the ConVar is unrecognised by the engine).Changes
lua/options/options.lua— new toggle in the HUD section, keygui_lifebar_only_damaged, callsConExecute("ui_LifebarOnlyDamaged " .. value)on applylua/ui/help/tooltips.lua— tooltip entryoptions_gui_lifebar_only_damagedwith title + description LOC tags (matches the existing FAF pattern, e.g.options_show_attached_unit_lifebars)loc/US/strings_db.lua—OPTIONS_0287(title) andOPTIONS_0288(description) stringsTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit