WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Minimap Code (https://www.wowinterface.com/forums/showthread.php?t=36650)

Phylax 11-09-10 01:18 PM

Minimap Code
 
Hello all, i need some help with a bit of code from a minimap mod.

MinimapZoneTextButton:SetParent(Minimap)
MinimapZoneTextButton:SetPoint("TOP", Minimap, 0, 14)
MinimapZoneTextButton:SetFrameStrata("LOW")
MinimapZoneText:SetFont('[FONTS\\ARIALN.ttf', 10, 'OUTLINE')
MinimapZoneText:SetTextColor(.41, .80, .94)

is what i have so far, i want the zone text to show up there and be that color, the only problem is when i zone it resets back to default blizzard green color, is there anyway to force it to keep that color?

Haleth 11-09-10 01:20 PM

Code:

local function dummy() end
MinimapZoneText.SetTextColor = dummy

Make sure you add that second line after you've set the new colour.

Also, you seem to have a typo at the font part, you have a bracket [ that shouldn't be there.

You might also want to add this before you set the new position of the button:

Code:

MinimapZoneTextButton:ClearAllPoints()
I'm not sure if it's necessary to parent the button to the minimap by the way because I doubt it'll make much of a difference.

Phylax 11-09-10 06:08 PM

ty much, worked great :)

samishii23 11-10-10 02:59 PM

Quote:

Originally Posted by Haleth (Post 217051)
Code:

local function dummy() end
MinimapZoneText.SetTextColor = dummy


If i'm to understand this, that means that basicly each time the zone text is updated that function will run?

Haleth 11-10-10 03:01 PM

Indeed. The function that sets the text colour now becomes an empty function.

samishii23 11-10-10 06:16 PM

Ah, now I see. Explains why I've seen so many "Dummy" functions in addons.
Ty for the insight. :)

Seerah 11-10-10 08:18 PM

Or you could just do
Code:

MinimapZoneText.SetTextColor = function() end


All times are GMT -6. The time now is 02:16 PM.

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