end |
end |
|
local function Update(self) |
local function READY_CHECK(self, event, name) |
if(not IsRaidLeader() and not IsRaidOfficer() and not IsPartyLeader()) then return end |
|
local texture = self.ReadyCheck |
texture:SetTexture(statusTexture[GetReadyCheckStatus(self.unit)]) |
if(UnitName(self.unit) == name) then |
texture:SetTexture([=[Interface\RAIDFRAME\ReadyCheck-Ready]=]) |
else |
texture:SetTexture([=[Interface\RAIDFRAME\ReadyCheck-Waiting]=]) |
end |
|
texture:SetAlpha(1) |
texture:Show() |
end |
|
local function PrepareFade(self) |
local readycheck = self.ReadyCheck |
local dummy = readycheck.dummy |
local function READY_CHECK_CONFIRM(self, event, index, status) |
if(self.id ~= tostring(index)) then return end |
|
dummy.unit = self.unit |
dummy.finish = readycheck.delayTime or 10 |
dummy.fade = readycheck.fadeTime or 1.5 |
dummy.offset = readycheck.fadeTime or 1.5 |
dummy:SetScript('OnUpdate', OnUpdate) |
local texture = self.ReadyCheck |
if(status and status == 1) then |
texture:SetTexture([=[Interface\RAIDFRAME\ReadyCheck-Ready]=]) |
else |
texture:SetTexture([=[Interface\RAIDFRAME\ReadyCheck-NotReady]=]) |
end |
end |
|
local function READY_CHECK_FINISHED(self) |
local rc = self.ReadyCheck |
rc.dummy.finish = rc.delayTime or 10 |
rc.dummy.fade = rc.fadeTime or 1.5 |
rc.dummy.offset = rc.fadeTime or 1.5 |
rc.dummy:SetScript('OnUpdate', OnFinishUpdate) |
end |
|
local function Enable(self) |
local readycheck = self.ReadyCheck |
if(readycheck) then |
self:RegisterEvent('READY_CHECK', Update) |
self:RegisterEvent('READY_CHECK_CONFIRM', Update) |
self:RegisterEvent('READY_CHECK_FINISHED', PrepareFade) |
self:RegisterEvent('READY_CHECK', READY_CHECK) |
self:RegisterEvent('READY_CHECK_CONFIRM', READY_CHECK_CONFIRM) |
self:RegisterEvent('READY_CHECK_FINISHED', READY_CHECK_FINISHED) |
|
readycheck.dummy = CreateFrame('Frame', nil, self) |
|