4,951
edits
Falterfire (talk | contribs) (Added function to show extra text for some item skillboxes) |
Falterfire (talk | contribs) (Added unified 'getItemSources' function) |
||
Line 171: | Line 171: | ||
end | end | ||
function p. | function p._getCreationTable(item) | ||
local skill = '' | local skill = '' | ||
local specialReq = nil | local specialReq = nil | ||
Line 303: | Line 297: | ||
if Shared.tableCount(tables) == 0 then | if Shared.tableCount(tables) == 0 then | ||
return " | return "" | ||
else | else | ||
return table.concat(tables, '\r\n<br/>') | return table.concat(tables, '\r\n<br/>') | ||
Line 343: | Line 337: | ||
return result | return result | ||
end | |||
function p.getCreationTable(frame) | |||
local itemName = frame.args ~= nil and frame.args[1] or frame | |||
local item = p.getItem(itemName) | |||
if item == nil then | |||
return "ERROR: No item named "..itemName.." exists in the data module" | |||
end | |||
return p._getCreationTable(item) | |||
end | end | ||
Line 985: | Line 989: | ||
return p._getItemLootSourceTable(item) | return p._getItemLootSourceTable(item) | ||
end | |||
function p._getItemSources(item) | |||
local result = '' | |||
local creationTable = p._getCreationTable(item) | |||
result = result..creationTable | |||
local lootTable = p._getItemLootSourceTable(item) | |||
if string.len(lootTable) > 0 then | |||
if string.len(result) > 0 then result = result..'<br/>' end | |||
result = result..lootTable | |||
end | |||
return result | |||
end | |||
function p.getItemSources(frame) | |||
local itemName = frame.args ~= nil and frame.args[1] or frame | |||
local item = p.getItem(itemName) | |||
if item == nil then | |||
return "ERROR: No item named "..itemName.." exists in the data module" | |||
end | |||
return p._getItemSources(item) | |||
end | end | ||