Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zendil committed Jul 29, 2016
1 parent 306a74f commit 12c5872
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Teds_PVP_Spelltimers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ w.filter_def = {
--TODO: Offensive abilities, and give option to pick which filters are applied
--Define Handlers
function f:Event(event, ...)
--switch by what event has occured
if event == "UNIT_AURA" or event == "PLAYER_TARGET_CHANGED" then
f:Scan(event, ...)
elseif event == "ADDON_LOADED" then
Expand Down Expand Up @@ -211,34 +212,52 @@ function f:Loaded(event, addon)
end
end
function Teds_PVP_Spelltimers_DragFrame:Center()
--get current y position
local _,y = m:GetCenter()
--reset and move to center, maintaining y position
m:ClearAllPoints()
m:SetPoint("CENTER", UIParent, "BOTTOM", 0, y)
end
function Teds_PVP_Spelltimers_DragFrame:Reset()
--reset and move to default position
m:ClearAllPoints()
m:SetPoint("TOP", UIParent, "TOP", 0, -50)
end
function Teds_PVP_Spelltimers_DragFrame:Done()
--get the mover's position
local x,y = m:GetCenter()
--hide the mover
m:Hide()
--reset the frame
f:ClearAllPoints()
--move the frame to the new spot
f:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x, y)
--reregister events
f:RegisterEvent("UNIT_AURA")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
end
function f:Mover()
--Unregister events so we don't activate while moving
f:UnregisterEvent("UNIT_AURA")
f:UnregisterEvent("PLAYER_TARGET_CHANGED")
--get position to set the mover
local x,y = f:GetCenter()
--hide frame
f:Hide()
--put the mover in the right spot
m:ClearAllPoints()
m:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x, y)
--show the mover
m:Show()
--if this is the mover's first load then we also have to set it up
if not m.loaded then
--ok, now we're loaded
m.loaded = true
--set up dragging
m:RegisterForDrag("LeftButton")
m:SetScript("OnDragStart", m.StartMoving)
m:SetScript("OnDragStop", m.StopMovingOrSizing)
--set up buttons and handlers
m.centerbutton:RegisterForClicks("AnyDown")
m.centerbutton:SetScript("OnClick", m.Center)
m.resetbutton:RegisterForClicks("AnyDown")
Expand All @@ -247,6 +266,7 @@ function f:Mover()
m.donebutton:SetScript("OnClick", m.Done)
end
end
--testing assignment
T = f
--Assign Handlers
f:SetScript("OnEvent", f.Event)
Expand Down

0 comments on commit 12c5872

Please sign in to comment.