Originally Posted by Haleth
Specify? It works fine for me.
|
It didn't work at all in Firelands for me yestoday and it was working fine untill patch.
My script same as Smelly's Altpower/Tukui
LUA Code:
if AftermathhUI.plugins.altpower == false then return end
_G["PlayerPowerBarAlt"]:UnregisterEvent("UNIT_POWER_BAR_SHOW")
_G["PlayerPowerBarAlt"]:UnregisterEvent("UNIT_POWER_BAR_HIDE")
_G["PlayerPowerBarAlt"]:UnregisterEvent("PLAYER_ENTERING_WORLD")
local AltPowerBG = CreateFrame("Frame", "AltPowerBG", frame)
AltPowerBG:SetSize(200, 24)
AltPowerBG:SetPoint('BOTTOMLEFT', UIParent, 199, 211)
AltPowerBG:SetBackdrop({
bgFile = AftermathhUI.media.blank,
insets = {top = 1, left = 4.5, bottom = 1, right = 1},
})
AltPowerBG:SetBackdropColor(unpack(AftermathhUI.media.backdropcolor))
local AltPowerBar = CreateFrame("StatusBar", "AltPowerBar", AltPowerBG)
AltPowerBar:SetStatusBarTexture(AftermathhUI.media.texture)
AltPowerBar:SetPoint("TOPLEFT", AltPowerBG, "TOPLEFT", 2, -2)
AltPowerBar:SetMinMaxValues(0, 100)
AltPowerBar:SetPoint("BOTTOMRIGHT", AltPowerBG, "BOTTOMRIGHT", -2, 2)
CreateBorderLight(AltPowerBar, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 2)
local AltPowerText = AltPowerBar:CreateFontString(nil, "OVERLAY")
AltPowerText:SetFont(AftermathhUI.media.font, 13, AftermathhUI.media.fontflag)
if AftermathhUI.media.shadowoffset == true then
AltPowerText:SetShadowColor(0, 0, 0)
AltPowerText:SetShadowOffset(1, -1)
end
AltPowerText:SetPoint("CENTER", AltPowerBG, "CENTER")
AltPowerBG:RegisterEvent("UNIT_POWER")
AltPowerBG:RegisterEvent("UNIT_POWER_BAR_SHOW")
AltPowerBG:RegisterEvent("UNIT_POWER_BAR_HIDE")
AltPowerBG:RegisterEvent("PLAYER_ENTERING_WORLD")
AltPowerBG:SetScript("OnEvent", function(self)
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
if UnitAlternatePowerInfo("player") or UnitAlternatePowerInfo("target") then
self:Show()
else
self:Hide()
end
end)
local TimeSinceLastUpdate = 1
AltPowerBar:SetScript("OnUpdate", function(self, elapsed)
if not AltPowerBar:IsShown() then return end
TimeSinceLastUpdate = TimeSinceLastUpdate + elapsed
if (TimeSinceLastUpdate >= 1) then
self:SetMinMaxValues(0, UnitPowerMax("player", ALTERNATE_POWER_INDEX))
local power = UnitPower("player", ALTERNATE_POWER_INDEX)
local mpower = UnitPowerMax("player", ALTERNATE_POWER_INDEX)
self:SetValue(power)
AltPowerText:SetText(power.." / "..mpower)
local r, g, b = AftermathhUI.ColorGradient(power/mpower, 0,.8,0,.8,.8,0,.8,0,0)
AltPowerBar:SetStatusBarColor(r, g, b)
self.TimeSinceLastUpdate = 0
end
end)