Add battletags

This commit is contained in:
2025-01-09 12:19:37 +01:00
parent 176d184d91
commit a7e85acd67
3 changed files with 41 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ function shared.MinimapTagger.Init()
local texture = frame:CreateTexture(nil, "ARTWORK")
texture:SetAllPoints(frame)
texture:SetTexture("Interface\\AddOns\\WeakAuras\\PowerAurasMedia\\Auras\\Aura27")
--texture:SetTexture("Interface\\AddOns\\Heimdall\\Texture\\Alert")
table.insert(alertFramePool, frame)
end
---@param x number
@@ -98,6 +99,7 @@ function shared.MinimapTagger.Init()
local texture = frame:CreateTexture(nil, "ARTWORK")
texture:SetAllPoints(frame)
texture:SetTexture("Interface\\AddOns\\WeakAuras\\PowerAurasMedia\\Auras\\Aura11")
--texture:SetTexture("Interface\\AddOns\\Heimdall\\Texture\\Tag")
table.insert(tagFramePool, frame)
end
---@param x number
@@ -119,6 +121,37 @@ function shared.MinimapTagger.Init()
PlantFrame(x, y, frame)
end
---@type Frame[]
local battleFramePool = {}
local battleFramePoolMaxSize = 20
for i = 1, battleFramePoolMaxSize do
local frame = CreateFrame("Frame")
frame.custom = { busy = false }
local texture = frame:CreateTexture(nil, "ARTWORK")
texture:SetAllPoints(frame)
texture:SetTexture("Interface\\AddOns\\WeakAuras\\PowerAurasMedia\\Auras\\Aura19")
--texture:SetTexture("Interface\\AddOns\\Heimdall\\Texture\\Fight")
table.insert(battleFramePool, frame)
end
---@param x number
---@param y number
local function PlantBattle(x, y)
local frame = nil
for _, battleFrame in ipairs(battleFramePool) do
if not battleFrame.custom.busy then
frame = battleFrame
break
end
end
if not frame then
if Heimdall_Data.config.minimapTagger.debug then
print(string.format("[%s] Battle frame pool is full and could not get frame", ModuleName))
end
return
end
PlantFrame(x, y, frame)
end
local pauseUntil = 0
local frame = CreateFrame("Frame")
frame:RegisterEvent("WORLD_MAP_UPDATE")
@@ -153,6 +186,14 @@ function shared.MinimapTagger.Init()
alertFrame:Hide()
alertFrame.custom.busy = false
end
for _, tagFrame in ipairs(tagFramePool) do
tagFrame:Hide()
tagFrame.custom.busy = false
end
for _, battleFrame in ipairs(battleFramePool) do
battleFrame:Hide()
battleFrame.custom.busy = false
end
end)
end)

Binary file not shown.

BIN
Texture/Tag.tga Normal file

Binary file not shown.