View Single Post
11/18/14, 01:08 PM   #3
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by Sasky View Post
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.
I tried using your code, but gets the same error in the "for" line as before.
Guess I am gonna do it the hard way, by adding them one by one instead.
I already converted most of the settings menu, but thanks for the input
  Reply With Quote