Files
wow_cyka/SpellQSettings.lua
2025-05-04 14:27:32 +02:00

34 lines
963 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