-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
126 lines (109 loc) · 3.2 KB
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
local _, AddonTable = ...
local L = AddonTable.L
local AdiBags = LibStub("AceAddon-3.0"):GetAddon("AdiBags")
local AdiBags_ClassReagents = LibStub("AceAddon-3.0"):NewAddon("AdiBags_ClassReagents")
-- Virag Dev Tool
AdiBags_ClassReagents.kbDEBUG = true
function AdiBags_ClassReagents:Dump(str, obj)
if ViragDevTool_AddData and AdiBags_ClassReagents.kbDEBUG then
ViragDevTool_AddData(obj, str)
end
end
AdiBags_ClassReagents.ItemTables = {
['MAGE'] = {
[17056] = true, -- Light Feather
[17031] = true, -- Rune of Teleportation
[17032] = true -- Rune of Portals
},
['PRIEST'] = {
[17056] = true, -- Light Feather
[17029] = true, -- Sacred Candle
[17028] = true -- Holy Candle
},
['WARLOCK'] = {
[5565] = true, -- Infernal Stone
[16583] = true -- Demonic Figurine
},
['DRUID'] = {
[17034] = true, -- Maple Seed
[17021] = true, -- Wild Berries
[17035] = true, -- Stranglethorn Seed
[17038] = true, -- Ironwood Seed
[17036] = true, -- Ashwood Seed
[17026] = true, -- Wild Thornroot
[17037] = true -- Hornbeam Seed
},
['ROGUE'] = {
[8924] = true, -- Dust of Deterioration
[5173] = true, -- Deathweed
[8923] = true -- Essence of Agony
},
['SHAMAN'] = {
[17030] = true, -- Ankh
},
['PALADIN'] = {
[21177] = true, -- Symbol of Kings
[17033] = true -- Symbol of Divinity
}
}
AddonTable.Modules = {}
function AdiBags_ClassReagents:GetOptions()
return {}
end
function AdiBags_ClassReagents:GetProfile()
return {
PetFood = true
}
end
function AdiBags_ClassReagents:DefaultFilter(slotData, module, petFoodFilter)
local prefix = module.prefix
local localisedClass, playerClass, _ = UnitClass('player')
local category = 'Class Reagents'
for className, items in pairs(AdiBags_ClassReagents.ItemTables) do
if (className == playerClass) then
category = localisedClass .. ' Reagents'
else
category = 'Class Reagents'
end
for id,_ in pairs(items) do
if (tonumber(id) == slotData.itemId) then
return category
end
end
end
end
function AdiBags_ClassReagents:GetDefaultCategories()
return {
["Class Reagents"] = "Class Reagents"
}
end
function AdiBags_ClassReagents:Load(module)
local petFoodFilter = AdiBags:RegisterFilter(module.namespace, 90)
petFoodFilter.uiName = module.namespace
petFoodFilter.uiDesc = module.description
if module.filter ~=nil then
function petFoodFilter:Filter(slotData)
return module.filter(slotData)
end
else
function petFoodFilter:Filter(slotData)
return AdiBags_ClassReagents:DefaultFilter(slotData, module, petFoodFilter)
end
end
function petFoodFilter:OnInitialize()
self.db = AdiBags.db:RegisterNamespace(module.namespace, {
profile = AdiBags_ClassReagents:GetProfile()
})
end
function petFoodFilter:GetOptions()
return AdiBags_ClassReagents:GetOptions(), AdiBags:GetOptionHandler(self, true)
end
end
AddonTable.Modules.reagents = {
["name"] = "Reagents",
["categories"] = AdiBags_ClassReagents:GetDefaultCategories(),
["namespace"] = "Class Reagents",
["prefix"] = "Class Reagents",
["description"] = "Class reagents"
}
AdiBags_ClassReagents:Load(AddonTable.Modules.reagents)