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:
Brues
2026-06-16 19:53:52 -05:00
parent b3f8745b91
commit 50d06f2e7a
3 changed files with 21 additions and 12 deletions
+1
View File
@@ -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")