Module:ItemData/nav: Difference between revisions

Sur (talk | contribs)
m fixed min_souls and max_souls params not being passed correctly from get_item_nav_bulletpoints and get_item_nav_cards
Sur (talk | contribs)
m write_item_slot_subgroup now returns the whole Navbox subgroup template output
Line 113: Line 113:
local debug_mode = frame.args['debug_mode']
local debug_mode = frame.args['debug_mode']
if slot == nil then return "'slot' parameter is required" end
if slot == nil then return "'slot' parameter is required" end
-- Define base args
local template_title = "Navbox subgroup"
local template_args = {
["groupstyle"] = "background-color:#8b56b4;width:10%;min-width:70px;border-radius: 8px 0 0 8px",
["grouppadding"] = "5px",
["listpadding"] = "0 0.25rem",
}
local soul_style = "font-size: 12px; text-shadow: 1px 1px rgba(0, 0, 0, 0.3);"
local soul_style = "font-size: 12px; text-shadow: 1px 1px rgba(0, 0, 0, 0.3);"
local ret = ''
local prices = generic_module.get_item_price_per_tier()
local prices = generic_module.get_item_price_per_tier()
for i, souls in ipairs(prices) do
for i, souls in ipairs(prices) do
Line 131: Line 138:
--Create the subgroup
--Create the subgroup
ret = ret .. "|group" .. (i-1) .. "={{Souls|"..souls.."|Shadow="..soul_style.."}}"
template_args["group" .. (i-1)] = frame:expandTemplate{title="Souls", args={[1] = min_souls, ["Shadow"] = soul_style}}
local list
local list
if type=='get_item_nav_cards' then
if type=='get_item_nav_cards' then
Line 140: Line 147:
return "'type' should be get_item_nav_cards or get_item_nav_bulletpoints"
return "'type' should be get_item_nav_cards or get_item_nav_bulletpoints"
end
end
ret = ret .. "|list" .. (i-1) .. "=" .. list
template_args["list" .. (i-1)] = list
end
end
end
end
return process_debug_mode(ret, debug_mode)
return frame:expandTemplate{title=template_title, args=template_args}
end
end


return p
return p