Thread Tools Display Modes
11-29-10, 01:57 PM   #1
Lyelu
A Cyclonian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 44
Buff Scripts

I'm trying to make it so you can left-click the buffs frame to toggle between Show all buffs and show only my buffs. It doesn't work...
Code:
	self.Buffs:SetScript("OnMouseUp", function(self, btn)
		local frame = self:GetParent()
		if btn == "LeftButton" then 
			frame.Buffs.onlyShowPlayer = not frame.Buffs.onlyShowPlayer
			Henna.db.profile.mybuffsonly = frame.Buffs.onlyShowPlayer
			print (frame.Buffs.onlyShowPlayer )
		end
		if btn == "RightButton" then
			print ("You must type /cancel <buff name> to cancel a buff.")
		end
	end)
Advice?

Also I can't update the sizes from my Config panel.

Code:
buffsize = {
	name = "Buff Size",
	type = "range",
	min = 14, max = 32, step = 1,
	arg = "buffsize",
	get	= function() return Henna.db.profile.buffsize end,
	set	= function(info, v) Henna.db.profile.buffsize = v 
			for i,v in pairs(oUF.objects) do
				if (v.unit ~= nil) then
					if (v.Buffs) then v.Buffs.size = Henna.db.profile.buffsize end
					if (v.Debuffs) then v.Debuffs.size = Henna.db.profile.buffsize end
				end
			end
			end,
}
This second part, I think I need to use SetSize instead, but I can't figure out the name of my target frames. I've tried everything I could think of, from reading oUF/elements/aura.lua. It works when you use /reload ui, but I have all the rest of the file working without using a reload, so this last part is irksomely inconsistent.

Thanks for any help!

Last edited by Lyelu : 11-29-10 at 01:59 PM.
  Reply With Quote
11-29-10, 10:25 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You need to run buffs:ForceUpdate() after changing the settings.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
11-30-10, 03:54 PM   #3
Lyelu
A Cyclonian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 44
Thanks - that worked on the buffs frame.


It doesn't work in the options though; it appears to adjust the spacing instead of the size.
Code:
if (v.Buffs) then v.Buffs:ForceUpdate() end
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Buff Scripts


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