local L = LibStub("AceLocale-3.0"):GetLocale("TotemTimers_GUI", true)


TotemTimers.options.args.enhancecds = {
    type = "group",
    name = "enhancecds",
    args = {
        enable = {
            order = 0,
            type = "toggle",
            name = L["Enable"],
            set = function(info, val) TotemTimers_Settings.EnhanceCDs = val  TotemTimers_ProcessSetting("EnhanceCDs") end,
            get = function(info) return TotemTimers_Settings.EnhanceCDs end,
        }, 
        header = {
            order = 2,
            type = "header",
            name = "",
        },        
        CDTimersOnButtons = {
            order = 3,
            type = "toggle",
            name = L["Timers On Buttons"],
            set = function(info, val) TotemTimers_Settings.CDTimersOnButtons = val
                        TotemTimers_ProcessSetting("TimersOnButtons") end,
            get = function(info) return TotemTimers_Settings.CDTimersOnButtons end,
        },  
        HideEnhanceCDsOOC = {
            order = 4,
            type = "toggle",
            name = L["Hide out of combat"],
            desc = L["Hide OOC Desc"],
            set = function(info, val) TotemTimers_Settings.HideEnhanceCDsOOC = val  TotemTimers_ProcessSetting("HideEnhanceCDsOOC") end,
            get = function(info) return TotemTimers_Settings.HideEnhanceCDsOOC end,
        }, 
        OOCAlpha = {
            order = 6,
            type="range",
            min = 0,
            max = 1,
            step = 0.1,
            name = L["OOC Alpha"], 
            desc = L["OOC Alpha Desc"],
            set = function(info, val)
                        TotemTimers_Settings.EnhanceCDsOOCAlpha = val  TotemTimers_ProcessSetting("EnhanceCDsOOCAlpha")	
                  end,
            get = function(info) return TotemTimers_Settings.EnhanceCDsOOCAlpha end,
        },
        scaling = {
            order = 10,
            type = "header",
            name = "Scaling",
        },
        ECDSize = {
            order = 11,
            type = "range",
            name = L["ECD Button Size"] ,
            min = 16,
            max = 96,
            step = 1,
            bigStep = 2,
            set = function(info, val)
                        TotemTimers_Settings.EnhanceCDsSize = val  TotemTimers_ProcessSetting("EnhanceCDsSize")	
                  end,
            get = function(info) return TotemTimers_Settings.EnhanceCDsSize end,
        },
        ECDfontSize = {
            order = 12,
            type = "range",
            name = L["ECD Font Size"],
            min = 6,
            max = 40,
            step = 1,
            set = function(info, val)
                        TotemTimers_Settings.EnhanceCDsTimeHeight = val  TotemTimers_ProcessSetting("EnhanceCDsTimeHeight")	
                  end,
            get = function(info) return TotemTimers_Settings.EnhanceCDsTimeHeight end,
        },
        maelstromheight = {
            order = 13,
            type = "range",
            name = L["Maelstrom Bar Height"],
            min = 6,
            max = 40,
            step = 1,
            set = function(info, val)
                        TotemTimers_Settings.EnhanceCDsMaelstromHeight = val  TotemTimers_ProcessSetting("EnhanceCDsMaelstromHeight")	
                  end,
            get = function(info) return TotemTimers_Settings.EnhanceCDsMaelstromHeight end,
        },
    },
}
    
local ACD = LibStub("AceConfigDialog-3.0")
local frame = ACD:AddToBlizOptions("TotemTimers", L["EnhanceCDs"], "TotemTimers", "enhancecds")    
frame:SetScript("OnEvent", function(self) InterfaceOptionsFrame:Hide() end)
frame:HookScript("OnShow", function(self) if InCombatLockdown() then InterfaceOptionsFrame:Hide() end TotemTimers.LastGUIPanel = self end)
frame:RegisterEvent("PLAYER_REGEN_DISABLED")