285
edits
(Enforce min-width on icon columns to ensure visibility on mobile devices) |
ByteFoolish (talk | contribs) (getRunecraftingRunes) |
||
Line 134: | Line 134: | ||
result = result..'||style="text-align:right"|+'..bonusXP..'%' | result = result..'||style="text-align:right"|+'..bonusXP..'%' | ||
result = result..'||style="text-align:right"|+'..total..'%' | result = result..'||style="text-align:right"|+'..total..'%' | ||
end | |||
result = result..'\r\n|}' | |||
return result | |||
end | |||
function p.getRunecraftingRunes(frame) | |||
local result = '{| class="wikitable sortable stickyHeader"' | |||
result = result..'\r\n|- class="headerRow-0"' | |||
result = result..'\r\n!Item\r\n!Name\r\n!Runecrafting Level\r\n!Experience' | |||
result = result..'\r\n!Item Price\r\n!Ingredients\r\n!XP/s\r\n!GP/s' | |||
local runeArray = {} | |||
for i, rune in Shared.skpairs(SkillData.Runecrafting.Runes) do | |||
table.insert(runeArray, rune) | |||
end | |||
table.sort(runeArray, function(a, b) return a.runecraftingLevel < b.runecraftingLevel end) | |||
for i, rune in Shared.skpairs(runeArray) do | |||
result = result..'\r\n|-' | |||
result = result..'\r\n| style="text-align: left;" | '..Icons.Icon({rune.name, type='item', size='50', notext=true}) | |||
result = result..'\r\n| style ="text-align: left;" |[['..rune.name..']]' | |||
result = result..'\r\n| style="text-align:right"|'..rune.runecraftingLevel | |||
result = result..'\r\n| style="text-align:right"|'..rune.runecraftingXP | |||
result = result..'\r\n| style="text-align:right"|'..rune.sellsFor | |||
local matArray = {} | |||
for j, mat in Shared.skpairs(rune.runecraftReq) do | |||
local matItem = Items.getItemByID(mat.id) | |||
table.insert(matArray, Icons.Icon({matItem.name, type='item', notext=true, qty=mat.qty})) | |||
end | |||
result = result..'\r\n|'..table.concat(matArray, ' ') | |||
local rcCraftTime = 2.00 | |||
local xps = rune.runecraftingXP / rcCraftTime | |||
local gps = rune.sellsFor / rcCraftTime | |||
result = result..'\r\n| style="text-align:right"|'..string.format("%.2f", xps) | |||
result = result..'\r\n| style="text-align:right"|'..string.format("%.2f", gps) | |||
end | end | ||
edits