Thread Tools Display Modes
03-21-11, 09:37 AM   #1
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Showing mushrooms in ouf

A druid can place wild mushrooms on the ground: http://www.wowhead.com/spell=88747

I've been told that ouf_mono shows the number of placed mushrooms in the player frame, but I couldn't really find the code where this happens. Does anyone know how to do it in ouf? What element would be responsible for this, or is it a custom solution? Thanks for any help
__________________
" ... and the Vogon will do things to you that you wish you'd never been born, or, if you're a clearer minded thinker, that the Vogon had never been born."
  Reply With Quote
03-21-11, 10:07 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
If the number is represented by the stack counter of the buff you could just track the spellid and show the buff count.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
03-21-11, 12:44 PM   #3
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Originally Posted by zork View Post
If the number is represented by the stack counter of the buff you could just track the spellid and show the buff count.
Ah no, there's no buff associated to that. I could manually track that via UNIT_SPELLCAST_SUCCESSFULL, but as I said, I heard it can be done via ouf
__________________
" ... and the Vogon will do things to you that you wish you'd never been born, or, if you're a clearer minded thinker, that the Vogon had never been born."
  Reply With Quote
03-21-11, 01:13 PM   #4
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Found it Seems he's using the totembar to see the how many that are out there.

Code:
-- shrooooooooooooms (Wild Mushroom)
if select(2, UnitClass("player")) == "DRUID" then
	for i=1,3 do
		oUF.Tags['mono:wm'..i] = function(u)
			_,_,_,dur = GetTotemInfo(i)
			if dur > 0 then
				return "|cffFF6161_ |r"
			end
		end
		oUF.TagEvents['mono:wm'..i] = 'PLAYER_TOTEM_UPDATE'
		oUF.UnitlessTagEvents.PLAYER_TOTEM_UPDATE = true
	end
end

Last edited by Aftermathhqt : 03-21-11 at 01:15 PM.
  Reply With Quote
03-21-11, 02:03 PM   #5
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Originally Posted by Game92 View Post
Found it Seems he's using the totembar to see the how many that are out there.

Code:
-- shrooooooooooooms (Wild Mushroom)
if select(2, UnitClass("player")) == "DRUID" then
	for i=1,3 do
		oUF.Tags['mono:wm'..i] = function(u)
			_,_,_,dur = GetTotemInfo(i)
			if dur > 0 then
				return "|cffFF6161_ |r"
			end
		end
		oUF.TagEvents['mono:wm'..i] = 'PLAYER_TOTEM_UPDATE'
		oUF.UnitlessTagEvents.PLAYER_TOTEM_UPDATE = true
	end
end
Uhh yeah thanks a lot, right just now someone posted in the official forums that they use the totem bar. Thanks a lot
__________________
" ... and the Vogon will do things to you that you wish you'd never been born, or, if you're a clearer minded thinker, that the Vogon had never been born."
  Reply With Quote
03-22-11, 06:16 AM   #6
Monolit
A Black Drake
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 81
Originally Posted by Pyrates View Post
A druid can place wild mushrooms on the ground: http://www.wowhead.com/spell=88747

I've been told that ouf_mono shows the number of placed mushrooms in the player frame, but I couldn't really find the code where this happens. Does anyone know how to do it in ouf? What element would be responsible for this, or is it a custom solution? Thanks for any help
The solution I came up with may be not ideal but it should do the job for now.
I mean I couldn't find the proper way to make a single tag that handles all of the mushrooms at the same time, instead I had to make that loop creating 3 different tags for each of the mushrooms and then put them in my special power display func like this:
Code:
  --gen class specific power display
  lib.gen_specificpower = function(f, unit)
    local h = CreateFrame("Frame", nil, f)
    h:SetAllPoints(f.Health)
    h:SetFrameLevel(10)
    local sp = lib.gen_fontstring(h, cfg.font, 30, "THINOUTLINE")
    sp:SetPoint("CENTER", f.Health, "CENTER",0,3)
	if class == "DRUID" then
		f:Tag(sp, '[mono:wm1][mono:wm2][mono:wm3]')
	else
		f:Tag(sp, '[mono:sp][mono:orbs][mono:ws][mono:ls]')
	end
  end
I've only done testing on my shaman (since it uses more or less same mechanics) and it does seem to be working correctly, however there might be a better way of implementing this as a single tag for shrooms.

EDIT: Oh yes, and if you wonder why you can't find this in oUF_mono ... I've been just a bit lazy with uploading standalone versions of my add-ons. It's available as part of MonoUI.

Last edited by Monolit : 03-22-11 at 06:19 AM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Showing mushrooms in ouf


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