View Single Post
09-04-15, 05:34 AM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Lua Code:
  1. local CoordText = WorldMapFrameCloseButton:CreateFontString(nil, nil, 'GameFontNormal')
  2. CoordText:SetPoint('RIGHT', WorldMapFrameCloseButton, 'LEFT', -30, 0)
  3.  
  4. local totalElapsed = 0
  5. WorldMapDetailFrame:HookScript('OnUpdate', function(self, elapsed)
  6.     if(totalElapsed > 0.1) then
  7.         if(WorldMapScrollFrame:IsMouseOver()) then
  8.             local scale = self:GetEffectiveScale()
  9.             local centerX, centerY = self:GetCenter()
  10.             local width, height = self:GetSize()
  11.             local x, y = GetCursorPosition()
  12.  
  13.             x = ((x / scale) - (centerX - (width / 2))) / width
  14.             y = (centerY + (height / 2) - (y / scale)) / height
  15.  
  16.             CoordText:SetFormattedText('%.2f, %.2f', x * 100, y * 100)
  17.             CoordText:SetTextColor(0, 1, 0)
  18.         else
  19.             local x, y = GetPlayerMapPosition('player')
  20.             CoordText:SetFormattedText('%.2f, %.2f', x * 100, y * 100)
  21.             CoordText:SetTextColor(1, 1, 0)
  22.         end
  23.  
  24.         totalElapsed = 0
  25.     else
  26.         totalElapsed = totalElapsed + elapsed
  27.     end
  28. end)

What I use, this adds player (or mouse when hovering the map) position to the left of the close button.
  Reply With Quote