Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Looming

From Mine in Abyss
Revision as of 03:46, 5 June 2019 by minecraft>ItsPlantseed (Should this be called looming, weaving, or just loom?)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This module implements {{looming}}.

Dependencies

See also


de:Modul:Weben fr:Module:Tissage it:Modulo:Looming ja:モジュール:Looming lzh:模組:Looming pt:Módulo:Looming ru:Модуль:Ткацкий станок th:มอดูล:Looming uk:Модуль:Ткацтво zh:Module:Looming



local p = {}

local i18n = {
	categoryUpcoming = 'Category:Upcoming',
	moduleArgs = [[Module:ProcessArgs]],
	moduleRecipe = [[Module:Recipe table]],
	type = 'Loom',
}
p.i18n = i18n

local recipeTable = require( i18n.moduleRecipe ).table

function p.table( f )
	local args = f
	if f == mw.getCurrentFrame() then
		args = require( i18n.moduleArgs ).merge( true )
	else
		f = mw.getCurrentFrame()
	end
	
	args.Banner = args[1]
	args.Dye = args[2]
	args.Pattern = args[3]
	args.Sprite = args[4]
	args.Output = args[5]
	
	local out = recipeTable( args, {
		uiFunc = 'loom',
		type = i18n.type,
		ingredientArgs = { 'Banner', 'Dye', 'Pattern' },
		outputArgs = { 'Output' },
	} )
	
	local title = mw.title.getCurrentTitle()
	local category
	if args.upcoming and args.nocat ~= '1' and title.namespace == 0 and not title.isSubpage then
		category = '[[' .. i18n.categoryUpcoming .. ']]'
	end
	
	return out, category
end

return p