-
Notifications
You must be signed in to change notification settings - Fork 13
/
AutoCategory_Integrations_Iakoni_Gear_Changer.lua
48 lines (41 loc) · 1.31 KB
/
AutoCategory_Integrations_Iakoni_Gear_Changer.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
--Integration with Iakoni's Gear Changer
function IntegrateIakoniGearChanger()
if GearChangerByIakoni then
local function GearChangerByIakoni_DoRefresh(list)
local a=GearChangerByIakoni.savedVariables.ArraySet
local b=GearChangerByIakoni.savedVariables.ArraySetSavedFlag
--loop through the currently shown inventory items
for _,v in pairs(list.activeControls) do
local bag = v.dataEntry.data.bagId
local slot = v.dataEntry.data.slotIndex
if bag ~= nil and slot ~= nil then
local itemID = Id64ToString(GetItemUniqueId(bag, slot))
local marker = v:GetNamedChild("GCBISet")
if not marker then
marker = GearChangerByIakoni.CreateControlMarker(v)
end
marker:SetHidden(true)
local itemType = GetItemType(bag, slot)
if itemType == ITEMTYPE_ARMOR or itemType == ITEMTYPE_WEAPON then
local founditem = false
for i=1, 10 do
if b[i] == 1 then --check only if the set is saved
for _,u in pairs(GearChangerByIakoni.WornArray) do
if itemID==a[i][u] then
marker:SetHidden(false)
founditem = true
break
end
end
end
if founditem then
break
end
end
end
end
end
end
GearChangerByIakoni.DoRefresh = GearChangerByIakoni_DoRefresh
end
end