Module:GameSkills: Difference between revisions
From SpiritVale Wiki
More actions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
-- Module:GameSkills | -- Module:GameSkills | ||
-- | -- | ||
-- | -- Upgrades: | ||
-- | -- - Adds a per-skill Level Select slider (client-side JS updates fields) | ||
-- - Default level = Max Level | |||
-- - Adds .sv-skill-card + data-max-level/data-level hooks for JS | |||
-- - Replaces large Lv1/Lv2/... lists with data-series dynamic spans | |||
-- | -- | ||
-- | -- Requires the JS you installed in MediaWiki:Common.js. | ||
local GameData = require("Module:GameData") | local GameData = require("Module:GameData") | ||
| Line 72: | Line 68: | ||
if type(v) == "number" then return v end | if type(v) == "number" then return v end | ||
if type(v) == "string" then return tonumber(v) end | if type(v) == "string" then return tonumber(v) end | ||
if type(v) == "table" and v.Value ~= nil then | |||
return toNum(v.Value) | |||
end | |||
return nil | return nil | ||
end | |||
local function clamp(n, lo, hi) | |||
if type(n) ~= "number" then return lo end | |||
if n < lo then return lo end | |||
if n > hi then return hi end | |||
return n | |||
end | end | ||
| Line 117: | Line 123: | ||
---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ||
-- | -- Dynamic field helpers (JS-driven) | ||
---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ||
local function dynSpan(series, level) | |||
local function | if type(series) ~= "table" or #series == 0 then | ||
return nil | |||
if | end | ||
level = clamp(level or #series, 1, #series) | |||
- | local span = mw.html.create("span") | ||
span:addClass("sv-dyn") | |||
span:attr("data-series", mw.text.jsonEncode(series)) | |||
span:wikitext(mw.text.nowiki(series[level] or "")) | |||
return tostring(span) | |||
end | end | ||
local function isFlatList(list) | local function isFlatList(list) | ||
| Line 185: | Line 169: | ||
end | end | ||
-- | -- Like your old valuePairLines/valuePairText, but: | ||
-- | -- - if Per Level is a list, we render a dynamic span instead of "v1 / v2 / ...". | ||
-- | -- - scalar Per Level stays as the old "Base" and "Per Level" lines (still short). | ||
local function | local function valuePairDynamicLines(name, block, maxLevel, level) | ||
if type(block) ~= "table" then | if type(block) ~= "table" then | ||
return {} | return {} | ||
| Line 196: | Line 180: | ||
local per = block["Per Level"] | local per = block["Per Level"] | ||
-- Per Level list ( | -- Per Level list (expanded) | ||
if type(per) == "table" then | if type(per) == "table" then | ||
-- empty list -> show Base only | |||
if #per == 0 then | if #per == 0 then | ||
local baseText = formatUnitValue(base) | local baseText = formatUnitValue(base) | ||
if baseText then | if baseText then | ||
return { string.format("%s: %s", name, baseText) } | return { string.format("%s: %s", name, mw.text.nowiki(baseText)) } | ||
end | end | ||
return {} | return {} | ||
end | end | ||
-- | -- Flat list -> show single value | ||
if isFlatList(per) then | if isFlatList(per) then | ||
local baseText = formatUnitValue(base) | local baseText = formatUnitValue(base) | ||
local one = tostring(per[1]) | local one = formatUnitValue(per[1]) or tostring(per[1]) | ||
local show = baseText or one | local show = baseText or one | ||
if show then | if show then | ||
return { string.format("%s: %s", name, show) } | return { string.format("%s: %s", name, mw.text.nowiki(show)) } | ||
end | end | ||
return {} | return {} | ||
end | end | ||
local | -- Dynamic series | ||
local series = {} | |||
for _, v in ipairs(per) do | for _, v in ipairs(per) do | ||
table.insert( | table.insert(series, formatUnitValue(v) or tostring(v)) | ||
end | end | ||
if | |||
return {} | local dyn = dynSpan(series, level) | ||
if dyn then | |||
return { string.format("%s: %s", name, dyn) } | |||
end | end | ||
return { | return {} | ||
end | end | ||
-- Scalar Per Level | -- Scalar Per Level (keep old style) | ||
local lines = {} | local lines = {} | ||
local baseText = formatUnitValue(base) | local baseText = formatUnitValue(base) | ||
| Line 233: | Line 221: | ||
if baseText then | if baseText then | ||
table.insert(lines, string.format("%s: %s", name, baseText)) | table.insert(lines, string.format("%s: %s", name, mw.text.nowiki(baseText))) | ||
end | end | ||
if perText and isNonZeroScalar(per) then | if perText and isNonZeroScalar(per) then | ||
table.insert(lines, string.format("%s Per Level: %s", name, perText)) | table.insert(lines, string.format("%s Per Level: %s", name, mw.text.nowiki(perText))) | ||
end | end | ||
| Line 242: | Line 230: | ||
end | end | ||
local function | local function valuePairDynamicText(name, block, maxLevel, level, sep) | ||
local lines = | local lines = valuePairDynamicLines(name, block, maxLevel, level) | ||
if #lines == 0 then | if #lines == 0 then return nil end | ||
return table.concat(lines, sep or "<br />") | return table.concat(lines, sep or "<br />") | ||
end | end | ||
local function | ---------------------------------------------------------------------- | ||
if | -- Lookups | ||
---------------------------------------------------------------------- | |||
local function getSkillById(id) | |||
id = trim(id) | |||
if not id then return nil end | |||
local dataset = getSkills() | |||
local byId = dataset.byId or {} | |||
return byId[id] | |||
end | |||
local function findSkillByName(name) | |||
local | name = trim(name) | ||
if not name then return nil end | |||
local dataset = getSkills() | |||
local byName = dataset.byName or {} | |||
if byName[name] then | |||
return byName[name] | |||
end | end | ||
for _, rec in ipairs(dataset.records or {}) do | |||
if type(rec) == "table" then | |||
if rec["External Name"] == name or rec["Name"] == name or rec["Display Name"] == name then | |||
return rec | |||
end | |||
end | |||
end | end | ||
return | return nil | ||
end | end | ||
---------------------------------------------------------------------- | |||
-- Formatting helpers | |||
---------------------------------------------------------------------- | |||
local function basisLabel(entry, isHealing) | local function basisLabel(entry, isHealing) | ||
| Line 297: | Line 288: | ||
end | end | ||
-- | -- Dynamic damage entry: | ||
-- | -- Build a series for Lv1..LvMax, and show only the selected one. | ||
local function formatDamageEntry(entry, maxLevel, level) | |||
local function formatDamageEntry(entry, maxLevel) | |||
if type(entry) ~= "table" then | if type(entry) ~= "table" then | ||
return nil | return nil | ||
| Line 307: | Line 296: | ||
local isHealing = (entry.Type == "Healing") | local isHealing = (entry.Type == "Healing") | ||
local basis = isHealing and "Healing" or basisLabel(entry) | |||
local baseRaw = entry["Base %"] | local baseRaw = entry["Base %"] | ||
| Line 313: | Line 303: | ||
local baseN = toNum(baseRaw) | local baseN = toNum(baseRaw) | ||
local perN = toNum(perRaw) | local perN = toNum(perRaw) | ||
local function baseIsPresent() | local function baseIsPresent() | ||
| Line 336: | Line 324: | ||
end | end | ||
-- No scaling -> just show base | |||
if perN == nil or perN == 0 or not maxLevel or maxLevel <= 0 then | if perN == nil or perN == 0 or not maxLevel or maxLevel <= 0 then | ||
return baseText and (baseText .. " " .. basis) or nil | return baseText and (mw.text.nowiki(baseText .. " " .. basis)) or nil | ||
end | end | ||
local | -- Build series strings for each level | ||
local series = {} | |||
for lv = 1, maxLevel do | for lv = 1, maxLevel do | ||
table.insert( | local perPart = perN * lv | ||
if baseText and baseN ~= nil then | |||
-- numeric base: show total | |||
local total = baseN + perPart | |||
table.insert(series, string.format("%s%% %s", fmtNum(total), basis)) | |||
elseif baseText then | |||
-- nonnumeric base: can't total, show additive | |||
table.insert(series, string.format("%s + %s%% %s", baseText, fmtNum(perPart), basis)) | |||
else | |||
-- no base: show perPart only | |||
table.insert(series, string.format("%s%% %s", fmtNum(perPart), basis)) | |||
end | |||
end | end | ||
return dynSpan(series, level) | |||
end | end | ||
local function formatDamageList(list, maxLevel, includeTypePrefix | local function formatDamageList(list, maxLevel, level, includeTypePrefix) | ||
if type(list) ~= "table" or #list == 0 then | if type(list) ~= "table" or #list == 0 then | ||
return nil | return nil | ||
| Line 360: | Line 358: | ||
for _, d in ipairs(list) do | for _, d in ipairs(list) do | ||
if type(d) == "table" then | if type(d) == "table" then | ||
local txt = formatDamageEntry(d, maxLevel, | local txt = formatDamageEntry(d, maxLevel, level) | ||
if txt then | if txt then | ||
if includeTypePrefix and d.Type and d.Type ~= "" then | if includeTypePrefix and d.Type and d.Type ~= "" then | ||
table.insert(parts, tostring(d.Type) .. ": " .. txt) | table.insert(parts, mw.text.nowiki(tostring(d.Type) .. ": ") .. txt) | ||
else | else | ||
table.insert(parts, txt) | table.insert(parts, txt) | ||
| Line 377: | Line 375: | ||
end | end | ||
local function formatScaling(list, basisOverride) | local function formatScaling(list, basisOverride) | ||
if type(list) ~= "table" or #list == 0 then | if type(list) ~= "table" or #list == 0 then | ||
| Line 409: | Line 403: | ||
end | end | ||
local function formatArea(area, maxLevel, level) | |||
local function formatArea(area) | |||
if type(area) ~= "table" then | if type(area) ~= "table" then | ||
return nil | return nil | ||
| Line 416: | Line 409: | ||
local parts = {} | local parts = {} | ||
local distLine = | local distLine = valuePairDynamicText("Distance", area["Area Distance"], maxLevel, level, "<br />") | ||
if distLine then | if distLine then | ||
table.insert(parts, distLine) | table.insert(parts, distLine) | ||
| Line 423: | Line 416: | ||
local size = area["Area Size"] | local size = area["Area Size"] | ||
if size and size ~= "" then | if size and size ~= "" then | ||
table.insert(parts, "Size: " .. tostring(size)) | table.insert(parts, "Size: " .. mw.text.nowiki(tostring(size))) | ||
end | end | ||
| Line 432: | Line 425: | ||
end | end | ||
local function formatTimingBlock(bt) | local function formatTimingBlock(bt, maxLevel, level) | ||
if type(bt) ~= "table" then | if type(bt) ~= "table" then | ||
return nil | return nil | ||
| Line 443: | Line 436: | ||
return | return | ||
end | end | ||
local lines = | local lines = valuePairDynamicLines(label, block, maxLevel, level) | ||
for _, line in ipairs(lines) do | for _, line in ipairs(lines) do | ||
table.insert(parts, line) | table.insert(parts, line) | ||
| Line 454: | Line 447: | ||
if bt["Effect Cast Time"] ~= nil then | if bt["Effect Cast Time"] ~= nil then | ||
table.insert(parts, "Effect Cast Time: " .. tostring(bt["Effect Cast Time"])) | table.insert(parts, "Effect Cast Time: " .. mw.text.nowiki(tostring(bt["Effect Cast Time"]))) | ||
end | end | ||
if bt["Damage Delay"] ~= nil then | if bt["Damage Delay"] ~= nil then | ||
table.insert(parts, "Damage Delay: " .. tostring(bt["Damage Delay"])) | table.insert(parts, "Damage Delay: " .. mw.text.nowiki(tostring(bt["Damage Delay"]))) | ||
end | end | ||
if bt["Effect Remove Delay"] ~= nil then | if bt["Effect Remove Delay"] ~= nil then | ||
table.insert(parts, "Effect Remove Delay: " .. tostring(bt["Effect Remove Delay"])) | table.insert(parts, "Effect Remove Delay: " .. mw.text.nowiki(tostring(bt["Effect Remove Delay"]))) | ||
end | end | ||
| Line 469: | Line 462: | ||
end | end | ||
local function formatResourceCost(rc) | local function formatResourceCost(rc, maxLevel, level) | ||
if type(rc) ~= "table" then | if type(rc) ~= "table" then | ||
return nil | return nil | ||
| Line 475: | Line 468: | ||
local parts = {} | local parts = {} | ||
local manaLines = | local manaLines = valuePairDynamicLines("MP", rc["Mana Cost"], maxLevel, level) | ||
for _, line in ipairs(manaLines) do | for _, line in ipairs(manaLines) do | ||
table.insert(parts, line) | table.insert(parts, line) | ||
end | end | ||
local hpLines = | local hpLines = valuePairDynamicLines("HP", rc["Health Cost"], maxLevel, level) | ||
for _, line in ipairs(hpLines) do | for _, line in ipairs(hpLines) do | ||
table.insert(parts, line) | table.insert(parts, line) | ||
| Line 498: | Line 491: | ||
if combo.Type then | if combo.Type then | ||
table.insert(parts, "Type: " .. tostring(combo.Type)) | table.insert(parts, "Type: " .. mw.text.nowiki(tostring(combo.Type))) | ||
end | end | ||
local durText = formatUnitValue(combo.Duration) | local durText = formatUnitValue(combo.Duration) | ||
if durText then | if durText then | ||
table.insert(parts, "Duration: " .. durText) | table.insert(parts, "Duration: " .. mw.text.nowiki(durText)) | ||
end | end | ||
| Line 509: | Line 502: | ||
local pctText = formatUnitValue(combo.Percent) | local pctText = formatUnitValue(combo.Percent) | ||
if pctText then | if pctText then | ||
table.insert(parts, "Bonus: " .. pctText) | table.insert(parts, "Bonus: " .. mw.text.nowiki(pctText)) | ||
end | end | ||
end | end | ||
| Line 519: | Line 512: | ||
end | end | ||
local function valuePairRawText(block) | |||
if type(block) ~= "table" then | |||
return nil | |||
end | |||
local base = block.Base | |||
local per = block["Per Level"] | |||
if type(per) == "table" then | |||
if #per == 0 then | |||
return formatUnitValue(base) | |||
end | |||
if isFlatList(per) then | |||
return formatUnitValue(base) or tostring(per[1]) | |||
end | |||
local vals = {} | |||
for _, v in ipairs(per) do | |||
table.insert(vals, formatUnitValue(v) or tostring(v)) | |||
end | |||
return (#vals > 0) and table.concat(vals, " / ") or nil | |||
end | |||
local baseText = formatUnitValue(base) | |||
local perText = formatUnitValue(per) | |||
if baseText and perText and isNonZeroScalar(per) then | |||
return string.format("%s (Per Level: %s)", baseText, perText) | |||
end | |||
return baseText or perText | |||
end | |||
local function formatMechanicEffects(effects) | local function formatMechanicEffects(effects) | ||
if type(effects) ~= "table" then | if type(effects) ~= "table" then | ||
| Line 547: | Line 568: | ||
end | end | ||
else | else | ||
local txt = | -- Keep old behavior here (usually not huge) | ||
local txt = valuePairRawText(block) | |||
if txt then | if txt then | ||
table.insert(parts, txt) | table.insert(parts, mw.text.nowiki(tostring(name) .. ": " .. txt)) | ||
end | end | ||
end | end | ||
| Line 593: | Line 615: | ||
end | end | ||
local function formatStatusApplications(list) | local function formatStatusApplications(list, maxLevel, level) | ||
if type(list) ~= "table" or #list == 0 then | if type(list) ~= "table" or #list == 0 then | ||
return nil | return nil | ||
| Line 607: | Line 629: | ||
if type(s.Duration) == "table" then | if type(s.Duration) == "table" then | ||
local t = | local t = valuePairDynamicText("Duration", s.Duration, maxLevel, level, "; ") | ||
if t then table.insert(detail, t) end | if t then table.insert(detail, t) end | ||
end | end | ||
if type(s.Chance) == "table" then | if type(s.Chance) == "table" then | ||
local t = | local t = valuePairDynamicText("Chance", s.Chance, maxLevel, level, "; ") | ||
if t then table.insert(detail, t) end | if t then table.insert(detail, t) end | ||
end | end | ||
| Line 633: | Line 655: | ||
end | end | ||
local function formatStatusRemoval(list) | local function formatStatusRemoval(list, maxLevel, level) | ||
if type(list) ~= "table" or #list == 0 then | if type(list) ~= "table" or #list == 0 then | ||
return nil | return nil | ||
| Line 650: | Line 672: | ||
end | end | ||
local amt = valuePairRawText(r) | local amt = nil | ||
local seg = label | -- If this removal has a Per Level list, make it dynamic | ||
if type(r["Per Level"]) == "table" and #r["Per Level"] > 0 and not isFlatList(r["Per Level"]) then | |||
local series = {} | |||
for _, v in ipairs(r["Per Level"]) do | |||
table.insert(series, formatUnitValue(v) or tostring(v)) | |||
end | |||
amt = dynSpan(series, level) | |||
else | |||
amt = valuePairRawText(r) | |||
if amt then amt = mw.text.nowiki(amt) end | |||
end | |||
local seg = mw.text.nowiki(label) | |||
if amt then | if amt then | ||
seg = seg .. " – " .. amt | seg = seg .. " – " .. amt | ||
| Line 750: | Line 784: | ||
-- Infobox builder | -- Infobox builder | ||
---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ||
local function buildLevelSelectUI(level, maxLevel) | |||
-- Matches the JS expectations: | |||
-- .sv-level-slider placeholder for the <input type="range"> | |||
-- .sv-level-num span for updating the number | |||
local wrap = mw.html.create("div") | |||
wrap:addClass("sv-level-ui") | |||
local label = wrap:tag("div"):addClass("sv-level-label") | |||
label:wikitext("Level <span class=\"sv-level-num\">" .. tostring(level) .. "</span> / " .. tostring(maxLevel)) | |||
wrap:tag("div"):addClass("sv-level-slider") | |||
return tostring(wrap) | |||
end | |||
local function buildInfobox(rec, opts) | local function buildInfobox(rec, opts) | ||
opts = opts or {} | opts = opts or {} | ||
local showUsers = (opts.showUsers ~= false) | local showUsers = (opts.showUsers ~= false) | ||
local maxLevel = tonumber(rec["Max Level"]) or 1 | |||
if maxLevel < 1 then maxLevel = 1 end | |||
-- Always default to max level (your requirement) | |||
local level = maxLevel | |||
level = clamp(level, 1, maxLevel) | |||
local root = mw.html.create("table") | local root = mw.html.create("table") | ||
root:addClass("wikitable spiritvale-skill-infobox") | root:addClass("wikitable spiritvale-skill-infobox") | ||
-- JS hook: treat the table itself as the "card" | |||
root:addClass("sv-skill-card") | |||
root:attr("data-max-level", tostring(maxLevel)) | |||
root:attr("data-level", tostring(level)) | |||
-- ========================================================== | -- ========================================================== | ||
| Line 798: | Line 858: | ||
------------------------------------------------------------------ | ------------------------------------------------------------------ | ||
addSectionHeader(root, "General") | addSectionHeader(root, "General") | ||
addRow(root, " | |||
-- Replace Max Level -> Level Select (slider) | |||
addRow(root, "Level Select", buildLevelSelectUI(level, maxLevel)) | |||
-- Hide Users on: | -- Hide Users on: | ||
| Line 824: | Line 886: | ||
local skillParts = {} | local skillParts = {} | ||
for _, rs in ipairs(req["Required Skills"]) do | for _, rs in ipairs(req["Required Skills"]) do | ||
local | local nameReq = rs["Skill External Name"] or rs["Skill Internal Name"] or "Unknown" | ||
local | local lvlReq = rs["Required Level"] | ||
if | if lvlReq then | ||
table.insert(skillParts, string.format("%s (Lv.%s)", | table.insert(skillParts, string.format("%s (Lv.%s)", nameReq, lvlReq)) | ||
else | else | ||
table.insert(skillParts, | table.insert(skillParts, nameReq) | ||
end | end | ||
end | end | ||
| Line 877: | Line 939: | ||
addRow(root, "Range", rangeText) | addRow(root, "Range", rangeText) | ||
local areaText = formatArea(mech.Area) | local areaText = formatArea(mech.Area, maxLevel, level) | ||
addRow(root, "Area", areaText) | addRow(root, "Area", areaText) | ||
| Line 884: | Line 946: | ||
end | end | ||
local btText = formatTimingBlock(mech["Basic Timings"]) | local btText = formatTimingBlock(mech["Basic Timings"], maxLevel, level) | ||
addRow(root, "Timing", btText) | addRow(root, "Timing", btText) | ||
local rcText = formatResourceCost(mech["Resource Cost"]) | local rcText = formatResourceCost(mech["Resource Cost"], maxLevel, level) | ||
addRow(root, "Resource Cost", rcText) | addRow(root, "Resource Cost", rcText) | ||
| Line 903: | Line 965: | ||
if next(dmg) ~= nil then | if next(dmg) ~= nil then | ||
addSectionHeader(root, "Damage and Scaling") | addSectionHeader(root, "Damage and Scaling") | ||
-- Split healing out of Main Damage (Type == "Healing") | -- Split healing out of Main Damage (Type == "Healing") | ||
| Line 930: | Line 990: | ||
local pureHealing = (#healOnly > 0) and (#mainNonHeal == 0) and (not flatHas) and (not reflHas) | local pureHealing = (#healOnly > 0) and (#mainNonHeal == 0) and (not flatHas) and (not reflHas) | ||
local mainText = formatDamageList(mainNonHeal, maxLevel, (#mainNonHeal > 1) | local mainText = formatDamageList(mainNonHeal, maxLevel, level, (#mainNonHeal > 1)) | ||
addRow(root, "Main Damage", mainText) | addRow(root, "Main Damage", mainText) | ||
local flatText = formatDamageList(flatList, maxLevel, | local flatText = formatDamageList(flatList, maxLevel, level, false) | ||
addRow(root, "Flat Damage", flatText) | addRow(root, "Flat Damage", flatText) | ||
local reflText = formatDamageList(reflList, maxLevel, | local reflText = formatDamageList(reflList, maxLevel, level, false) | ||
addRow(root, "Reflect Damage", reflText) | addRow(root, "Reflect Damage", reflText) | ||
local healText = formatDamageList(healOnly, maxLevel, false | local healText = formatDamageList(healOnly, maxLevel, level, false) | ||
addRow(root, "Healing", healText) | addRow(root, "Healing", healText) | ||
| Line 958: | Line 1,018: | ||
-- Status | -- Status | ||
------------------------------------------------------------------ | ------------------------------------------------------------------ | ||
local statusApps = formatStatusApplications(rec["Status Applications"]) | local statusApps = formatStatusApplications(rec["Status Applications"], maxLevel, level) | ||
local statusRem = formatStatusRemoval(rec["Status Removal"]) | local statusRem = formatStatusRemoval(rec["Status Removal"], maxLevel, level) | ||
if statusApps or statusRem then | if statusApps or statusRem then | ||
addSectionHeader(root, "Status Effects") | addSectionHeader(root, "Status Effects") | ||
| Line 993: | Line 1,053: | ||
local args = getArgs(frame) | local args = getArgs(frame) | ||
local userName = args.user or args[1] | local userName = args.user or args[1] | ||
if not userName or userName == "" then | if not userName or userName == "" then | ||
| Line 1,022: | Line 1,081: | ||
root:addClass("spiritvale-skill-list") | root:addClass("spiritvale-skill-list") | ||
for _, rec in ipairs(matches) do | for _, rec in ipairs(matches) do | ||
root:wikitext(buildInfobox(rec, { showUsers = false })) | root:wikitext(buildInfobox(rec, { showUsers = false })) | ||
| Line 1,037: | Line 1,095: | ||
local args = getArgs(frame) | local args = getArgs(frame) | ||
local raw1 = args[1] | local raw1 = args[1] | ||
local name = args.name or raw1 | local name = args.name or raw1 | ||
| Line 1,047: | Line 1,101: | ||
local rec | local rec | ||
if name and name ~= "" then | if name and name ~= "" then | ||
rec = findSkillByName(name) | rec = findSkillByName(name) | ||
end | end | ||
if not rec and id and id ~= "" then | if not rec and id and id ~= "" then | ||
rec = getSkillById(id) | rec = getSkillById(id) | ||
end | end | ||
if not rec then | if not rec then | ||
local pageTitle = mw.title.getCurrentTitle() | local pageTitle = mw.title.getCurrentTitle() | ||
| Line 1,067: | Line 1,117: | ||
(not id or id == "") | (not id or id == "") | ||
if noExplicitArgs then | if noExplicitArgs then | ||
return p.listForUser(frame) | return p.listForUser(frame) | ||
end | end | ||
if name and name ~= "" and name == pageName and (not id or id == "") then | if name and name ~= "" and name == pageName and (not id or id == "") then | ||
return p.listForUser(frame) | return p.listForUser(frame) | ||
end | end | ||
local label = name or id or "?" | local label = name or id or "?" | ||
return string.format( | return string.format( | ||
| Line 1,086: | Line 1,133: | ||
end | end | ||
local showUsers = not isDirectSkillPage(rec) | local showUsers = not isDirectSkillPage(rec) | ||
return buildInfobox(rec, { showUsers = showUsers }) | return buildInfobox(rec, { showUsers = showUsers }) | ||