Download
(1 Kb)
Download
Updated: 01-09-11 03:00 PM
Pictures
File Info
Updated:01-09-11 03:00 PM
Created:11-27-10 10:49 AM
Downloads:1,508
Favorites:6
MD5:
oUF DruidMana
Version: 1.2.2
by: Ennie [More]
Druid ManaBar oUF plugin
You will need oUF, and layout providing support for this plugin. It allows to show mana bar when you in Bear or Cat form.

Git repo: https://github.com/Ennie/oUF_DruidMana


My code to use this plugin. I use it with oUF_Drk v2


1. in lib.lua before
Code:
		elseif playerClass == "SHAMAN" then
			if IsAddOnLoaded("oUF_boring_totembar") then
				local barFrame = CreateFrame("Frame", nil, self)
				barFrame:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -5)
				barFrame:SetHeight(4)
				barFrame:SetWidth(self:GetWidth())
				barFrame:SetFrameLevel(3)
add this:
Code:
			-- shifted mana bar
			if IsAddOnLoaded("oUF_DruidMana") then
				local manaBarFrame = CreateFrame("Frame", nil, self)
				manaBarFrame:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -5)
				manaBarFrame:SetHeight(4)
				manaBarFrame:SetWidth(self:GetWidth())
				manaBarFrame:SetFrameLevel(4)
				createBGFrame(manaBarFrame, 3)
				local ManaBar = CreateFrame('StatusBar', nil, manaBarFrame)
				ManaBar:SetPoint('LEFT', manaBarFrame, 'LEFT', 0, 0)
				ManaBar:SetSize(manaBarFrame:GetWidth(), manaBarFrame:GetHeight())
				ManaBar:SetStatusBarTexture(cfg.statusBarTexture)
				ManaBar:GetStatusBarTexture():SetHorizTile(true)
				ManaBar:SetFrameLevel(5)

				local MBText = setFont(ManaBar, cfg.font, 10, "OUTLINE", 2)
				MBText:SetPoint('CENTER', ManaBar, 'CENTER', 0, 0)
				self:Tag(MBText, '[drk:druidmana]')

				manaBarFrame.ManaBar = ManaBar
				self.DruidMana = manaBarFrame
			end
2. at end of file tags.lua add this:
Code:
-- druid mana
oUF.Tags['drk:druidmana']  = function() 
	local min, max = UnitPower('player', SPELL_POWER_MANA), UnitPowerMax('player', SPELL_POWER_MANA)
	if min~=max then 
		return SVal(min)
	else
		return SVal(max)
	end
end
oUF.TagEvents['drk:druidmana'] = 'UNIT_POWER UNIT_MAXPOWER'
v1.2.2
- fixed default coloring

v1.2.1
- fixed tag error. sorry :<

v1.2
- added oUF tag for mana min/max values

