WoWInterface SVN AlphaMapFansUpdate

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /branches
    from Rev 12 to Rev 11
    Reverse comparison

Rev 12 → Rev 11

AlphaMapBeta/AlphaMap_POI_Instances/AlphaMap_POI_Instances.lua
25,9 → 25,9
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
52,13 → 52,13
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;
72,7 → 72,7
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;
92,11 → 92,11
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
129,11 → 129,11
 
-- 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");
174,7 → 174,7
 
-- 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
 
AlphaMapBeta/AlphaMap/AlphaMap.lua
60,10 → 60,7
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;
239,8 → 236,11
------------------------
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
277,6 → 277,43
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);
1224,51 → 1261,8
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
1491,7 → 1485,6
end
 
elseif( event == "VARIABLES_LOADED") then
 
if ( ( MetaMap_OptionsButton ) or ( Cartographer ) ) then
applyAMMapChanges = nil;
AM_OptionsGM_Change:Disable();
2178,17 → 2171,17
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
4191,10 → 4184,10
 
function DrawAlphaMapGatherer()
 
if ( AML.drawingG ) then
if ( AMap.drawingG ) then
return;
else
AML.drawingG = true;
AMap.drawingG = true;
end
 
local setting = Gatherer.Config.GetSetting;
4261,7 → 4254,7
mainNote = getglobal("AlphaMapGathererPOI"..noteCount);
end
 
AML.drawingG = nil;
AMap.drawingG = nil;
end
 
function AlphaMapNotes_OnEnter( id, noteFrame )
4772,7 → 4765,7
 
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;
4827,7 → 4820,7
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;
5975,7 → 5968,7
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
6238,14 → 6231,14
 
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;
6404,7 → 6397,7
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();
6415,7 → 6408,7
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;
6769,7 → 6762,7
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
7467,7 → 7460,7
 
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
7670,7 → 7663,7
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();
7691,7 → 7684,7
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;
7969,9 → 7962,9
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();
7979,21 → 7972,21
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;
8599,11 → 8592,11
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
8648,11 → 8641,11
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
8797,7 → 8790,7
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;
AlphaMapBeta/AlphaMap_POI_MailBoxes/AlphaMap_POI_MailBoxes.lua
25,9 → 25,9
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
52,13 → 52,13
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;
72,7 → 72,7
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;
92,11 → 92,11
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
129,11 → 129,11
 
-- 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");
174,7 → 174,7
 
-- 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