No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
local tables = 'MoveDataCargoTest' | local tables = 'MoveDataCargoTest' | ||
p.fields = 'id,input,target,damage,startup' | p.fields = 'id,name,input,target,damage,reach,tracksLeft,tracksRight,startup,recv,tot,crush,block,hit,ch,notes' | ||
p.queryOverride = function(frame) | p.queryOverride = function(frame) |
Revision as of 11:30, 22 August 2023
Documentation for this module may be created at Module:Move7/doc
local p = {};
local cargo = mw.ext.cargo
local tables = 'MoveDataCargoTest'
p.fields = 'id,name,input,target,damage,reach,tracksLeft,tracksRight,startup,recv,tot,crush,block,hit,ch,notes'
p.queryOverride = function(frame)
local args = frame:getParent().args
local id = args['id']
if id == nil then
return "Error: no id"
end
local result = cargo.query(tables, p.fields, { where = "id = '" .. id .. "'" })[1]
for k, v in pairs(result) do
local override
if k == 'id' then
override = args['overrideId']
else
override = args[k]
end
if override ~= nil then
result[k] = override
end
end
return frame:expandTemplate{ title = 'MoveDataCargoTest/Display', args = result }
end
return p