Нет описания правки |
Нет описания правки |
||
| Строка 3: | Строка 3: | ||
local p = {} | local p = {} | ||
p.store = prototypes.store | p.store = prototypes.store | ||
function p.readscalar(frame) | |||
return mw.text.nowiki(p.store[frame.args[1]][frame.args[2]]) | |||
end | |||
function p.buildlists(frame) | function p.buildlists(frame) | ||
Версия от 15:20, 18 января 2024
Для документации этого модуля может быть создана страница Модуль:Uplink Lookup/doc
local prototypes = mw.loadData("Module:Uplink Lookup/data")
local p = {}
p.store = prototypes.store
function p.readscalar(frame)
return mw.text.nowiki(p.store[frame.args[1]][frame.args[2]])
end
function p.buildlists(frame)
local out = ""
local group = frame.args[1]
for k in pairs(p.store) do
if p.store[k].group == group then
out = out .. frame:expandTemplate{ title = "Uplink", args = { prototype = k }}
elseif group == nil then
out = out .. frame:expandTemplate{ title = "Uplink", args = { prototype = k }}
end
end
return out
end
return p