Lua Code:
local CoordText = WorldMapFrame.BorderFrame.TitleText
local totalElapsed = 0
WorldMapDetailFrame:HookScript('OnUpdate', function(self, elapsed)
if(totalElapsed > 0.1) then
if(WorldMapScrollFrame:IsMouseOver()) then
local scale = self:GetEffectiveScale()
local centerX, centerY = self:GetCenter()
local width, height = self:GetSize()
local x, y = GetCursorPosition()
x = ((x / scale) - (centerX - (width / 2))) / width
y = (centerY + (height / 2) - (y / scale)) / height
CoordText:SetFormattedText('%.0f , %.0f', x * 100, y * 100)
CoordText:SetTextColor(0, 1, 0)
else
local x, y = GetPlayerMapPosition('player')
CoordText:SetFormattedText('%.0f , %.0f', x * 100, y * 100)
CoordText:SetTextColor(1, 1, 0)
end
totalElapsed = 0
else
totalElapsed = totalElapsed + elapsed
end
end)
Is throwing this error, repeatedly.
Code:
25x Tweaks\Coordinates.lua:19: attempt to perform arithmetic on local 'x' (a nil value)
Tweaks\Coordinates.lua:19: in function <Tweaks\Coordinates.lua:4>
Locals:
self = WorldMapDetailFrame {
0 = <userdata>
}
elapsed = 0.015000000596046
x = nil
y = nil
(*temporary) = <function> defined =[C]:-1
(*temporary) = WorldMapFrameTitleText {
0 = <userdata>
}
(*temporary) = "%.0f , %.0f"
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to perform arithmetic on local 'x' (a nil value)"
totalElapsed = 0.11200000345707
CoordText = WorldMapFrameTitleText {
0 = <userdata>
Any ideas as to why? It seems to happen inside instances.
Thanks.