/branches
for _, poi in ipairs(AM_INSTANCE_LOCS[m]) do |
if ( ( not poi.floor ) or ( poi.floor == lFloor ) ) then |
i = i + 1; |
note = getglobal("AM_POII_Note_"..i); |
note = getglobal("AM_POI_Note_"..i); |
if ( not note ) then |
note = CreateFrame("Button", "AM_POII_Note_"..i, frame, "AM_GenPOI_Template"); |
note = CreateFrame("Button", "AM_POI_Note_"..i, frame, "AM_GenPOI_Template"); |
note:SetScript("OnEnter", function(self) |
local x, y = GetCursorPosition(); |
if ( x > 500 ) then |
end) |
note:SetScript("OnClick", function(self, mouseButton) |
if ( mouseButton == "LeftButton" ) then |
local map = AMap.AlphaMap_GetMap(self.toMap); |
local map = AML.AlphaMap_GetMap(self.toMap); |
if ( map ) then |
AlphaMapFrame_Update( map ); |
elseif ( self.toWorldMap ) then |
local cont, zone = AMap.AlphaMap_GetWorldMap(self.toWorldMap); |
local cont, zone = AML.AlphaMap_GetWorldMap(self.toWorldMap); |
if ( cont ~= "error" ) then |
SetMapZoom(cont, zone); -- ))(( |
AM_WorldMapSelected = true; |
end |
end) |
end |
noteT = getglobal("AM_POII_Note_"..i.."Texture"); |
noteT = getglobal("AM_POI_Note_"..i.."Texture"); |
noteT:SetTexture( poi.icon ); |
x = ( poi.x * width ) / amUnitScale; |
end |
i = i + 1; |
note = getglobal("AM_POII_Note_"..i); |
note = getglobal("AM_POI_Note_"..i); |
while (note) do |
note:Hide(); |
i = i + 1; |
note = getglobal("AM_POII_Note_"..i); |
note = getglobal("AM_POI_Note_"..i); |
end |
end |
-- Insert Instance Display function code in to the main AlphaMap POI Plugin array |
-- AlphaMap will loop through these functions to display the required POIs |
table.insert(AMap.CustomPOIs, DisplayInstanceLocs); |
table.insert(AML.CustomPOIs, DisplayInstanceLocs); |
-- Set up the Control Check Button allowing people to toggle |
-- display of Instance Locations off and on from the AlphaMap |
local i = #(AMap.CustomPOIControls) + 1; |
local i = #(AML.CustomPOIControls) + 1; |
local controlButton = CreateFrame("Button", "AM_POIC"..i, UIParent, "AM_GenPOIControl_Template"); |
controlButton.id = i; |
local controlButtonT = getglobal("AM_POIC"..i.."Texture"); |
-- Insert the Created control button in to the main AlphaMap array |
-- for display when the Control & Alt keys are pressed together |
table.insert(AMap.CustomPOIControls, controlButton); |
table.insert(AML.CustomPOIControls, controlButton); |
end |
AM_Raid_Progress_Types = {}; |
AM_BG_Types = {}; |
AMap = {}; |
AMap.CustomPOIs = {}; |
AMap.CustomPOIControls = {}; |
local AMap = {}; |
local AM_UPDATE_INTERVAL_SMAX = 0.66; |
local AM_UPDATE_INTERVAL_PMAX = 0.08; |
local AM_Update_Timer_S = 0; |
------------------------ |
local AML = {}; |
AML.CustomPOIs = {}; |
AML.CustomPOIControls = {}; |
function AML.ProcessCustomPOIs(c, z, m, frame) |
for _, func in ipairs(AMap.CustomPOIs) do |
for _, func in ipairs(AML.CustomPOIs) do |
func(c, z, m, frame); |
end |
end |
return nil; |
end |
function AML.AlphaMap_GetMap(mapData, pX, pY) |
if ( ( mapData ) and ( type(mapData) == "string" ) ) then |
for i=1, getn(AM_ALPHAMAP_LIST), 1 do |
if ( ( AM_ALPHAMAP_LIST[i].area ) and ( AM_ALPHAMAP_LIST[i].area == mapData ) and ( pX ) and ( pY ) ) then |
if ( ( pX > AM_ALPHAMAP_LIST[i].wmData.minX ) and |
( pX < AM_ALPHAMAP_LIST[i].wmData.maxX ) and |
( pY > AM_ALPHAMAP_LIST[i].wmData.minY ) and |
( pY < AM_ALPHAMAP_LIST[i].wmData.maxY ) ) then |
return AM_ALPHAMAP_LIST[i], i, AM_ALPHAMAP_LIST[i].filename; |
end |
elseif ( AM_ALPHAMAP_LIST[i].filename == mapData ) then |
if ( AM_ValidMaps[mapData] ) then |
return AM_ALPHAMAP_LIST[i], i, mapData; |
end |
elseif ( AM_ALPHAMAP_LIST[i].name == mapData ) then |
local map = AM_ALPHAMAP_LIST[i].filename; |
if ( AM_ValidMaps[map] ) then |
return AM_ALPHAMAP_LIST[i], i, map; |
end |
end |
end |
elseif ( ( mapData ) and ( type(mapData) == "number" ) ) then |
if ( AM_ALPHAMAP_LIST[mapData] ) then |
local map = AM_ALPHAMAP_LIST[mapData].filename; |
if ( AM_ValidMaps[map] ) then |
return AM_ALPHAMAP_LIST[mapData].Display, AM_ALPHAMAP_LIST[mapData].type; |
end |
end |
end |
return nil; |
end |
function AML.AlphaMap_Print(msg, r, g, b, frame, id) |
if ( Print ) then |
Print(msg, r, g, b, frame, id); |
return numOverlays; |
end |
-- Made global |
function AMap.AlphaMap_GetMap(mapData, pX, pY) |
if ( ( mapData ) and ( type(mapData) == "string" ) ) then |
for i=1, getn(AM_ALPHAMAP_LIST), 1 do |
if ( ( AM_ALPHAMAP_LIST[i].area ) and ( AM_ALPHAMAP_LIST[i].area == mapData ) and ( pX ) and ( pY ) ) then |
if ( ( pX > AM_ALPHAMAP_LIST[i].wmData.minX ) and |
( pX < AM_ALPHAMAP_LIST[i].wmData.maxX ) and |
( pY > AM_ALPHAMAP_LIST[i].wmData.minY ) and |
( pY < AM_ALPHAMAP_LIST[i].wmData.maxY ) ) then |
return AM_ALPHAMAP_LIST[i], i, AM_ALPHAMAP_LIST[i].filename; |
end |
elseif ( AM_ALPHAMAP_LIST[i].filename == mapData ) then |
if ( AM_ValidMaps[mapData] ) then |
return AM_ALPHAMAP_LIST[i], i, mapData; |
end |
elseif ( AM_ALPHAMAP_LIST[i].name == mapData ) then |
local map = AM_ALPHAMAP_LIST[i].filename; |
if ( AM_ValidMaps[map] ) then |
return AM_ALPHAMAP_LIST[i], i, map; |
end |
end |
end |
elseif ( ( mapData ) and ( type(mapData) == "number" ) ) then |
if ( AM_ALPHAMAP_LIST[mapData] ) then |
local map = AM_ALPHAMAP_LIST[mapData].filename; |
if ( AM_ValidMaps[map] ) then |
return AM_ALPHAMAP_LIST[mapData].Display, AM_ALPHAMAP_LIST[mapData].type; |
end |
end |
end |
return nil; |
end |
-- )( |
function AMap.AlphaMap_GetWorldMap(map) |
function AML.AlphaMap_GetWorldMap(map) |
if ( mapMapper[map] ) then |
return mapMapper[map].c, mapMapper[map].z; |
end |
end |
elseif( event == "VARIABLES_LOADED") then |
if ( ( MetaMap_OptionsButton ) or ( Cartographer ) ) then |
applyAMMapChanges = nil; |
AM_OptionsGM_Change:Disable(); |
else |
if ( playerX > 0 ) then |
local zoneNameExt = zoneName..AM_EXTERIOR; |
amAlphaMapMap = AMap.AlphaMap_GetMap(zoneNameExt); |
amAlphaMapMap = AML.AlphaMap_GetMap(zoneNameExt); |
if ( not amAlphaMapMap ) then |
amAlphaMapMap = AMap.AlphaMap_GetMap(mapFileName, playerX, playerY); |
amAlphaMapMap = AML.AlphaMap_GetMap(mapFileName, playerX, playerY); |
end |
else |
-- trigger a second test for 1 second later... ? |
end |
if ( not amAlphaMapMap ) then |
amAlphaMapMap = AMap.AlphaMap_GetMap(zoneName); |
amAlphaMapMap = AML.AlphaMap_GetMap(zoneName); |
end |
if ( ( amAlphaMapMap ) and ( mapFileName ) ) then |
function DrawAlphaMapGatherer() |
if ( AML.drawingG ) then |
if ( AMap.drawingG ) then |
return; |
else |
AML.drawingG = true; |
AMap.drawingG = true; |
end |
local setting = Gatherer.Config.GetSetting; |
mainNote = getglobal("AlphaMapGathererPOI"..noteCount); |
end |
AML.drawingG = nil; |
AMap.drawingG = nil; |
end |
function AlphaMapNotes_OnEnter( id, noteFrame ) |
elseif ( ( GetMapInfo() ) and ( GetCurrentMapContinent() == -1 ) ) then |
local mapFileName = GetMapInfo(); |
local amMap = AMap.AlphaMap_GetMap(mapFileName); |
local amMap = AML.AlphaMap_GetMap(mapFileName); |
if ( amMap ) then |
AML.AM_CopySettings(AlphaMapConfigurations[ AML.AM_Strip(amMap.filename) ], AlphaMapConfig); |
local settingLabel = amMap.displayname; |
local amMap = nil; |
local mapFileName = GetMapInfo(); |
if ( mapFileName ) then |
amMap = AMap.AlphaMap_GetMap(mapFileName); |
amMap = AML.AlphaMap_GetMap(mapFileName); |
end |
AlphaMapFrame_Update(amMap); |
amMapNeedsRefresh = nil; |
return; |
end |
if ( ( not AlphaMapFrame:IsVisible() ) and ( MiniMapBattlefieldFrame.status == "active" ) ) then |
local am = AMap.AlphaMap_GetMap(lastEnteredZone); |
local am = AML.AlphaMap_GetMap(lastEnteredZone); |
if ( ( am ) and ( AM_BG_Types[am.type] ) ) then |
local settings = AlphaMapConfigurations[ AML.AM_Strip(am.filename) ]; |
if ( settings.autoOpen ) then -- previously .amInBG |
if ( mBttn == "LeftButton" ) then |
local bttnName = parent:GetName(); |
local iMap = AMap.AlphaMap_GetMap(parent.toMap); |
local iMap = AML.AlphaMap_GetMap(parent.toMap); |
if ( iMap ) then |
getglobal(bttnName.."Highlight"):Hide(); |
AlphaMapFrame_Update( iMap ); |
elseif ( parent.toWorldMap ) then |
getglobal(bttnName.."Highlight"):Hide(); |
local cont, zone = AMap.AlphaMap_GetWorldMap(parent.toWorldMap); |
local cont, zone = AML.AlphaMap_GetWorldMap(parent.toWorldMap); |
if ( cont ~= "error" ) then |
SetMapZoom(cont, zone); -- ))(( |
AM_WorldMapSelected = true; |
local parent = note:GetParent(); |
local keyID = parent.control:GetID(); |
if ( mBttn == "LeftButton" ) then |
local iMap = AMap.AlphaMap_GetMap(parent.toMap); |
local iMap = AML.AlphaMap_GetMap(parent.toMap); |
if ( iMap ) then |
for n=1, amNotesPerPage, 1 do |
getglobal("AlphaMapAlphaMapButtonDtl"..n.."Highlight"):Hide(); |
for n=1, amNotesPerPage, 1 do |
getglobal("AlphaMapAlphaMapButtonDtl"..n.."Highlight"):Hide(); |
end |
local cont, zone = AMap.AlphaMap_GetWorldMap(parent.toWorldMap); |
local cont, zone = AML.AlphaMap_GetWorldMap(parent.toWorldMap); |
if ( cont ~= "error" ) then |
SetMapZoom(cont, zone); -- ))(( |
AM_WorldMapSelected = true; |
amAlphaMapMap = nil; |
else |
local mType = sortedMapListType; |
local map = AMap.AlphaMap_GetMap( sortedMapList[selected].name ); |
local map = AML.AlphaMap_GetMap( sortedMapList[selected].name ); |
amMapType = mType; |
amAlphaMapMap = map; |
if ( not AlphaMapFrame:IsVisible() ) then |
elseif ( ( GetMapInfo() ) and ( GetCurrentMapContinent() == -1 ) ) then |
local mapFileName = GetMapInfo(); |
local amMap = AMap.AlphaMap_GetMap(mapFileName); |
local amMap = AML.AlphaMap_GetMap(mapFileName); |
if ( amMap ) then |
-- v3.00 Needs type re-writing x |
if ( AlphaMapConfig[amMap.type] ) then |
CloseDropDownMenus(); |
if ( AlphaMapAlphaMapFrame:IsVisible() ) then |
if ( ( amAlphaMapMap ) and ( not AM_Minimap_Data[amAlphaMapMap.filename] ) and ( MouseIsOver(AlphaMapAlphaMapFrame) ) ) then |
local iMap = AMap.AlphaMap_GetMap(amAlphaMapMap.toMap); |
local iMap = AML.AlphaMap_GetMap(amAlphaMapMap.toMap); |
if ( ( mouseButton == "LeftButton" ) and ( not amAlphaMapMap.zoomed ) ) then |
local x, y = GetCursorPosition(); |
AlphaMapFrame_Update( iMap ); |
elseif ( amAlphaMapMap.toWorldMap ) then |
local cont, zone = AMap.AlphaMap_GetWorldMap(amAlphaMapMap.toWorldMap); |
local cont, zone = AML.AlphaMap_GetWorldMap(amAlphaMapMap.toWorldMap); |
if ( cont ~= "error" ) then |
SetMapZoom(cont, zone); -- ))(( |
AM_WorldMapSelected = true; |
if ( ( IsControlKeyDown() ) and ( IsAltKeyDown() ) and ( not AlphaMapAlphaMapFrame:IsVisible() ) |
and ( not AML.controlsVisible ) ) then |
local b, controls = 1, #(AMap.CustomPOIControls); |
local b, controls = 1, #(AML.CustomPOIControls); |
local xO = ( controls - 1 ) * 22; |
local control, prevC = AMap.CustomPOIControls[b]; |
local control, prevC = AML.CustomPOIControls[b]; |
if ( control ) then |
control:ClearAllPoints(); |
control:Show(); |
prevC = control; |
b = b + 1; |
control = AMap.CustomPOIControls[b]; |
control = AML.CustomPOIControls[b]; |
while ( control ) do |
control:ClearAllPoints(); |
control:SetPoint("LEFT", prevC:GetName(), "RIGHT", 1, 0); |
control:Show(); |
prevC = control; |
b = b + 1; |
control = AMap.CustomPOIControls[b]; |
control = AML.CustomPOIControls[b]; |
end |
end |
AML.controlsVisible = true; |
elseif ( ( ( not IsControlKeyDown() ) or ( not IsAltKeyDown() ) or ( AlphaMapAlphaMapFrame:IsVisible() ) ) |
and ( AML.controlsVisible ) ) then |
for _, control in ipairs(AMap.CustomPOIControls) do |
for _, control in ipairs(AML.CustomPOIControls) do |
control:Hide(); |
end |
AML.controlsVisible = false; |
end |
if ( ( targ ) and ( targ ~= "" ) and ( not UnitPlayerControlled("target") ) and ( inInstance ) ) then |
local mapData, _, filename = AMap.AlphaMap_GetMap( GetRealZoneText() ); |
local mapData, _, filename = AML.AlphaMap_GetMap( GetRealZoneText() ); |
if ( mapData ) then |
if ( AM_LINKED_DUNGEONS[filename] ) then |
for dungeon in pairs( AM_LINKED_DUNGEONS[filename] ) do |
mapData = AMap.AlphaMap_GetMap(dungeon); |
mapData = AML.AlphaMap_GetMap(dungeon); |
if ( mapData ) then |
done = AM_HighlightBoss_Dungeon(mapData, targ, dType); |
if ( done ) then |
local done = nil; |
if ( inInstance ) then |
local mapData, _, filename = AMap.AlphaMap_GetMap( GetRealZoneText() ); |
local mapData, _, filename = AML.AlphaMap_GetMap( GetRealZoneText() ); |
if ( mapData ) then |
if ( AM_LINKED_DUNGEONS[filename] ) then |
for dungeon in pairs( AM_LINKED_DUNGEONS[filename] ) do |
mapData = AMap.AlphaMap_GetMap(dungeon); |
mapData = AML.AlphaMap_GetMap(dungeon); |
if ( mapData ) then |
done = AM_CheckBoss_Dungeon(msg, dType, mapData); |
if ( done ) then |
local amMap = amAlphaMapMap; |
local amTyp = amMapType; |
local mapFileName = GetMapInfo(); |
local tmpAmMap = AMap.AlphaMap_GetMap(mapFileName); |
local tmpAmMap = AML.AlphaMap_GetMap(mapFileName); |
if ( not updatingPaused ) then |
updatingPaused = true; |
for _, poi in ipairs(AM_MAILBOX_LOCS[m]) do |
if ( ( not poi.floor ) or ( poi.floor == lFloor ) ) then |
i = i + 1; |
note = getglobal("AM_POIM_Note_"..i); |
note = getglobal("AM_POI_Note_"..i); |
if ( not note ) then |
note = CreateFrame("Button", "AM_POIM_Note_"..i, frame, "AM_GenPOI_Template"); |
note = CreateFrame("Button", "AM_POI_Note_"..i, frame, "AM_GenPOI_Template"); |
note:SetScript("OnEnter", function(self) |
local x, y = GetCursorPosition(); |
if ( x > 500 ) then |
end) |
note:SetScript("OnClick", function(self, mouseButton) |
if ( mouseButton == "LeftButton" ) then |
local map = AMap.AlphaMap_GetMap(self.toMap); |
local map = AML.AlphaMap_GetMap(self.toMap); |
if ( map ) then |
AlphaMapFrame_Update( map ); |
elseif ( self.toWorldMap ) then |
local cont, zone = AMap.AlphaMap_GetWorldMap(self.toWorldMap); |
local cont, zone = AML.AlphaMap_GetWorldMap(self.toWorldMap); |
if ( cont ~= "error" ) then |
SetMapZoom(cont, zone); -- ))(( |
AM_WorldMapSelected = true; |
end |
end) |
end |
noteT = getglobal("AM_POIM_Note_"..i.."Texture"); |
noteT = getglobal("AM_POI_Note_"..i.."Texture"); |
noteT:SetTexture( poi.icon ); |
x = ( poi.x * width ) / amUnitScale; |
end |
i = i + 1; |
note = getglobal("AM_POIM_Note_"..i); |
note = getglobal("AM_POI_Note_"..i); |
while (note) do |
note:Hide(); |
i = i + 1; |
note = getglobal("AM_POIM_Note_"..i); |
note = getglobal("AM_POI_Note_"..i); |
end |
end |
-- Insert MailBox Display function code in to the main AlphaMap POI Plugin array |
-- AlphaMap will loop through these functions to display the required POIs |
table.insert(AMap.CustomPOIs, DisplayMailBoxLocs); |
table.insert(AML.CustomPOIs, DisplayMailBoxLocs); |
-- Set up the Control Check Button allowing people to toggle |
-- display of MailBox Locations off and on from the AlphaMap |
local i = #(AMap.CustomPOIControls) + 1; |
local i = #(AML.CustomPOIControls) + 1; |
local controlButton = CreateFrame("Button", "AM_POIC"..i, UIParent, "AM_GenPOIControl_Template"); |
controlButton.id = i; |
local controlButtonT = getglobal("AM_POIC"..i.."Texture"); |
-- Insert the Created control button in to the main AlphaMap array |
-- for display when the Control & Alt keys are pressed together |
table.insert(AMap.CustomPOIControls, controlButton); |
table.insert(AML.CustomPOIControls, controlButton); |
end |