WoWInterface SVN zz_Coords

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 66 to Rev 67
    Reverse comparison

Rev 66 → Rev 67

trunk/zz_Coords/provider.lua New file
0,0 → 1,130
-- Provides a basic interface for something that manages the adding, updating, and removing of data like icons, blobs or text to the map canvas
local MapCanvasDataProviderMixin = {};
 
function MapCanvasDataProviderMixin:OnAdded(owningMap)
-- Optionally override in your mixin, called when this provider is added to a map canvas
self.owningMap = owningMap;
end
 
function MapCanvasDataProviderMixin:OnRemoved(owningMap)
-- Optionally override in your mixin, called when this provider is removed from a map canvas
assert(owningMap == self.owningMap);
self.owningMap = nil;
 
if self.registeredEvents then
for event in pairs(self.registeredEvents) do
owningMap:UnregisterEvent(event);
end
self.registeredEvents = nil;
end
end
 
function MapCanvasDataProviderMixin:RemoveAllData()
-- Override in your mixin, this method should remove everything that has been added to the map
end
 
function MapCanvasDataProviderMixin:RefreshAllData(fromOnShow)
-- Override in your mixin, this method should assume the map is completely blank, and refresh any data necessary on the map
end
 
function MapCanvasDataProviderMixin:OnShow()
-- Override in your mixin, called when the map canvas is shown
end
 
function MapCanvasDataProviderMixin:OnHide()
-- Override in your mixin, called when the map canvas is closed
end
 
function MapCanvasDataProviderMixin:OnMapInsetSizeChanged(mapInsetIndex, expanded)
-- Optionally override in your mixin, called when a map inset changes sizes
end
 
function MapCanvasDataProviderMixin:OnMapInsetMouseEnter(mapInsetIndex)
-- Optionally override in your mixin, called when a map inset gains mouse focus
end
 
function MapCanvasDataProviderMixin:OnMapInsetMouseLeave(mapInsetIndex)
-- Optionally override in your mixin, called when a map inset loses mouse focus
end
 
function MapCanvasDataProviderMixin:OnCanvasScaleChanged()
-- Optionally override in your mixin, called when the canvas scale changes
end
 
function MapCanvasDataProviderMixin:OnCanvasPanChanged()
-- Optionally override in your mixin, called when the pan location changes
end
 
function MapCanvasDataProviderMixin:OnCanvasSizeChanged()
-- Optionally override in your mixin, called when the canvas size changes
end
 
function MapCanvasDataProviderMixin:OnEvent(event, ...)
-- Override in your mixin to accept events register via RegisterEvent
end
 
function MapCanvasDataProviderMixin:OnGlobalAlphaChanged()
-- Optionally override in your mixin if your data provider obeys global alpha, called when the global alpha changes
end
 
function MapCanvasDataProviderMixin:OnMapChanged()
-- Optionally override in your mixin, called when map ID changes
self:RefreshAllData();
end
 
-- Provides a basic interface for something that is visible on the map canvas, like icons, blobs or text
local MapCanvasPinMixin = {};
 
function MapCanvasPinMixin:OnLoad()
-- Override in your mixin, called when this pin is created
end
 
function MapCanvasPinMixin:OnAcquired(...) -- the arguments here are anything that are passed into AcquirePin after the pinTemplate
-- Override in your mixin, called when this pin is being acquired by a data provider but before its added to the map
end
 
function MapCanvasPinMixin:OnReleased()
-- Override in your mixin, called when this pin is being released by a data provider and is no longer on the map
end
 
function MapCanvasPinMixin:OnClick(button)
-- Override in your mixin, called when this pin is clicked
end
 
function MapCanvasPinMixin:OnMouseEnter()
-- Override in your mixin, called when the mouse enters this pin
end
 
function MapCanvasPinMixin:OnMouseLeave()
-- Override in your mixin, called when the mouse leaves this pin
end
 
function MapCanvasPinMixin:OnMouseDown()
-- Override in your mixin, called when the mouse is pressed on this pin
end
 
function MapCanvasPinMixin:OnMouseUp()
-- Override in your mixin, called when the mouse is released
end
 
function MapCanvasPinMixin:OnMapInsetSizeChanged(mapInsetIndex, expanded)
-- Optionally override in your mixin, called when a map inset changes sizes
end
 
function MapCanvasPinMixin:OnMapInsetMouseEnter(mapInsetIndex)
-- Optionally override in your mixin, called when a map inset gains mouse focus
end
 
function MapCanvasPinMixin:OnMapInsetMouseLeave(mapInsetIndex)
-- Optionally override in your mixin, called when a map inset loses mouse focus
end
 
 
 
function MapCanvasPinMixin:OnCanvasPanChanged()
-- Optionally override in your mixin, called when the pan location changes
end
 
function MapCanvasPinMixin:OnCanvasSizeChanged()
-- Optionally override in your mixin, called when the canvas size changes
end