Module:StoreTableHead: Difference between revisions

Jump to navigation Jump to search
m
we're not doing delta
(Created page with "local p = {} local params = require('Module:Paramtest') local yesno = require('Module:Yesno') local var = mw.ext.VariablesLua function p.main(frame) local args = frame:getParent().args local currency,namenotes,delta,smw,hideimage,hidege,hidebuy,hidesell,hidestock,hiderestock,hidecaption = params.defaults{ {args.currency,'Coins'}, {args.namenotes,''}, {args.delta,10}, {args.smw,'yes'...")
 
m (we're not doing delta)
Line 7: Line 7:
function p.main(frame)
function p.main(frame)
     local args = frame:getParent().args
     local args = frame:getParent().args
     local currency,namenotes,delta,smw,hideimage,hidege,hidebuy,hidesell,hidestock,hiderestock,hidecaption = params.defaults{
     local currency,namenotes,smw,hideimage,hidege,hidebuy,hidesell,hidestock,hiderestock,hidecaption = params.defaults{
                     {args.currency,'Coins'},
                     {args.currency,'Coins'},
                     {args.namenotes,''},
                     {args.namenotes,''},
                    {args.delta,10},
                     {args.smw,'yes'},
                     {args.smw,'yes'},
                     {args.hideimage,'no'},
                     {args.hideimage,'no'},
Line 22: Line 21:
     var.vardefine('Currency', currency)
     var.vardefine('Currency', currency)
     var.vardefine('NameNotes', namenotes)
     var.vardefine('NameNotes', namenotes)
    var.vardefine('Delta', delta)
     var.vardefine('smw', smw)
     var.vardefine('smw', smw)
     var.vardefine('hideImage', hideimage)
     var.vardefine('hideImage', hideimage)
Line 31: Line 29:
     var.vardefine('hideRestock', hiderestock)
     var.vardefine('hideRestock', hiderestock)
      
      
    local ret = mw.html.create('')
    if not(yesno(hidecaption)) then
        ret:tag('caption')
            :css('white-space','nowrap')
            :wikitext(string.format('Sells at: [[Store sell ratio::%.1f]]%% • Buys at: [[Store buy ratio::%.1f]]%% • Change per: [[Store price delta::%.1f]]%%',sellmultiplier/10,buymultiplier/10,delta/10))
            :done()
    end
     ret:tag('tr')
     ret:tag('tr')
     local colspan = yesno(hideimage) and 1 or 2
     local colspan = yesno(hideimage) and 1 or 2
899

edits

Navigation menu