mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 04:00:02 +00:00
nameplates: cachedGuid + percent-mode guard + name text position
- Switch the four GUID reads in OnDataChanged from plate.parent:GetName(1) (SuperWoW idiom) to plate.cachedGuid (set by NAME_PLATE_UNIT_ADDED via UnitGUID(token)). Move the initial OnDataChanged call out of OnConfigChange's CREATE path so it runs after UNIT_ADDED has populated cachedGuid; re-add it explicitly in the user-config-change loop. - Reject GetUnitField's health/maxHealth when maxHealth == 100 — the engine writes (hp_percent, 100) into UnitFields for non-detailed units (UPDATE_PARTIAL packets carry percent only). Without this guard, Nampower's raw field read returns the percent and the nameplate displays "5 / 100" as if it were real HP. Mirrors libhealth's heuristic so we fall through to its estimator instead. - New config: nametextpos (LEFT/CENTER/RIGHT, defaults to CENTER). Decouple the bar's anchor from the name so the name's JustifyH can shift left/right without dragging the bar with it.
This commit is contained in:
@@ -866,6 +866,7 @@ function pfUI:LoadConfig()
|
||||
|
||||
pfUI:UpdateConfig("nameplates", nil, "showhp", "0")
|
||||
pfUI:UpdateConfig("nameplates", nil, "hptextpos", "RIGHT")
|
||||
pfUI:UpdateConfig("nameplates", nil, "nametextpos", "CENTER")
|
||||
pfUI:UpdateConfig("nameplates", nil, "hptextformat", "curmaxs")
|
||||
pfUI:UpdateConfig("nameplates", nil, "vpos", "-10")
|
||||
pfUI:UpdateConfig("nameplates", nil, "width", "120")
|
||||
|
||||
Reference in New Issue
Block a user