Do a little formatting
This commit is contained in:
@@ -69,6 +69,7 @@ function shared.MinimapTagger.Init()
|
|||||||
frame:Show()
|
frame:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--region Alert
|
||||||
---@type Frame[]
|
---@type Frame[]
|
||||||
local alertFramePool = {}
|
local alertFramePool = {}
|
||||||
local alertFramePoolMaxSize = 20
|
local alertFramePoolMaxSize = 20
|
||||||
@@ -118,7 +119,9 @@ function shared.MinimapTagger.Init()
|
|||||||
end
|
end
|
||||||
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.alertTTL)
|
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.alertTTL)
|
||||||
end
|
end
|
||||||
|
--endregion
|
||||||
|
|
||||||
|
--region Tag
|
||||||
---@type Frame[]
|
---@type Frame[]
|
||||||
local tagFramePool = {}
|
local tagFramePool = {}
|
||||||
local tagFramePoolMaxSize = 20
|
local tagFramePoolMaxSize = 20
|
||||||
@@ -168,7 +171,9 @@ function shared.MinimapTagger.Init()
|
|||||||
end
|
end
|
||||||
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.tagTTL)
|
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.tagTTL)
|
||||||
end
|
end
|
||||||
|
--endregion
|
||||||
|
|
||||||
|
--region Battle
|
||||||
---@type Frame[]
|
---@type Frame[]
|
||||||
local battleFramePool = {}
|
local battleFramePool = {}
|
||||||
local battleFramePoolMaxSize = 20
|
local battleFramePoolMaxSize = 20
|
||||||
@@ -218,6 +223,59 @@ function shared.MinimapTagger.Init()
|
|||||||
end
|
end
|
||||||
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.combatTTL)
|
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.combatTTL)
|
||||||
end
|
end
|
||||||
|
--endregion
|
||||||
|
|
||||||
|
--region Help
|
||||||
|
---@type Frame[]
|
||||||
|
local helpFramePool = {}
|
||||||
|
local helpFramePoolMaxSize = 20
|
||||||
|
for i = 1, helpFramePoolMaxSize do
|
||||||
|
local frame = CreateFrame("Frame")
|
||||||
|
frame.custom = { busy = false }
|
||||||
|
local texture = frame:CreateTexture(nil, "ARTWORK")
|
||||||
|
texture:SetAllPoints(frame)
|
||||||
|
texture:SetTexture(TextureRoot .. "Help.tga")
|
||||||
|
table.insert(helpFramePool, frame)
|
||||||
|
end
|
||||||
|
local muteHelpUntil = 0
|
||||||
|
---@param x number
|
||||||
|
---@param y number
|
||||||
|
---@param scale number?
|
||||||
|
local function PlantHelp(x, y, scale)
|
||||||
|
local frame = nil
|
||||||
|
for _, helpFrame in ipairs(helpFramePool) do
|
||||||
|
if not helpFrame.custom.busy then
|
||||||
|
frame = helpFrame
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not frame then
|
||||||
|
if Heimdall_Data.config.minimapTagger.debug then
|
||||||
|
print(string.format("[%s] Help frame pool is full and could not get frame", ModuleName))
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if Heimdall_Data.config.minimapTagger.helpSound then
|
||||||
|
if Heimdall_Data.config.minimapTagger.debug then
|
||||||
|
print(string.format("[%s] Playing help sound: %s", ModuleName,
|
||||||
|
Heimdall_Data.config.minimapTagger.helpSoundFile))
|
||||||
|
end
|
||||||
|
if muteHelpUntil > GetTime() then
|
||||||
|
if Heimdall_Data.config.minimapTagger.debug then
|
||||||
|
print(string.format("[%s] Help sound is muted until %d", ModuleName, muteHelpUntil))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
muteHelpUntil = GetTime() + Heimdall_Data.config.minimapTagger.helpSoundThrottle
|
||||||
|
local ok = PlaySoundFile(SoundRoot .. Heimdall_Data.config.minimapTagger.helpSoundFile, "Master")
|
||||||
|
if not ok and Heimdall_Data.config.minimapTagger.debug then
|
||||||
|
print(string.format("[%s] Failed to play help sound: %s", ModuleName,
|
||||||
|
Heimdall_Data.config.minimapTagger.helpSoundFile))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.helpTTL)
|
||||||
|
end
|
||||||
|
--endregion
|
||||||
|
|
||||||
local pauseUntil = 0
|
local pauseUntil = 0
|
||||||
local frame = CreateFrame("Frame")
|
local frame = CreateFrame("Frame")
|
||||||
@@ -237,8 +295,7 @@ function shared.MinimapTagger.Init()
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
--local scale = Heimdall_Data.config.minimapTagger.scale
|
local scale = Heimdall_Data.config.minimapTagger.scale
|
||||||
local scale = 4
|
|
||||||
BattlefieldMinimap:SetScale(scale)
|
BattlefieldMinimap:SetScale(scale)
|
||||||
BattlefieldMinimap:SetMovable(true)
|
BattlefieldMinimap:SetMovable(true)
|
||||||
BattlefieldMinimap:EnableMouse(true)
|
BattlefieldMinimap:EnableMouse(true)
|
||||||
|
Reference in New Issue
Block a user