ESO Lua File v100010

ingame/group/revivecounter.lua

[◄ back to folders ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local RaidReviveCounterManager = ZO_Object:Subclass()
function RaidReviveCounterManager:New(control)
    local manager = ZO_Object.New(self)
    manager.control = control
    manager.countControl = GetControl(control, "Count")
    local function OnRaidLifeUpdate(event, currentCounter)
        if not IsRaidInProgress() and not HasRaidEnded() then
            currentCounter = nil
        else
            currentCounter = currentCounter or GetRaidReviveCounterInfo()
        end
        manager:Update(currentCounter)
    end
    control:RegisterForEvent(EVENT_RAID_REVIVE_COUNTER_UPDATE, OnRaidLifeUpdate)
    control:RegisterForEvent(EVENT_PLAYER_ACTIVATED, OnRaidLifeUpdate)
    control:RegisterForEvent(EVENT_RAID_TIMER_STATE_UPDATE, OnRaidLifeUpdate)
    return manager
end
function RaidReviveCounterManager:Update(currentCounter)
    if currentCounter then
        self.countControl:SetText(currentCounter)
        self.control:SetHidden(false)
    else
        self.control:SetHidden(true)
    end
end
    InitializeTooltip(InformationTooltip, self, BOTTOM, 0, -5)
    SetTooltipText(InformationTooltip, GetString(SI_GROUP_LIST_PANEL_REVIVE_COUNTER_TOOLTIP))
end
    ClearTooltip(InformationTooltip)
end
    RAID_REVIVE_COUNTER = RaidReviveCounterManager:New(self)
end