local _AddonName, _EchoRaidTools = ...

EchoRaidTools_ButtonTemplateMixin = {}
function EchoRaidTools_ButtonTemplateMixin:OnEnter()
    if self.tooltip then
        local tt = EchoRaidToolsTooltip or GameTooltip
        tt:SetOwner(self, "ANCHOR_TOPLEFT")
        tt:SetFrameLevel(self:GetFrameLevel() + 2)
        tt:SetText(self.tooltip)
    end
end
function EchoRaidTools_ButtonTemplateMixin:OnLeave()
    if self.tooltip then
        local tt = EchoRaidToolsTooltip or GameTooltip
        tt:Hide()
    end
end
function EchoRaidTools_ButtonTemplateMixin:OnDisable()
    if self.Icon then
        self.Icon:SetDesaturated(true)
    end
    self:SetAlpha(0.8)
end
function EchoRaidTools_ButtonTemplateMixin:OnEnable()
    if self.Icon then
        self.Icon:SetDesaturated(false)
    end
    self:SetAlpha(1.0)
end

EchoRaidToolsConfig_ButtonMixin = {}
function EchoRaidToolsConfig_ButtonMixin:OnLoad()
    self.Enabled = true
end
function EchoRaidToolsConfig_ButtonMixin:Enable()
    self.TopText:SetTextColor(1, 0.82, 0, 0.7)
    self.Button:Enable()
    self.Enabled = true
end
function EchoRaidToolsConfig_ButtonMixin:Disable()
    self.TopText:SetTextColor(1, 0.82, 0, 0.3)
    self.Button:Disable()
    self.Enabled = false
end
function EchoRaidToolsConfig_ButtonMixin:IsEnabled()
    return self.Enabled
end

EchoRaidTools_BasicButtonMixin = {}
function EchoRaidTools_BasicButtonMixin:OnEnter()
    if self.tooltip then
        local tt = EchoRaidToolsTooltip or GameTooltip
        tt:SetOwner(self, "ANCHOR_TOPLEFT")
        tt:SetFrameLevel(self:GetFrameLevel() + 2)
        tt:SetText(self.tooltip)
    end
end
function EchoRaidTools_BasicButtonMixin:OnLeave()
    if self.tooltip then
        local tt = EchoRaidToolsTooltip or GameTooltip
        tt:Hide()
    end
end

EchoRaidTools_SimpleTextButtonMixin = {}
function EchoRaidTools_SimpleTextButtonMixin:SetColor(r,g,b,a)

end
function EchoRaidTools_SimpleTextButtonMixin:SetClass(class)

end
function EchoRaidTools_SimpleTextButtonMixin:OnEnter()
    self.BG:Show()
end
function EchoRaidTools_SimpleTextButtonMixin:OnLeave()
    self.BG:Hide()
end