Thread Tools Display Modes
11-09-10, 01:18 PM   #1
Phylax
A Defias Bandit
AddOn Compiler - Click to view compilations
Join Date: Mar 2010
Posts: 3
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?
  Reply With Quote
11-09-10, 01:20 PM   #2
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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.

Last edited by Haleth : 11-09-10 at 01:24 PM.
  Reply With Quote
11-09-10, 06:08 PM   #3
Phylax
A Defias Bandit
AddOn Compiler - Click to view compilations
Join Date: Mar 2010
Posts: 3
ty much, worked great
  Reply With Quote
11-10-10, 02:59 PM   #4
samishii23
An Aku'mai Servant
Join Date: Oct 2010
Posts: 33
Originally Posted by Haleth View Post
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?
  Reply With Quote
11-10-10, 03:01 PM   #5
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Indeed. The function that sets the text colour now becomes an empty function.
  Reply With Quote
11-10-10, 06:16 PM   #6
samishii23
An Aku'mai Servant
Join Date: Oct 2010
Posts: 33
Ah, now I see. Explains why I've seen so many "Dummy" functions in addons.
Ty for the insight.
  Reply With Quote
11-10-10, 08:18 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Or you could just do
Code:
MinimapZoneText.SetTextColor = function() end
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Minimap Code

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