Originally Posted by Ayantir
|
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:
for itemStyleIndex = 1, GetNumValidItemStyles() do
local itemStyleId = GetValidItemStyleId(itemStyleIndex)
if itemStyleId > 0 then
local styleItemLink = GetItemStyleMaterialLink(itemStyleId)
local _, _, meetsUsageRequirement = GetItemLinkInfo(styleItemLink)
if meetsUsageRequirement then
d(zo_strformat("<<1>> : <<2>> (<<3>>)", itemStyleId, styleItemLink, GetItemStyleName(itemStyleId)))
end
end
end
Maybe even remove GetItemLinkInfo(styleItemLink) completely