Module:Player/Flag: Difference between revisions
From TwogPedia
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
mw.logObject(results) | mw.logObject(results) | ||
if #results > 0 then | if #results > 0 then | ||
mw.log('Not workingoo?') | |||
Flags.icon( mw.text.split(results[1].nationality, ',')[1], gameCategory) | Flags.icon( mw.text.split(results[1].nationality, ',')[1], gameCategory) | ||
else | else |
Revision as of 18:32, 7 September 2022
Documentation for this module may be created at Module:Player/Flag/doc
local Flags = require('Module:Flags')
local pFlag = {}
local cargo = mw.ext.cargo
function pFlag.makeFlag(flagArg, playerId, gameCategory)
-- Look up Cargo table for nationality string
if flagArg then
return Flags.icon( flagArg, gameCategory)
end
local tables = 'Players'
local fields = '_pageName, nationality'
local cargoArgs = {
where = '_pageName = "' .. playerId .. '"'
}
local results = cargo.query(tables, fields, cargoArgs)
mw.log(results)
mw.logObject(results)
if #results > 0 then
mw.log('Not workingoo?')
Flags.icon( mw.text.split(results[1].nationality, ',')[1], gameCategory)
else
return nil
end
end
return pFlag
No categories