Mercurial > wow > inventory
changeset 172:e31b68c119df
Inventorium should now also appear in the Blizzard options frame.
author | Zerotorescue |
---|---|
date | Thu, 27 Jan 2011 22:48:17 +0100 |
parents | 5f405272cdd4 |
children | 7c7a540ee07e |
files | Modules/Config.lua |
diffstat | 1 files changed, 20 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/Modules/Config.lua Tue Jan 25 19:31:09 2011 +0100 +++ b/Modules/Config.lua Thu Jan 27 22:48:17 2011 +0100 @@ -109,7 +109,7 @@ if AceConfigRegistry then -- Now rebuild the list - AceConfigRegistry:NotifyChange("InventoriumOptions"); + AceConfigRegistry:NotifyChange("Inventorium"); end end end, @@ -137,7 +137,7 @@ if AceConfigRegistry then -- Now rebuild the list - AceConfigRegistry:NotifyChange("InventoriumOptions"); + AceConfigRegistry:NotifyChange("Inventorium"); end end end, @@ -956,7 +956,7 @@ if AceConfigRegistry then -- Now rebuild the list - AceConfigRegistry:NotifyChange("InventoriumOptions"); + AceConfigRegistry:NotifyChange("Inventorium"); end else addon:Print(("%s is already in the group |cfffed000%s|r."):format( (itemData.link or unknownItemName:format(itemId)), itemData:InGroup() ), addon.Colors.Red); @@ -994,7 +994,7 @@ if AceConfigRegistry then -- Now rebuild the list - AceConfigRegistry:NotifyChange("InventoriumOptions"); + AceConfigRegistry:NotifyChange("Inventorium"); end end, get = false, @@ -1028,7 +1028,7 @@ if AceConfigRegistry then -- Now rebuild the list - AceConfigRegistry:NotifyChange("InventoriumOptions"); + AceConfigRegistry:NotifyChange("Inventorium"); end end, get = false, @@ -1077,7 +1077,7 @@ if AceConfigRegistry then -- Now rebuild the list - AceConfigRegistry:NotifyChange("InventoriumOptions"); + AceConfigRegistry:NotifyChange("Inventorium"); end end, get = false, @@ -1175,7 +1175,7 @@ if AceConfigRegistry then -- Now rebuild the list - AceConfigRegistry:NotifyChange("InventoriumOptions"); + AceConfigRegistry:NotifyChange("Inventorium"); end end, get = false, @@ -1288,6 +1288,8 @@ this:GetModule("Config"):Show(); end, { "c", "config", "conf", "option", "options", "opt", "setting", "settings" }, "|Hfunction:InventoriumCommandHandler:config|h|cff00fff7/im config|r|h (or /im c) - Open the config window to change the settings and manage groups."); + self:Load(false); + -- Whenever the profile is changed, update the groups | args: (object for the functionName, eventName, functionName) addon.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig"); addon.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig"); @@ -1319,19 +1321,21 @@ self:FillGroupOptions(); end -function mod:Load() +function mod:Load(premadeGroupsCheck) + if premadeGroupsCheck then + self:PremadeGroupsCheck(); + end + if not AceConfigDialog and not AceConfigRegistry then - self:PremadeGroupsCheck(); - self:FillOptions(); -- Build options dialog AceConfigDialog = LibStub("AceConfigDialog-3.0"); AceConfigRegistry = LibStub("AceConfigRegistry-3.0"); -- Register options table - LibStub("AceConfig-3.0"):RegisterOptionsTable("InventoriumOptions", options); + LibStub("AceConfig-3.0"):RegisterOptionsTable("Inventorium", options); -- Set a nice default size (so that 4 normal sized elements fit next to eachother) - AceConfigDialog:SetDefaultSize("InventoriumOptions", 975, 600); + AceConfigDialog:SetDefaultSize("Inventorium", 975, 600); -- In case the addon is loaded from another condition, always call the remove interface options if AddonLoader and AddonLoader.RemoveInterfaceOptions then @@ -1339,14 +1343,14 @@ end -- Add to the blizzard addons options thing - AceConfigDialog:AddToBlizOptions("InventoriumOptions"); + AceConfigDialog:AddToBlizOptions("Inventorium", "Inventorium"); end end function mod:Show() - self:Load(); + self:Load(true); - AceConfigDialog:Open("InventoriumOptions"); + AceConfigDialog:Open("Inventorium"); end function mod:FillOptions() @@ -2331,7 +2335,7 @@ if AceConfigRegistry then -- Now rebuild the list - AceConfigRegistry:NotifyChange("InventoriumOptions"); + AceConfigRegistry:NotifyChange("Inventorium"); end -- Remember the new version