Originally Posted by Wandamey
that's nice, I managed to place my post right when I could pretend it was useful
edit cross post with SMDK if you wait 5 mn, i'm sure votan will help with a tested version of bait listing by id and something like this :
local fakeitemLink = zo_strformat(|H0blablabla<<1>>blablabla|h|h, baitId) <---build an ItemLink with no name
zo_strformat(<<1>>,GetItemLinkName(fakeitemLink)) <-- get localized name - format or not depending on the value returned by GetFishingLureInfo or format both the same to compare
(all you need to do this is in fisherman, file Baits.lua btw : all ids, the localized name function too)
but i think you are able to simply make a table lure[itemId] = lureindex, i'm pretty sure these indexes are stable because of the selection wheel.
re edit : you are using local lureIndex = GetFishingLure() at first? It probably just return the index of the current lure on the rod? not sure. but anyway you are using it as the indice 2 lines later. Doesn't seem needed at all.
|
I changed my local variables after last post to
Lua Code:
local defaults = {
data = {
FoulBaitLeft = 0,
FoulSBaitLeft = 0,
RiverBaitLeft = 0,
RiverSBaitLeft = 0,
OceanBaitLeft = 0,
OceanSBaitLeft = 0,
LakeBaitLeft = 0,
LakeSBaitLeft = 0,
GeneralBait = 0,
},
},
so they became "local" for my entire addon instead of the one function
Edit: You are right about the
local lureIndex = GetFishingLure() I just copied from circonian's example lol.