Thread Tools Display Modes
07-13-10, 11:01 AM   #1
Zagrei
A Cobalt Mageweaver
 
Zagrei's Avatar
AddOn Compiler - Click to view compilations
Join Date: Nov 2009
Posts: 246
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 Thanks in advance!
__________________

Last edited by Zagrei : 07-13-10 at 11:19 AM.
  Reply With Quote
07-13-10, 11:38 AM   #2
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
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.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Add instance difficulty to Minimap text string?

Thread Tools
Display Modes

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