Skip to content

Subject: Suggested improvements for TagsDatabase.lua#353

Open
adavak wants to merge 11 commits into
DaleHuntGB:masterfrom
adavak:master
Open

Subject: Suggested improvements for TagsDatabase.lua#353
adavak wants to merge 11 commits into
DaleHuntGB:masterfrom
adavak:master

Conversation

@adavak

@adavak adavak commented Jun 19, 2026

Copy link
Copy Markdown

Subject: Suggested improvements for TagsDatabase.lua

Hi, here are some enhancements I made to Core/Config/TagsDatabase.lua in the health tag methods. Feel free to use or ignore any of them.

Changes made:

1. Localized status text for Dead & Offline
Replaced hardcoded "Dead" and "Offline" with WoW global strings so they auto-localize:

local deadText = DEAD or "Dead"
local offlineText = PLAYER_OFFLINE or "Offline"

2. AFK / DND appended as suffix instead of replacing health
Previously AFK and DND replaced the health value entirely (same as Dead/Ghost/Offline). Changed them to append as a suffix after health text, e.g. 123K (暂离) / 123K (勿扰):

local statusSuffix = UnitIsAFK(unit) and (" ("..(AFK or "AFK")..")") or UnitIsDND(unit) and (" ("..(DND or "DND")..")") or ""

3. Added UNIT_FLAGS to health tag events
So tags refresh when AFK/DND status changes:

["curhp:abbr"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_FLAGS",
["curhpperhp"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_FLAGS",
["curhpperhp:abbr"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_FLAGS",

4. Added PLAYER_FLAGS_CHANGED handler
Since UNIT_FLAGS doesn't fire for the player's own AFK/DND changes, added a standalone handler at the bottom:

local afkDndFrame = CreateFrame("Frame")
afkDndFrame:RegisterEvent("PLAYER_FLAGS_CHANGED")
afkDndFrame:SetScript("OnEvent", function()
    for unit in pairs(UUF.db.profile.Units) do
        local frame = UUF[unit:upper()]
        if frame and frame.UpdateTags then
            frame:UpdateTags()
        end
    end
end)

Things to discuss with you:

  • Feign Death (UnitIsFeignDeath()) – currently left in the code as UnitIsFeignDeath(unit) and "Feign Death". However, this API only returns valid data for friendly units; hostile units always show false.
  • Ghost – there's no WoW global string for ghost status (unlike DEAD/PLAYER_OFFLINE/AFK/DND). Currently using hardcoded "Ghost". Any idea for a localized alternative, or is hardcoded English fine?

Let me know if you'd like a clean diff instead.

@DaleHuntGB

Copy link
Copy Markdown
Owner

Hi,

Thanks for the PR. I'll take a look, as I'm working on Party/Raid Frames currently, these tags are likely to be more impactful.

Localising the STATUS related tags is in the pipeline but I'd like to add general localisation to the entire AddOn. These will come hand in hand.

adavak added 6 commits June 23, 2026 14:00
…et boolean taint

Previous attempt removed == true/false comparators, but the direct
boolean test (and/or) on secret boolean values still causes taint.
Wrap all UnitIsDead/Ghost/Connected/AFK/DND return values with
UUF:IsSecretValue before testing, matching the addon's existing
pattern in Auras.lua and CastBar.lua.

@DaleHuntGB DaleHuntGB left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

As for the rest of the localisation, if DEAD is a localised term, there should be no need to have both. At this point, I would just change to DEAD instead and when localisation is more in scope, I will take some additional time to look into this.

85523e9 - has migrated over to the localised value that exists. Ghost / Offline will need to be handled when localisation comes in future updates.

Comment on lines +815 to +821
afkDndFrame:SetScript("OnEvent", function()
for unit in pairs(UUF.db.profile.Units) do
local frame = UUF[unit:upper()]
if frame and frame.UpdateTags then
frame:UpdateTags()
end
end

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I believe the goal here is to update the player when their status changes, looping over all the units seems like a large overkill.

end

local function UpdatePips(element, stages)
if(not stages) then return end

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Library edits should not be made here. On release, the latest master branch of oUF is packaged, therefore, overwriting libraries is ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants