Download
(3Kb)
Download
Updated: 06-29-11 05:44 PM
Pictures
File Info
Updated:06-29-11 05:44 PM
Created:10-01-10 09:20 PM
Downloads:5,119
Favorites:16
MD5:

oUF boring totembar  Popular! (More than 5000 hits)

Version: 1.3.40200
by: tecu [More]

Update (v1.3.40200):

updated toc for 40200.


Purpose:

  • To add a totem display to the oUF player frame, similar to that of the default UI, and that of the original oUF_TotemBar by Soeters.
  • To provide features not present in Soeters' addon (being able to show totem icons is the most significant difference).


Features:

When set up properly, this addon will show and hide a frame for each totem based on whether or not that totem is active. In addition, if configured to do so, it will update a StatusBar and FontString to reflect the time left, another FontString with the name, a Texture (with the texture!), and color certain elements to reflect the type of the placed totem.


Usage:
  1. Add oUF_boring_totembar to the OptionalDeps in your layout's toc.
  2. Lament this addon's dumb name.
  3. Create a frame or table on your unitframe named TotemBar.
  4. Add four frames, TotemBar[1] through Totembar[4], to that table.
  5. Configure the following options/sub-elements as desired.


Options and Sub-Elements:
All of these are optional, the only thing this mod (should) need to work are the frames .TotemBar[1] through .TotemBar[4], and of course the .TotemBar element.
  • .TotemBar.Destroy : true|false : If true, you will be able to right click to destroy a totem and to shift-right click to destroy all totems.
  • .TotemBar.AbbreviateNames : true|false : if true, the initials of the totem name will be displayed in the text element instead of the whole name.
  • .UpdateColors : true|false : if true, this addon will update the colors of the .StatusBar and the .bg elements to reflect the type of totem.
  • .TotemBar[x].StatusBar : "StatusBar" UI frame. If present, it will be updated to reflect the time remaining on a placed totem.
  • .TotemBar[x].StatusBar.Reverse : true|false : if true, the .StatusBar element will 'fill' as opposed to deplete.
  • .TotemBar[x].Icon : UI texture : will be updated with the icon of the placed totem.
  • .TotemBar[x].Text : UI fontstring : will be updated with the name of the placed totem.
  • .TotemBar[x].bg : UI texture : will be colored to indicate the type of totem if .UpdateColors is true.
  • .TotemBar[x].bg.multiplier : number : Factor to darken the background color with respect to the totem's color (should be in the range 0 to 1).


(ugly) Usage Example:
Code:
if select(2, UnitClass'player') == "SHAMAN" then
	local w, h = 224, 16
	local tb = {
		AbbreviateNames = true,
		Destroy = true,
		UpdateColors = true,
	}
	for i = 1, 4 do
		local t = CreateFrame('Frame', nil, self)
		t:SetPoint('TOP', tb[i - 1] or self, 'BOTTOM', 0, -2)
		t:SetSize(w, h)
		
		local bg = t:CreateTexture(nil, 'BACKGROUND')
		bg:SetAllPoints()
		bg:SetTexture(1, 1, 1)
		bg.multiplier = 0.2
		t.bg = bg
		
		local bar = CreateFrame('StatusBar', nil, t)
		bar:SetPoint('RIGHT', -1, 0)
		bar:SetSize(w - h - 3, h - 2)
		bar.Reverse = true
		t.StatusBar = bar
		
		local icon = t:CreateTexture(nil, 'ARTWORK')
		icon:SetPoint('LEFT', 1, 0)
		icon:SetSize(h - 2, h - 2)
		icon:SetTexCoord(0.07, 0.93, 0.07, 0.93)
		t.Icon = icon
		
		local time = bar:CreateFontString(nil, 'OVERLAY')
		time:SetPoint('RIGHT', -1, 0)
		time:SetFontObject'GameFontNormal'
		time:SetJustifyH'RIGHT'
		t.Time = time
		
		local text = bar:CreateFontString(nil, 'OVERLAY')
		text:SetPoint('LEFT', 1, 0)
		text:SetPoint('RIGHT', time, 'LEFT', -2, 0)
		text:SetFontObject'GameFontNormal'
		text:SetJustifyH'LEFT'
		t.Text = text
		
		tb[i] = t
	end
	self.TotemBar = tb
end

Credits:
This addon is all original code, but heavily inspired by the coding of the default elements of oUF (by haste), and a blatant knockoff of the idea and functionality of oUF_TotemBar (by Soeters), which in turn was an attempt to replicate features in the default WoW UI.

v1.3:
- Added support for embedded oUF (I think)
- Moved color updates to enable()
- Changed the usage example to a more traditional icon + bar format. It is still ugly.


v1.2:
- Updated totem colors to those of the Default UI
- Removed pre-4.0 compatibility
- Revised the update method to use GetTotemTimeLeft
- - - This means it will update in 1s steps now
- Cleaned up some code and fixed some minor bugs.
Optional Files (0)


Post A Reply Comment Options
Unread 08-20-11, 05:44 AM  
pekaziz
A Kobold Labourer
 
pekaziz's Avatar

Forum posts: 0
File comments: 126
Uploads: 0
Thanks so much for the fast reply. Now all I need to do is to wait Haste to update ouf

Ah, I didn't see your 2nd post at the first time. You're a wonderful person tecu, now it totally works!
Last edited by pekaziz : 08-20-11 at 05:50 AM.
Report comment to moderator  
Reply With Quote
Unread 08-20-11, 03:50 AM  
tecu
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 23
Uploads: 1
oh hey look: some dude already reported this to haste ( https://github.com/haste/oUF/issues/96 ) so it'll be fixed sometime.
Report comment to moderator  
Reply With Quote
Unread 08-20-11, 03:28 AM  
tecu
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 23
Uploads: 1
this is probably not your fault. i looked at freeui and it uses the event system from the dev branch of oUF rather than that of the latest stable release. i followed the code (in my head, so i may be wrong about this), and it looks like this new event system is not compatible with PLAYER_TOTEM_UPDATE because arg1 is not a unit, and PLAYER_TOTEM_UPDATE is not listed in sharedUnitEvents. (it looks like any event not listed whose arg1 is not a unit will also not work).

if i'm right about this, you may be able to fix this by opening up FreeUI/oUF/events.lua and adding a new line after 67 (between 'UNIT_THREAT_LIST_UPDATE = true,' and '}') that says 'PLAYER_TOTEM_UPDATE = true,' (without the quotes).

if my suggestion works or not, this has gone beyond what i'm willing and able to support. your best bet at this time is to ask the author of freeui to use the latest stable release of oUF ( http://www.wowinterface.com/downloads/info9994-oUF.html ) and create a layout that supports the default oUF totem element.
Report comment to moderator  
Reply With Quote
Unread 08-19-11, 11:02 PM  
pekaziz
A Kobold Labourer
 
pekaziz's Avatar

Forum posts: 0
File comments: 126
Uploads: 0
Hi tecu,

Since the last update of FreeUI I can't make this plugin work anymore.

I'm still using this code and pasted it just before the "target" stuff in unitframes.lua like you told me before:

Code:
if select(2, UnitClass'player') == "SHAMAN" then
	local w, h = 56, 12
	local tb = {
		AbbreviateNames = true,
		Destroy = true,
		UpdateColors = true,
	}
	for i = 1, 4 do
		local t = CreateFrame('Frame', nil, self)
		t:SetPoint("LEFT", (i - 1) * (w + 1.8), -16)
		t:SetSize(w, h)
		
		local bg = t:CreateTexture(nil, 'BACKGROUND')
		bg:SetAllPoints()
		bg:SetTexture(1, 1, 1)
		bg.multiplier = 0.1
		t.bg = bg
		
		local bar = CreateFrame('StatusBar', nil, t)
		bar:SetPoint('RIGHT', -1, 0)
		bar:SetSize(w - 2, h - 2)
		bar.Reverse = false
		t.StatusBar = bar
		
		
		local text = bar:CreateFontString(nil, 'OVERLAY')
		text:SetPoint('CENTER', 0, 0)
		text:SetPoint('CENTER', time, 'CENTER', -2, 0)
		text:SetFont(C.media.font, 8, "OUTLINEMONOCHROME")
		text:SetJustifyH'LEFT'
		t.Text = text
		
		tb[i] = t
	end
	self.TotemBar = tb
