Download
(359Kb)
Download
Updated: 10-24-20 12:31 AM
Pictures
File Info
Compatibility:
Shadowlands pre-patch (9.0.1)
Updated:10-24-20 12:31 AM
Created:04-25-11 12:21 AM
Downloads:10,144
Favorites:76
MD5:

SimplePowerBar  Popular! (More than 5000 hits)

Version: v3.8
by: suicidalkatt [More]

!SimplePowerBar

Is a lightweight addon designed to replace the default Blizzard Alternate Power Bar.
It will automatically show or hide when needed.
Features:
  • Use the clean SimplePowerBar or enable the default Blizzard frame if you so desire.
  • Customizable placement and sizing. Drag and drop placement or exact.
  • Horizontal or vertical statusbar orientation.
  • Customizable coloring for everything as well as optional color fading or class coloring.
  • Additional text options for labeling and percentages.
  • Shared Media support (fonts / statusbar / background / border).
  • All new test mode!
Slash Commands:
  • '/spb' Opens options window.
  • '/spb lock' Toggles frame locking.
  • '/spb blizz' Toggles between SimplePowerBar and the default Blizzard frame.
  • '/spb fade' Toggles color fading.
  • '/spb test' Toggles the test mode.
  • '/spb debug' Displays event messages.
  • '/spb about' Shows about information.
  • '/spb help' Shows slash commands.
Work in progress:
  • Support for AlternatePowerTimers.

--[[v3.8]]--
  • ToC Bump
  • Fixes to "SetBackdrop" API change.
  • Fixes to Blizzard API calls and Blizzard color detection.
  • Ace libraries updated.

** Known Issues **
  • Blizzard mover is not working as expected.

--[[v3.7]]--
  • ToC Bump
  • New improvements to statusbar coloring options.
  • Ace libraries updated.

--[[v3.6]]--
  • ToC Bump

--[[v3.5]]--
  • ToC Update and minor cvar name fix.

--[[v3.4]]--
  • ToC Update


--[[v3.3]]--
  • ToC Update

--[[v3.2]]--
  • Allowed some selective coloring for particular blizzard textures (Stone Guards). Should additional custom coloring be needed, I will update the table.

--[[v3.1]]--
  • Implemented the ability to set statusbar color to use the default blizzard coloring. /spb > Bar Settings > Statusbar > Coloring Method

--[[v3.0]]--
  • Huge re-write of the internals.
  • Internal Ace Libraries updated.
  • Implemented the ability to use the default Blizzard frame.
  • Added a new test mode.
  • Added coloring and texture settings for border, background, text, and text shadow strings.
  • Completely rearranged the options to make a bit more sense.

--[[v2.7]]--
  • ToC Bump

--2.6
  • Updated for 4.3.

--2.5
  • Added frame strata and level options. (Under 'Size & Placement')

--2.4
  • Changed hiding method.
  • Fixed '/spb lock' sometimes not working.

--2.3
  • ToC bump.

--2.2
  • Typo.

--2.1
  • Major bugfixes.

--2.0
  • Bugfixes.
  • Performance increase.

--1.2
  • Added many more text options.
  • Statusbar orientation can now be changed.

--1.1
  • ToC Bump
Optional Files (0)


Post A Reply Comment Options
Unread 10-16-12, 06:23 PM  
galvin
A Frostmaul Preserver
AddOn Author - Click to view AddOns

Forum posts: 265
File comments: 166
Uploads: 1
Originally Posted by suicidalkatt
Originally Posted by galvin
Originally Posted by suicidalkatt
Originally Posted by galvin
Is there a way to have this show the original texture and color. On the stone guardians fight, the color of the bar is important.
I believe I could add "use default coloring" in there but Im not familiar with the encounter. Could you enlighten me on the encounter or show me a screenshot of the blizzard bar?
I updated my post below. I'd rather have a list of all the alt action bars, then be able to set a color to each one. But if that's too complicated then just searching a substring in the alt text would be best.
I can access the Blizzard statusbar colors with their function they provide:
Lua Code:
  1. local texture, r, g, b = UnitAlternatePowerTextureInfo(unit,textureIndex,[timerFrameIndex])

Being able to set a custom color per bar with every bar listed is not doable however. You can now enable 'Blizzard coloring' for statusbars but you must disable class coloring and not use the color fade option (obviously).

/spb > Bar Settings > Statusbar > Coloring Method
The color option doesn't work on stone guardians, my guess is they're using colored textures instead.
So the best thing to do is allow us to change the color of each type of bar thru a table.
Report comment to moderator  
Reply With Quote
Unread 10-15-12, 06:36 PM  
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 331
File comments: 1467
Uploads: 50
Originally Posted by galvin
Originally Posted by suicidalkatt
Originally Posted by galvin
Is there a way to have this show the original texture and color. On the stone guardians fight, the color of the bar is important.
I believe I could add "use default coloring" in there but Im not familiar with the encounter. Could you enlighten me on the encounter or show me a screenshot of the blizzard bar?
I updated my post below. I'd rather have a list of all the alt action bars, then be able to set a color to each one. But if that's too complicated then just searching a substring in the alt text would be best.
I can access the Blizzard statusbar colors with their function they provide:
Lua Code:
  1. local texture, r, g, b = UnitAlternatePowerTextureInfo(unit,textureIndex,[timerFrameIndex])

Being able to set a custom color per bar with every bar listed is not doable however. You can now enable 'Blizzard coloring' for statusbars but you must disable class coloring and not use the color fade option (obviously).

/spb > Bar Settings > Statusbar > Coloring Method
Last edited by suicidalkatt : 10-15-12 at 06:44 PM.
Report comment to moderator  
Reply With Quote
Unread 10-15-12, 01:10 PM  
galvin
A Frostmaul Preserver
AddOn Author - Click to view AddOns

Forum posts: 265
File comments: 166
Uploads: 1
Originally Posted by suicidalkatt
Originally Posted by galvin
Is there a way to have this show the original texture and color. On the stone guardians fight, the color of the bar is important.
I believe I could add "use default coloring" in there but Im not familiar with the encounter. Could you enlighten me on the encounter or show me a screenshot of the blizzard bar?
I updated my post below. I'd rather have a list of all the alt action bars, then be able to set a color to each one. But if that's too complicated then just searching a substring in the alt text would be best.
Report comment to moderator  
Reply With Quote
Unread 10-14-12, 05:55 PM  
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 331
File comments: 1467
Uploads: 50
Originally Posted by galvin
Is there a way to have this show the original texture and color. On the stone guardians fight, the color of the bar is important.
I believe I could add "use default coloring" in there but Im not familiar with the encounter. Could you enlighten me on the encounter or show me a screenshot of the blizzard bar?
Last edited by suicidalkatt : 10-14-12 at 05:58 PM.
Report comment to moderator  
Reply With Quote
Unread 10-14-12, 04:03 PM  
galvin
A Frostmaul Preserver
AddOn Author - Click to view AddOns

Forum posts: 265
File comments: 166
Uploads: 1
Is there a way to have this show the original texture and color. On the stone guardians fight, the color of the bar is important.

Came up with a simple way to do this. Have a lookup table for the name. So if powerbar text has a certain name, it looks the name up in a table then applies a color.

I did some looking, and I think there is a table of all the bars or a way to build a table. This way you could just have a list, and put in an override color for the bars you want. For now I'm going to hack the mod to show the color for the guardians.

I added this function, but checking for exact text wouldn't be a good idea as an option, but searching for a substring would.

Code:
local function SetColorBasedOnText()
  local Label = select(10,UnitAlternatePowerInfo('player'))
  local r, g, b = 0, 0, 0

  if Label == 'Jade Petrification' then -- green
    r, g, b = 0, 1, 0
  elseif Label == 'Jasper Petrification' then -- red
    r, g, b = 1, 0, 0
  elseif Label == 'Amethyst Petrification' then -- purple
    r, g, b = 1, 0, 1
  elseif Label == 'Cobalt Petrification' then -- blue
    r, g, b = 0, 0, 1
  end

  SimplePowerBarStatus:SetStatusBarColor(r, g, b)
end
Last edited by galvin : 10-14-12 at 07:00 PM.
Report comment to moderator  
Reply With Quote
Unread 09-10-12, 12:24 AM  
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 331
File comments: 1467
Uploads: 50
Originally Posted by galvin
How hard would it be to make the addon just move the default bar without changing the way it looks?

I tried doing this my self, but the bar wouldn't move vertically.
No, I've been reworking this addon a lot and I'll be providing a way to use the addon or switch to the default blizzard frames and place them where you'd like.
Report comment to moderator  
Reply With Quote
Unread 09-04-12, 05:22 PM  
galvin
A Frostmaul Preserver
AddOn Author - Click to view AddOns

Forum posts: 265
File comments: 166
Uploads: 1
How hard would it be to make the addon just move the default bar without changing the way it looks?

I tried doing this my self, but the bar wouldn't move vertically.
Report comment to moderator  
Reply With Quote
Unread 08-24-12, 12:01 AM  
galvin
A Frostmaul Preserver
AddOn Author - Click to view AddOns

Forum posts: 265
File comments: 166
Uploads: 1
Originally Posted by suicidalkatt
Originally Posted by galvin
I updated your toc file, so you don't need the libs.xml file.
Maybe I like my Libs xml!
haha, I hate XML evil xml :P
Report comment to moderator  
Reply With Quote
Unread 08-23-12, 11:39 PM  
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 331
File comments: 1467
Uploads: 50
Originally Posted by galvin
I updated your toc file, so you don't need the libs.xml file.
Maybe I like my Libs xml!
Report comment to moderator  
Reply With Quote
Unread 08-23-12, 11:06 PM  
galvin
A Frostmaul Preserver
AddOn Author - Click to view AddOns

Forum posts: 265
File comments: 166
Uploads: 1
I updated your toc file, so you don't need the libs.xml file.

Code:
## Interface: 40300
## Author: Suicidal Katt
## Version: 2.6
## Title: !Simple|cff5CB3FFPowerBar|r
## Notes: A smart and simple blizzard power bar alt.
## SavedVariables: SimpPB_DB

# load libs

Libs\LibStub\LibStub.lua
Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml
Libs\AceGUI-3.0\AceGUI-3.0.xml
Libs\AceAddon-3.0\AceAddon-3.0.xml
Libs\AceConfig-3.0\AceConfig-3.0.xml
Libs\AceConsole-3.0\AceConsole-3.0.xml
Libs\AceDB-3.0\AceDB-3.0.xml
Libs\AceDBOptions-3.0\AceDBOptions-3.0.xml
Libs\LibSharedMedia-3.0\lib.xml
Libs\AceGUI-3.0-SharedMediaWidgets\widget.xml


# Load addon stuff

Media.lua
Core.lua
Options.lua
Report comment to moderator  
Reply With Quote
Unread 08-23-12, 10:26 PM  
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 331
File comments: 1467
Uploads: 50
Originally Posted by galvin
I downloaded the one from curse and first thing I do is load this up in scite and find some variables that are global. This mod actually works in beta, I like it, but I don't like the globals.

in core.lua you have
--[[ snip ]]--
I know you're still around so hopefully you can do a pass on it to clean it up. I'm sure they'll be plenty of raid encounters using the power bar.

In any addon the only things that should be global blizzard UI stuff. Globals are slower than upvalues too. And can risk having another mod conflict.

Anyway good job with the addon, wish I found it sooner.
When I first made this addon I was still relatively new to Lua coding and how frame elements were created / used.

I will be updating this for MoP Beta and will be adding those silly timers that blizzard uses for their AlternatePowerBar.

I'm glad you're enjoying the addon
Report comment to moderator  
Reply With Quote
Unread 08-23-12, 10:17 PM  
galvin
A Frostmaul Preserver
AddOn Author - Click to view AddOns

