From StrategyWiki, the video game walkthrough and strategy guide wiki
Jump to navigation Jump to search
(Lua module to generate item Shop row)
Tags: Mobile edit Mobile web edit
 
(Renaming json file)
Tags: Mobile edit Mobile web edit
Line 5: Line 5:
function p.row( frame )
function p.row( frame )
local args = getArgs( frame, { wrappers = 'Template:Pokemon/Shop row' } )
local args = getArgs( frame, { wrappers = 'Template:Pokemon/Shop row' } )
local itemList = mw.loadJsonData( 'Module:Pokemon/ShopList.json' )
local itemList = mw.loadJsonData( 'Module:Pokemon/ShopPricing.json' )


     local itemName = args[1] or 'Potion'
     local itemName = args[1] or 'Potion'

Revision as of 20:44, 7 October 2023

Documentation for this module may be created at Module:Pokemon/Shop/Documentation

local getArgs = require('Module:Arguments').getArgs

local p = {}

function p.row( frame )
	local args = getArgs( frame, { wrappers = 'Template:Pokemon/Shop row' } )
	local itemList = mw.loadJsonData( 'Module:Pokemon/ShopPricing.json' )

    local itemName = args[1] or 'Potion'
	local itemPrice = itemList[itemName]

    local row={
          "|-\n",
          '| ', itemName, '\n', 
          '| ', '[[File:Pokebuck.png]]', 
           itemPrice
   }
   return table.concat( row )
end

return p