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
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
return options;
end
-function RaidFrameCustomization:SetupOptions()
- local profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db);
- local options = createOptionsTable(self);
- local config = LibStub("AceConfig-3.0");
- config:RegisterOptionsTable("Indicators", options);
- config:RegisterOptionsTable("Indicators Profiles", profiles);
+local profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(RaidFrameCustomization.db);
+local options = createOptionsTable(RaidFrameCustomization);
+local config = LibStub("AceConfig-3.0");
+config:RegisterOptionsTable("Indicators", options);
+config:RegisterOptionsTable("Indicators Profiles", profiles);
- local dialog = LibStub("AceConfigDialog-3.0");
- self.optionsFrames = {};
- self.optionsFrames.Indicators = dialog:AddToBlizOptions("Indicators", "Indicators");
- self.optionsFrames.Profile = dialog:AddToBlizOptions("Indicators Profiles", "Profiles", "Indicators");
-end
+local dialog = LibStub("AceConfigDialog-3.0");
+RaidFrameCustomization.optionsFrames = {};
+RaidFrameCustomization.optionsFrames.Indicators = dialog:AddToBlizOptions("Indicators", "Indicators");
+RaidFrameCustomization.optionsFrames.Profile = dialog:AddToBlizOptions("Indicators Profiles", "Profiles", "Indicators");