forked from Bastion/Bastion
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.6 KiB
59 lines
1.6 KiB
local
|
|
Tinkr,
|
|
---@type Bastion
|
|
Bastion = ...
|
|
|
|
local IcyVeins = Bastion.SpellBook:GetSpell(12472)
|
|
local FrozenOrb = Bastion.SpellBook:GetSpell(84714)
|
|
local Blizzard = Bastion.SpellBook:GetSpell(190356)
|
|
|
|
Bastion.ToggleManager:Add({
|
|
id = 'Frost_CdsEnabled',
|
|
icon = IcyVeins:GetIcon(),
|
|
state = false
|
|
})
|
|
|
|
Bastion.ToggleManager:Add({
|
|
id = 'Frost_FrozenOrbEnabled',
|
|
icon = FrozenOrb:GetIcon(),
|
|
state = false
|
|
})
|
|
|
|
Bastion.ToggleManager:Add({
|
|
id = 'Frost_AutoAOE',
|
|
icon = Blizzard:GetIcon(),
|
|
state = true
|
|
})
|
|
|
|
---@alias GetFrostOption fun(option: "CdsEnabled" | "FrozenOrbEnabled" | 'AutoAOE'): boolean
|
|
|
|
---@type GetFrostOption
|
|
local function GetFrostOption(option)
|
|
return Bastion.ToggleManager:GetState("Frost_" .. option)
|
|
end
|
|
|
|
local Command = Bastion.Command:New('frost')
|
|
|
|
Command:Register('aoe', 'Toggle bastion on/off', function()
|
|
Bastion.ToggleManager:Toggle("Frost_AutoAOE")
|
|
end)
|
|
|
|
Command:Register('cds', 'Toggle bastion on/off', function()
|
|
Bastion.ToggleManager:Toggle("Frost_CdsEnabled")
|
|
|
|
if GetFrostOption("FrozenOrbEnabled") and not GetFrostOption("CdsEnabled") then
|
|
Bastion.ToggleManager:Toggle("Frost_FrozenOrbEnabled")
|
|
elseif not GetFrostOption("FrozenOrbEnabled") and GetFrostOption("CdsEnabled") then
|
|
Bastion.ToggleManager:Toggle("Frost_FrozenOrbEnabled")
|
|
end
|
|
end)
|
|
|
|
Command:Register('orb', 'Toggle bastion on/off', function()
|
|
Bastion.ToggleManager:Toggle("Frost_FrozenOrbEnabled")
|
|
|
|
if not GetFrostOption("FrozenOrbEnabled") and GetFrostOption("CdsEnabled") then
|
|
Bastion.ToggleManager:Toggle("Frost_CdsEnabled")
|
|
end
|
|
end)
|
|
|
|
return GetFrostOption |