comparison Core.lua @ 24:db57cd9273f1

Fixed premade item data update check.
author Zerotorescue
date Thu, 28 Oct 2010 19:20:33 +0200
parents 7d7aaa3fbe94
children 8177b5bcb883
comparison
equal deleted inserted replaced
23:7d7aaa3fbe94 24:db57cd9273f1
99 -- Default to tracking on all chars, untracking is a convenience, not tracking by default would probably get multiple issue reports. 99 -- Default to tracking on all chars, untracking is a convenience, not tracking by default would probably get multiple issue reports.
100 self.db.global.defaults.trackAtCharacters[playerName] = true; 100 self.db.global.defaults.trackAtCharacters[playerName] = true;
101 end 101 end
102 102
103 self:PremadeGroupsCheck(); 103 self:PremadeGroupsCheck();
104 end
105
106 local function InGroup(itemId)
107 -- Go through all groups to see if this item is already somewhere
108 for groupName, values in pairs(addon.db.global.groups) do
109 if values.items and values.items[itemId] then
110 return groupName;
111 end
112 end
113
114 return;
104 end 115 end
105 116
106 function addon:PremadeGroupsCheck(updateGroupName, updateKey, accept) 117 function addon:PremadeGroupsCheck(updateGroupName, updateKey, accept)
107 -- Compare the current premade groups with those used, notify about changes 118 -- Compare the current premade groups with those used, notify about changes
108 if addon.defaultGroups then 119 if addon.defaultGroups then
883 end 894 end
884 895
885 return true; 896 return true;
886 end 897 end
887 898
888 local function InGroup(itemId)
889 -- Go through all groups to see if this item is already somewhere
890 for groupName, values in pairs(addon.db.global.groups) do
891 if values.items and values.items[itemId] then
892 return groupName;
893 end
894 end
895
896 return;
897 end
898
899 local function AddToGroup(groupName, itemId) 899 local function AddToGroup(groupName, itemId)
900 if InGroup(itemId) then 900 if InGroup(itemId) then
901 return false; 901 return false;
902 end 902 end
903 903