Anonymous

Module:Skills/Artisan: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 210: Line 210:
local category = args[1]
local category = args[1]
return p._getHerblorePotionTable(category)
return p._getHerblorePotionTable(category)
end
function p.test()
local potionArray = GameData.getEntities(SkillData.Herblore.recipes,
function(potion)
mw.logObject(potion.realm)
end
)
end
--WIP to get table that only shows how to make a specific potion
--Without the tier rows added.
function p._getHerblorePotionSlimTable(realmID)
local potions = GameData.getEntities(SkillData.Herblore.recipes,
function(obj)
return Skills.getRecipeRealm(obj) == realmID
end
)
table.sort(potions, function(a, b) return Skills.standardRecipeSort(skillID, a, b) end)
local tbl = mw.html.create("table")
        :addClass("wikitable sortable stickyHeader mw-collapsible mw-collapsed")
       
    -- Add header
    tbl :tag("tr"):addClass("headerRow-0")
    :tag('th'):wikitext("Potion")
      :attr('colspan', 2)
    :tag('th'):wikitext('[[DLC]]')
    :tag('th'):wikitext('<br>Level')
    :tag('th'):wikitext('<br>XP')
    :tag('th'):wikitext('Herb')
    :tag('th'):wikitext('Secondary')
    --:tag('th'):wikitext('Effect')
    :done()
end
function p.getHerblorePotionSlimTable(frame)
local args = frame.args ~= nil and frame.args or frame
local realmName = args.realm
local realm = Skills.getRealmFromName(realmName)
return p._getHerblorePotionSlimTable(realm)
end
end


2,873

edits