Closed Anonomit closed 1 month ago
Ah interesting. This is what I get for mostly ignoring this addon because I am busy with other things, and I threw this together quickly only out of request.
I'll look into adapting it properly.
With that being said, I think the reason I ended up storing as strings is only because I wasn't too concerned about localization, probably out of laziness and no intention of expanding on this addon, and I also specifically wanted the notes to vary and not be shared among all versions of the same item. I really thought very few people would even use it, and a lot more ended up doing so, so now there's some post-design regrets there in taking a speedier route lol.
I know by ID it will be the same for all variations of the item, but just out of personal preference, I wanted the ability to have different notes for all variations. So, that is more just a personal design choice, so I'll probably keep that now. I originally had it by ID and ended up just hating the notes carrying over all variations of the item. Maybe I'll change that back one day. We'll see.
Anyway, I haven't looked into this addon in some months, so I appreciate reaching out with some great suggestions. It's been on my to-do list for a while since I haven't even updated it for 11.0! Your message is a good reminder to update it!
I actually really need to because I leave town for a couple of weeks on vacation as of the 13th, so I better get something else before I leave! Again, thank you very much. It's always nice hearing from someone who knows what they are talking about as I am often just kind of wingin it in the addon dev world!
This shouldn't be an issue now in latest update.
Your current method of getting the name of an item can conflict with addons that modify tooltips. For example, I run an addon that embeds the item icon into the title line of item tooltips. You could get the name out the item link, which you already have retrieved. This should be better than reading it back from the UI, which other addons may modify.
This pattern matching is sufficient to capture the item name from an item link.
link:match("|h%[[^%]]+%]")
Side note: I'm not sure why you're storing the item names in the first place, unless it's to have notes share between normal and heroic versions of an item? I think it would be better to store the notes by item ID, which is already being kept in your database anyway. That way the notes would persist across different locales, they wouldn't confuse different items with the same names, and you wouldn't need a different note for each possible version of a suffixed item (Sword of the Eagle vs Sword of the Owl).