29b33e2 - Create slash command to load config addon
[wowui.git] / RaidFrameCustomization / Core.lua
index 5ddbb44..18dbf08 100644 (file)
@@ -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.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig");
     self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig");
     self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig");
-    self:SetupOptions();
 end
 
 function RaidFrameCustomization:OnEnable()
 end
 
 function RaidFrameCustomization:OnEnable()
@@ -54,3 +53,30 @@ function RaidFrameCustomization:OnDisable()
         end
     end
 end
         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