I am trying to filter a list of itemID's to build and add a button to a scroll frame based on the item rarity.
I already have a working scroll frame that correctly adds a list of buttons based on a list of itemID's, but when I try to create buttons based on the item rarity my code keeps breaking with a nil error.
I have looked at a lot of addon's that have filter systems but I am still a novice to programming, (self-teaching), and I don’t understand a lot of the addon code that I am viewing.
if(ListOfItemRarity.rarityGrey and itemRarity ==0)or(ListOfItemRarity.rarityWhite and itemRarity ==1)or(ListOfItemRarity.rarityGreen and itemRarity ==2)or(ListOfItemRarity.rarityBlue and itemRarity ==3)or(ListOfItemRarity.rarityPurple and itemRarity ==4)or(ListOfItemRarity.rarityHeirloom and itemRarity ==5)or(ListOfItemRarity.rarityLegendary and itemRarity ==6)or(ListOfItemRarity.rarityArtifact and itemRarity ==7)then
Hi all
I am trying to filter a list of itemID's to build and add a button to a scroll frame based on the item rarity.
I already have a working scroll frame that correctly adds a list of buttons based on a list of itemID's, but when I try to create buttons based on the item rarity my code keeps breaking with a nil error.
I have looked at a lot of addon's that have filter systems but I am still a novice to programming, (self-teaching), and I don’t understand a lot of the addon code that I am viewing.
Here is my test code;
pastebin
Any help would be gratefully appreciated.