Add ttl per frame
This commit is contained in:
@@ -10,7 +10,8 @@ function shared.MinimapTagger.Init()
|
||||
---@param y number
|
||||
---@param frame Frame
|
||||
---@param scale number?
|
||||
local function PlantFrame(x, y, frame, scale)
|
||||
---@param ttl number?
|
||||
local function PlantFrame(x, y, frame, scale, ttl)
|
||||
scale = scale or 1
|
||||
local w, h = BattlefieldMinimap:GetSize()
|
||||
w, h = w * BattlefieldMinimap:GetEffectiveScale(), h * BattlefieldMinimap:GetEffectiveScale()
|
||||
@@ -44,7 +45,7 @@ function shared.MinimapTagger.Init()
|
||||
self.custom.progress = 0
|
||||
self:SetScript("OnUpdate", function(self, elapsed)
|
||||
self.custom.progress = self.custom.progress + elapsed
|
||||
local progress = self.custom.progress / Heimdall_Data.config.minimapTagger.ttl
|
||||
local progress = self.custom.progress / ttl
|
||||
if Heimdall_Data.config.minimapTagger.debug then
|
||||
print(string.format("[%s] Alert progress%%: %f", ModuleName, progress))
|
||||
print(string.format("[%s] Alert progress: %f", ModuleName, self.custom.progress))
|
||||
@@ -91,7 +92,7 @@ function shared.MinimapTagger.Init()
|
||||
end
|
||||
return
|
||||
end
|
||||
PlantFrame(x, y, frame, scale)
|
||||
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.alertTTL)
|
||||
end
|
||||
|
||||
---@type Frame[]
|
||||
@@ -123,7 +124,7 @@ function shared.MinimapTagger.Init()
|
||||
end
|
||||
return
|
||||
end
|
||||
PlantFrame(x, y, frame, scale)
|
||||
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.tagTTL)
|
||||
end
|
||||
|
||||
---@type Frame[]
|
||||
@@ -155,7 +156,7 @@ function shared.MinimapTagger.Init()
|
||||
end
|
||||
return
|
||||
end
|
||||
PlantFrame(x, y, frame, scale)
|
||||
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.combatTTL)
|
||||
end
|
||||
|
||||
local pauseUntil = 0
|
||||
|
||||
Reference in New Issue
Block a user