oUF

97.2k Downloads

HolyPower/HarmonyOrbs visibility update

Rainrider opened this issue ยท 3 comments

commented

The number of holy power a paladin can have depends on a passive spell (http://mop.wowhead.com/spell=115675) learned at level 85. It's 3 prior to lvl 85 and 5 after that.

The number of chi a monk can have depends on the talent Ascension (http://mop.wowhead.com/spell=115396). It's 4 chi without and 5 with the talent.

Tukz has a solution to the monk problem with his HarmonyBar plugin (http://www.wowinterface.com/downloads/info21224-oUFHarmonyBar.html).

commented

Both holypower and harmonybar has support for this.

commented

Create a premade lvl 85 monk on beta. Learn the Ascension talent. Get:

18x oUF-1.6.0\elements\harmonyorbs.lua:55: attempt to index field "?" (a nil value)
oUF-1.6.0\elements\harmonyorbs.lua:55: in function <oUF\elements\harmonyorbs.lua:41>
(tail call): ?
oUF-1.6.0\events.lua:76: in function <oUF\events.lua:62>

Locals:
(_temporary) = "UNIT_POWER"
(_temporary) = "player"
(_temporary) = "LIGHT_FORCE"
(_temporary) = "UNIT_POWER"
(_temporary) = "player"
(_temporary) = "LIGHT_FORCE"
(*temporary) = =[C]:-1

That's using the following code as provided by the example in the element:

local AddHarmonyOrbsBar = function(self, width, height, spacing)
    self.Harmony = {}
    local maxOrbs = UnitPowerMax("player", SPELL_POWER_LIGHT_FORCE)

    for i = 1, maxOrbs do
        self.Harmony[i] = self.Overlay:CreateTexture("oUF_Rain_ChiOrb_"..i, "OVERLAY")
        self.Harmony[i]:SetSize((width - maxOrbs * spacing - spacing) / maxOrbs, height)
        self.Harmony[i]:SetPoint("BOTTOMLEFT", self.Overlay, (i - 1) * self.Harmony[i]:GetWidth() + i * spacing, 1)
        self.Harmony[i]:SetTexture(unpack(ns.colors.class["MONK"]))
    end
end
ns.AddHarmonyOrbsBar = AddHarmonyOrbsBar

The other possibility is to always create 5 chi orbs in the layout, witch means the element won't update the visibility on the fifth one upon learning/unlearning Ascension and won't resize the visible chi to fill the holder frame as Tukz does it in his implementation.

Haven't tested holypower but it is coded exactly the same as the Harmony element

commented

Should be fixed with a1f98d2.