Add ttl per frame
This commit is contained in:
14
Heimdall.lua
14
Heimdall.lua
@@ -170,7 +170,12 @@ local function init()
|
|||||||
---@field masterChannel string
|
---@field masterChannel string
|
||||||
---@field throttle number
|
---@field throttle number
|
||||||
---@field scale number
|
---@field scale number
|
||||||
---@field ttl number
|
---@field tagTTL number
|
||||||
|
---@field alertTTL number
|
||||||
|
---@field combatTTL number
|
||||||
|
---@field tagSound boolean
|
||||||
|
---@field alertSound boolean
|
||||||
|
---@field combatSound boolean
|
||||||
|
|
||||||
--- Data ---
|
--- Data ---
|
||||||
---@class HeimdallMessengerData
|
---@class HeimdallMessengerData
|
||||||
@@ -338,7 +343,12 @@ local function init()
|
|||||||
masterChannel = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "masterChannel" }, "Agent"),
|
masterChannel = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "masterChannel" }, "Agent"),
|
||||||
throttle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "throttle" }, 10),
|
throttle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "throttle" }, 10),
|
||||||
scale = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "scale" }, 3),
|
scale = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "scale" }, 3),
|
||||||
ttl = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "ttl" }, 1),
|
tagTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagTTL" }, 1),
|
||||||
|
alertTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertTTL" }, 1),
|
||||||
|
combatTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatTTL" }, 1),
|
||||||
|
tagSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagSound" }, false),
|
||||||
|
alertSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertSound" }, false),
|
||||||
|
combatSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSound" }, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,8 @@ function shared.MinimapTagger.Init()
|
|||||||
---@param y number
|
---@param y number
|
||||||
---@param frame Frame
|
---@param frame Frame
|
||||||
---@param scale number?
|
---@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
|
scale = scale or 1
|
||||||
local w, h = BattlefieldMinimap:GetSize()
|
local w, h = BattlefieldMinimap:GetSize()
|
||||||
w, h = w * BattlefieldMinimap:GetEffectiveScale(), h * BattlefieldMinimap:GetEffectiveScale()
|
w, h = w * BattlefieldMinimap:GetEffectiveScale(), h * BattlefieldMinimap:GetEffectiveScale()
|
||||||
@@ -44,7 +45,7 @@ function shared.MinimapTagger.Init()
|
|||||||
self.custom.progress = 0
|
self.custom.progress = 0
|
||||||
self:SetScript("OnUpdate", function(self, elapsed)
|
self:SetScript("OnUpdate", function(self, elapsed)
|
||||||
self.custom.progress = self.custom.progress + 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
|
if Heimdall_Data.config.minimapTagger.debug then
|
||||||
print(string.format("[%s] Alert progress%%: %f", ModuleName, progress))
|
print(string.format("[%s] Alert progress%%: %f", ModuleName, progress))
|
||||||
print(string.format("[%s] Alert progress: %f", ModuleName, self.custom.progress))
|
print(string.format("[%s] Alert progress: %f", ModuleName, self.custom.progress))
|
||||||
@@ -91,7 +92,7 @@ function shared.MinimapTagger.Init()
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
PlantFrame(x, y, frame, scale)
|
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.alertTTL)
|
||||||
end
|
end
|
||||||
|
|
||||||
---@type Frame[]
|
---@type Frame[]
|
||||||
@@ -123,7 +124,7 @@ function shared.MinimapTagger.Init()
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
PlantFrame(x, y, frame, scale)
|
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.tagTTL)
|
||||||
end
|
end
|
||||||
|
|
||||||
---@type Frame[]
|
---@type Frame[]
|
||||||
@@ -155,7 +156,7 @@ function shared.MinimapTagger.Init()
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
PlantFrame(x, y, frame, scale)
|
PlantFrame(x, y, frame, scale, Heimdall_Data.config.minimapTagger.combatTTL)
|
||||||
end
|
end
|
||||||
|
|
||||||
local pauseUntil = 0
|
local pauseUntil = 0
|
||||||
|
Reference in New Issue
Block a user