Hi all
I am in the middle of building an item filter that removes an item from a list.
With much help from Fizzlemizz I am much further along but once again I have a couple of questions.
Q1
I have a function to find matched items on my filtered and main lists, but my function is returning false when it is actually true.
local function isItemOnList(currentItem)
for k, v in pairs(AAAGlobalItemLinkList) do
if v == currentItem then
print('item found')
-- table.remove(AAAGlobalItemLinkList, k)
return true
else
print('item not found')
return false
end
end
end
Why is this happening? I cant understand how I messed this up.
Q2
I continue to have an issue where I have to spam the update function to display the item list in full when I login and/or reload.
local function updateScrollFrame()
wipe(listItems)
for index = 1, #AAAGlobalItemLinkList do
if testItemRarity(AAAGlobalItemLinkList[index]) then
tinsert(listItems, AAAGlobalItemLinkList[index])
end
end
FauxScrollFrame_Update(testingScrollFrame, #listItems, NumberOfButtons, HeightOfButtons)
for index = 1, NumberOfButtons do
local offset = index + FauxScrollFrame_GetOffset(testingScrollFrame)
local button = testingScrollFrame.buttons[index]
if index > #listItems then
button:SetText('')
button.index = nil
else
button.index = offset
local itemName, itemLink, _, _, _, _, _, _, _, _, _ = GetItemInfo(listItems[offset])
button:SetText(itemLink)
end
end
end
I have this function fire when I login and reload but it still does not display the full list of buttons until I spam the update button.
Here are links to my code on pastebin;
Lua - /Sx6U2nYz
Toc - /DYj9BJ4J
(i still cant post links)
Any help that can explain how I have messed this up would be greatly received.