-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathRaidMarker.lua
More file actions
43 lines (37 loc) · 1.1 KB
/
RaidMarker.lua
File metadata and controls
43 lines (37 loc) · 1.1 KB
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
---@class addonTablePlatynator
local addonTable = select(2, ...)
addonTable.Display.RaidMarkerMixin = CreateFromMixins(addonTable.Display.CombatVisibilityMixin)
function addonTable.Display.RaidMarkerMixin:SetUnit(unit)
self.unit = unit
if self.unit then
self:RegisterEvent("RAID_TARGET_UPDATE")
self:RegisterCombatEvents()
self:UpdateMarker()
else
self:Strip()
end
end
function addonTable.Display.RaidMarkerMixin:Strip()
self:UnregisterAllEvents()
self.marker:SetTexCoord(0, 1, 0, 1)
end
function addonTable.Display.RaidMarkerMixin:OnEvent(eventName)
if eventName == "PLAYER_REGEN_ENABLED" or eventName == "PLAYER_REGEN_DISABLED" then
self:UpdateMarker()
else
self:UpdateMarker()
end
end
local fontString = UIParent:CreateFontString(nil, nil, "GameFontNormal")
function addonTable.Display.RaidMarkerMixin:UpdateMarker()
local index = GetRaidTargetIndex(self.unit)
if type(index) ~= "nil" then
self.marker:Show()
SetRaidTargetIconTexture(self.marker, index)
if self:ShouldHideForCombat() then
self.marker:Hide()
end
else
self.marker:Hide()
end
end