/
local outbound = true |
local mf, mfn |
local db |
local delayMapUpdate = .2 |
local delayMapUpdate = .4 |
local delayOnUpdate = .5 |
local WorldMapFrame = TestWorldMapFrame and TestWorldMapFrame or WorldMapFrame |
local function isoutbound() |
return true |
end |
local function getContinent() |
local continent |
local mapID = C_Map.GetBestMapForUnit("player") |
if(mapID) then |
local info = C_Map.GetMapInfo(mapID) |
if(info) then |
if(info['mapType'] > 2) then |
while(info['mapType'] > 2) do |
info = C_Map.GetMapInfo(info['parentMapID']) |
end |
continent = info['mapID'] |
end |
end |
end |
return continent |
end |
local function positionFrame() |
if(WORLDMAP_SETTINGS['size'] ~= WORLDMAP_WINDOWED_SIZE) then |
-- if(WORLDMAP_SETTINGS['size'] ~= WORLDMAP_WINDOWED_SIZE) then |
if(WorldMapFrame:IsMaximized()) then |
zz_CoordsMapFrameCoordText:SetPoint("BOTTOM", WorldMapFrame, "BOTTOM", db['screenX'], db['screenY']) |
else |
zz_CoordsMapFrameCoordText:SetText() |
end |
local function bfa_func() |
if(C_Map and C_Map.GetPlayerMapPosition) then |
return C_Map.GetPlayerMapPosition(C_Map.GetBestMapForUnit("player"),"player") |
local mapID = C_Map.GetBestMapForUnit("player") |
if(mapID) then |
return C_Map.GetPlayerMapPosition(mapID,"player") |
end |
else |
local x,y = GetPlayerMapPosition("player") |
return { |
end |
local function setPlayerCoords() |
local tab = bfa_func() |
local x,y = tab['x'],tab['y'] |
if(x) then |
if(y) then |
playerCoords = format("%.1f, %.1f", x*100, y*100) |
if(tab) then |
local x,y = tab['x'],tab['y'] |
if(x) then |
if(y) then |
playerCoords = format("%.1f, %.1f", x*100, y*100) |
end |
end |
end |
end |
local function ZONED() |
if(not WorldMapFrame:IsShown()) then |
SetMapToCurrentZone() |
-- SetMapToCurrentZone() |
end |
zoneText = db['ShowZone'] and GetRealZoneText() or "" |
if(db['ShowSubZone']) then |
end |
zoneText = limitLength(zoneText,db['maxLength']) |
end |
local alreadyprinted = false |
local function MapFrame_OnUpdate() |
C_Timer.After(delayMapUpdate, MapFrame_OnUpdate) |
if(not zz_CoordsMapFrameCoordText:IsVisible()) then return end |
if(not alreadyprinted) then |
alreadyprinted=true |
for k,v in pairs(WorldMapFrame) do |
print(k,v) |
end |
end |
if(not WorldMapFrame.ScrollContainer:IsVisible()) then return end |
setPlayerCoords() |
local x, y = GetCursorPosition(); |
x = x / WorldMapButton:GetEffectiveScale(); |
y = y / WorldMapButton:GetEffectiveScale(); |
local centerX, centerY = WorldMapButton:GetCenter(); |
local width = WorldMapButton:GetWidth(); |
local height = WorldMapButton:GetHeight(); |
local x,y = WorldMapFrame.ScrollContainer:GetCursorPosition() |
local centerX, centerY = WorldMapFrame.ScrollContainer:GetCenter(); |
local width = WorldMapFrame.ScrollContainer:GetWidth(); |
local height = WorldMapFrame.ScrollContainer:GetHeight(); |
local adjustedY = addon['round']((centerY + (height/2) - y) / height * 100,1); |
local adjustedX = addon['round']((x - (centerX - (width/2))) / width * 100,1); |
zz_CoordsMapFrameCoordText:SetText(format("%s%s",isoutbound() and L['outbound'] or L['COORDFMTSTRING']( mapFrame,adjustedX, adjustedY), playerCoords)) |
-- WorldMapFrameTitleText:SetText(adjustedX..", "..adjustedY) |
positionFrame() |
if(isoutbound()) then |
MouseOut(mapFrame) |
coordText:SetTextColor(GameFontNormal:GetTextColor()) |
coordText:SetShadowColor(GameFontNormal:GetShadowColor()) |
coordText:SetShadowOffset(GameFontNormal:GetShadowOffset()) |
coordText:SetPoint("BOTTOM", WorldMapFrame, "BOTTOM", 0, 10) |
coordText:SetPoint("BOTTOM", WorldMapFrame.ScrollContainer, "BOTTOM", 0, 10) |
mapFrame:Show() |
coordText:Show() |
end |
local function getPref(pref) |