WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Add instance difficulty to Minimap text string? (https://www.wowinterface.com/forums/showthread.php?t=33914)

Zagrei 07-13-10 11:01 AM

Add instance difficulty to Minimap text string?
 
Hey, I'm working with a self-modified version of iMinimap. Basically, I removed all of the icons and replaced them with text strings, such as 'LFG' when in a que, or 'MAIL!" when you have mail (duh), and made the tracking menu show when you right click the minimap.

What I want to know is if it is possible to put a '+' next to the 'LFG' string when I am in a Heroic instance, and hide it when I am in a Regular difficulty one. I have tried looking in the code of other minimaps, but none of them have anything helpful (that I have noticed, anyways). I was thinking it would look like 'LFG+' for Heroic, and 'LFG' when in a Reg.

If someone could give me a helping hand, that would be quite dandy :D Thanks in advance!

Waverian 07-13-10 11:38 AM

Here's some code I'm using for the instance size / difficulty tag on my minimap (mostly ripped from the FrameXML for the minimap difficulty icon anyway)

Code:

local UpdateDifficultyTag = function()
        local _, instanceType, difficulty, _, maxPlayers, playerDifficulty, isDynamicInstance = GetInstanceInfo()
        if (instanceType == 'party' or instanceType == 'raid') and not (difficulty == 1 and maxPlayers == 5) then               
                local isHeroic = false
                if instanceType == 'party' and difficulty == 2 then
                        isHeroic = true
                elseif instanceType == 'raid' then
                        if isDynamicInstance and playerDifficulty == 1 then
                                isHeroic = true
                        elseif difficulty > 2 then
                                isHeroic = true
                        end
                end

                MiniMapInstanceDifficultyText:SetFormattedText('%d%s', maxPlayers, isHeroic and 'H' or 'N')
        end
end

local f = CreateFrame'Frame'
f:RegisterEvent'PLAYER_DIFFICULTY_CHANGED'
f:RegisterEvent'UPDATE_INSTANCE_INFO'
f:SetScript('OnEvent', UpdateDifficultyTag)

Should be pretty easy to use your fontstring object instead, and using a + instead of H/N.


All times are GMT -6. The time now is 01:21 AM.

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