Make announcer play nice with variable playback speed

This commit is contained in:
2024-03-08 15:26:02 +01:00
parent b6172c3442
commit 6954dc3329
2 changed files with 8 additions and 2 deletions

View File

@@ -10,8 +10,9 @@ aura_env.debug = false
BaseCooldown = {
---@param id number
---@param name string
---@param playbackSpeed number?
---@return BaseCooldown
new = function(id, name)
new = function(id, name, playbackSpeed)
local self = setmetatable({}, {
__index = BaseCooldown
})
@@ -20,6 +21,11 @@ BaseCooldown = {
name = string.gsub(name, " ", "_")
name = string.gsub(name, "'", "")
self.filename = name
if playbackSpeed ~= nil then
self.filename = string.format("1x\\%s", self.filename)
else
self.filename = string.format("%dx\\%s", playbackSpeed, self.filename)
end
self.isOnCooldown = false
self.announced = false
self.remaining = 0

View File

@@ -2,6 +2,6 @@
function(e, file)
local success = PlaySoundFile(file, "Master")
if not success then
print(string.format("Failed to play sound file at %s", file))
if aura_env.debug then print(string.format("Failed to play sound file at %s", file)) end
end
end