Minecraft Wiki

Minecraft 위키가 Weird Gloop으로 이사를 시작합니다. 현재는 영어 위키만 적용된 사항이며, 한국어는 추후 이사 예정이니 참고해주세요.


새로 오신 분들은 길라잡이위키 규칙을 꼭 읽어주세요.

문서 작성번역을 도와주시면 이 위키에 큰 힘이 됩니다.

READ MORE

Minecraft Wiki
Advertisement
[만들기 | 역사 | 캐시 제거]설명문서
이 모듈의 설명문서가 없습니다. 이 모듈의 사용 방법을 안다면, 설명문서를 만들어 주십시오.
local p = {}
local emptyevent = [=[''없음''<ref group="sound" name="emptyevent">Empty events do not have this parameter set.</ref>]=]
local nosubtitle = [=[''없음''<ref group="sound" name="nosubtitle">[https://bugs.mojang.com/issues/?jql=project%20%3D%20MC%20AND%20resolution%20%3D%20Unresolved%20AND%20text%20~%20%22sound%20missing%22 Reports on Mojira].</ref>]=]

local function vardefine( f, name, value )
	f:callParserFunction( '#vardefine', name, value )
end

local function var( f, name, defaultvalue )
	local result = f:callParserFunction( '#var', name, defaultvalue )
	if result == '' then
		return nil
	end
	return result
end

local function addCategory( nocat, value, categoryName )
	if not nocat then
		local category = [=[[[분류:]=] .. categoryName .. [=[이 없는 문서]]]=]
		
		value = value .. category
	end
	
	return value
end

function p.table( f )
	local args = f
	if f == mw.getCurrentFrame() then
		args = require( '모듈:ProcessArgs' ).norm()
	else
		f = mw.getCurrentFrame()
	end
	local parent = f:getParent() or f
	local result = ''
	
	if not var( parent, 'soundstable' ) then
		vardefine( parent, 'soundstable', 1 )
		if args.nocat then
			vardefine( parent, 'nocat', 1 )
		end
		local bedrockordungeons = false
		local bedrock = false
		local dungeons = false
		if args.bedrock or args.type=='bedrock' then
			vardefine( parent, 'bedrock', 1 )
			bedrockordungeons = true
			bedrock = true
			vardefine( parent, 'bedrockordungeons', 1 )
		end
		if args.dungeons or args.type=='dungeons' then
			vardefine( parent, 'dungeons', 1 )
			bedrockordungeons = true
			dungeons = true
			vardefine( parent, 'bedrockordungeons', 1 )
		end
		result = result .. [=[<table class="wikitable">]=]
		local headerrow = mw.html.create( 'tr' )
		local headings = { '소리' }
		
		if not bedrockordungeons then
			table.insert( headings, '[[자막]]' )
		end
		if not dungeons then
			local sourceheading = parent:expandTemplate{ title = 'abbr', args = { '근원', '이 소리에 속하는 분류: 음악 및 소리 설정에서 이 소리를 제어하는 음량 슬라이더' } }
			table.insert( headings, sourceheading )
		end
		local descriptionheading = parent:expandTemplate{ title = 'abbr', args = { '설명', '게임이 이 사운드 이벤트를 호출할 때' } }
		table.insert( headings, descriptionheading )
		if not dungeons then
            table.insert( headings, '[[리소스 위치]]')
        end
		if not bedrockordungeons then
			table.insert( headings, '번역 키' )
		end
		if not dungeons then
			table.insert( headings, '음량' )
			table.insert( headings, '음조' )
		end
		if not bedrockordungeons then
			table.insert( headings, '감쇠<br>거리' )
		end
		
		for i, header in ipairs( headings ) do
			headerrow
				:tag( 'th' )
				:wikitext( header ) 
		end
		
		result = result .. tostring( headerrow )
	end
	
	-- Header variables
	local nocat = var( parent, 'nocat' )
	local bedrockordungeons = var( parent, 'bedrockordungeons' )
	local bedrock = var( parent, 'bedrock' )
	local dungeons = var( parent, 'dungeons' )
	
	local cells = {}
	
	local sound = ''
	if args.sound == '-' then
		sound = [=[''없음'']=]
	elseif args.sound == nil then
		sound = addCategory( nocat, '?', '소리' )
	else
		-- First parameter is empty because we don't want a sound name
		local sounds = { '', args.sound }
		for count = 2, 20 do
			local index = 'sound' .. count
			if args[index] then
				table.insert( sounds, args[index] )
			end
		end
		
		sound = parent:expandTemplate{ title = 'Sound', args = sounds }
	end
	table.insert( cells, sound )
	
	if not bedrockordungeons then
		local subtitle = args.subtitle
		if args.subtitle == '-' then
			subtitle = parent:preprocess( nosubtitle )
		elseif args.sound == '-' then
			subtitle = parent:preprocess( emptyevent )
		elseif args.translationkey == '-' then
			local content = parent:expandTemplate{ title = 'bug', args = { args.subtitle } }
			subtitle = [=[''없음'']=] .. parent:extensionTag( 'ref', content, { group = 'sound', name = 'bug' .. args.subtitle } )
		elseif args.subtitle ~= nil then
			subtitle = args.subtitle
		else
			subtitle = addCategory( nocat, '?', '자막' )
		end
		table.insert( cells, subtitle )
	end
	
	if not dungeons then
		local source = addCategory( nocat, '?', 'sound source' )
		if args.source == 'Master Volume' or args.source == 'master' then
			source = '마스터 음량'
		elseif args.source == 'Music' or args.source == 'music' then
			source = '음악'
		elseif args.source == 'Jukebox/Note Blocks' or args.source == 'record' then
			source = '주크박스/소리 블록'
		elseif args.source == 'Weather' or args.source == 'weather' then
			source = '날씨'
		elseif args.source == 'Hostile Creatures' or args.source == 'hostile' then
			source = '적대적 생명체'
		elseif args.source == 'Friendly Creatures' or args.source == 'neutral' then
			source = '친화적 생명체'
		elseif args.source == 'Players' or args.source == 'player' then
			source = '플레이어'
		elseif args.source == 'Blocks' or args.source == 'block' then
			source = '블록'
		elseif args.source == 'Ambient/Environment' or args.source == 'ambient' then
			source = '주변음/환경음'
		elseif args.source == 'Voice/Speech' or args.source == 'voice' then
			source = '목소리/Speech'
		elseif args.source == 'Sound' or args.source == 'sound' then
			source = '소리'
		end
        table.insert( cells, source )
	end

	local desc = args.description or addCategory( nocat, '?', '소리 설명' )
	table.insert( cells, desc )
	
    if not dungeons then
	    local id
	    if args.id then
	    	id = [=[<code style="white-space: nowrap">]=] .. args.id .. [=[</code>]=]
	    else
	    	id = addCategory( nocat, '?', '소리 ID' )
	    end
	    table.insert( cells, id )
    end
	
	if not bedrockordungeons then
		local translationkey
		if args.sound == '-' then
			translationkey = parent:preprocess( emptyevent )
		elseif args.subtitle == '-' then
			translationkey = parent:preprocess( nosubtitle )
		elseif args.translationkey == '-' then
			local content = parent:expandTemplate{ title = 'bug', args = { args.subtitle } }
			translationkey = [=[''없음'']=] .. parent:extensionTag( 'ref', content, { group = 'sound', name = 'bug' .. args.subtitle } )
		elseif args.translationkey ~= nil then
			translationkey = [=[<code style="white-space: nowrap">]=] .. args.translationkey .. [=[</code>]=]
		else
			translationkey = addCategory( nocat, '?', '자막 키' )
		end
		table.insert( cells, translationkey )
	end
	
	if not dungeons then
		table.insert( cells, args.volume or addCategory( nocat, '?', '소리 음량' ) )
		table.insert( cells, args.pitch or addCategory( nocat, '?', '소리 음조' ) )
	end
	if not bedrockordungeons then
		table.insert( cells, args.distance or addCategory( nocat, '?', '소음 감쇠 거리' ) )
	end
	
	local row = mw.html.create( 'tr' )
	for i, cell in ipairs( cells ) do
		row
			:tag( 'td' )
			:wikitext( cell ) 
	end
	result = result .. tostring( row )
	
	if args.foot then
		-- Reset the variables we used
		vardefine(parent, 'soundstable', '')
		vardefine(parent, 'nocat', '')
		vardefine(parent, 'bedrock', '')
		vardefine(parent, 'dungeons', '')
		vardefine(parent, 'bedrockordungeons', '')
		
		-- Add table ending
		result = result .. [=[</table>]=] .. parent:expandTemplate{ title = 'notelist', args = { 'sound' } }
	end
	
	return tostring( result )
end
return p
Advertisement