View Single Post
11/19/14, 12:26 PM   #12
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
You're still failing to understand the basic fact that you cannot put a for loop (or any other non-expression statement, for that matter), into table definition (or any other place where an expression is expected, for that matter).

Lua Code:
  1. optionsTable:insert({ --[17] --> Blacksmithing Rules submenu <--
  2.         type = "submenu",
  3.         name = getTranslated("CRAFTING_TYPE_BLACKSMITHING"),
  4.         controls = {
  5.             {--[17.1]
  6.                     type = "dropdown",
  7.                 name = getTranslated("setAllOptions") .."|r",
  8.                 tooltip = getTranslated("setAllOptionsTooltip"),
  9.                 choices = getTranslateTable(sendingType),
  10.                 getFunc = function() return "-" end,
  11.                 setFunc = function(value) setAllOptions(value,numProfile,blackSmithingRules) end,
  12.             },
  13.         },
  14.     })
  15.             for _, craftKey in pairs(blackSmithingRules) do
  16.                 optionsTable:insert({
  17.                     type = "dropdown",
  18.                     name = getTranslated(craftKey),
  19.                     choices = getTranslateTable(sendingType),
  20.                     getFunc = function() return getTranslated(BankManager.Saved[craftKey][numProfile]) end,
  21.                     setFunc = function(val) changeTranslateTable(val, craftKey, numProfile) end,
  22.                 })
  23.             end
  Reply With Quote