RaidFrameCustomization = LibStub("AceAddon-3.0"):NewAddon("RaidFrameCustomization"); RaidFrameCustomization.normalBarColor = CreateColor(0.3, 0.3, 0.3); RaidFrameCustomization.dispelBarColor = CreateColor(1, 0.5, 0); RaidFrameCustomization.normalBackColor = {0.7, 0.7, 0.7}; RaidFrameCustomization.dispelBackColor = {0.5, 0.2, 0}; RaidFrameCustomization.frames = {}; RaidFrameCustomization.positions = { "TOPLEFT", "TOPRIGHT", "CENTER", "BOTTOMLEFT", "BOTTOMRIGHT" }; RaidFrameCustomization.running = false; local defaults = { profile = { indicatorFont = "Arial Narrow", showIcons = true, enabled = true, indicators = { ['**'] = { textSize = 10, textColor = {1, 1, 1, 1}, mine = false, stack = true, showText = true, showIcon = true, useDefaultIcon = true, iconSize = 10, iconColor = {1, 1, 1, 1}, }, }, } }; function RaidFrameCustomization:OnInitialize() self.db = LibStub("AceDB-3.0"):New("RaidFrameCustomizationDB", defaults); self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig"); self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig"); self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig"); end function RaidFrameCustomization:OnEnable() self:RefreshConfig(); end function RaidFrameCustomization:OnDisable() self.running = false; for _, frame in pairs(self.frames) do for _, ind in pairs(frame) do ind.text:SetText(""); ind.icon:SetTexture(""); end end end SLASH_RAIDFRAMECUSTOM1 = "/raidframecustom"; function SlashCmdList.RAIDFRAMECUSTOM(msg, editBox) local loaded, finished = IsAddonLoaded("RaidFrameCustomizationConfig"); if not loaded then local loaded, reason = LoadAddon("RaidFrameCustomizationConfig"); if not loaded then if reason == "DISABLED" then print("RaidFrameCustomizationConfig is disabled"); elseif reason == "MISSING" then print("RaidFrameCustomizationConfig is missing"); elseif reason == "CORRUPT" then print("RaidFrameCustomizationConfig is corrupt"); elseif reason == "INCOMPATIBLE" then print("RaidFrameCustomizationConfig is incompatible"); elseif reason == "INTERFACE_VERSION" then print("RaidFrameCustomizationConfig has wrong interface version"); end return; end elseif not finished then -- slash command sent again when loading process is in progress return; end InterfaceOptionsFrame_OpenToCategory(RaidFrameCustomization.optionsFrames.Indicators); end