mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-02 19:50: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:
@@ -2922,6 +2922,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U["nameplates"], T["Healthbar Texture"], C.nameplates, "healthtexture", "dropdown", pfUI.gui.dropdowns.uf_bartexture)
|
||||
CreateConfig(U["nameplates"], T["Show Health Points"], C.nameplates, "showhp", "checkbox")
|
||||
CreateConfig(U["nameplates"], T["Health Text Position"], C.nameplates, "hptextpos", "dropdown", pfUI.gui.dropdowns.textalign)
|
||||
CreateConfig(U["nameplates"], T["Name Text Position"], C.nameplates, "nametextpos", "dropdown", pfUI.gui.dropdowns.textalign)
|
||||
CreateConfig(U["nameplates"], T["Health Text Format"], C.nameplates, "hptextformat", "dropdown", pfUI.gui.dropdowns.hpformat)
|
||||
CreateConfig(U["nameplates"], T["Hide Healthbar On Enemy NPCs"], C.nameplates, "enemynpc", "checkbox")
|
||||
CreateConfig(U["nameplates"], T["Hide Healthbar On Enemy Players"], C.nameplates, "enemyplayer", "checkbox")
|
||||
|
||||
Reference in New Issue
Block a user