Module:StreetBrawlItems: Difference between revisions

Jump to navigation Jump to search
p.tier: support style=icon|card, size, theme class, Middle-chance label (with help from vergir-bot LLM)
Default card size to 0.875 so counter cards match the tier columns (with help from vergir-bot LLM)
Line 7: Line 7:
-- Slot display order: Weapon -> Vitality (Armor) -> Spirit (Tech)
-- Slot display order: Weapon -> Vitality (Armor) -> Spirit (Tech)
local SLOT_RANK = { Weapon = 1, Armor = 2, Tech = 3 }
local SLOT_RANK = { Weapon = 1, Armor = 2, Tech = 3 }
-- Card scale passed to ItemBox for favored/unfavored/counter cards.
-- Default card scale passed to ItemBox (tier columns and counter cards).
local CARD_SIZE = "0.8"
local CARD_SIZE = "0.875"


local NAME_TO_KEY, KEY_TO_NAME, RELEASED = {}, {}, {}
local NAME_TO_KEY, KEY_TO_NAME, RELEASED = {}, {}, {}
Line 97: Line 97:
-- {{#invoke:StreetBrawlItems|hero|HERO|GROUP|TIER|label=..|collapse=yes|style=card|icon}}
-- {{#invoke:StreetBrawlItems|hero|HERO|GROUP|TIER|label=..|collapse=yes|style=card|icon}}
-- GROUP = favored | unfavored | common  (use hero_counter for counters)
-- GROUP = favored | unfavored | common  (use hero_counter for counters)
-- Legacy: superseded by p.tier, kept for reference.
function p.hero(frame)
function p.hero(frame)
local hkey = hero_key(frame.args[1]); if not hkey then return "" end
local hkey = hero_key(frame.args[1]); if not hkey then return "" end
Line 124: Line 125:


if collapse then
if collapse then
-- Common: a div collapsible with the label inside as a custom toggle (no native
-- toggle -> no brackets). The caret flips off the container's mw-collapsed state.
local id = "sbcommon-" .. hkey .. "-" .. tostring(tier or 0)
local id = "sbcommon-" .. hkey .. "-" .. tostring(tier or 0)
local head = (label ~= "" and label) or "Common"
local head = (label ~= "" and label) or "Common"