Forum posts: 265
File comments: 166
Uploads: 1
I downloaded the one from curse and first thing I do is load this up in scite and find some variables that are global. This mod actually works in beta, I like it, but I don't like the globals.

in core.lua you have
Code:
function SimplePowerBar:CreatePowerBar()
	db = self.db.profile
	local frame = self.frame
	local SimplePowerBarBG = CreateFrame("Frame", "SimplePowerBarBG", frame)
	SimplePowerBarBG:SetFrameStrata(db.frameStrata)
	SimplePowerBarBG:SetFrameLevel(db.frameLevel)
	SimplePowerBarBG:SetHeight(db.height)
	SimplePowerBarBG:SetWidth(db.width)
	SimplePowerBarBG:SetPoint("CENTER",UIParent,"CENTER", db.x, db.y)
	SimplePowerBarBG:SetBackdrop({
		bgFile = db.PanelTex, 
		edgeFile = db.PanelTex, 
		tile = false, tileSize = 0, edgeSize = db.borderSize, 
		insets = { left = db.borderInset, right = db.borderInset, top = db.borderInset, bottom = db.borderInset}
	})
	
	SimplePowerBarBG:SetMovable(true)
	SimplePowerBarBG:SetClampedToScreen(true)
	SimplePowerBarBG:SetUserPlaced(true)
	
	local SimplePowerBarLock = SimplePowerBarBG:CreateTexture("SimplePowerBarLock","OVERLAY",nil)
	SimplePowerBarLock:SetTexture("Interface\\GLUES\\CharacterSelect\\Glues-AddOn-Icons")
	SimplePowerBarLock:SetWidth(8)
	SimplePowerBarLock:SetHeight(8)	
	SimplePowerBarLock:SetTexCoord(0.25,0.48,0,1)
	SimplePowerBarLock:SetAlpha(1)
	SimplePowerBarLock:SetPoint("CENTER",SimplePowerBarBG,"TOPRIGHT")
	
	local SimplePowerBarStatus = CreateFrame("StatusBar", "SimplePowerBarStatus", SimplePowerBarBG)
	SimplePowerBarStatus:SetPoint("TOPLEFT", SimplePowerBarBG, "TOPLEFT", 1, -1)
	SimplePowerBarStatus:SetPoint("BOTTOMRIGHT", SimplePowerBarBG, "BOTTOMRIGHT", -1, 1)	
		
	local SimplePowerBarText = SimplePowerBarStatus:CreateFontString("SimplePowerBarText", "OVERLAY")
		
	local SimplePowerBarLabel = SimplePowerBarStatus:CreateFontString("SimplePowerBarLabel", "OVERLAY")
end
These two lines
local SimplePowerBarText = SimplePowerBarStatus:CreateFontString("SimplePowerBarText", "OVERLAY")

local SimplePowerBarLabel = SimplePowerBarStatus:CreateFontString("SimplePowerBarLabel", "OVERLAY")


Problem is these don't become local for the rest of the addon. When you define a local value inside a function, the rest of the addon won't see it. For now I can just declare these two variables at the top of the addon then change those two lines to take the "local" out.

I know you're still around so hopefully you can do a pass on it to clean it up. I'm sure they'll be plenty of raid encounters using the power bar.

In any addon the only things that should be global blizzard UI stuff. Globals are slower than upvalues too. And can risk having another mod conflict.

Anyway good job with the addon, wish I found it sooner.
Report comment to moderator  
Reply With Quote
Unread 06-23-12, 01:13 PM  
nectary
A Kobold Labourer
 
nectary's Avatar
Premium Member

Forum posts: 0
File comments: 15
Uploads: 0
Addon needs more recognition, this is great.
Report comment to moderator  
Reply With Quote
Unread 08-01-11, 05:07 PM  
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 331
File comments: 1467
Uploads: 50
Originally posted by Maxen
Woot, thanks !
Enjoy !
Report comment to moderator  
Reply With Quote
Unread 08-01-11, 08:20 AM  
Maxen
A Fallenroot Satyr

Forum posts: 23
File comments: 235
Uploads: 0
Woot, thanks !
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.