X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/0e7d6a3379082663dafa57a9ad6c435d913cb372..29b33e2d8f2b3e2a90b59217bc0a2e0d6bf4ebd8:/RaidFrameCustomization/Core.lua diff --git a/RaidFrameCustomization/Core.lua b/RaidFrameCustomization/Core.lua index 5ddbb44..18dbf08 100644 --- a/RaidFrameCustomization/Core.lua +++ b/RaidFrameCustomization/Core.lua @@ -38,7 +38,6 @@ function RaidFrameCustomization:OnInitialize() self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig"); self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig"); self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig"); - self:SetupOptions(); end function RaidFrameCustomization:OnEnable() @@ -54,3 +53,30 @@ function RaidFrameCustomization:OnDisable() 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