WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Altpower (https://www.wowinterface.com/forums/showthread.php?t=42014)

Aftermathhqt 12-05-11 05:42 PM

Altpower
 
is it just me or is the altpower just totally broke?

Haleth 12-05-11 05:49 PM

Specify? It works fine for me.

zork 12-06-11 01:26 AM

Actually it is fine. There is a game on darkmoon faerie where I have two alterpower bars but that is correct aswell. Because in that game player and pet are the same unit and I spawn the altpowerbar for both.

The display on the bar depends on the min/max settings of the powerbar.

Aftermathhqt 12-06-11 02:06 AM

Quote:

Originally Posted by Haleth (Post 248773)
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:
  1. if AftermathhUI.plugins.altpower == false then return end
  2.  
  3. _G["PlayerPowerBarAlt"]:UnregisterEvent("UNIT_POWER_BAR_SHOW")
  4. _G["PlayerPowerBarAlt"]:UnregisterEvent("UNIT_POWER_BAR_HIDE")
  5. _G["PlayerPowerBarAlt"]:UnregisterEvent("PLAYER_ENTERING_WORLD")
  6.  
  7. local AltPowerBG = CreateFrame("Frame", "AltPowerBG", frame)
  8. AltPowerBG:SetSize(200, 24)
  9. AltPowerBG:SetPoint('BOTTOMLEFT', UIParent, 199, 211)
  10. AltPowerBG:SetBackdrop({
  11.     bgFile = AftermathhUI.media.blank,
  12.     insets = {top = 1, left = 4.5, bottom = 1, right = 1},
  13. })
  14. AltPowerBG:SetBackdropColor(unpack(AftermathhUI.media.backdropcolor))
  15.  
  16. local AltPowerBar = CreateFrame("StatusBar", "AltPowerBar", AltPowerBG)
  17. AltPowerBar:SetStatusBarTexture(AftermathhUI.media.texture)
  18. AltPowerBar:SetPoint("TOPLEFT", AltPowerBG, "TOPLEFT", 2, -2)
  19. AltPowerBar:SetMinMaxValues(0, 100)
  20. AltPowerBar:SetPoint("BOTTOMRIGHT", AltPowerBG, "BOTTOMRIGHT", -2, 2)
  21.  
  22. CreateBorderLight(AltPowerBar, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 2)
  23.  
  24. local AltPowerText = AltPowerBar:CreateFontString(nil, "OVERLAY")
  25. AltPowerText:SetFont(AftermathhUI.media.font, 13, AftermathhUI.media.fontflag)
  26. if AftermathhUI.media.shadowoffset == true then
  27.     AltPowerText:SetShadowColor(0, 0, 0)
  28.     AltPowerText:SetShadowOffset(1, -1)
  29. end
  30. AltPowerText:SetPoint("CENTER", AltPowerBG, "CENTER")
  31.  
  32. AltPowerBG:RegisterEvent("UNIT_POWER")
  33. AltPowerBG:RegisterEvent("UNIT_POWER_BAR_SHOW")
  34. AltPowerBG:RegisterEvent("UNIT_POWER_BAR_HIDE")
  35. AltPowerBG:RegisterEvent("PLAYER_ENTERING_WORLD")
  36. AltPowerBG:SetScript("OnEvent", function(self)
  37.     self:UnregisterEvent("PLAYER_ENTERING_WORLD")
  38.     if UnitAlternatePowerInfo("player") or UnitAlternatePowerInfo("target") then
  39.         self:Show()
  40.     else
  41.         self:Hide()
  42.     end
  43. end)
  44.  
  45. local TimeSinceLastUpdate = 1
  46. AltPowerBar:SetScript("OnUpdate", function(self, elapsed)
  47.     if not AltPowerBar:IsShown() then return end
  48.     TimeSinceLastUpdate = TimeSinceLastUpdate + elapsed
  49.  
  50.     if (TimeSinceLastUpdate >= 1) then
  51.         self:SetMinMaxValues(0, UnitPowerMax("player", ALTERNATE_POWER_INDEX))
  52.         local power = UnitPower("player", ALTERNATE_POWER_INDEX)
  53.         local mpower = UnitPowerMax("player", ALTERNATE_POWER_INDEX)
  54.         self:SetValue(power)
  55.         AltPowerText:SetText(power.." / "..mpower)
  56.         local r, g, b = AftermathhUI.ColorGradient(power/mpower, 0,.8,0,.8,.8,0,.8,0,0)
  57.         AltPowerBar:SetStatusBarColor(r, g, b)
  58.         self.TimeSinceLastUpdate = 0
  59.     end
  60. end)

Haleth 12-06-11 07:05 AM

Well, Blizzard did make a few changes to UnitPowerBarAlt (though not AltPowerBar, idk what's the difference) to include a buff timer:

http://www.wowinterface.com/forums/s...ad.php?t=42010

Might be related to that.

I use oUF's alt power element and it works fine (though doesn't include the buff timer yet).

Aftermathhqt 12-09-11 06:25 AM

Found the wrong

had it attached to "frame" which is nothing, that's why it did'nt work.

local AltPowerBG = CreateFrame("Frame", "AltPowerBG" frame)

Thanks for help through


All times are GMT -6. The time now is 04:40 AM.

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