v1.1
- improved and corrected plugin text with haste`s advices.
- implemented coloring by class, bar color, and gradient.
- code cleanup

v1.0
- first release
Optional Files (0)


Archived Files (4)
File Name
Version
Size
Author
Date
1.2.1
1kB
Ennie
01-08-11 02:22 PM
1.2
1kB
Ennie
01-08-11 10:31 AM
1.1
1kB
Ennie
11-27-10 06:54 PM
1.0
987B
Ennie
11-27-10 11:11 AM


Post A Reply Comment Options
Old 03-25-12, 02:19 AM  
Xark
A Deviate Faerie Dragon

Forum posts: 14
File comments: 63
Uploads: 0
hey

can someone pls tell me how to enable this in ouf_hank?

would be lovely

Thnx Xark
Xark is offline Report comment to moderator  
Reply With Quote
Old 03-17-11, 03:08 PM  
Ennie
A Murloc Raider
 
Ennie's Avatar
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 24
Uploads: 6
Originally posted by Akkorian
Hi Ennie,

You should probably replace this:
Code:
		local t = PowerBarColor['MANA']
		r, g, b = t['r'], t['g'], t['b']
with this:
Code:
		r, g, b = unpack( oUF.colors.power.MANA )
Most layouts don’t change the values in PowerBarColor, but lots of them change the colors in oUF’s colors table.
Thank you for pointing at it, i'll include it in next update.
__________________
Ennie is offline Report comment to moderator  
Reply With Quote
Old 02-22-11, 05:58 AM  
Akkorian
A Flamescale Wyrmkin
 
Akkorian's Avatar
AddOn Author - Click to view AddOns

Forum posts: 107
File comments: 122
Uploads: 2
Hi Ennie,

You should probably replace this:
Code:
		local t = PowerBarColor['MANA']
		r, g, b = t['r'], t['g'], t['b']
with this:
Code:
		r, g, b = unpack( oUF.colors.power.MANA )
Most layouts don’t change the values in PowerBarColor, but lots of them change the colors in oUF’s colors table.
__________________
“Be humble, for you are made of earth. Be noble, for you are made of stars.” — Serbian proverb
Akkorian is online now Report comment to moderator  
Reply With Quote
Old 01-10-11, 11:52 PM  
Ennie
A Murloc Raider
 
Ennie's Avatar
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 24
Uploads: 6
Originally posted by drakull
Sorry, I totally missed the .bg implementation in your code.
no problems. thanks for the feedback
__________________
Ennie is offline Report comment to moderator  
Reply With Quote
Old 01-10-11, 04:56 AM  
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view AddOns

Forum posts: 49
File comments: 58
Uploads: 1
Sorry, I totally missed the .bg implementation in your code.
drakull is offline Report comment to moderator  
Reply With Quote
Old 01-09-11, 11:23 AM  
Ennie
A Murloc Raider
 
Ennie's Avatar
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 24
Uploads: 6
Originally posted by drakull
I found a little bug while trying out your plugin, you must change line 36 from:
Code:
r, g, b = self.ColorGradient(min / max, unpack(druidmana.smoothGradient or druidmana.colors.smooth))
to:
Code:
r, g, b = self.ColorGradient(min / max, unpack(oUF.smoothGradient or oUF.colors.smooth))
Thanks for the feedback
i'm busy wiping at nefarian right now, but after raidover i'll post update.


Originally posted by drakull
Edit: I'm writing a postupdate function to add a .bg object with a multiplier property (just like I did with holypower and soulshards bars) but I think it would be cleaner if u had it inside your plugin.

Let me know what you think.
Not shure i understand you right, but.. What do you want to do with that? change bar alpha depending on how much mana druid have or what?

And can't it help you? if you set DruidMana.bg.multiplier to your value, it should work.
Code:
		local bg = druidmana.bg
		if(bg) then
			local mu = bg.multiplier or 1
			bg:SetVertexColor(r * mu, g * mu, b * mu)
		end
__________________
Last edited by Ennie : 01-09-11 at 11:53 AM.
Ennie is offline Report comment to moderator  
Reply With Quote
Old 01-08-11, 05:55 PM  
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view AddOns

Forum posts: 49
File comments: 58
Uploads: 1
I found a little bug while trying out your plugin, you must change line 36 from:
Code:
r, g, b = self.ColorGradient(min / max, unpack(druidmana.smoothGradient or druidmana.colors.smooth))
to:
Code:
r, g, b = self.ColorGradient(min / max, unpack(oUF.smoothGradient or oUF.colors.smooth))
Edit: I'm writing a postupdate function to add a .bg object with a multiplier property (just like I did with holypower and soulshards bars) but I think it would be cleaner if u had it inside your plugin.

Let me know what you think.
Last edited by drakull : 01-08-11 at 05:58 PM.
drakull is offline Report comment to moderator  
Reply With Quote
Old 01-08-11, 02:33 PM  
Ennie
A Murloc Raider
 
Ennie's Avatar
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 24
Uploads: 6
Re: Re: Re: Wow

Originally posted by Rammoth
Okay, and I got the codes there.

I like how yours looks better though. When I looked at the screenshots of the original, it's not nearly as cool. I don't know what you did to make it look so much better, but I like it a lot.
in my version of oUF_Drk i've changed font(BigNoodleTilting => MagistralTT), fontsize, values, and textures(drakull liked Aluminium texture, while my favourite is Minimalist). I can share it, but it integrated into my undone UI, and you know, you shouldn't poke drakull for bugs from my rewrite of oUF_Drk

If you already applied my code from comment, please update it, it was incompatible with eclipse bar (didn't work for boomkins). Also, please update DruidMana addon, there are an error in prev.version
__________________
Last edited by Ennie : 01-08-11 at 02:34 PM.
Ennie is offline Report comment to moderator  
Reply With Quote
Old 01-08-11, 01:11 PM  
Rammoth
A Cliff Giant
 
Rammoth's Avatar
AddOn Author - Click to view AddOns

Forum posts: 73
File comments: 672
Uploads: 1
Re: Re: Wow

Originally posted by Ennie
It's modified oUF_Drk from QulightUI. If you like this layout, i can provide my code to add support for my plugin.

Original oUF layout - oUF_Drk by Drakull can be found here
Okay, and I got the codes there.

I like how yours looks better though. When I looked at the screenshots of the original, it's not nearly as cool. I don't know what you did to make it look so much better, but I like it a lot.
Rammoth is offline Report comment to moderator  
Reply With Quote
Old 01-08-11, 11:40 AM  
Ennie
A Murloc Raider
 
Ennie's Avatar
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 24
Uploads: 6
oUF_Drk

To add plugin support in oUF_Drk 2.0 layout you should add this code:
1. in lib.lua before
Code:
		elseif playerClass == "SHAMAN" then
			if IsAddOnLoaded("oUF_boring_totembar") then
				local barFrame = CreateFrame("Frame", nil, self)
				barFrame:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -5)
				barFrame:SetHeight(4)
				barFrame:SetWidth(self:GetWidth())
				barFrame:SetFrameLevel(3)
add this:
Code:
			-- shifted mana bar
			if IsAddOnLoaded("oUF_DruidMana") then
				local manaBarFrame = CreateFrame("Frame", nil, self)
				manaBarFrame:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -5)
				manaBarFrame:SetHeight(4)
				manaBarFrame:SetWidth(self:GetWidth())
				manaBarFrame:SetFrameLevel(4)
				createBGFrame(manaBarFrame, 3)
				local ManaBar = CreateFrame('StatusBar', nil, manaBarFrame)
				ManaBar:SetPoint('LEFT', manaBarFrame, 'LEFT', 0, 0)
				ManaBar:SetSize(manaBarFrame:GetWidth(), manaBarFrame:GetHeight())
				ManaBar:SetStatusBarTexture(cfg.statusBarTexture)
				ManaBar:GetStatusBarTexture():SetHorizTile(true)
				ManaBar:SetFrameLevel(5)

				local MBText = setFont(ManaBar, cfg.font, 10, "OUTLINE", 2)
				MBText:SetPoint('CENTER', ManaBar, 'CENTER', 0, 0)
				self:Tag(MBText, '[drk:druidmana]')

				manaBarFrame.ManaBar = ManaBar
				self.DruidMana = manaBarFrame
			end
2. at end of file tags.lua add this:
Code:
-- druid mana
oUF.Tags['drk:druidmana']  = function() 
	local min, max = UnitPower('player', SPELL_POWER_MANA), UnitPowerMax('player', SPELL_POWER_MANA)
	if min~=max then 
		return SVal(min)
	else
		return SVal(max)
	end
end
oUF.TagEvents['drk:druidmana'] = 'UNIT_POWER UNIT_MAXPOWER'
EDIT: tested, worked for me. going to add this to addon page.
__________________
Last edited by Ennie : 01-08-11 at 02:46 PM.
Ennie is offline Report comment to moderator  
Reply With Quote
Old 01-08-11, 10:05 AM  
Ennie
A Murloc Raider
 
Ennie's Avatar
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 24
Uploads: 6
Re: Wow

Originally posted by Rammoth
The player frame in the first screenshot is amazing, what player frame layout are you using for that, how do I get that?
It's modified oUF_Drk from QulightUI. If you like this layout, i can provide my code to add support for my plugin.

Original oUF layout - oUF_Drk by Drakull can be found here
__________________
Last edited by Ennie : 01-08-11 at 10:09 AM.
Ennie is offline Report comment to moderator  
Reply With Quote
Old 01-04-11, 07:06 PM  
Rammoth
A Cliff Giant
 
Rammoth's Avatar
AddOn Author - Click to view AddOns

Forum posts: 73
File comments: 672
Uploads: 1
Wow

The player frame in the first screenshot is amazing, what player frame layout are you using for that, how do I get that?
Rammoth is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: