Minecraft Wiki
Advertisement
[view | edit | history | purge]DocumentationJump to code ↴

This module implements {{DungeonsDLC}}. Data stored in Module:DungeonsDLC/data.

Dependencies

[view | edit | history | purge]The above documentation is transcluded from Module:DungeonsDLC/doc.
local p = {}

local i18n = {
	title = "This page describes content that is a part of the [[MCD:$1|$1]] DLC.",
	titleUpcoming = "This page describes content that is a part of an upcoming DLC.",
	titleSection = "This section describes content that is a part of the [[MCD:$1|$1]] DLC.",
	titleUpcomingSection = "This section describes content that is a part of an upcoming DLC.",
	message = "This feature may be added to the game in the future.",
	category = "[[Category:$1 content]]",
	categoryFuture = "[[Category:Minecraft Dungeons future content]]",
}

function p.base( f )
	local args = f
	if f == mw.getCurrentFrame() then 
		args = require( 'Module:ProcessArgs' ).merge( true )
	else
		f = mw.getCurrentFrame()
	end
	
	local dataPage = mw.loadData( 'Module:DungeonsDLC/data' )
	local data = dataPage[args[1]] or {}
	
	if not args.section then
		if args[1] then
			title = i18n.title:gsub( '%$1', args[1] )
		else
			title = i18n.titleUpcoming
		end
	else
		if args[1] then
			title = i18n.titleSection:gsub( '%$1', args[1] )
		else
			title = i18n.titleUpcomingSection
		end
	end
		
	if data.released == true then
		text = args.message or ''
	else
		text = i18n.message
	end
	
	local image = data.image or "Mystery Armor.png"
	local bgcol = data.bgcol or "#EDD"
	local linecol = data.linecol or "#DEB5B5"
	local section = args.section or ''
	
	if not args.nocat then
		if data.released == true then
			cat = i18n.category
		else
			cat = i18n.category .. i18n.categoryFuture
		end
	else
		cat = ''
	end
	
	return '{{Message box|title=' .. title .. '|text=' .. text .. '|image=' .. image .. '|bgcol=' .. bgcol .. '|linecol=' .. text .. '|mini=' .. section .. '}}' .. cat:gsub( '%$1', args[1] or '' )
end

return p

-- TO DO: automatic documentation page
Advertisement