Thread: 3.1 Update
View Single Post
07/16/17, 09:21 AM   #25
Weolo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 79
Originally Posted by Ayantir View Post
I've updated http://wiki.esoui.com/StyleItemIndex

If your addon deals with smithing (+wood / clothing) or style knowledge, you should rewrite it.
Nice one Ayantir
I think your dynamic list code could be tweaked slightly.
I am happy to do this but wanted to get your opinion first.

Looking at how ZOS do it in "function ZO_SharedSmithingCreation:RefreshStyleList()" they loop using GetNumValidItemStyles() instead of GetHighestItemStyleId(). And they get the ID from the index, ItemStyleId from GetValidItemStyleId(itemStyleIndex)

How about this:
Lua Code:
  1. for itemStyleIndex = 1, GetNumValidItemStyles() do
  2.     local itemStyleId = GetValidItemStyleId(itemStyleIndex)
  3.     if itemStyleId > 0 then
  4.         local styleItemLink = GetItemStyleMaterialLink(itemStyleId)
  5.         local _, _, meetsUsageRequirement = GetItemLinkInfo(styleItemLink)
  6.         if meetsUsageRequirement then
  7.             d(zo_strformat("<<1>> : <<2>> (<<3>>)", itemStyleId, styleItemLink, GetItemStyleName(itemStyleId)))
  8.         end
  9.     end
  10. end

Maybe even remove GetItemLinkInfo(styleItemLink) completely

Last edited by Weolo : 07/16/17 at 09:24 AM.
  Reply With Quote