WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Enhanced shadow orbs (https://www.wowinterface.com/forums/showthread.php?t=50160)

10leej 10-18-14 12:23 AM

Enhanced shadow orbs
 
So my shaodw orbs bar is giving me a nice little error

Quote:

Interface\AddOns\oUF_Bob\embeds\oUF_ShadowOrbsBar.lua:29: 'for' limit must be a number
so I take a peak in my oUF_ShadowOrbsBar.lua\

on line 29 I have
Code:

for i = 1, PRIEST_BAR_NUM_ORBS do
  if i <= numOrbs then
    pb[i]:SetAlpha(1)
  else
    pb[i]:SetAlpha(.2)
  end
end

however there is a new perk that I discovered called Enhanced Shadow Orbs, now I have no idea what this actually is but apparently because of it I can't use PRIEST_BAR_NUM_ORBS to give me the maximum number of shadow orbs now

I'm wondering if this shows as a buff or not.

EDIT:
Actually scratch this entire thing I looked at what tukz was doing in tukui

Code:

local numOrbs = UnitPower("player", SPELL_POWER_SHADOW_ORBS)
local totalOrbs = IsSpellKnown(SHADOW_ORB_MINOR_TALENT_ID) and 5 or 3

for i = 1, totalOrbs do
        if i <= numOrbs then
                pb[i]:SetAlpha(1)
        else
                pb[i]:SetAlpha(.2)
        end
end

if(pb.PostUpdate) then
        return pb:PostUpdate(numOrbs)
end


kurapica.igas 10-19-14 11:45 PM

You can get the max number by using
Lua Code:
  1. UnitPowerMax("player", SPELL_POWER_SHADOW_ORBS)
, also an event "UNIT_MAXPOWER" can be used to get the new max number.

p3lim 10-20-14 12:48 PM

Or just use the ClassIcons element in oUF, it does all this for you.


All times are GMT -6. The time now is 03:42 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI