Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Join the Playtest on Steam Now: SpiritVale

Module:Definitions: Difference between revisions

From SpiritVale Wiki
No edit summary
Tags: Reverted Mobile edit Mobile web edit
No edit summary
Tags: Reverted Mobile edit Mobile web edit
Line 201: Line 201:
-- =============================================================================
-- =============================================================================


local function render(domain, key)
local function _render(domain, key)
local db = load_db()
local db = load_db()
domain = norm_domain(db, domain)
domain = norm_domain(db, domain)
Line 267: Line 267:
function p.def(frame)
function p.def(frame)
local a = frame.args or {}
local a = frame.args or {}
return render(a[1] or a.Domain or a.domain, a[2] or a.Key or a.key)
return _render(a[1] or a.Domain or a.domain, a[2] or a.Key or a.key)
end
end


function p.render(domain, key)
-- Supports BOTH:
return render(domain, key)
-- 1) Wikitext: {{#invoke:Definitions|render|Stat|Vit}}
-- 2) Lua: p.render("Stat","Vit")
function p.render(a, b)
if type(a) == "table" then
local args = a.args or {}
return _render(args[1], args[2])
end
return _render(a, b)
end
end


return p
return p