Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(223 Kb)
Download
Updated: 10-20-14 01:50 AM
Pictures
File Info
Compatibility:
Warlords of Draenor Pre-Patch (6.0.2)
Updated:10-20-14 01:50 AM
Created:04-25-11 12:21 AM
Downloads:5,198
Favorites:84
MD5:

SimplePowerBar  Popular! (More than 5000 hits)

Version: v3.7
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.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)


Archived Files (17)
File Name
Version
Size
Author
Date
v3.6
221kB
suicidalkatt
09-10-13 08:13 PM
v3.5
221kB
suicidalkatt
07-09-13 05:45 AM
v3.4
221kB
suicidalkatt
03-05-13 08:01 AM
v3.3
221kB
suicidalkatt
11-27-12 08:27 PM
v3.2
221kB
suicidalkatt
10-16-12 10:59 PM
v3.1
220kB
suicidalkatt
10-15-12 06:38 PM
v3.0
220kB
suicidalkatt
09-13-12 12:12 PM
v2.7
214kB
suicidalkatt
08-28-12 03:36 AM
v2.6
209kB
suicidalkatt
11-29-11 01:54 AM
v2.5
209kB
suicidalkatt
08-01-11 12:51 AM
v2.4
209kB
suicidalkatt
07-19-11 03:22 AM
v2.3
209kB
suicidalkatt
06-28-11 02:25 PM
v2.2
209kB
suicidalkatt
06-14-11 07:38 PM
v2.0
209kB
suicidalkatt
05-23-11 10:07 PM
v1.2
209kB
suicidalkatt
05-09-11 09:35 AM
v1.1
208kB
suicidalkatt
04-26-11 06:12 PM
v1.0
208kB
suicidalkatt
04-25-11 12:21 AM


Post A Reply Comment Options
Unread 10-15-12, 06:36 PM  
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 321
File comments: 1414
Uploads: 62
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.
suicidalkatt is offline Report comment to moderator  
Reply With Quote
Unread 10-15-12, 01:10 PM  
galvin
A Black Drake

Forum posts: 84
File comments: 169
Uploads: 0
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.
galvin is offline 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: 321
File comments: 1414
Uploads: 62
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.
suicidalkatt is offline Report comment to moderator  
Reply With Quote
Unread 10-14-12, 04:03 PM  
galvin
A Black Drake

Forum posts: 84
File comments: 169
Uploads: 0
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.
galvin is offline 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: 321
File comments: 1414
Uploads: 62
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.
suicidalkatt is offline Report comment to moderator  
Reply With Quote
Unread 09-04-12, 05:22 PM  
galvin
A Black Drake

Forum posts: 84
File comments: 169
Uploads: 0
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.
galvin is offline Report comment to moderator  
Reply With Quote
Unread 08-24-12, 12:01 AM  
galvin
A Black Drake

Forum posts: 84
File comments: 169
Uploads: 0
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
galvin is offline 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: 321
File comments: 1414
Uploads: 62
Originally Posted by galvin
I updated your toc file, so you don't need the libs.xml file.
Maybe I like my Libs xml!
suicidalkatt is offline Report comment to moderator  
Reply With Quote
Unread 08-23-12, 11:06 PM  
galvin
A Black Drake

Forum posts: 84
File comments: 169
Uploads: 0
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
galvin is offline 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: 321
File comments: 1414
Uploads: 62
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
suicidalkatt is offline Report comment to moderator  
Reply With Quote
Unread 08-23-12, 10:17 PM  
galvin
A Black Drake

Forum posts: 84
File comments: 169
Uploads: 0
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.
galvin is offline 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: 14
Uploads: 0
Addon needs more recognition, this is great.
nectary is offline 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: 321
File comments: 1414
Uploads: 62
Originally posted by Maxen
Woot, thanks !
Enjoy !
suicidalkatt is offline Report comment to moderator  
Reply With Quote
Unread 08-01-11, 08:20 AM  
Maxen
A Deviate Faerie Dragon

Forum posts: 17
File comments: 221
Uploads: 0
Woot, thanks !
Maxen is offline Report comment to moderator  
Reply With Quote
Unread 07-30-11, 01:25 PM  
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view AddOns

Forum posts: 321
File comments: 1414
Uploads: 62
Originally posted by Maxen
is it possible to change the strata of the bar ? I want it on top of my broker bar when needed. Thanks.

edit: added this -> SimplePowerBarBG:SetFrameStrata("HIGH") but can't test it yet
I'll add options for this when I'm back from vaction! ( Monday PST )
suicidalkatt is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: