WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Showing mushrooms in ouf (https://www.wowinterface.com/forums/showthread.php?t=39368)

Pyrates 03-21-11 09:37 AM

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 :)

zork 03-21-11 10:07 AM

If the number is represented by the stack counter of the buff you could just track the spellid and show the buff count.

Pyrates 03-21-11 12:44 PM

Quote:

Originally Posted by zork (Post 232505)
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 :)

Aftermathhqt 03-21-11 01:13 PM

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


Pyrates 03-21-11 02:03 PM

Quote:

Originally Posted by Game92 (Post 232520)
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 :)

Monolit 03-22-11 06:16 AM

Quote:

Originally Posted by Pyrates (Post 232501)
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.


All times are GMT -6. The time now is 02:55 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI