Thread Tools Display Modes
12-05-11, 05:42 PM   #1
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Altpower

is it just me or is the altpower just totally broke?
  Reply With Quote
12-05-11, 05:49 PM   #2
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Specify? It works fine for me.
  Reply With Quote
12-06-11, 01:26 AM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
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.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 12-06-11 at 02:03 AM.
  Reply With Quote
12-06-11, 02:06 AM   #4
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Haleth View Post
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)

Last edited by Aftermathhqt : 12-06-11 at 02:32 AM.
  Reply With Quote
12-06-11, 07:05 AM   #5
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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).
  Reply With Quote
12-09-11, 06:25 AM   #6
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
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
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Altpower

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off