View Single Post
12/22/15, 01:59 PM   #9
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
I thank you for all your suggestions, and will see what I can make out of it

I guess I was a bit inaccurate in my initial question.
I needed to know WHAT kind of bait that have changed in amount.
This means I have to check all 9 types of bait.
I also need to make sure it can register if I have more than one stack of a certain bait and add it all up.

IF I understand this all right, then I can't just cache the amount in a variable for later use, as the amount can change when you move bait to/from your bank, when you pick up bait, when you get it from a mail and so on UNLESS I set it to update in all those cases... The only exception is if I can set it to ONLY update when the map is opened, but I guess it would have to be some sort of a prehook function to make sure the pin data is updated before you point to the pins (correct me if I am wrong).

The most important thing is to make it update the amount of correct bait on the correct pins when the map is opened.

My current solution does check all 9 and it does take multiple stacks into account.
As it is it updates every time there is a change in the bag content by doing a EVENT_INVENTORY_SINGLE_SLOT_UPDATE.
It is not optimal, I know, but it works for now

UPDATE:
I realized one thing...
So far I have using GetItemLink(BAG_BACKPACK, i) to go through the entire bag.
I can use GetFishingLureInfo(lureIndex) instead, just as long as I use the icon name for comparisons (to make sure it works across languages) then I guess that would be a LOT better

Last edited by SnowmanDK : 12/22/15 at 02:43 PM.
  Reply With Quote