View Single Post
11/18/14, 12:50 PM   #2
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
Looping over the block does nothing. You'd need to build-up a table by appending each entry from the loop:

Lua Code:
  1. local settingsTable = {}
  2. for k, craftKey in pairs(blackSmithingRules) do
  3.     local entry = {--[17.x]
  4.         type = "dropdown",
  5.         name = getTranslated(craftKey),
  6.         choices = getTranslateTable(sendingType),
  7.         getFunc = function() return getTranslated(BankManager.Saved[craftKey][numProfile]) end,
  8.         setFunc = function(value) changeTranslateTable(value,craftKey,numProfile) end,
  9.     }
  10.     table.append(settingsTable, entry);
  11. end
Keep in mind that ordering matters in the options table. You can either table.append everything to build it up, or just make the table in the normal manner up to that point then use table.append from then on.

Alternatively, if you want to stick to the function-based style (rather than make the table yourself), you can take a look at:
http://www.esoui.com/downloads/info5...Interface.html
You'd have to extend it for any of the new LAM2 features (like texture), but it is something to consider.
  Reply With Quote