/
<Bindings> |
<!-- |
<Binding name="METAMAP_MAPTOGGLE" header="METAMAP_TITLE"> |
MetaMap_ToggleFrame(WorldMapFrame); |
</Binding> |
<Binding name = "METAMAP_NBK"> |
MetaMap_LoadNBK() |
</Binding> |
--> |
</Bindings> |
function MetaMap_GetMapContinents() |
local continentNames = { }; |
for i = 1, 1000 do |
local mapInfo = C_Map.GetMapInfo(i); |
if ( mapInfo and mapInfo.mapType == 2 and mapInfo.parentMapID > 0 ) then |
continentNames[mapInfo.mapID] = mapInfo.name; |
end |
local continentsP6 = { GetMapContinents() }; |
local index = 0; |
for i = 2, #continentsP6, 2 do |
index = index + 1; |
continentNames[index] = continentsP6[i]; |
end |
return continentNames; |
end |
function MetaMap_GetMapZones(cMapID) |
function MetaMap_GetMapZones(cKey) |
local zoneNames = { }; |
local mapInfo = C_Map.GetMapChildrenInfo(cMapID); |
for key, zone in pairs(mapInfo) do |
if ( zone.mapType == 3 ) then |
zoneNames[zone.mapID] = zone.name; |
-- some maps have sub-maps |
local sMapInfo = C_Map.GetMapChildrenInfo(zone.mapID); |
for sKey, sZone in pairs(sMapInfo) do |
if ( sZone.mapType == 3 ) then |
zoneNames[sZone.mapID] = sZone.name; |
local zonesP6 = { GetMapZones(cKey) }; |
local index = 0; |
for i = 2, #zonesP6, 2 do |
index = index + 1; |
zoneNames[index] = zonesP6[i]; |
local mapid = zonesP6[i-1]; |
local subZonesP6 = { GetMapSubzones(mapid) }; |
if ( #subZonesP6 > 0 ) then |
for j = 2, #subZonesP6, 2 do |
index = index + 1; |
zoneNames[index] = subZonesP6[j]; |
end |
end |
end |
end |
return zoneNames; |
end |
--[[ |
function MetaMap_GetMapZoneID(continent,zoneName) |
local mapid, name |
local zonesP6 = { GetMapZones(continent) }; |
end |
end |
end |
--]] |
function MetaMap_MergeZoneName(zoneTable) |
local nameid; |
end |
function MetaMap_GetMapZoneName(areaid) |
local mapInfo = C_Map.GetMapInfo(areaid); |
if ( mapInfo ) then return mapInfo.name; end |
--old |
--[[ |
local clist = MetaMap_GetMapContinents(); |
for c = 1, #clist do |
local mapid, name |
end |
end |
end |
--]] |
end |
function MetaMap_ZoneIDToName(continentKey, zoneKey) |
end |
if (continentKey == -1) then |
for index, zoneTable in pairs(MetaMap_ZoneTable) do |
if ( zoneTable.mapid and MetaMap_UiMapID_AreaID[zoneKey] and (zoneTable.mapid == MetaMap_UiMapID_AreaID[zoneKey].AreaID) ) then |
if ( zoneTable.mapid and (zoneTable.mapid == zoneKey) ) then |
return MetaMap_MergeZoneName(zoneTable); |
end |
end |
return UNKNOWN; |
end |
function MetaMap_GetCurrentMapDungeonLevel() |
local level; |
local mapID = WorldMapFrame:GetMapID(); |
if ( mapID and MetaMap_UiMapID_AreaID[mapID] ) then |
level = MetaMap_UiMapID_AreaID[mapID].Floor; |
else |
level = 0; |
end |
return level; |
end |
function MetaMap_GetCurrentMapInfo() |
local mapName = ""; |
local mapID = WorldMapFrame:GetMapID(); |
if ( MetaMapOptions.ShowDNI ) then |
mapName = MetaMapOptions.MetaMapZone; |
else |
mapName = MetaMap_ZoneIDToName(-1, mapID); |
end |
local mapLevel = 0; |
if ( MetaMap_UiMapID_AreaID[mapID] ) then |
mapLevel = MetaMap_UiMapID_AreaID[mapID].Floor; |
end |
--old |
--[[ |
local mapName, dataZone; |
local _, _, _, isMicroDungeon = GetMapInfo(); |
local mapLevel = GetCurrentMapDungeonLevel(); |
if ( MetaMapOptions.ShowDNI or isMicroDungeon ) then |
if ( MetaMapOptions.ShowDNI ) then |
mapName = MetaMapOptions.MetaMapZone; |
else |
local MapZone = GetCurrentMapZone(); |
if ( MapZone > 0 ) then |
mapName = MetaMap_ZoneIDToName(-1, WorldMapFrame:GetMapID()); |
mapName = MetaMap_ZoneIDToName(-1, GetCurrentMapAreaID()); |
else |
local mapC = GetCurrentMapContinent(); |
local mapZ = GetCurrentMapZone(); |
if ( (mapC == -1) and (mapZ == 0) ) then |
local name = GetMapInfo(); |
if ( name ) then |
mapName = MetaMap_ZoneIDToName(-1, WorldMapFrame:GetMapID()); |
mapName = MetaMap_ZoneIDToName(-1, GetCurrentMapAreaID()); |
end |
end |
if ( not mapName ) then |
end |
end |
end |
--]] |
return mapName, mapLevel, MetaMap_Notes[mapName]; |
return mapName, mapLevel, MetaMap_Notes[mapName], isMicroDungeon; |
end |
function MetaMap_SplitZoneName(zoneName0) |
if (not currentid) then |
found = true; |
else |
if (MetaMap_UiMapID_AreaID[currentid].AreaID == zoneTable.mapid) then found = true; end |
if (currentid == zoneTable.mapid) then found = true; end |
end |
end |
end |
ztype = zoneTable.ztype; |
mapid = 0; |
if (zoneTable.mapid ~= nil) then |
for i = 1, 1000 do |
if ( MetaMap_UiMapID_AreaID[i] and MetaMap_UiMapID_AreaID[i].AreaID == zoneTable.mapid ) then |
mapid = i; |
end |
end |
mapid = zoneTable.mapid; |
end |
end |
end |
_G[self:GetName().."Text"]:SetText(METAMAP_OPTIONS_SCALE); |
_G[self:GetName().."High"]:SetText(); |
_G[self:GetName().."Low"]:SetText(); |
self:SetMinMaxValues(0.2,1.0); |
self:SetValueStep(0.05); |
self:SetMinMaxValues(0.0,1.0); |
self:SetValueStep(0.01); |
</OnLoad> |
<OnValueChanged> |
MetaMap_UpdateScale(); |
WorldMapTooltip:SetOwner(self, "ANCHOR_CENTER"); |
WorldMapTooltip:SetText("Tooltip Scaling Sample", 0, 1, 0); |
WorldMapTooltip:AddLine("Move the Tooltip slider to change the scale of the tooltips shown on the WorldMap", 1, 1, 1, true); |
--old WorldMapPOIFrame.allowBlobTooltip = false; |
WorldMapPOIFrame.allowBlobTooltip = false; |
WorldMapTooltip:Show(); |
</OnEnter> |
<OnLeave> |
--old WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapTooltip:Hide(); |
</OnLeave> |
</Scripts> |
</Scripts> |
</Slider> |
<!-- old |
<Slider name="MetaMapFrameStrataSlider" inherits="OptionsSliderTemplate"> |
<Size><AbsDimension x="150" y="16"/></Size> |
<Anchors> |
_G[self:GetName().."Text"]:SetText(METAMAP_OPTIONS_FRAMESTRATA..": |cff00ff00"..self:GetValue()); |
_G[self:GetName().."High"]:SetText(); |
_G[self:GetName().."Low"]:SetText(); |
self:SetMinMaxValues(0,4); |
self:SetMinMaxValues(0,2); |
self:SetValueStep(1); |
self:SetValue(MetaMapOptions.MetaMapFrameStrata); |
</OnShow> |
<OnValueChanged> |
MetaMapOptions.MetaMapFrameStrata = math.floor(MetaMapFrameStrataSlider:GetValue() + 0.5); |
_G[self:GetName().."Text"]:SetText(METAMAP_OPTIONS_FRAMESTRATA..": |cff00ff00"..MetaMapOptions.MetaMapFrameStrata); |
MetaMapOptions.MetaMapFrameStrata = MetaMapFrameStrataSlider:GetValue(); |
_G[self:GetName().."Text"]:SetText(METAMAP_OPTIONS_FRAMESTRATA..": |cff00ff00"..self:GetValue()); |
MetaMap_SetFrameStrata(); |
</OnValueChanged> |
</Scripts> |
</Slider> |
--> |
</Frames> |
</Frame> |
local MetaMapTopFrame_Visible = false; |
local MataMapMainMenu_Visible = false; |
MetaMap_WorldMap_baseScale = 0; |
local MetaMap_oldScale = 0; |
local MetaMap_oldScrollH = 0; |
local MetaMap_oldScrollV = 0; |
local MetaMap_oldScale = 0; |
MetaMap_CurrentAction = false; |
local MetaMap_LastNote = 0; |
["MetaMapAlpha2"] = 0.60, |
["BDshader1"] = 0.0, |
["BDshader2"] = 0.0, |
["MetaMapPos1"] = { -1, -1 }, |
["MetaMapPos2"] = { -1, -1 }, |
["MetaMapScale1"] = 0.75, |
["MetaMapScale2"] = 0.55, |
["MetaMapTTScale1"] = 1.0, |
function MetaMap_SetWorldMap() |
MiniMapWorldMapButton:Hide(); |
--old hooksecurefunc("WorldMapFrame_ToggleWindowSize", MetaMap_FullScreenToggle); |
hooksecurefunc("WorldMapFrame_ToggleWindowSize", MetaMap_FullScreenToggle); |
-- hooksecurefunc is not working for functions called directly by XML code, thats use additional: |
WorldMapFrame.BorderFrame.MaximizeMinimizeFrame.MinimizeButton:HookScript("OnClick", MetaMap_FullScreenToggle); |
WorldMapFrame.BorderFrame.MaximizeMinimizeFrame.MaximizeButton:HookScript("OnClick", MetaMap_FullScreenToggle); |
-- update the lines at change of the world map zoom |
--old WorldMapScrollFrame:HookScript("OnMouseWheel", MetaMap_MainMapUpdate); |
WorldMapFrame.ScrollContainer:HookScript("OnMouseWheel", MetaMap_MainMapUpdate); |
WorldMapFrame.ScrollContainer:HookScript("OnMouseDown", MetaMap_ProcessMapClick); |
WorldMapScrollFrame:HookScript("OnMouseWheel", MetaMap_MainMapUpdate); |
--old MetaMap_SetFrameStrata(); |
MetaMap_SetFrameStrata(); |
MetaMap_WorldMapFrame_OnKeyDown_old = WorldMapFrame:GetScript("OnKeyDown"); |
MetaMap_FullScreenToggle(); |
hooksecurefunc(WorldMapFrame, "Show", MetaMapTopFrame_OnShow); |
hooksecurefunc(WorldMapFrame, "Hide", MetaMapTopFrame_OnHide); |
--old MetaMap_SetMapToCurrentZone(); |
MetaMap_SetMapToCurrentZone(); |
MetaMap_oldScale = WORLDMAP_SETTINGS.size; |
end |
function MetaMapButton_OnClick() |
function MetaMap_OnLoad(self) |
hooksecurefunc("ToggleDropDownMenu", MetaMap_ToggleDropDownMenu); |
--old hooksecurefunc("WorldMapZoomOutButton_OnClick", MetaMap_WorldMapZoomOutButton_OnClick); |
WorldMapFrame.ScrollContainer:HookScript("OnMouseUp", MetaMap_WorldMapZoomOutButton_OnClick); |
hooksecurefunc("WorldMapZoomOutButton_OnClick", MetaMap_WorldMapZoomOutButton_OnClick); |
QuestMapFrame:HookScript("OnMouseUp", MetaMap_QuestMapFrame_OnMouseUp); |
--# hooksecurefunc("QuestMapFrame_CloseQuestDetails", MetaMap_QuestMapFrame_CloseQuestDetails); |
QuestMapFrame.DetailsFrame.BackButton:HookScript("OnClick", MetaMap_QuestMapFrameDetailsFrameBackButton_OnClick); |
--old WorldMapScrollFrame:HookScript("OnMouseWheel", MetaMap_WorldMapScrollFrame_OnMouseWheel); |
WorldMapFrame.ScrollContainer:HookScript("OnMouseWheel", MetaMap_WorldMapScrollFrame_OnMouseWheel); |
--old hooksecurefunc("WorldMapScrollFrame_OnPan", MetaMap_WorldMapScrollFrame_OnPan); |
--??? WorldMapFrame.ScrollContainer:HookScript("IsPanning", MetaMap_WorldMapScrollFrame_OnPan); |
WorldMapScrollFrame:HookScript("OnMouseWheel", MetaMap_WorldMapScrollFrame_OnMouseWheel); |
hooksecurefunc("WorldMapScrollFrame_OnPan", MetaMap_WorldMapScrollFrame_OnPan); |
--old hooksecurefunc("QuestLogQuests_GetHeaderButton", MetaMap_QuestLogQuests_GetHeaderButton); |
--??? |
--old hooksecurefunc("QuestLogQuests_GetTitleButton", MetaMap_QuestLogQuests_GetTitleButton); |
--??? |
hooksecurefunc("QuestLogQuests_GetHeaderButton", MetaMap_QuestLogQuests_GetHeaderButton); |
hooksecurefunc("QuestLogQuests_GetTitleButton", MetaMap_QuestLogQuests_GetTitleButton); |
hooksecurefunc("NavBar_ClearTrailingButtons", MetaMap_NavBar_ClearTrailingButtons); |
--old hooksecurefunc("WorldMapLevelButton_OnClick", MetaMap_WorldMapLevelButton_OnClick); |
hooksecurefunc("WorldMapLevelButton_OnClick", MetaMap_WorldMapLevelButton_OnClick); |
--old AzerothButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
--??? |
--old OutlandButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
--??? |
--old DraenorButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
--??? |
AzerothButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
OutlandButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
DraenorButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
--old TheMaelstromButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
--??? |
--old DeepholmButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
--??? |
--old KezanButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
--??? |
--old LostIslesButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
--??? |
TheMaelstromButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
DeepholmButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
KezanButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
LostIslesButton:HookScript("OnClick", MetaMap_WorldMapAreaButton_OnClick); |
--#? WorldMapLevelUpButton:HookScript("OnClick", MetaMap_WorldMapLevelUpDown_OnClick); |
--#? WorldMapLevelDownButton:HookScript("OnClick", MetaMap_WorldMapLevelUpDown_OnClick); |
--#? hooksecurefunc("WorldMapLevelButton_OnClick", MetaMap_WorldMapLevelUpDown_OnClick); |
self:RegisterEvent("ADDON_LOADED"); |
self:RegisterEvent("VARIABLES_LOADED"); |
self:RegisterEvent("UPDATE_BINDINGS"); |
--old self:RegisterEvent("WORLD_MAP_UPDATE"); |
WorldMapFrame.ScrollContainer:HookScript("OnUpdate", MetaMap_WORLD_MAP_UPDATE); |
self:RegisterEvent("WORLD_MAP_UPDATE"); |
self:RegisterEvent("ZONE_CHANGED_NEW_AREA"); |
self:RegisterEvent("ZONE_CHANGED"); |
self:RegisterEvent("ZONE_CHANGED_INDOORS"); |
end |
function MetaMapContainerFrame_OnLoad(frame) |
frame:SetWidth(WorldMapFrame.ScrollContainer:GetWidth() - MetaMap_MapListFrame:GetWidth()-1); |
frame:SetHeight(WorldMapFrame.ScrollContainer:GetHeight()-41); |
frame:SetWidth(WorldMapButton:GetWidth() - MetaMap_MapListFrame:GetWidth()-1); |
frame:SetHeight(WorldMapButton:GetHeight()-41); |
frame:SetFrameLevel(frame:GetParent():GetFrameLevel()+3); |
MetaMapContainer_Header:SetFrameLevel(frame:GetFrameLevel()+2); |
MetaMapContainer_Footer:SetFrameLevel(frame:GetFrameLevel()+2); |
WorldMapPlayerLower:ClearAllPoints(); |
PositionWorldMapArrowFrame("center","WorldMapDetailFrame","topleft",xOfs,yOfs); |
WorldMapPlayerLower:ClearAllPoints(); |
WorldMapPlayerLower:SetPoint("center",WorldMapDetailFrame,"topleft",500,-308); |
WorldMapPlayerLower:SetPoint("center","WorldMapDetailFrame","topleft",500,-308); |
UpdateWorldMapArrow(); |
point, relativeTo, relativePoint, xOfs, yOfs = WorldMapPlayerLower:GetPoint(); |
DEFAULT_CHAT_FRAME:AddMessage("ArrowAfter: "..point..","..relativeTo:GetName()..","..relativePoint..","..xOfs..","..yOfs); |
MetaMap_InfoLineFrame:SetFrameLevel(WorldMapFrame:GetFrameLevel()+3); |
MetaMap_Debug_Print("MetaMapTopFrame_OnShow: Updating Quests",true); |
end |
--old WorldMapFrameTutorialButton:Hide(); |
WorldMapFrame.BorderFrame.Tutorial:Hide(); |
WorldMapFrameTutorialButton:Hide(); |
if (not MetaMap_VarsLoaded) then return; end |
if ( not MetaMapTopFrame_Visible ) then |
StaticPopup1:SetFrameStrata("FULLSCREEN"); |
if (MetaMap_FullScreenMode or InCombatLockdown()) then |
MetaMapNotesEditFrame:SetParent(WorldMapFrame); |
MetaMap_SendFrame:SetParent(WorldMapFrame); |
MetaMapNotesEditFrame:SetParent("WorldMapFrame"); |
MetaMap_SendFrame:SetParent("WorldMapFrame"); |
end |
end |
MetaMap_ToggleDR(self,0); |
StaticPopup1:SetFrameStrata("DIALOG"); |
MetaMapNotesEditFrame:SetParent(UIParent); |
MetaMapNotesEditFrame:SetParent("UIParent"); |
MetaMapNotesEditFrame:SetFrameStrata("FULLSCREEN"); |
MetaMap_SendFrame:SetParent(UIParent); |
MetaMap_SendFrame:SetParent("UIParent"); |
MetaMap_SendFrame:SetFrameStrata("FULLSCREEN"); |
MetaMap_SetMapToCurrentZone(); |
end |
end |
function MetaMap_WORLD_MAP_UPDATE(self,elapsed) |
MetaMap_OnEvent(self, "WORLD_MAP_UPDATE"); |
end |
local WORLD_MAP_UPDATE_event_look = false; |
-- skip the required delay for map changes in case of a zone change |
local MetaMap_ZONE_CHANGE = false; |
elseif (event == "VARIABLES_LOADED") then |
MetaMap_SetWorldMap(); |
--[[old |
-- Prevents taint from expanding menus past blizzard's MAXBUTTONS, also fixes an init issue with menus longer than 17. |
if ( UIDROPDOWNMENU_MAXBUTTONS < 29 ) then |
local toggle; |
ToggleFrame(WorldMapFrame); |
end |
end |
--]] |
MetaMap_CurrentSaveSet = MetaMapOptions.SaveSet; |
MetaMap_ModeToggleButton:SetText(MetaMapOptions.SaveSet); |
MetaMap_OrigChatFrame_OnEvent = ChatFrame_MessageEventHandler; |
ChatFrame_MessageEventHandler = MetaMap_ChatFrame_OnEvent; |
-- shifted to PLAYER_ENTERING_WORLD, because the worldMapFrame is not fully initialized yet |
--old MetaMap_MiniNote.TimeSinceLastUpdate = 0; |
--old for i=0, 9, 1 do |
--old if (MetaMap_NoteFilter[i] == nil) then MetaMap_NoteFilter[i] = true; end |
--old end |
--old if (not MetaMapOptions.MetaMapZone) then |
--old MetaMapOptions.MetaMapZone = MetaMap_ZoneTable[110][MetaMap_Locale]; |
--old end |
--old if (not MetaMapOptions.MetaMapLevel) then MetaMapOptions.MetaMapLevel = 0; end |
--old if ( not MetaMapOptions.oldScrollH ) then MetaMapOptions.oldScrollH = 0; end |
--old if ( not MetaMapOptions.oldScrollV ) then MetaMapOptions.oldScrollV = 0; end |
--old if ( not MetaMapOptions.oldScale ) then MetaMapOptions.oldScale = WorldMapFrame:GetScale(); end |
--old MetaMap_ZoneCapture = nil; |
MetaMap_MiniNote.TimeSinceLastUpdate = 0; |
for i=0, 9, 1 do |
if (MetaMap_NoteFilter[i] == nil) then MetaMap_NoteFilter[i] = true; end |
end |
if (not MetaMapOptions.MetaMapZone) then |
MetaMapOptions.MetaMapZone = MetaMap_ZoneTable[110][MetaMap_Locale]; |
end |
if (not MetaMapOptions.MetaMapLevel) then MetaMapOptions.MetaMapLevel = 0; end |
if ( not MetaMapOptions.oldScrollH ) then MetaMapOptions.oldScrollH = 0; end |
if ( not MetaMapOptions.oldScrollV ) then MetaMapOptions.oldScrollV = 0; end |
if ( not MetaMapOptions.oldScale ) then MetaMapOptions.oldScale = WORLDMAP_SETTINGS.size; end |
MetaMap_ZoneCapture = nil; |
-- shifted to PLAYER_ENTERING_WORLD, because the worldMapFrame is not fully initialized yet |
--old MetaMapOptions_Init(); |
--old MetaMapList_Init(); |
MetaMapOptions_Init(); |
MetaMapList_Init(); |
--old -- check if MobMap is installed and using its internal quest tracker |
--old if ( mobmap_use_questtracker ) then |
--old MetaMap_Print(METAMAP_MOBMAP_QUESTTRACKER_WARNING, true, 1, 0, 0); |
--old mobmap_use_questtracker = false; |
--old MobMap_QuestTracker_Setup(); |
--old end |
-- check if MobMap is installed and using its internal quest tracker |
if ( mobmap_use_questtracker ) then |
MetaMap_Print(METAMAP_MOBMAP_QUESTTRACKER_WARNING, true, 1, 0, 0); |
mobmap_use_questtracker = false; |
MobMap_QuestTracker_Setup(); |
end |
MetaMap_VarsLoaded = true; |
elseif (event == "WORLD_MAP_UPDATE") then |
if (not MetaMap_VarsLoaded) then return; end |
if ( not MetaMap_StayOnMap and (zType == "DNI" or zType == "BG" or zType == "SCN" or zType == "RDI") ) then |
MetaMapOptions.ShowDNI = true; |
MetaMap_ShowInstance(self, true); |
--#? run this if a menu entry of the world map is used |
--#? elseif ( ???) then |
--#? MetaMapOptions.ShowDNI = false; |
--#? MetaMapOptions.MetaMapZone = nil; |
--#? MetaMapOptions.MetaMapLevel = 0; |
--#? UIDropDownMenu_ClearAll(MetaMap_InstanceMenu); |
end |
if (IsAddOnLoaded("MetaMapWKB") and WKB_DisplayFrame:IsVisible()) then |
MetaMap_Timer_DelayWKB_AddUnitInfo = 5.0; |
elseif (event == "PLAYER_ENTERING_WORLD") then |
if (not MetaMap_VarsLoaded) then return; end |
if (not MetaMap_GetRealZoneText()) then return; end |
ShowUIPanel(WorldMapFrame); |
MetaMapOptions_Init(); |
MetaMapList_Init(); |
HideUIPanel(WorldMapFrame); |
MetaMap_MiniNote.TimeSinceLastUpdate = 0; |
for i=0, 9, 1 do |
if (MetaMap_NoteFilter[i] == nil) then MetaMap_NoteFilter[i] = true; end |
end |
if (not MetaMapOptions.MetaMapZone) then |
MetaMapOptions.MetaMapZone = MetaMap_ZoneTable[110][MetaMap_Locale]; |
end |
MetaMap_oldScale = MetaMap_WorldMap_baseScale; |
if (not MetaMapOptions.MetaMapLevel) then MetaMapOptions.MetaMapLevel = 0; end |
if ( not MetaMapOptions.oldScrollH ) then MetaMapOptions.oldScrollH = 0; end |
if ( not MetaMapOptions.oldScrollV ) then MetaMapOptions.oldScrollV = 0; end |
if ( not MetaMapOptions.oldScale ) then MetaMapOptions.oldScale = MetaMap_oldScale; end |
MetaMap_ZoneCapture = nil; |
--old if (not MetaMap_GetRealZoneText()) then return; end |
MetaMap_SetMapToCurrentZone(); |
if ( MetaMap_GetRealZoneText() ) then |
MetaMap_ZoneDisplay:SetText(METAMAP_CURZONE..MetaMap_GetRealZoneText()); |
end |
MetaMap_ZoneDisplay:SetText(METAMAP_CURZONE..MetaMap_GetRealZoneText()); |
MetaMap_Timer_DelayWKB_AddUnitInfo = 5.0; |
elseif (event == "MINIMAP_UPDATE_ZOOM") then |
MetaMap_MinimapUpdateZoom(); |
if (MetaMap_RealZoneTimer and MetaMap_RealZoneTimer < 0) then |
MetaMap_RealZoneTimer = nil; |
if (realZone) then |
--old local _, _, _, isMicroDungeon = GetMapInfo(); |
local _, _, _, isMicroDungeon = GetMapInfo(); |
for _, zoneTable in pairs(MetaMap_ZoneTable) do |
if (zoneTable[MetaMap_Locale] == realZone) then |
--old if ( (zoneTable.ztype == "SZR") and not isMicroDungeon ) then |
if ( zoneTable.ztype == "SZR" ) then |
if ( (zoneTable.ztype == "SZR") and not isMicroDungeon ) then |
realZone = MetaMap_SplitZoneName(zoneTable.Location); |
end |
end |
end |
local baseName = MetaMap_SplitZoneName(MetaMap_BaseMap.Name); |
--old if ( (baseName ~= realZone) or (MetaMap_IsMicroDungeon ~= isMicroDungeon) ) then |
if ( baseName ~= realZone ) then |
--old MetaMap_IsMicroDungeon = isMicroDungeon; |
MetaMap_IsMicroDungeon = false; |
if ( (baseName ~= realZone) or (MetaMap_IsMicroDungeon ~= isMicroDungeon) ) then |
MetaMap_IsMicroDungeon = isMicroDungeon; |
MetaMap_OnEvent(self, "ZONE_CHANGED"); |
MetaMap_Debug_Print("*** Event ZONE_CHANGED triggered by MetaMap_OnUpdate ***",true); |
end |
-- print(GetMapZones(1)); SetMapZoom(1,4); |
-- the mapList used by SetMapZoom(continent,mapListNr) is a combination of |
-- GetMapZones(continent) and GetMapSubzones(mapid), but with dungeons removed |
--[[ |
function MetaMap_SetMapZoomByName(name) |
if (not name or name == "") then SetMapZoom(-1,0); return; end |
local cKey, zKey = MetaMap_NameToZoneID(name); |
end |
SetMapZoom(-1,0); |
end |
--]] |
-- check if the zoneName is included in MetaMap_ZoneTable else add it |
function MetaMap_ZoneTableUpdate(zoneName) |
MetaMap_Debug_Print("FullScreenToggle:", true); |
if ( InCombatLockdown() ) then return; end |
local mapid = WorldMapFrame:GetMapID(); |
if ( not mapid ) then return; end |
--old local level = GetCurrentMapDungeonLevel(); |
local mapid = GetCurrentMapAreaID(); |
local level = GetCurrentMapDungeonLevel(); |
--old MetaMap_FullScreenMode = ( not WorldMapFrame_InWindowedMode() ); |
MetaMap_FullScreenMode = WorldMapFrame.isMaximized; |
MetaMap_FullScreenMode = ( not WorldMapFrame_InWindowedMode() ); |
if (not MetaMap_FullScreenMode) then |
WorldMapFrame:SetScript("OnKeyDown", nil); |
MetaMapOptions_Init(); |
WorldMapFrame:SetScript("OnKeyDown", MetaMap_WorldMapFrame_OnKeyDown_old); |
MetaMap_MainCoords:Hide(); |
end |
--old WorldMapFrameTutorialButton:Hide(); |
WorldMapFrameTutorialButton:Hide(); |
--old local _, _, _, isMicroDungeon = GetMapInfo(); |
--old if ( not isMicroDungeon ) then SetMapByID(mapid); end |
WorldMapFrame:SetMapID(mapid); |
local _, _, _, isMicroDungeon = GetMapInfo(); |
if ( not isMicroDungeon ) then SetMapByID(mapid); end |
-- ??? MetaMapShown is undefined ??? |
--old if (MetaMapShown) then MetaMap_ShowInstance(self, true); end |
--old if ( (level ~= 0) and not isMicroDungeon ) then SetDungeonMapLevel(level); end |
if (MetaMapShown) then MetaMap_ShowInstance(self, true); end |
if ( (level ~= 0) and not isMicroDungeon ) then SetDungeonMapLevel(level); end |
end |
function MetaMap_ShowInstance(self, show, basemap) |
MetaMapOptions.ShowDNI = show; |
--old local _, _, _, isMicroDungeon = GetMapInfo(); |
local _, _, _, isMicroDungeon = GetMapInfo(); |
if (basemap or not WorldMapFrame:IsVisible()) then |
if (show and (zType == "RDI" or zType == "DNI" or zType == "BG" or zType == "SCN")) then |
--#? UIDropDownMenu_SetText(MetaMap_InstanceMenu, MetaMapOptions.MetaMapZone); |
else |
--#? UIDropDownMenu_ClearAll(MetaMap_InstanceMenu); |
--old if ( isMicroDungeon ) then |
--old MetaMapOptions.MetaMapLevel = GetCurrentMapDungeonLevel(); |
--old else |
if ( isMicroDungeon ) then |
MetaMapOptions.MetaMapLevel = GetCurrentMapDungeonLevel(); |
else |
MetaMapOptions.MetaMapZone = nil; |
MetaMapOptions.MetaMapLevel = 0; |
--old end |
end |
MetaMapOptions.oldScrollH = 0; |
MetaMapOptions.oldScrollV = 0; |
MetaMapOptions.oldScale = WorldFrame:GetScale(); |
MetaMapOptions.oldScale = WORLDMAP_SETTINGS.size; |
end |
return; |
end |
-- set the map only if different to the shown map to prevent endless loop |
local map_isSet = false; |
local _, instance = MetaMap_NameToZoneID(MetaMapOptions.MetaMapZone); |
local location = WorldMapFrame:GetMapID(); |
local location = GetCurrentMapAreaID(); |
if (instance ~= location) then |
-- to set the mapid to 611 does not work, but its the same map as 685 |
if (instance == 611) then |
map_isSet = true; |
end |
local level = MetaMapOptions.MetaMapLevel; |
location = MetaMap_GetCurrentMapDungeonLevel(); |
location = GetCurrentMapDungeonLevel(); |
if (level ~= 0 and level ~= location) then |
SetDungeonMapLevel(MetaMapOptions.MetaMapLevel); |
map_isSet = true; |
else |
if (not show) then |
--#? UIDropDownMenu_ClearAll(MetaMap_InstanceMenu); |
--old if ( isMicroDungeon ) then |
--old MetaMapOptions.MetaMapLevel = GetCurrentMapDungeonLevel(); |
--old else |
if ( isMicroDungeon ) then |
MetaMapOptions.MetaMapLevel = GetCurrentMapDungeonLevel(); |
else |
MetaMapOptions.MetaMapZone = nil; |
MetaMapOptions.MetaMapLevel = 0; |
--old end |
end |
MetaMapOptions.oldScrollH = 0; |
MetaMapOptions.oldScrollV = 0; |
MetaMapOptions.oldScale = WorldFrame:GetScale(); |
MetaMapOptions.oldScale = WORLDMAP_SETTINGS.size; |
end |
if (WorldMapFrame:IsVisible()) then |
if (IsAddOnLoaded("MetaMapWKB") and WKB_DisplayFrame:IsVisible()) then |
function MetaMap_MiniCoordsUpdate() |
if (WorldMapFrame:IsVisible()) then return; end |
--old local px, py = GetPlayerMapPosition("player"); |
local px, py = C_Map.GetBestMapForUnit("player"); |
local px, py = GetPlayerMapPosition("player"); |
if (px == 0 and py == 0) then |
local _, _, zType = MetaMap_GetZoneTableEntry(MetaMap_GetRealZoneText()); |
if (zType == "DN") then |
function MetaMap_MainCoordsUpdate() |
local OFFSET_X = 0; |
local OFFSET_Y = 0; |
local centerX, centerY = WorldMapFrame.ScrollContainer:GetCenter() |
local width = WorldMapFrame.ScrollContainer:GetWidth() |
local height = WorldMapFrame.ScrollContainer:GetHeight() |
local centerX, centerY = WorldMapButton:GetCenter() |
local width = WorldMapButton:GetWidth() |
local height = WorldMapButton:GetHeight() |
local x, y = GetCursorPosition() |
x = x / WorldMapFrame.ScrollContainer:GetEffectiveScale() |
y = y / WorldMapFrame.ScrollContainer:GetEffectiveScale() |
x = x / WorldMapButton:GetEffectiveScale() |
y = y / WorldMapButton:GetEffectiveScale() |
if (centerX == nil) then |
centerX = 0; |
MetaMapCoordsCursor:SetText("|cffffffff"..format("%4.1f, %4.1f", x, y)); |
end |
local px, py = C_Map.GetBestMapForUnit("player"); |
local px, py = GetPlayerMapPosition("player"); |
if(px==nil) then px=0; end |
if(py==nil) then py=0; end |
if (px == 0 and py == 0) then |
local continent, zone = MetaMap_NameToZoneID(MetaMap_GetRealZoneText()); |
if (zType == "DN") then |
MetaMapCoordsPlayer:SetText(METAMAP_INSTANCE_1); |
--old elseif (GetCurrentMapContinent() ~= continent or GetCurrentMapZone() ~= zone) then |
elseif (GetCurrentMapContinent() ~= continent or zone ~= 1) then |
elseif (GetCurrentMapContinent() ~= continent or GetCurrentMapZone() ~= zone) then |
MetaMapCoordsPlayer:SetText(""); |
else |
MetaMapCoordsPlayer:SetText("|cff00ff00Dead Zone"); |
MetaMapOptions.MetaMapLevel = 0; |
MetaMapOptions.oldScrollH = 0; |
MetaMapOptions.oldScrollV = 0; |
MetaMapOptions.oldScale = WorldFrame:GetScale(); |
MetaMapOptions.oldScale = WORLDMAP_SETTINGS.size; |
MetaMap_ShowInstance(self, true); |
MetaMap_CurrentMap = MetaMap_SaveCurrentMapData(); |
HideUIPanel(MetaMap_DialogFrame); |
else |
if (MetaMap_FullScreenMode) then |
MetaMap_DialogFrame:SetParent(WorldMapFrame); |
MetaMap_DialogFrame:SetParent("WorldMapFrame"); |
else |
MetaMap_DialogFrame:SetParent(UIParent); |
MetaMap_DialogFrame:SetParent("UIParent"); |
MetaMap_DialogFrame:SetFrameStrata("FULLSCREEN"); |
end |
ShowUIPanel(MetaMap_DialogFrame); |
end |
MetaMapOptions.oldScrollH = 0; |
MetaMapOptions.oldScrollV = 0; |
MetaMapOptions.oldScale = WorldFrame:GetScale(); |
MetaMapOptions.oldScale = WORLDMAP_SETTINGS.size; |
if (zType == "RDI" or zType == "DNI" or zType == "BG" or zType == "SCN") then |
MetaMap_ShowInstance(self, true); |
else |
MetaMap_ShowInstance(self, false); |
-- SetMapZoom(MetaMap_NameToZoneID(zoneName)); |
--old MetaMap_SetMapZoomByName(zoneName); |
WorldMapFrame:SetMapID(MetaMap_NameToZoneID(zoneName)); |
MetaMap_SetMapZoomByName(zoneName); |
end |
MetaMap_CurrentMap = MetaMap_SaveCurrentMapData(); |
end |
-- This gets called from WorldMapFrame.lua when user left clicks on the map. |
--old local MetaMap_ProcessMapClick_old = ProcessMapClick; |
--old function ProcessMapClick(...) |
function MetaMap_ProcessMapClick(self, button) |
MetaMap_Debug_Print("MetaMap_ProcessMapClick", true); |
local MetaMap_ProcessMapClick_old = ProcessMapClick; |
function ProcessMapClick(...) |
MetaMap_Debug_Print("ProcessMapClick", true); |
local mapName, mapLevel, dataZone = MetaMap_GetCurrentMapInfo(); |
local mapName, mapLevel, dataZone, isMicroDungeon = MetaMap_GetCurrentMapInfo(); |
if (not MetaMap_FramesHidden()) then return; end |
if ( (IsControlKeyDown() or IsShiftKeyDown() or IsAltKeyDown()) and mapName and dataZone ) then |
if (mapName or MetaMapOptions.ShowDNI) then |
local centerX, centerY = WorldMapFrame.ScrollContainer:GetCenter(); |
local width = WorldMapFrame.ScrollContainer:GetWidth(); |
local height = WorldMapFrame.ScrollContainer:GetHeight(); |
local centerX, centerY = WorldMapButton:GetCenter(); |
local width = WorldMapButton:GetWidth(); |
local height = WorldMapButton:GetHeight(); |
local x, y = GetCursorPosition(); |
x = x / WorldMapFrame.ScrollContainer:GetEffectiveScale(); |
y = y / WorldMapFrame.ScrollContainer:GetEffectiveScale(); |
x = x / WorldMapButton:GetEffectiveScale(); |
y = y / WorldMapButton:GetEffectiveScale(); |
if (centerX == nil) then |
centerX = 0; |
end |
else |
MetaMap_Debug_Print("--------click mark-------",true); |
--old MetaMap_ProcessMapClick_old(...); |
MetaMap_ProcessMapClick_old(...); |
if ( not MetaMapOptions.MapChange ) then |
MetaMap_StayOnMap = true; |
-- map frame zoom in/out |
function MetaMap_WorldMapScrollFrame_OnMouseWheel(self, delta) |
if ( WorldMapFrame.isMaximized ) then return; end |
if ( not WorldMapFrame_InWindowedMode() ) then return; end |
local newScale = WorldMapFrame.ScrollContainer.currentScale; |
local newScale = WorldMapDetailFrame:GetScale(); |
if ( newScale == MetaMap_oldScale ) then return; end |
--[[old |
local scrollFrame = WorldMapFrame.ScrollContainer; |
local scrollFrame = WorldMapScrollFrame; |
local relativeFrame = UIParent; |
local myScale = scrollFrame:GetScale(); |
local myScale = WorldMapFrame:GetScale(); |
local relativeFrameScale = relativeFrame:GetScale(); |
-- get the mouse position on the frame, with 0,0 at top left |
-- set scroll values |
scrollFrame:SetHorizontalScroll(newScrollH); |
scrollFrame:SetVerticalScroll(newScrollV); |
--]] |
--save values |
MetaMap_oldScale = newScale; |
--old MetaMap_oldScrollH = newScrollH; |
MetaMap_oldScrollH = WorldMapFrame.ScrollContainer.currentScrollX; |
--old MetaMap_oldScrollV = newScrollV; |
MetaMap_oldScrollV = WorldMapFrame.ScrollContainer.currentScrollY; |
MetaMap_oldScrollH = newScrollH; |
MetaMap_oldScrollV = newScrollV; |
end |
-- reset local variables related to map zoom |
function MetaMap_WorldMapScrollFrame_ResetZoom() |
MetaMap_oldScrollH = 0; |
MetaMap_oldScrollV = 0; |
MetaMap_oldScale = MetaMap_WorldMap_baseScale; |
MetaMap_oldScale = WORLDMAP_SETTINGS.size; |
end |
-- the zoomed world map is moved |
function MetaMap_WorldMapScrollFrame_OnPan() |
--old MetaMap_oldScrollH = WorldMapScrollFrame:GetHorizontalScroll(); |
MetaMap_oldScrollH = WorldMapFrame.ScrollContainer.currentScrollX; |
--old MetaMap_oldScrollV = WorldMapScrollFrame:GetVerticalScroll(); |
MetaMap_oldScrollV = WorldMapFrame.ScrollContainer.currentScrollY; |
MetaMap_oldScrollH = WorldMapScrollFrame:GetHorizontalScroll(); |
MetaMap_oldScrollV = WorldMapScrollFrame:GetVerticalScroll(); |
end |
-- max. zoom world map at player position |
-- *** Allow zoom out from all dungeons and BGs *** |
-- This gets called from WorldMapFrame.lua when user right clicks on the map or |
-- gets called from WorldMapFrame.xml if the "WorldMapZoomOutButton" is clicked |
function MetaMap_WorldMapZoomOutButton_OnClick(self, button) |
if ( button ~= "RightButton" ) then return; end |
function MetaMap_WorldMapZoomOutButton_OnClick() |
MetaMap_Debug_Print("MetaMap_WorldMapZoomOutButton_OnClick", true); |
if ( not MetaMapOptions.MapChange ) then |
MetaMap_StayOnMap = true; |
SetMapByID(mapid); |
else |
-- SetMapZoom(MetaMap_NameToZoneID(mapName)); |
--old MetaMap_SetMapZoomByName(mapName); |
WorldMapFrame:SetMapID(MetaMap_NameToZoneID(zoneName)); |
MetaMap_SetMapZoomByName(mapName); |
end |
MetaMapOptions.MetaMapZone = mapName; |
else |
local continent; |
if (zIndex) then continent = MetaMap_ZoneTable[zIndex].Continent; end |
if (not continent) then continent = -1; end |
--old SetMapZoom(continent, 0); |
--old MetaMapOptions.MetaMapZone = MetaMap_ZoneIDToName(continent, 0); |
SetMapZoom(continent, 0); |
MetaMapOptions.MetaMapZone = MetaMap_ZoneIDToName(continent, 0); |
end |
MetaMap_ShowInstance(nil, false); |
MetaMap_MainMapUpdate(); |
if (_G["MetaMapNotesPOI"..noteNumber]) then |
button = _G["MetaMapNotesPOI"..noteNumber]; |
else |
button = CreateFrame("Button" ,"MetaMapNotesPOI"..noteNumber, WorldMapFrame.ScrollContainer.Child, "MetaMapNotes_NoteTemplate"); |
button = CreateFrame("Button" ,"MetaMapNotesPOI"..noteNumber, WorldMapButton, "MetaMapNotes_NoteTemplate"); |
MetaMap_LastNote = MetaMap_LastNote + 1; |
end |
button:SetWidth(MetaMapOptions.NoteSize); |
MetaMap_SetMapToCurrentZone(); |
local mapName, mapLevel, dataZone = MetaMap_GetCurrentMapInfo(); |
local px, py = C_Map.GetBestMapForUnit("player"); |
local px, py = GetPlayerMapPosition("player"); |
if (not dataZone or px == 0 or px == nil) then |
MetaMap_Print(METAMAP_INVALIDZONE, true); |
return; |
if (msg ~= "" and msg ~= nil) then |
name = string.sub(msg,string.find(msg,"%s*([^%c]*)")); |
end |
local noteAdded, noteID = MetaMap_AddNewNote(mapName, px, py, name, "", "", UnitName("player"), 0, 0, 0, 0, mode, MetaMap_GetCurrentMapDungeonLevel()); |
local noteAdded, noteID = MetaMap_AddNewNote(mapName, px, py, name, "", "", UnitName("player"), 0, 0, 0, 0, mode, GetCurrentMapDungeonLevel()); |
if (noteAdded) then |
if (mode ~= 2) then |
MetaMap_Print(format(METAMAP_ACCEPT_NOTE, MetaMap_GetRealZoneText()), true); |
end |
function MetaMap_QuickNoteShow() |
local x, y = C_Map.GetBestMapForUnit("player"); |
local x, y = GetPlayerMapPosition("player"); |
local coords = format("%d, %d", x * 100, y * 100); |
Coords_EditBox:SetText(coords); |
MiniNote_CheckButton:SetChecked(false); |
Minimap:SetZoom(Minimap:GetZoom() + tempzoom); |
MetaMap_IsInside = MetaMap_MiniNote_IsInCity; |
--old local _, _, _, isMicroDungeon = GetMapInfo(); |
--old MetaMap_IsMicroDungeon = isMicroDungeon; |
local _, _, _, isMicroDungeon = GetMapInfo(); |
MetaMap_IsMicroDungeon = isMicroDungeon; |
MetaMap_MiniNote_MapzoomInit = true; |
end |
end |
end |
local zName, zIndex = MetaMap_GetZoneTableEntry(MetaMap_GetRealZoneText()); |
local continent, zone = MetaMap_NameToZoneID(MetaMap_GetRealZoneText()); |
--old if (not zIndex or continent ~= GetCurrentMapContinent() or zone ~= GetCurrentMapZone()) then return; end |
if (not zIndex or continent ~= GetCurrentMapContinent() or zone ~= 1) then return; end |
local x, y = C_Map.GetBestMapForUnit("player"); |
if (not zIndex or continent ~= GetCurrentMapContinent() or zone ~= GetCurrentMapZone()) then return; end |
local x, y = GetPlayerMapPosition("player"); |
if (x == 0 and y == 0) then return; end |
local currentSet = MetaMap_ZoneTable[zIndex]; |
local currentZoom = Minimap:GetZoom(); |
deltax = math.cos(m) * 57 * adjust; |
deltay = math.sin(m) * 57 * adjust; |
end |
MetaMap_MiniNote:SetPoint("CENTER", MinimapCluster, "TOPLEFT", 105 + deltax, -93 - deltay); |
MetaMap_MiniNote:SetPoint("CENTER", "MinimapCluster", "TOPLEFT", 105 + deltax, -93 - deltay); |
MetaMap_MiniNote:Show(); |
end |
if (MetaMap_MiniNote_Data.id > 0) then |
MetaMap_SetMapToCurrentZone(); |
if (not WorldMapFrame:IsVisible()) then |
MetaMapNotesEditFrame:SetParent(UIParent); |
MetaMapNotesEditFrame:SetParent("UIParent"); |
end |
MetaMap_EditExistingNote(MetaMap_MiniNote_Data.id); |
elseif (MetaMap_MiniNote_Data.id == 0) then |
function MetaMap_EditNewNote(ax, ay) |
if (not MetaMap_FramesHidden()) then return; end |
local mapName, mapLevel, dataZone = MetaMap_GetCurrentMapInfo(); |
local width = WorldMapFrame.ScrollContainer:GetWidth(); |
local height = WorldMapFrame.ScrollContainer:GetHeight(); |
local width = WorldMapButton:GetWidth(); |
local height = WorldMapButton:GetHeight(); |
local xOffset,yOffset; |
MetaMap_TempData_xPos = ax; |
MetaMap_TempData_yPos = ay; |
MetaMap_TempData_Id = id; |
if (id == 0) then |
--old WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapTooltip:Hide(); |
MetaMap_EditNewNote(MetaMap_vnote_xPos, MetaMap_vnote_yPos); |
return; |
elseif (id == -1) then |
--old WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapTooltip:Hide(); |
MetaMap_EditNewNote(MetaMap_PartyNoteData.xPos, MetaMap_PartyNoteData.yPos); |
return; |
dataZone[MetaMap_TempData_Id].icon = MetaMap_TempData_Icon; |
dataZone[MetaMap_TempData_Id].xPos = MetaMap_TempData_xPos; |
dataZone[MetaMap_TempData_Id].yPos = MetaMap_TempData_yPos; |
dataZone[MetaMap_TempData_Id].mLevel = MetaMap_GetCurrentMapDungeonLevel(); |
dataZone[MetaMap_TempData_Id].mLevel = GetCurrentMapDungeonLevel(); |
if (MetaMap_TempData_LootID ~= nil) then |
dataZone[MetaMap_TempData_Id].lootid = MetaMap_TempData_LootID; |
function MetaMap_MainMapUpdate() |
MetaMap_Debug_Print("MetaMap_MainMapUpdate", true); |
if (WorldMapFrame.ScrollContainer:IsVisible()) then |
if (WorldMapButton:IsVisible()) then |
MetaMap_WorldMapButton_OnUpdate(); |
end |
if (Minimap:IsVisible() and MinimapPing_OnUpdate ~= nil) then |
if (MetaMap_FramesHidden()) then |
--MetaMap_Debug_Print("MapNoteOnEnter:Showing", true); |
local x, y = self:GetCenter(); |
local x2, y2 = WorldMapFrame.ScrollContainer:GetCenter(); |
local x2, y2 = WorldMapButton:GetCenter(); |
local anchor = ""; |
if (x > x2) then |
anchor = "ANCHOR_LEFT"; |
WorldMapTooltip:AddDoubleLine(METAMAP_CREATEDBY, dataZone[id].creator, 0, 0.75, 0.85, 0, 0.75, 0.85); |
end |
end |
--old WorldMapPOIFrame.allowBlobTooltip = false; |
WorldMapPOIFrame.allowBlobTooltip = false; |
WorldMapTooltip:Show(); |
else |
--old WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapTooltip:Hide(); |
end |
end |
local msg = dataZone[id].name.." "..tinf1.." ("..mapName.." - "..coords..")"; |
ChatFrameEditBox:Insert(msg); |
elseif (dataZone[id].icon ~= 10) then |
local width = WorldMapFrame.ScrollContainer:GetWidth(); |
local height = WorldMapFrame.ScrollContainer:GetHeight(); |
local width = WorldMapButton:GetWidth(); |
local height = WorldMapButton:GetHeight(); |
id = id + 0; |
MetaMap_TempData_Id = id; |
local ax = dataZone[id].xPos; |
yOffset = -(ay * height) + 113; |
end |
MetaMap_SendNoteButton:Enable(); |
--old WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapTooltip:Hide(); |
MetaMap_EditExistingNote(MetaMap_TempData_Id); |
end |
local lineCount = #(zoneTable); |
local currentX = MetaMap_Notes[mapName][id].xPos; |
local currentY = MetaMap_Notes[mapName][id].yPos; |
local centerX, centerY = WorldMapFrame.ScrollContainer:GetCenter(); |
local width = WorldMapFrame.ScrollContainer:GetWidth(); |
local height = WorldMapFrame.ScrollContainer:GetHeight(); |
local centerX, centerY = WorldMapButton:GetCenter(); |
local width = WorldMapButton:GetWidth(); |
local height = WorldMapButton:GetHeight(); |
local x, y = GetCursorPosition(); |
x = x / WorldMapFrame.ScrollContainer:GetEffectiveScale(); |
y = y / WorldMapFrame.ScrollContainer:GetEffectiveScale(); |
x = x / WorldMapButton:GetEffectiveScale(); |
y = y / WorldMapButton:GetEffectiveScale(); |
if (centerX == nil) then |
centerX = 0; |
local MetaMapNotesLine = MetaMap_CreateLineObject(id); |
local positiveSlopeTexture = METAMAP_IMAGE_PATH.."LineTemplatePositive256"; |
local negativeSlopeTexture = METAMAP_IMAGE_PATH.."LineTemplateNegative256"; |
local width = WorldMapFrame.ScrollContainer.Child:GetWidth(); |
local height = WorldMapFrame.ScrollContainer.Child:GetHeight(); |
local width = WorldMapDetailFrame:GetWidth(); |
local height = WorldMapDetailFrame:GetHeight(); |
local deltax = math.abs((x1 - x2) * width); |
local deltay = math.abs((y1 - y2) * height); |
--old local xOffset = math.min(x1,x2) * width; |
--old local yOffset = -(math.min(y1,y2) * height); |
local xOffset1 = math.min(x1,x2) * width; |
local yOffset1 = -(math.min(y1,y2) * height); |
local xOffset2 = math.max(x1,x2) * width; |
local yOffset2 = -(math.max(y1,y2) * height); |
local xOffset = math.min(x1,x2) * width; |
local yOffset = -(math.min(y1,y2) * height); |
local lowerpixel = math.min(deltax, deltay); |
lowerpixel = lowerpixel / 256; |
if (lowerpixel > 1) then |
lowerpixel = 1; |
end |
if (x1 - x2 == 0) then |
if (deltax == 0) then |
deltax = 2; |
MetaMapNotesLine:SetTexture(0, 0, 0); |
MetaMapNotesLine:SetTexCoord(0, 1, 0, 1); |
elseif (y1 - y2 == 0) then |
elseif (deltay == 0) then |
deltay = 2; |
MetaMapNotesLine:SetTexture(0, 0, 0); |
MetaMapNotesLine:SetTexCoord(0, 1, 0, 1); |
end |
end |
MetaMapNotesLine:SetParent(WorldMapFrame.ScrollContainer.Child); |
MetaMapNotesLine:SetPoint("TOPLEFT", WorldMapFrame.ScrollContainer.Child, "TOPLEFT", xOffset1, yOffset1); |
MetaMapNotesLine:SetPoint("BOTTOMRIGHT", WorldMapFrame.ScrollContainer.Child, "TOPLEFT", xOffset2, yOffset2); |
--old MetaMapNotesLine:SetWidth(deltax); |
--old MetaMapNotesLine:SetHeight(deltay); |
MetaMapNotesLine:SetPoint("TOPLEFT", "WorldMapDetailFrame", "TOPLEFT", xOffset, yOffset); |
MetaMapNotesLine:SetWidth(deltax); |
MetaMapNotesLine:SetHeight(deltay); |
MetaMapNotesLine:Show(); |
end |
if (button == "LeftButton" and (IsControlKeyDown() or IsShiftKeyDown() or IsAltKeyDown())) then |
if (mapName or MetaMapOptions.ShowDNI) then |
local centerX, centerY = WorldMapFrame.ScrollContainer:GetCenter(); |
local width = WorldMapFrame.ScrollContainer:GetWidth(); |
local height = WorldMapFrame.ScrollContainer:GetHeight(); |
local centerX, centerY = WorldMapButton:GetCenter(); |
local width = WorldMapButton:GetWidth(); |
local height = WorldMapButton:GetHeight(); |
local x, y = GetCursorPosition(); |
x = x / WorldMapFrame.ScrollContainer:GetEffectiveScale(); |
y = y / WorldMapFrame.ScrollContainer:GetEffectiveScale(); |
x = x / WorldMapButton:GetEffectiveScale(); |
y = y / WorldMapButton:GetEffectiveScale(); |
if (centerX == nil) then |
centerX = 0; |
end |
end |
function MetaMap_WorldMapButton_OnUpdate() |
function MetaMap_WorldMapButton_OnUpdate(self, elapsed) |
if (not MetaMap_VarsLoaded or MetaMap_Drawing) then return; end |
local lastNote = 0; |
local lastLine = 0; |
local temp = MetaMap_CreateNoteObject(i); |
local xPos = dataZone[i].xPos; |
local yPos = dataZone[i].yPos; |
local xOffset = xPos * WorldMapFrame.ScrollContainer.Child:GetWidth(); |
local yOffset = -yPos * WorldMapFrame.ScrollContainer.Child:GetHeight(); |
local xOffset = xPos * WorldMapButton:GetWidth(); |
local yOffset = -yPos * WorldMapButton:GetHeight(); |
temp:SetParent(WorldMapFrame.ScrollContainer.Child); -- ##### self:GetMap():GetCanvasContainer() |
temp:SetPoint("CENTER", WorldMapFrame.ScrollContainer.Child, "TOPLEFT", xOffset, yOffset); |
temp:SetParent("WorldMapButton"); |
temp:SetPoint("CENTER", "WorldMapButton", "TOPLEFT", xOffset, yOffset); |
_G["MetaMapNotesPOI"..i.."Texture"]:SetTexture(METAMAP_ICON_PATH.."Icon"..dataZone[i].icon); |
_G["MetaMapNotesPOI"..i.."Highlight"]:Hide(); |
--[[old |
for landmarkIndex = 1, GetNumMapLandmarks(), 1 do |
local worldMapPOI = _G["WorldMapFramePOI"..landmarkIndex]; |
if (worldMapPOI == nil) then break; end |
local xPosmin = xPos - 2; local xPosmax = xPos + 2; |
local yPosmin = yPos - 2; local yPosmax = yPos + 2; |
if(x~=nil and y ~=nil and (x > xPosmin and x < xPosmax) and (y > yPosmin and y < yPosmax)) then |
metaMapPOI:SetFrameLevel(WorldMapFrame.ScrollContainer.Child:GetFrameLevel() + 1); |
metaMapPOI:SetFrameLevel(worldMapPOI:GetFrameLevel() + 1); |
end |
end |
--]] |
if (dataZone[i].icon == 10) then |
if (dataZone[i].name == MetaMap_FilterName) then |
else |
temp:Show(); |
end |
elseif (MetaMap_NoteFilter[dataZone[i].icon] and (dataZone[i].mLevel == nil or dataZone[i].mLevel == MetaMap_GetCurrentMapDungeonLevel())) then |
elseif (MetaMap_NoteFilter[dataZone[i].icon] and (dataZone[i].mLevel == nil or dataZone[i].mLevel == GetCurrentMapDungeonLevel())) then |
temp:Show(); |
else |
MetaMap_FilterName = dataZone[i].name; |
if (dataZone) then |
-- vNote button |
if (mapName and MetaMap_vnote_xPos ~= nil) then |
xOffset = MetaMap_vnote_xPos * WorldMapFrame.ScrollContainer.Child:GetWidth(); |
yOffset = -MetaMap_vnote_yPos * WorldMapFrame.ScrollContainer.Child:GetHeight(); |
MetaMapNotesPOIvNote:SetPoint("CENTER", WorldMapFrame.ScrollContainer.Child, "TOPLEFT", xOffset, yOffset); |
xOffset = MetaMap_vnote_xPos * WorldMapButton:GetWidth(); |
yOffset = -MetaMap_vnote_yPos * WorldMapButton:GetHeight(); |
MetaMapNotesPOIvNote:SetPoint("CENTER", "WorldMapButton", "TOPLEFT", xOffset, yOffset); |
MetaMapNotesPOIvNote:Show(); |
else |
else |
MetaMapNotesPOIpartyTexture:SetTexture(METAMAP_ICON_PATH.."Iconparty"); |
end |
xOffset = MetaMap_PartyNoteData.xPos * WorldMapFrame.ScrollContainer.Child:GetWidth(); |
yOffset = -MetaMap_PartyNoteData.yPos * WorldMapFrame.ScrollContainer.Child:GetHeight(); |
MetaMapNotesPOIparty:SetParent(WorldMapFrame.ScrollContainer.Child); |
MetaMapNotesPOIparty:SetPoint("CENTER", WorldMapFrame.ScrollContainer.Child, "TOPLEFT", xOffset, yOffset); |
xOffset = MetaMap_PartyNoteData.xPos * WorldMapButton:GetWidth(); |
yOffset = -MetaMap_PartyNoteData.yPos * WorldMapButton:GetHeight(); |
MetaMapNotesPOIparty:SetParent("WorldMapButton"); |
MetaMapNotesPOIparty:SetPoint("CENTER", "WorldMapButton", "TOPLEFT", xOffset, yOffset); |
MetaMapNotesPOIparty:Show(); |
else |
MetaMapList_Init(); |
MetaMap_FilterName = ""; |
if (IsAddOnLoaded("MetaMapTRK")) then |
TRK_DisplayNodes(mapName, MetaMap_GetCurrentMapDungeonLevel()); |
TRK_DisplayNodes(mapName, GetCurrentMapDungeonLevel()); |
end |
end |
end |
function MetaMapPOI_OnEvent(mode) |
--old if (GetCurrentMapZone() == 0) then return; end |
if (GetCurrentMapZone() == 0) then return; end |
local mapName, mapLevel, dataZone = MetaMap_GetCurrentMapInfo(); |
local noteAdded1, noteAdded2; |
local name, unknown, textureIndex, x, y; |
end |
if (mode == 1) then |
if (textureIndex==6) then |
noteAdded1 = MetaMap_AddNewNote(mapName, x, y, name, "", "", METAMAPPOI_NAME, icon, 6, 0, 0,nil,MetaMap_GetCurrentMapDungeonLevel()); |
noteAdded1 = MetaMap_AddNewNote(mapName, x, y, name, "", "", METAMAPPOI_NAME, icon, 6, 0, 0,nil,GetCurrentMapDungeonLevel()); |
end |
else |
noteAdded2 = MetaMap_AddNewNote(mapName, x, y, name, "", "", METAMAPPOI_NAME, icon, 6, 0, 0,nil,MetaMap_GetCurrentMapDungeonLevel()); |
noteAdded2 = MetaMap_AddNewNote(mapName, x, y, name, "", "", METAMAPPOI_NAME, icon, 6, 0, 0,nil,GetCurrentMapDungeonLevel()); |
end |
end |
if (noteAdded1 and noteAdded2) then |
WorldMapTooltip:AddLine(METAMAP_INFOLINE_HINT3, 0.40, 0.40, 0.40, false); |
WorldMapTooltip:AddLine(METAMAP_INFOLINE_HINT4, 0.40, 0.40, 0.40, false); |
--old WorldMapPOIFrame.allowBlobTooltip = false; |
WorldMapPOIFrame.allowBlobTooltip = false; |
WorldMapTooltip:Show(); |
--WorldMapTooltip:SetFrameLevel(WorldMapFrame:GetFrameLevel() + 20); |
end |
MetaMap_StayOnMap = false; |
MetaMap_MapClick = false; |
end |
--old SetMapToCurrentZone(); |
local realID = C_Map.GetBestMapForUnit("player"); |
if ( not realID ) then return; end |
WorldMapFrame:SetMapID(realID); |
SetMapToCurrentZone(); |
local realID = GetCurrentMapAreaID(); |
local realZone = GetRealZoneText(); |
--old local _, _, _, isMicroDungeon = GetMapInfo(); |
local _, _, _, isMicroDungeon = GetMapInfo(); |
if (realZone) then |
local _, index, type = MetaMap_GetZoneTableEntry(realZone, realID); |
--old if ( index and (type == "SZR") and not isMicroDungeon ) then |
if ( index and (type == "SZR") ) then |
if ( index and (type == "SZR") and not isMicroDungeon ) then |
local mapName = MetaMap_ZoneTable[index]["Location"]; |
if (mapName) then |
if (MetaMapOptions.MetaMapZone) then MetaMapOptions.MetaMapZone = mapName; end |
local _, _, _, mapid = MetaMap_GetZoneTableEntry(mapName); |
if ( mapid ~= 0 ) then |
MetaMap_Debug_Print("SetMapByID",true); |
--old SetMapByID(mapid); |
WorldMapFrame:SetMapID(mapid); |
SetMapByID(mapid); |
--SetDungeonMapLevel(0); |
else |
MetaMap_Debug_Print("SetMapZoom",true); |
-- SetMapZoom(MetaMap_NameToZoneID(mapName)); |
--old MetaMap_SetMapZoomByName(mapName); |
WorldMapFrame:SetMapID(MetaMap_NameToZoneID(zoneName)); |
MetaMap_SetMapZoomByName(mapName); |
end |
end |
end |
end |
if (realZone) then |
for _, zoneTable in pairs(MetaMap_ZoneTable) do |
if (zoneTable[MetaMap_Locale] == realZone) then |
--old if ( not zoneTable.mapid or (zoneTable.mapid == WorldMapFrame:GetMapID() and not isMicroDungeon) ) then |
if ( not zoneTable.mapid or (zoneTable.mapid == MetaMap_UiMapID_AreaID[WorldMapFrame:GetMapID()].AreaID) ) then |
if ( not zoneTable.mapid or (zoneTable.mapid == GetCurrentMapAreaID() and not isMicroDungeon) ) then |
if (zoneTable.ztype == "SZR") then |
realZone = zoneTable.Location; |
else |
MetaMapOptions.MetaMapLevel = 0; |
MetaMapOptions.oldScrollH = 0; |
MetaMapOptions.oldScrollV = 0; |
MetaMapOptions.oldScale = WorldFrame:GetScale(); |
MetaMapOptions.oldScale = WORLDMAP_SETTINGS.size; |
end |
MetaMap_BaseMap.ID = WorldMapFrame:GetMapID(); |
MetaMap_BaseMap.Level = MetaMap_GetCurrentMapDungeonLevel(); |
MetaMap_BaseMap.ID = GetCurrentMapAreaID(); |
MetaMap_BaseMap.Level = GetCurrentMapDungeonLevel(); |
if ( not MetaMapOptions.MapChange and WorldMapFrame:IsVisible() and mapReset and self and not MetaMap_CurrentMap.Micro ) then |
MetaMap_SetMapAfterRefresh(self); |
else |
if ( isMicroDungeon ) then |
MetaMapOptions.MetaMapZone = GetRealZoneText(); |
MetaMapOptions.MetaMapLevel = MetaMap_GetCurrentMapDungeonLevel(); |
MetaMapOptions.MetaMapLevel = GetCurrentMapDungeonLevel(); |
else |
MetaMapOptions.MetaMapZone = MetaMap_GetRealZoneText(); |
MetaMapOptions.MetaMapLevel = 0; |
end |
MetaMapOptions.oldScrollH = 0; |
MetaMapOptions.oldScrollV = 0; |
MetaMapOptions.oldScale = WorldFrame:GetScale(); |
MetaMapOptions.oldScale = WORLDMAP_SETTINGS.size; |
MetaMapOptions.ShowDNI = true; |
MetaMap_CurrentMap = MetaMap_SaveCurrentMapData(); |
local mapName = MetaMap_GetCurrentMapInfo(); |
local currentMap = {}; |
if (mapName) then |
currentMap.Name = mapName; |
currentMap.ID = WorldMapFrame:GetMapID(); |
currentMap.Name = mapName; |
currentMap.ID = GetCurrentMapAreaID(); |
-- check for dungeon map of cosmos |
if ( (currentMap.ID == -1) and (mapName ~= "The Cosmos") ) then |
currentMap.Name = "The Cosmos"; |
end |
--old currentMap.CID = GetCurrentMapContinent(); |
currentMap.CID = C_Map.GetWorldPosFromMapPos(currentMap.ID, C_Map.GetPlayerMapPosition(C_Map.GetBestMapForUnit("player"), "player")); |
--old currentMap.ZID = GetCurrentMapZone(); |
currentMap.ZID = 1; |
currentMap.Level = MetaMap_GetCurrentMapDungeonLevel(); |
--old local _, _, _, isMicroDungeon = GetMapInfo(); |
--old currentMap.Micro = isMicroDungeon; |
end |
currentMap.CID = GetCurrentMapContinent(); |
currentMap.ZID = GetCurrentMapZone(); |
currentMap.Level = GetCurrentMapDungeonLevel(); |
local _, _, _, isMicroDungeon = GetMapInfo(); |
currentMap.Micro = isMicroDungeon; |
if ( resetScale ) then |
currentMap.oldScale = MetaMap_WorldMap_baseScale; |
currentMap.oldScale = WORLDMAP_SETTINGS.size; |
currentMap.oldScrollH = 0; |
currentMap.oldScrollV = 0; |
else |
if (MetaMapOptions.MapChange) then return {}; end |
if (not WorldMapFrame:IsVisible()) then return {}; end |
if (not MetaMap_CurrentMap.Name or not MetaMap_CurrentMap.ID) then return {}; end |
local mapID = WorldMapFrame:GetMapID(); |
local mapLevel = MetaMap_GetCurrentMapDungeonLevel(); |
local mapID = GetCurrentMapAreaID(); |
local mapLevel = GetCurrentMapDungeonLevel(); |
if (mapID == MetaMap_CurrentMap.ID and mapLevel == MetaMap_CurrentMap.Level) then return {}; end |
local _, _, zType = MetaMap_GetZoneTableEntry(MetaMap_CurrentMap.Name); |
localisation.fr.lua |
localisation.de.lua |
localisation.es.lua |
MetaMapIDs.lua |
MetaMapConstants.lua |
MetaMapFunctions.lua |
MetaMapOptions.lua |
end |
if (MetaMap_CurrentAction) then |
WorldMapFrame.ScrollContainer:EnableMouse(false); |
WorldMapButton:EnableMouse(false); |
else |
WorldMapFrame.ScrollContainer:EnableMouse(true); |
WorldMapButton:EnableMouse(true); |
end |
if (MetaMapOptions.MetaMapButtonShown) then |
MetaMapButton_UpdatePosition(); |
function MetaMapButton_UpdatePosition() |
if (MetaMapOptions.MetaMapButtonPosition_Old ~= MetaMapOptions.MetaMapButtonPosition or not MetaMapOptions.MetaMapButtonPositionXY) then |
MetaMapButton:ClearAllPoints(); |
MetaMapButton:SetPoint("TOPLEFT", Minimap, "TOPLEFT", |
MetaMapButton:SetPoint("TOPLEFT", "Minimap", "TOPLEFT", |
52 - (80 * cos(MetaMapOptions.MetaMapButtonPosition)), |
(80 * sin(MetaMapOptions.MetaMapButtonPosition)) - 52 |
); |
MetaMapOptions.MetaMapAlpha2 = MetaMapAlphaSlider:GetValue(); |
WorldMapFrame:SetAlpha(MetaMapOptions.MetaMapAlpha2); |
end |
WorldMapFrame.ScrollContainer:SetAlpha(MetaMapAlphaSlider:GetValue() + 0.2); |
WorldMapButton:SetAlpha(MetaMapAlphaSlider:GetValue() + 0.2); |
end |
local MetaMap_clickX = 0; |
local MetaMap_clickY = 0; |
function MetaMap_WorldMapFrame_OnMouseDown(self, button) |
MetaMap_clickX, MetaMap_clickY = GetCursorPosition(); |
end |
local MetaMap_WorldMap_isMoving = false; |
local MetaMap_dragStartX = 0; |
local MetaMap_dragStartY = 0; |
function MetaMap_FrameStartMoving(self, button) |
if ( not MetaMap_FullScreenMode and MetaMap_WorldMap_baseScale ~= 0 and button == "LeftButton" and not MetaMap_WorldMap_isMoving and self.canMove ) then |
MetaMap_WorldMap_isMoving = true; |
MetaMap_dragStartX = MetaMap_clickX; |
MetaMap_dragStartY = MetaMap_clickY; |
self:StartMoving(); |
end |
end |
local MetaMap_saveScale = -1; |
local MetaMap_WorldMap_sizeX = 0; |
local MetaMap_WorldMap_sizeY = 0; |
function MetaMap_FrameStopMoving(self, button) |
if ( MetaMap_WorldMap_isMoving ) then |
self:StopMovingOrSizing(); |
local dragStopX, dragStopY = GetCursorPosition(); |
local moveX = (dragStopX - MetaMap_dragStartX) / UIParent:GetEffectiveScale(); |
local moveY = (dragStopY - MetaMap_dragStartY) / UIParent:GetEffectiveScale(); |
local dispX = GetScreenWidth() * UIParent:GetEffectiveScale(); |
local dispY = GetScreenHeight() * UIParent:GetEffectiveScale(); |
local newPosX = min(max(MetaMapOptions.MetaMapPos1[1] + moveX, 0), dispX - MetaMap_WorldMap_sizeX / UIParent:GetEffectiveScale()); |
local newPosY = max(min(MetaMapOptions.MetaMapPos1[2] + moveY, 0), -dispY + MetaMap_WorldMap_sizeY / UIParent:GetEffectiveScale()); |
if (MetaMapOptions.SaveSet == 1) then |
MetaMapOptions.MetaMapPos1 = { newPosX, newPosY }; |
else |
MetaMapOptions.MetaMapPos2 = { newPosX, newPosY }; |
end |
MetaMap_WorldMap_isMoving = false; |
end |
end |
local MetaMap_WorldMap_baseX = 0; |
local MetaMap_WorldMap_baseY = 0; |
local MetaMap_WorldMap_sizeQ = 0; |
local MetaMap_WorldMapScroll_sizeX = 0; |
local MetaMap_WorldMapScroll_sizeY = 0; |
local MetaMap_WorldMap_spacer = 0; |
local MetaPap_WorldMapFrameBg_TopY = 0; |
function MetaMap_UpdateScale() |
MetaMap_Debug_Print("MetaMap_UpdateScale", true); |
if ( InCombatLockdown() or MetaMap_WorldMap_isMoving ) then return; end |
if ( MetaMap_WorldMap_baseScale == 0 or MetaMap_WorldMap_baseX == 0 ) then |
MetaMap_WorldMap_baseScale = WorldMapFrame.ScrollContainer.baseScale; |
local nPoints = WorldMapFrame:GetNumPoints(); |
if ( nPoints == 1 ) then |
_, _, _, MetaMap_WorldMap_baseX, MetaMap_WorldMap_baseY = WorldMapFrame:GetPoint(); |
_, _, _, _, MetaMap_WorldMapFrameBg_TopY = WorldMapFrameBg:GetPoint(); |
local _, _, _, spacerX, spacerY = WorldMapFrame.TitleCanvasSpacerFrame:GetPoint(2); |
MetaMap_WorldMap_spacer = -spacerY; |
MetaMap_WorldMapScroll_sizeX = WorldMapFrame.minimizedWidth; |
MetaMap_WorldMapScroll_sizeY = WorldMapFrame.minimizedHeight - MetaMap_WorldMap_spacer; |
MetaMap_WorldMap_sizeQ = WorldMapFrame.questLogWidth; |
end |
end |
if ( MetaMapOptions.MetaMapPos1[1] == -1 ) then |
MetaMapOptions.MetaMapPos1 = { MetaMap_WorldMap_baseX, MetaMap_WorldMap_baseY }; |
end |
if ( MetaMapOptions.MetaMapPos2[1] == -1 ) then |
MetaMapOptions.MetaMapPos2 = { MetaMap_WorldMap_baseX, MetaMap_WorldMap_baseY }; |
end |
if (not MetaMap_FullScreenMode and MetaMap_WorldMap_baseScale ~= 0 ) then |
if ( InCombatLockdown() ) then return; end |
if (not MetaMap_FullScreenMode) then |
MetaMap_Debug_Print("MetaMap_UpdateScale-NoFullScreen", true); |
if (MetaMapOptions.SaveSet == 1) then |
MetaMapOptions.MetaMapScale1 = math.floor((MetaMapScaleSlider:GetValue() + 0.025 ) * 20) / 20.0; |
if (MetaMapOptions.MetaMapScale1 == 0) then MetaMapOptions.MetaMapScale1 = MetaMap_WorldMap_baseScale; end |
MetaMap_SetWorldMapScale(MetaMapOptions.MetaMapScale1, MetaMapOptions.MetaMapPos1[1], MetaMapOptions.MetaMapPos1[2]); |
MetaMapOptions.MetaMapScale1 = MetaMapScaleSlider:GetValue(); |
if (MetaMapOptions.MetaMapScale1 == 0) then MetaMapOptions.MetaMapScale1 = 0.5; end |
MetaMap_SetEffectiveScale(WorldMapFrame, MetaMapOptions.MetaMapScale1); |
else |
MetaMapOptions.MetaMapScale2 = math.floor((MetaMapScaleSlider:GetValue() + 0.025 ) * 20) / 20.0; |
if (MetaMapOptions.MetaMapScale2 == 0) then MetaMapOptions.MetaMapScale2 = MetaMap_WorldMap_baseScale; end |
MetaMap_SetWorldMapScale(MetaMapOptions.MetaMapScale2, MetaMapOptions.MetaMapPos2[1], MetaMapOptions.MetaMapPos2[2]); |
MetaMapOptions.MetaMapScale2 = MetaMapScaleSlider:GetValue(); |
if (MetaMapOptions.MetaMapScale2 == 0) then MetaMapOptions.MetaMapScale2 = 0.5; end |
MetaMap_SetEffectiveScale(WorldMapFrame, MetaMapOptions.MetaMapScale2); |
end |
end |
end |
local saveQuestPanel = false; |
function MetaMap_SetWorldMapScale(scale, posX, posY) |
local questPanel = WorldMapFrame:IsSidePanelShown(); |
if ( scale == 0 ) then |
-- Reset WorldMapFrame |
WorldMapFrame:ClearAllPoints(); |
WorldMapFrame:SetPoint("TOPLEFT",UIParent,"TOPLEFT",MetaMap_WorldMap_baseX,MetaMap_WorldMap_baseY); |
if ( scale ~= MetaMap_saveScale or questPanel ~= saveQuestPanel ) then |
WorldMapFrame.ScrollContainer:CreateZoomLevels(); |
WorldMapFrame:ResetZoom(); |
end |
WorldMapFrame.TitleCanvasSpacerFrame:SetScale(1.0); |
WorldMapFrame.BorderFrame:SetScale(1.0); |
WorldMapFrame.NavBar:SetScale(1.0); |
WorldMapFrame.SidePanelToggle:SetScale(1.0); |
WorldMapFrameBg:SetPoint("TOPLEFT",WorldMapFrame.BorderFrame,"TOPLEFT",2,MetaPap_WorldMapFrameBg_TopY); |
MetaMap_ModeToggleButton:SetScale(1.0); |
MetaMap_MoveToggleButton:SetScale(1.0); |
MetaMap_GoToCurrentZone:SetScale(1.0); |
MetaMap_OptionsButton:SetScale(1.0); |
MetaMap_InstanceButton:SetScale(1.0); |
QuestMapFrame:SetScale(1.0); |
else |
local nScale = scale / MetaMap_WorldMap_baseScale; |
local spacer = MetaMap_WorldMap_spacer * nScale; |
local sizeX = MetaMap_WorldMapScroll_sizeX / MetaMap_WorldMap_baseScale * scale; |
local sizeY = MetaMap_WorldMapScroll_sizeY / MetaMap_WorldMap_baseScale * scale; |
local setX = abs(posX) + sizeX; |
local setY = -(abs(posY) + sizeY + spacer); |
local bgPosY = MetaPap_WorldMapFrameBg_TopY / MetaMap_WorldMap_baseScale * nScale; |
if ( questPanel ) then |
setX = setX + MetaMap_WorldMap_sizeQ * nScale; |
end |
MetaMap_WorldMap_sizeX = (setX - posX); |
MetaMap_WorldMap_sizeY = -(setY - posY); |
WorldMapFrame:ClearAllPoints(); |
WorldMapFrame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", posX, posY); |
WorldMapFrame:SetPoint("BOTTOMRIGHT", UIParent, "TOPLEFT", setX, setY); |
if ( scale ~= MetaMap_saveScale or questPanel ~= saveQuestPanel ) then |
WorldMapFrame.ScrollContainer:CreateZoomLevels(); |
WorldMapFrame:ResetZoom(); |
end |
WorldMapFrame.TitleCanvasSpacerFrame:SetScale(nScale); |
WorldMapFrame.BorderFrame:SetScale(nScale); |
WorldMapFrame.NavBar:SetScale(nScale); |
WorldMapFrame.SidePanelToggle:SetScale(nScale); |
WorldMapFrameBg:SetPoint("TOPLEFT",WorldMapFrame.BorderFrame,"TOPLEFT",2,-bgPosY); |
MetaMap_ModeToggleButton:SetScale(nScale); |
MetaMap_MoveToggleButton:SetScale(nScale); |
MetaMap_GoToCurrentZone:SetScale(nScale); |
MetaMap_OptionsButton:SetScale(nScale); |
MetaMap_InstanceButton:SetScale(nScale); |
QuestMapFrame:SetScale(nScale); |
function MetaMap_SetEffectiveScale(frame, scale) |
local parent = frame:GetParent(); |
if (parent) then |
scale = scale / parent:GetEffectiveScale(); |
end |
MetaMap_saveScale = scale; |
saveQuestPanel = questPanel; |
frame:SetScale(scale); |
return scale; |
end |
function MetaMap_UpdateTTScale() |
PlaySound(SOUNDKIT.IG_CHARACTER_INFO_TAB); |
end |
--[[old |
function MetaMap_SetFrameStrata() |
local strata; |
if (MetaMapOptions.MetaMapFrameStrata == 4) then |
if (MetaMapOptions.MetaMapFrameStrata == 2) then |
strata = "DIALOG"; |
elseif (MetaMapOptions.MetaMapFrameStrata == 3) then |
strata = "HIGH"; |
elseif (MetaMapOptions.MetaMapFrameStrata == 2) then |
strata = "MEDIUM"; |
elseif (MetaMapOptions.MetaMapFrameStrata == 1) then |
strata = "LOW"; |
strata = "HIGH"; |
else |
strata = "BACKGROUND"; |
strata = "MEDIUM"; |
end |
--WorldMapFrame_ResetFrameLevels(); |
WorldMapTooltip:SetFrameStrata("TOOLTIP"); |
-- not all parts of the WorldMapFrame are shown with the same FrameStrata |
WorldMapFrame:SetFrameStrata(strata); |
MetaMap_OptionsButton:SetFrameLevel("99"); |
MetaMap_MiscDisplay:SetFrameLevel("99"); |
MetaMap_MainCoords:SetFrameLevel("99"); |
--WorldMapBlobFrame:SetFrameLevel(WorldMapPOIFrame:GetFrameLevel()+1); |
--WorldMapBlobFrame:SetFrameStrata("TOOLTIP"); |
--WorldMapQuestScrollFrame:SetFrameLevel(MetaMapTopFrame:GetFrameLevel()+6); |
WorldMapCompareTooltip1:SetFrameStrata("TOOLTIP"); |
WorldMapCompareTooltip2:SetFrameStrata("TOOLTIP"); |
WorldMapTooltip:SetFrameLevel("300"); |
end |
--]] |
function MetaMap_ToggleOptions(key, value) |
if (value) then |
</Scripts> |
</Button> |
<Button name="MetaMapNotes_NoteTemplate" hidden="true" virtual="true" frameStrata="HIGH" toplevel="true"> |
<Button name="MetaMapNotes_NoteTemplate" hidden="true" virtual="true"> |
<Size><AbsDimension x="16" y="16"/></Size> |
<Anchors> |
<Anchor point="CENTER"/> |
MetaMap_MapNoteOnEnter(self,self:GetID()); |
</OnEnter> |
<OnLeave> |
--old WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapTooltip:Hide(); |
</OnLeave> |
<OnClick> |
end |
</OnEnter> |
<OnLeave> |
--old WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapTooltip:Hide(); |
</OnLeave> |
<OnClick> |
</OnEnter> |
<OnLeave> |
_G[self:GetName().."Highlight"]:Hide(); |
--old WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapTooltip:Hide(); |
</OnLeave> |
</Scripts> |
<Frame name="MetaMap_InstanceMenu" inherits="UIDropDownMenuTemplate" parent="UIParent" id="33"/> |
<Frame name="MetaMap_MiscDisplay" parent="WorldMapFrame" hidden="false" frameStrata="HIGH" toplevel="true"> |
<Frame name="MetaMap_MiscDisplay" toplevel="true" parent="WorldMapFrame" hidden="false"> |
<Layers> |
<Layer level="ARTWORK"> |
<FontString name="MetaMapText_NoteTotals" inherits="MetaMap_FontSmallTemplate" text=""> |
</Frame> |
<!-- Coords printing at the map --> |
<Frame name="MetaMap_MainCoords" hidden="true" parent="WorldMapFrame" frameStrata="HIGH" toplevel="true"> |
<Frame name="MetaMap_MainCoords" hidden="true" parent="WorldMapFrame" > |
<Layers> |
<Layer level="ARTWORK"> |
<FontString name="MetaMapCoordsPlayer" inherits="MetaMap_FontSmallTemplate" text=""> |
<Frame name="MetaMapNotesLinesFrame" parent="WorldMapFrame.ScrollContainer.Child" hidden="false" frameStrata="HIGH" toplevel="true" /> |
<Frame name="MetaMapNotesLinesFrame" parent="WorldMapButton" hidden="false" /> |
<!--Frame name="MetaMapNotesLinesFrame" parent="WorldMapFrame" hidden="false"> |
<Scripts> |
<OnLoad> |
-- WorldMapPlayerUpper:GetScript("OnLeave")(WorldMapPlayerUpper); -- just a hide tooltip call |
</OnLeave> |
<OnClick> |
MetaMap_WorldMapButton_OnClick(WorldMapFrame.ScrollContainer, button); -- leave without self |
MetaMap_WorldMapButton_OnClick(WorldMapButton, button); -- leave without self |
</OnClick> |
</Scripts> |
</Button> |
<!-- for vNote & Party function --> |
<Button name="MetaMapNotesPOIvNote" inherits="WorldMapMetaMapNotesMiscTemplate" id="0" parent="WorldMapFrame.ScrollContainer" hidden="true"/> |
<Button name="MetaMapNotesPOIparty" inherits="WorldMapMetaMapNotesMiscTemplate" id="1" parent="WorldMapFrame.ScrollContainer" hidden="true"/> |
<Button name="MetaMapNotesPOIvNote" inherits="WorldMapMetaMapNotesMiscTemplate" id="0" parent="WorldMapButton" hidden="true"/> |
<Button name="MetaMapNotesPOIparty" inherits="WorldMapMetaMapNotesMiscTemplate" id="1" parent="WorldMapButton" hidden="true"/> |
<!-- Adds the MiniNote POI to MiniMapFrame --> |
<Button name="MetaMap_MiniNote" parent="Minimap" toplevel="true" hidden="true"> |
</Frames> |
<Scripts> |
<OnLoad> |
self:SetHeight(WorldMapFrame.ScrollContainer:GetHeight()); |
self:SetHeight(WorldMapButton:GetHeight()); |
self:SetFrameLevel(self:GetParent():GetFrameLevel() + 4); |
</OnLoad> |
</Scripts> |
MetaMap_InfoLineOnEnter(self); |
</OnEnter> |
<OnLeave> |
--old WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapPOIFrame.allowBlobTooltip = true; |
WorldMapTooltip:Hide(); |
</OnLeave> |
</Scripts> |
</Scripts> |
</Frame> |
<Button name="MetaMap_ModeToggleButton" hidden="false" parent="WorldMapFrame" inherits="UIPanelButtonTemplate" frameStrata="HIGH" toplevel="true" text="0"> |
<Button name="MetaMap_ModeToggleButton" hidden="false" parent="WorldMapFrame" inherits="UIPanelButtonTemplate" text="0"> |
<Size><AbsDimension x="22" y="22"/></Size> |
<Anchors><Anchor point="RIGHT" relativeTo="WorldMapFrameCloseButton" relativePoint="LEFT" x="-18" y="0"/></Anchors> |
<Anchors><Anchor point="TOPRIGHT" relativeTo="WorldMapFrameCloseButton" relativePoint="BOTTOMRIGHT" x="-6" y="6"/></Anchors> |
<Scripts> |
<OnLoad> |
self:RegisterForClicks("LeftButtonDown"); |
</Scripts> |
</Button> |
<CheckButton name="MetaMap_MoveToggleButton" inherits="ActionButtonTemplate" hidden="false" parent="WorldMapFrame" frameStrata="HIGH" toplevel="true"> |
<Size><AbsDimension x="30" y="30"/></Size> |
<Anchors><Anchor point="RIGHT" relativeTo="MetaMap_ModeToggleButton" relativePoint="LEFT" x="7" y="0"/></Anchors> |
<Backdrop bgFile="Interface\Buttons\LockButton-Border"/> |
<Button name="MetaMap_GoToCurrentZone" hidden="false" parent="WorldMapFrame" inherits="UIPanelButtonTemplate" text="METAMAP_GO_TO_CURENT_ZONE"> |
<Size><AbsDimension x="120" y="23"/></Size> |
<Anchors> |
<Anchor point="RIGHT" relativeTo="MetaMap_ModeToggleButton" relativePoint="LEFT"> |
<Offset><AbsDimension x="0" y="0"/></Offset> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnLoad> |
self:SetChecked(false); |
WorldMapFrame.canMove = false; |
WorldMapFrame:SetMovable(false); |
WorldMapFrame:EnableMouse(false); |
WorldMapFrame:SetClampedToScreen(false); |
WorldMapFrame:RegisterForDrag("LeftButton"); |
WorldMapFrame:HookScript("OnMouseDown", MetaMap_WorldMapFrame_OnMouseDown); |
WorldMapFrame:SetScript("OnDragStart", MetaMap_FrameStartMoving) |
WorldMapFrame:SetScript("OnDragStop", MetaMap_FrameStopMoving) |
</OnLoad> |
<OnClick> |
WorldMapFrame.canMove = self:GetChecked(); |
WorldMapFrame:SetMovable(self:GetChecked()); |
WorldMapFrame:EnableMouse(self:GetChecked()); |
</OnClick> |
</Scripts> |
<NormalTexture file="Interface\Buttons\LockButton-Locked-Up"/> |
<PushedTexture file="Interface\Buttons\LockButton-Unlocked-Down"/> |
<HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD"/> |
<CheckedTexture file="Interface\Buttons\LockButton-Unlocked-Up"/> |
</CheckButton> |
<Button name="MetaMap_GoToCurrentZone" hidden="false" parent="WorldMapFrame" inherits="UIPanelButtonTemplate" frameStrata="HIGH" toplevel="true" text="METAMAP_GO_TO_CURENT_ZONE"> |
<Size><AbsDimension x="110" y="23"/></Size> |
<Anchors><Anchor point="RIGHT" relativeTo="MetaMap_MoveToggleButton" relativePoint="LEFT" x="5" y="0"/></Anchors> |
<Scripts> |
<OnLoad> |
self:RegisterForClicks("LeftButtonDown"); |
</OnLoad> |
<OnClick> |
</Scripts> |
</Button> |
<Button name="MetaMap_OptionsButton" hidden="false" parent="WorldMapFrame" inherits="OptionsButtonTemplate" frameStrata="HIGH" toplevel="true" text="METAMAP_OPTIONS_BUTTON"> |
<Size><AbsDimension x="90" y="23"/></Size> |
<Anchors><Anchor point="RIGHT" relativeTo="MetaMap_GoToCurrentZone" relativePoint="LEFT" x="3" y="0"/></Anchors> |
<!-- Option button position in the map frame --> |
<Button name="MetaMap_OptionsButton" hidden="false" parent="WorldMapFrame" inherits="OptionsButtonTemplate" text="METAMAP_OPTIONS_BUTTON"> |
<Size><AbsDimension x="100" y="23"/></Size> |
<Anchors> |
<Anchor point="RIGHT" relativeTo="MetaMap_GoToCurrentZone" relativePoint="LEFT"> |
<Offset><AbsDimension x="-6" y="0"/></Offset> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnEnter> |
if (not MetaMapOptions.MenuMode) then |
</Scripts> |
</Button> |
<Button name="MetaMap_InstanceButton" hidden="false" parent="WorldMapFrame" inherits="OptionsButtonTemplate" frameStrata="HIGH" toplevel="true" text="Instance"> |
<!-- The instance menu button --> |
<Button name="MetaMap_InstanceButton" hidden="false" parent="WorldMapFrame" inherits="OptionsButtonTemplate" text="Instance"> |
<Size><AbsDimension x="80" y="23"/></Size> |
<Anchors><Anchor point="TOPLEFT" relativeTo="WorldMapFramePortraitFrame" relativePoint="TOPRIGHT" x="-7" y="-10"/></Anchors> |
<Anchors> |
<Anchor point="BOTTOMLEFT" relativeTo="WorldMapFrameNavBarOverlay" relativePoint="TOPLEFT"> |
<Offset><AbsDimension x="-2" y="1"/></Offset> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnEnter> |
if (not MetaMapOptions.MenuMode) then |