Originally Posted by merlight
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:
optionsTable:insert({ --[17] --> Blacksmithing Rules submenu <-- type = "submenu", name = getTranslated("CRAFTING_TYPE_BLACKSMITHING"), controls = { {--[17.1] type = "dropdown", name = getTranslated("setAllOptions") .."|r", tooltip = getTranslated("setAllOptionsTooltip"), choices = getTranslateTable(sendingType), getFunc = function() return "-" end, setFunc = function(value) setAllOptions(value,numProfile,blackSmithingRules) end, }, }, }) for _, craftKey in pairs(blackSmithingRules) do optionsTable:insert({ type = "dropdown", name = getTranslated(craftKey), choices = getTranslateTable(sendingType), getFunc = function() return getTranslated(BankManager.Saved[craftKey][numProfile]) end, setFunc = function(val) changeTranslateTable(val, craftKey, numProfile) end, }) end
|
But it works in HarvestMap!?!? That just makes me understand even less
EDIT: you mean I have to move the loop into a function of its own and call that?