Module:StreetBrawlItems: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Hero section: move styling to classes (Template:HeroStreetBrawl/styles.css), sort items by slot then cost then name, wrap groups for spacing (with help from vergir-bot LLM) |
Filter out disabled items; render Common as a clickable label toggle with a pipe-delimited list (with help from vergir-bot LLM) |
||
| Line 26: | Line 26: | ||
local function iname(code) local it = items[code]; return it and it.Name or nil end | local function iname(code) local it = items[code]; return it and it.Name or nil end | ||
local function iok(code) local it = items[code] | -- A "real" item: exists, has a display name, and is not disabled/removed. | ||
local function iok(code) | |||
local it = items[code] | |||
return it ~= nil and it.Name ~= nil and it.IsDisabled ~= true | |||
end | |||
local function itier(code) | local function itier(code) | ||
local it = items[code]; if not it then return nil end | local it = items[code]; if not it then return nil end | ||
| Line 118: | Line 122: | ||
if collapse then | if collapse then | ||
local head = (label ~= "" and label) or " | -- Common: a bold label (like Favored/Unfavored) that toggles a collapsed, | ||
return ' | -- pipe-delimited list of the remaining pool items. | ||
.. ' | local id = "sbcommon-" .. hkey .. "-" .. tostring(tier or 0) | ||
.. | local head = (label ~= "" and label) or "Common" | ||
return '<div class="sb-group">' | |||
.. '<div class="sb-label sb-toggle mw-customtoggle-' .. id .. '">' .. head .. '</div>' | |||
.. '<div class="sb-common mw-collapsible mw-collapsed" id="mw-customcollapsible-' .. id .. '">' | |||
.. '<div class="sb-common-body mw-collapsible-content">' .. table.concat(parts, " | ") .. '</div>' | |||
.. '</div></div>' | |||
end | end | ||