mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-02 19:50:02 +00:00
Move druid mana bar into the unit frame, off nampower
The druid secondary mana bar (shown while shapeshifted into a form that uses energy/rage) lived in nampower.lua and read base mana through nampower's GetUnitField. Extract it into the unit frame proper and drive it with ClassicAPI instead: - Create pfDruidMana_<unit> as f.druidmana in CreateUnitFrame (player and target), lay it out in UpdateConfig from the existing C.unitframes.druidmana* keys, and update it in a new pfUI.uf:UpdateDruidMana driven by the frame's own base-refresh pass (UNIT_MANA / UNIT_DISPLAYPOWER). No separate event frames, no nampower dependency. - Read mana via UnitPower(unit, 0) / UnitPowerMax(unit, 0), the ClassicAPI slot getters that return the mana pool regardless of the active power, so it works while in Cat/Bear form. - Add a "Show Druid Mana Bar Text" toggle (druidmanatext) so the current/max readout can be hidden while keeping the bar; config default, GUI checkbox, and locale stubs. - Remove the now-dead block from nampower.lua.
This commit is contained in:
@@ -2143,6 +2143,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
|
||||
CreateConfig(nil, T["Druid Settings"], nil, nil, "header")
|
||||
CreateConfig(nil, T["Show Druid Mana Bar"], C.unitframes, "druidmanabar", "checkbox", nil, nil, nil, nil)
|
||||
CreateConfig(nil, T["Show Druid Mana Bar Text"], C.unitframes, "druidmanatext", "checkbox", nil, nil, nil, nil)
|
||||
CreateConfig(nil, T["Druid Mana Bar Height"], C.unitframes, "druidmanaheight", nil, nil, nil, nil, nil)
|
||||
CreateConfig(nil, T["Druid Mana Bar Width (-1 = auto)"], C.unitframes, "druidmanawidth", nil, nil, nil, nil, nil)
|
||||
CreateConfig(nil, T["Druid Mana Bar X-Offset"], C.unitframes, "druidmanaoffx", nil, nil, nil, nil, nil)
|
||||
|
||||
Reference in New Issue
Block a user