Files
wow_cyka/SpellQSettings.lua
2024-12-17 14:22:02 +01:00

36 lines
966 B
Lua

local addonname, shared = ...
---@cast shared CykaShared
---@cast addonname string
---@class SpellQSettings
---@field Init fun()
shared.SpellQSettings = { Init = function() end }
function shared.SpellQSettings.Init()
if not shared.config.spellQueue.enabled then
print("Cyka - Spell queue disabled")
return
end
local function SetSpellQueue(window)
if not window then return end
print("Spell queue window set to " .. tostring(window))
SetCVar("SpellQueueWindow", window)
end
local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_LOGIN")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:SetScript("OnEvent", function(self, event, ...)
SetSpellQueue(shared.config.spellQueue.queue)
end)
SlashCmdList["SPELLQSETTINGS"] = function(window)
if window then shared.config.spellQueue.queue = window end
SetSpellQueue(shared.config.spellQueue.queue)
end
SLASH_SPELLQSETTINGS1 = "/sq"
print("Cyka - Spell queue settings loaded")
end