end
But I can't see any timer or bar this way. However when my totems are up and I do a /reloadui, I can see them perfectly. But when they either expire or I destroy by right clicking, a black box remains there and I couldn't find a solution to remove it.

Before (only works after reloading ui)



After (no more totems are up now)



I appreciate if you help me to fix this.

Thanks.
Report comment to moderator  
Reply With Quote
Unread 06-21-11, 07:59 PM  
tecu
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 23
Uploads: 1
that is a personal layout that i made some time ago. i do not have a working version of it anymore.
Report comment to moderator  
Reply With Quote
Unread 06-18-11, 07:05 PM  
Rinderpest
A Kobold Labourer

Forum posts: 1
File comments: 9
Uploads: 0
What layout are you using in that screenshot?
Report comment to moderator  
Reply With Quote
Unread 05-24-11, 05:30 PM  
tecu
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 23
Uploads: 1
hey, wow, sorry this reply is so late; i never set up email alerts for the comments here. if you still need help, you can pm me the code you changed from freeui and i'll take a look at it.

i have a guess though:
do you check for unit == 'player' when unit is not defined? my sample code does this; it is an older, not-really-recommended approach to styles in oUF. freeUI does not define the unit local in its style function, so removing the unit == 'player' check may fix it for you.
Report comment to moderator  
Reply With Quote
Unread 05-05-11, 10:32 AM  
pekaziz
A Kobold Labourer
 
pekaziz's Avatar

Forum posts: 0
File comments: 126
Uploads: 0
Hi,

I'm not sure if you're still tracking this page but I've a problem to make this addon to work with FreeUI.

I've added proper code into ouf.xml and your sample code into unitframes.lua but still couldn't get any result.

Can you help me with this?

Thanks.
Report comment to moderator  
Reply With Quote
Unread 01-24-11, 04:50 PM  
tecu
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 23
Uploads: 1
Re: Installation

Hey _Qo_.

oUF_lumen uses Soeters' oUF_TotemBar plugin (found here: http://www.wowinterface.com/download..._TotemBar.html ). Please download and use that instead.
Report comment to moderator  
Reply With Quote
Unread 01-22-11, 04:29 PM  
_Qo_
A Kobold Labourer

Forum posts: 0
File comments: 7
Uploads: 0
Exclamation Installation

Hi, im new on shamans but not on oUF unit frames, but i've got some problem while trying to uso this really useful plug-in.
Atm i'm using this compilation lumUI with rActionBarStyler and i can't find a way to let this plug-in works.
I've tryed to set the totembar of rActionBarStyler to =disable but didn't work.
My question is: this is a code that i've to copy and paste inside my .lua layout file (in my case oUFLumen\cfg.lua), or it's a "normal" addon that simply needs to be excrat into the Addon folder of world of warcraft?
Thanks! and sorry for my bad english
Report comment to moderator  
Reply With Quote
Unread 10-20-10, 01:34 PM  
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view AddOns

Forum posts: 221
File comments: 68
Uploads: 7
Really nice one, integrated it into my layout and it's working perfectly... Had no chance to test it on my Lvl80-Shaman, but works well on the Lvl7 dev-char.
__________________
Report comment to moderator  
Reply With Quote
Unread 10-18-10, 10:27 PM  
tecu
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 23
Uploads: 1
Cheers, glad to hear it. And I'll try to keep it working as long as folks are using it.
Report comment to moderator  
Reply With Quote
Unread 10-17-10, 06:24 PM  
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view AddOns

Forum posts: 268
File comments: 498
Uploads: 2
Nice addon mate. I've set it up and it's working nice.

Thanks for your work. Hope you intend to update it in the future if necessary! ^^
__________________
My oUF Layout: oUF Lumen
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: