View Single Post
12/22/15, 04:13 PM   #14
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by Wandamey View Post
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:
  1. local defaults = {
  2.     data = {
  3.         FoulBaitLeft = 0,
  4.         FoulSBaitLeft = 0,
  5.         RiverBaitLeft = 0,
  6.         RiverSBaitLeft = 0,
  7.         OceanBaitLeft = 0,
  8.         OceanSBaitLeft = 0,
  9.         LakeBaitLeft = 0,
  10.         LakeSBaitLeft = 0,
  11.         GeneralBait = 0,
  12.     },
  13. },
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.

Last edited by SnowmanDK : 12/22/15 at 04:17 PM.
  Reply With Quote