end |
end |
|
function MapCanvasDataProviderMixin:RemoveAllData() |
function zzDataProvider:RemoveAllData() |
-- Override in your mixin, this method should remove everything that has been added to the map |
if(mapframe) then |
mapframe:Hide() |
mapframe = nil |
coordText = nil |
end |
end |
|
function MapCanvasDataProviderMixin:RefreshAllData(fromOnShow) |
function zzDataProvider:RefreshAllData(fromOnShow) |
-- Override in your mixin, this method should assume the map is completely blank, and refresh any data necessary on the map |
update() |
end |
|
function MapCanvasDataProviderMixin:OnShow() |
function zzDataProvider:OnShow() |
-- Override in your mixin, called when the map canvas is shown |
end |
|
function MapCanvasDataProviderMixin:OnHide() |
function zzDataProvider:OnHide() |
-- Override in your mixin, called when the map canvas is closed |
end |
|
function MapCanvasDataProviderMixin:OnMapInsetSizeChanged(mapInsetIndex, expanded) |
function zzDataProvider:OnMapInsetSizeChanged(mapInsetIndex, expanded) |
-- Optionally override in your mixin, called when a map inset changes sizes |
end |
|
function MapCanvasDataProviderMixin:OnMapInsetMouseEnter(mapInsetIndex) |
function zzDataProvider:OnMapInsetMouseEnter(mapInsetIndex) |
-- Optionally override in your mixin, called when a map inset gains mouse focus |
end |
|
function MapCanvasDataProviderMixin:OnMapInsetMouseLeave(mapInsetIndex) |
function zzDataProvider:OnMapInsetMouseLeave(mapInsetIndex) |
-- Optionally override in your mixin, called when a map inset loses mouse focus |
end |
|
function MapCanvasDataProviderMixin:OnCanvasScaleChanged() |
function zzDataProvider:OnCanvasScaleChanged() |
-- Optionally override in your mixin, called when the canvas scale changes |
end |
|
function MapCanvasDataProviderMixin:OnCanvasPanChanged() |
function zzDataProvider:OnCanvasPanChanged() |
-- Optionally override in your mixin, called when the pan location changes |
end |
|
function MapCanvasDataProviderMixin:OnCanvasSizeChanged() |
function zzDataProvider:OnCanvasSizeChanged() |
-- Optionally override in your mixin, called when the canvas size changes |
end |
|
function MapCanvasDataProviderMixin:OnEvent(event, ...) |
function zzDataProvider:OnEvent(event, ...) |
-- Override in your mixin to accept events register via RegisterEvent |
end |
|
function MapCanvasDataProviderMixin:OnGlobalAlphaChanged() |
function zzDataProvider:OnGlobalAlphaChanged() |
-- Optionally override in your mixin if your data provider obeys global alpha, called when the global alpha changes |
end |
|
function MapCanvasDataProviderMixin:OnMapChanged() |
function zzDataProvider: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 |
function zzDataProvider:RegisterEvent(event) |
-- Since data providers aren't frames this provides a similar method of event registration, but always calls self:OnEvent(event, ...) |
if not self.registeredEvents then |
self.registeredEvents = {} |
end |
if not self.registeredEvents[event] then |
self.registeredEvents[event] = true; |
self:GetMap():AddDataProviderEvent(event); |
end |
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 |
function zzDataProvider:UnregisterEvent(event) |
if self.registeredEvents and self.registeredEvents[event] then |
self.registeredEvents[event] = nil; |
self:GetMap():RemoveDataProviderEvent(event); |
end |
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 |
function zzDataProvider:SignalEvent(event, ...) |
if self.registeredEvents and self.registeredEvents[event] then |
self:OnEvent(event, ...); |
end |
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 |
WorldMapFrame:AddDataProvider(zzDataProvider) |