Module:Inventory slot: Difference between revisions
imported>Ttv pedro270707 (DOES NOT WORK currently!) |
imported>Ttv pedro270707 (DOES NOT WORK currently!) |
(No difference)
|
Revision as of 23:38, 7 March 2023
This module creates an inventory slot. {{Inventory slot}}
should be preferred, rather than directly invoking this module on the article.
local p = {} function p.createSlot( f ) local args = require( "Module:ProcessArgs" ).merge local width = args.width or "32px" local height = args.height or "32px" local item = args.item local link = args.link local pageName = mw.title.getCurrentTitle().text if item ~= nil then mw.getCurrentFrame() end local slot = mw.html.create( "div" ) slot:css( "display", "inline-block" ) :css( "width", "32px" ) :css( "height", "32px" ) :css( "position", "relative" ) local slotContainer = mw.html.create( "div" ) slot:addClass( "inventory-slot" ) :addClass( "minecraft-item" ) :css( "position", "relative" ) :css( "width", width ) :css( "height", height ) :node( slot ) return slotContainer end return p