익명
×
새 문서 만들기
여기에 문서 제목을 쓰세요:
We currently have 900 articles on 루리위키. Type your article name above or click on one of the titles below and start writing!



900Articles

모듈:궤적시리즈/하늘의 궤적/캐릭터 크래프트: 두 판 사이의 차이

편집 요약 없음
편집 요약 없음
 
(같은 사용자의 중간 판 4개는 보이지 않습니다)
1번째 줄: 1번째 줄:
local p = {}
local p = {}


-- 1행 생성 (크래프트 한 개)
function p.table(frame)
function p.row(frame)
     local args = frame:getParent().args
     local args = frame.args
    local html = mw.html.create('table')
        :addClass('wikitable')
        :css({
            ['width'] = '100%',
            ['border-collapse'] = 'collapse',
            ['text-align'] = 'center',
        })


     -- 기본 값
     -- 헤더 구성 (이미지와 동일한 구조)
     local grade      = args["등급"] or ""
     local headers = {
    local name      = args["이름"] or ""
        {text = '크래프트', colspan = 2},
     local craftCell  = grade .. "<br>" .. name
        {text = '습득Lv'},
        {text = '소비CP'},
        {text = '타입'},
        {text = '히트수'},
        {text = '위력', colspan = 2},
        {text = '범위'},
        {text = '사정거리'},
        {text = '스턴'},
        {text = '경직'},
        {text = '효과'}
     }


     local powerRank  = args["위력랭크"] or ""
    -- 상단 헤더 (colspan 있는 헤더)
    local powerNum  = args["위력수치"] or ""
     local topHeader = html:tag('tr')
     local powerCell  = powerRank .. "<br>" .. powerNum
    for _, h in ipairs(headers) do
        topHeader:tag('th')
            :css({
                ['background'] = '#656565',
                ['color'] = '#fff',
                ['padding'] = '6px',
            })
            :attr('colspan', h.colspan or 1)
            :wikitext(h.text)
     end


     -- 표 한 생성
     -- 데이터 처리
     local row = '|-\n' ..
     local rowIndex = 0
        '| ' .. craftCell .. '\n' ..
    for i = 1, 50 do
         '| ' .. (args["습득Lv"] or "") .. '\n' ..
         local line = args['row' .. i]
        '| ' .. (args["소비CP"] or "") .. '\n' ..
         if not line or line == '' then break end
        '| ' .. (args["타입"] or "") .. '\n' ..
         '| ' .. (args["히트수"] or "") .. '\n' ..
        '| ' .. powerCell .. '\n' ..
        '| ' .. (args["범위"] or "") .. '\n' ..
        '| ' .. (args["사정거리"] or "") .. '\n' ..
        '| ' .. (args["스턴"] or "") .. '\n' ..
        '| ' .. (args["경직"] or "") .. '\n' ..
        '| ' .. (args["효과"] or "") .. '\n'


     return row
        rowIndex = rowIndex + 1
        local bg = (rowIndex % 2 == 1) and '#EDF3FF' or 'transparent'
 
        -- 행 구조: 종류, 이름, 습득Lv, 소비CP, 타입, 히트수, 위력등급, 위력수치, 범위, 사정, 스턴, 경직, 효과
        local cols = mw.text.split(line, ',', true)
 
        local tr = html:tag('tr'):css('background', bg)
 
        -- 종류 (C/SC)
        tr:tag('td')
            :css({
                ['padding'] = '4px',
                ['font-weight'] = 'bold'
            })
            :wikitext(cols[1] or '')
 
        -- 크래프트 이름
        tr:tag('td')
            :css({
                ['padding'] = '4px',
                ['font-weight'] = 'bold',
                ['text-align'] = 'left'
            })
            :wikitext(cols[2] or '')
 
        -- 습득Lv
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[3] or '')
 
        -- 소비CP
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[4] or '')
 
        -- 타입
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[5] or '')
 
        -- 히트수
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[6] or '')
 
        -- 위력 등급
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[7] or '')
 
        -- 위력 수치
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[8] or '')
 
        -- 범위
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[9] or '')
 
        -- 사정
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[10] or '')
 
        -- 스턴
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[11] or '')
 
        -- 경직
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[12] or '')
 
        -- 효과
        tr:tag('td')
            :css({
                ['padding'] = '4px',
                ['text-align'] = 'left'
            })
            :wikitext(cols[13] or '')
    end
 
     return tostring(html)
end
end


return p
return p

2025년 11월 23일 (일) 21:32 기준 최신판

이 모듈에 대한 설명문서는 모듈:궤적시리즈/하늘의 궤적/캐릭터 크래프트/설명문서에서 만들 수 있습니다

local p = {}

function p.table(frame)
    local args = frame:getParent().args
    local html = mw.html.create('table')
        :addClass('wikitable')
        :css({
            ['width'] = '100%',
            ['border-collapse'] = 'collapse',
            ['text-align'] = 'center',
        })

    -- 헤더 구성 (이미지와 동일한 구조)
    local headers = {
        {text = '크래프트', colspan = 2},
        {text = '습득Lv'},
        {text = '소비CP'},
        {text = '타입'},
        {text = '히트수'},
        {text = '위력', colspan = 2},
        {text = '범위'},
        {text = '사정거리'},
        {text = '스턴'},
        {text = '경직'},
        {text = '효과'}
    }

    -- 상단 헤더 (colspan 있는 헤더)
    local topHeader = html:tag('tr')
    for _, h in ipairs(headers) do
        topHeader:tag('th')
            :css({
                ['background'] = '#656565',
                ['color'] = '#fff',
                ['padding'] = '6px',
            })
            :attr('colspan', h.colspan or 1)
            :wikitext(h.text)
    end

    -- 데이터 행 처리
    local rowIndex = 0
    for i = 1, 50 do
        local line = args['row' .. i]
        if not line or line == '' then break end

        rowIndex = rowIndex + 1
        local bg = (rowIndex % 2 == 1) and '#EDF3FF' or 'transparent'

        -- 행 구조: 종류, 이름, 습득Lv, 소비CP, 타입, 히트수, 위력등급, 위력수치, 범위, 사정, 스턴, 경직, 효과
        local cols = mw.text.split(line, ',', true)

        local tr = html:tag('tr'):css('background', bg)

        -- 종류 (C/SC)
        tr:tag('td')
            :css({
                ['padding'] = '4px',
                ['font-weight'] = 'bold'
            })
            :wikitext(cols[1] or '')

        -- 크래프트 이름
        tr:tag('td')
            :css({
                ['padding'] = '4px',
                ['font-weight'] = 'bold',
                ['text-align'] = 'left'
            })
            :wikitext(cols[2] or '')

        -- 습득Lv
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[3] or '')

        -- 소비CP
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[4] or '')

        -- 타입
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[5] or '')

        -- 히트수
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[6] or '')

        -- 위력 등급
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[7] or '')

        -- 위력 수치
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[8] or '')

        -- 범위
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[9] or '')

        -- 사정
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[10] or '')

        -- 스턴
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[11] or '')

        -- 경직
        tr:tag('td')
            :css('padding', '4px')
            :wikitext(cols[12] or '')

        -- 효과
        tr:tag('td')
            :css({
                ['padding'] = '4px',
                ['text-align'] = 'left'
            })
            :wikitext(cols[13] or '')
    end

    return tostring(html)
end

return p