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



1,015Articles

모듈:샤인 포스트 Be your Idol/캐릭터 메모리: 두 판 사이의 차이

(새 문서: local p = {} function p.render(frame) local args = frame:getParent().args local html = mw.html.create('table') html:addClass('wikitable') :css({ ['width'] = '100%', ['border-collapse'] = 'collapse', ['word-break'] = 'break-all', ['table-layout'] = 'fixed' -- 셀 너비를 고정하기 위함 }) -- 테이블 헤더 생성 local headerRow = html:tag('tr') headerRow:tag('th'):css({['background...)
 
편집 요약 없음
 
(같은 사용자의 중간 판 31개는 보이지 않습니다)
1번째 줄: 1번째 줄:
local p = {}
local p = {}


function p.render(frame)
function p.render(f)
     local args = frame:getParent().args
     local a = {}
     local html = mw.html.create('table')
     local pnt = f:getParent()
     html:addClass('wikitable')
     if pnt then for k, v in pairs(pnt.args) do a[k] = v end end
        :css({
    for k, v in pairs(f.args) do a[k] = v end
            ['width'] = '100%',
            ['border-collapse'] = 'collapse',
            ['word-break'] = 'break-all',
            ['table-layout'] = 'fixed' -- 셀 너비를 고정하기 위함
        })


    -- 테이블 헤더 생성
     local results = {}
     local headerRow = html:tag('tr')
     local has = false
    headerRow:tag('th'):css({['background-color'] = '#3478bf', ['color'] = 'white', ['width'] = '20%'}):wikitext('메모리 타입')
     headerRow:tag('th'):css({['width'] = '45%'}):wikitext('메모리 이름')
    headerRow:tag('th'):css({['width'] = '35%'}):wikitext('게스트 메모리 시 참가자')


     local i = 1
     for i = 1, 50 do
    while args['타입' .. i] or args['이름' .. i] do
        local t = a['타입' .. i] or ''
         local m_type = args['타입' .. i] or ''
         local n = a['이름' .. i] or ''
         local m_name = args['이름' .. i] or ''
         local g = a['게스트' .. i] or ''
         local m_guest = args['게스트' .. i] or ''
         local s = a['스텟' .. i] or ''
         local m_detail = args['내용' .. i] or ''
         local d = a['내용' .. i] or ''


         -- 첫 번째 행 생성
         if t ~= '' or n ~= '' then
        local row = html:tag('tr')
            has = true
       
            local h = mw.html.create('table'):addClass('wikitable'):css{
        -- 1. 메모리 타입 셀
                width = '100%',
        row:tag('td'):css('text-align', 'center'):wikitext(m_type)
                ['border-collapse'] = 'collapse',
       
                ['table-layout'] = 'fixed',
        -- 2. 게스트 유무에 따른 이름 및 참가자 셀 처리
                border = '2px solid #000',
        if m_guest == '' or m_guest == nil then
                marginBottom = '15px'
            -- 게스트가 없을 때: 이름 셀을 2칸 합침
            }
            row:tag('td')
 
                :attr('colspan', '2')
            local r1 = h:tag('tr')
                :css('font-weight', 'bold')
            r1:tag('td'):css{
                 :wikitext(m_name)
                background = '#3478bf', width = '20%', border = '2px solid #000'
        else
            }:wikitext("<div style='text-align:center;font-weight:bold;color:#fff'>" .. t .. "</div>")
            -- 게스트가 있을 때: 각각 표시하고 'with' 추가
 
            row:tag('td'):css('font-weight', 'bold'):wikitext(m_name)
            if g == '' or g:match '^%s*$' then
            row:tag('td')
                r1:tag('td'):attr('colspan', 2):css{
                :css('text-align', 'center')
                    fontWeight = 'bold', border = '2px solid #000', paddingLeft = '10px'
                 :wikitext('<span style="color:#666; font-size:0.9em;">with</span> ' .. m_guest)
                 }:wikitext(n)
            else
                r1:tag('td'):css{
                    fontWeight = 'bold', width = '65%', border = '2px solid #000', paddingLeft = '10px'
                }:wikitext(n)
                r1:tag('td'):css{
                    textAlign = 'center', width = '15%', border = '2px solid #000'
                 }:wikitext("<span style='color:#666;font-size:.9em'>with </span>" .. g)
            end
 
            h:tag('tr'):tag('td'):attr('colspan', 3):css{
                background = '#f0f4f9', border = '2px solid #000', padding = '6px 12px', fontSize = '.9em'
            }:wikitext("'''추가 스탯:''' " .. (s ~= '' and s or '없음'))
 
            local c = h:tag('tr'):tag('td'):attr('colspan', 3):css{
                padding = 0, border = '2px solid #000'
            }:tag('div'):addClass('mw-collapsible mw-collapsed')
           
            c:tag('div'):addClass('mw-collapsible-toggle'):css{
                textAlign = 'center', background = '#eee', fontSize = '.85em', padding = '4px'
            }:wikitext('▼ 상세')
           
            c:tag('div'):addClass('mw-collapsible-content'):css{
                padding = '12px', background = '#fff'
            }:wikitext((d ~= '' and d ~= '-') and d or '상세 내용이 없습니다.')
 
            table.insert(results, tostring(h))
         end
         end
    end


        -- 세 번째 행: 상세 내용 (전체 합침)
    if not has then
         local detailRow = html:tag('tr')
         return "<div style='color:red;font-weight:bold'>-</div>"
        detailRow:tag('td')
            :attr('colspan', '3')
            :css({
                ['padding'] = '12px',
                ['background-color'] = '#ffffff',
                ['border-bottom'] = '2px solid #3478bf'
            })
            :wikitext(m_detail)
 
        i = i + 1
     end
     end


     return tostring(html)
     return table.concat(results, "")
end
end


return p
return p

2026년 3월 10일 (화) 13:02 기준 최신판

교류 #1
반짝이는 이미테이션
추가 스탯: 없음
▼ 상세
상세 내용이 없습니다.
교류 #2
이상의 아이돌
추가 스탯: 없음
▼ 상세
상세 내용이 없습니다.

사용 예시

숫자를 늘리면 무한히 늘어납니다

{{#invoke:샤인 포스트 Be your Idol/캐릭터 메모리|render
|타입1 = 
|이름1 = 
|게스트1 =
|스텟1
|내용1 = 

|타입2 = 
|이름2 = 
|게스트2 = 
|스텟2=
|내용2 = 
}}

local p = {}

function p.render(f)
    local a = {}
    local pnt = f:getParent()
    if pnt then for k, v in pairs(pnt.args) do a[k] = v end end
    for k, v in pairs(f.args) do a[k] = v end

    local results = {}
    local has = false

    for i = 1, 50 do
        local t = a['타입' .. i] or ''
        local n = a['이름' .. i] or ''
        local g = a['게스트' .. i] or ''
        local s = a['스텟' .. i] or ''
        local d = a['내용' .. i] or ''

        if t ~= '' or n ~= '' then
            has = true
            local h = mw.html.create('table'):addClass('wikitable'):css{
                width = '100%',
                ['border-collapse'] = 'collapse',
                ['table-layout'] = 'fixed',
                border = '2px solid #000',
                marginBottom = '15px'
            }

            local r1 = h:tag('tr')
            r1:tag('td'):css{
                background = '#3478bf', width = '20%', border = '2px solid #000'
            }:wikitext("<div style='text-align:center;font-weight:bold;color:#fff'>" .. t .. "</div>")

            if g == '' or g:match '^%s*$' then
                r1:tag('td'):attr('colspan', 2):css{
                    fontWeight = 'bold', border = '2px solid #000', paddingLeft = '10px'
                }:wikitext(n)
            else
                r1:tag('td'):css{
                    fontWeight = 'bold', width = '65%', border = '2px solid #000', paddingLeft = '10px'
                }:wikitext(n)
                r1:tag('td'):css{
                    textAlign = 'center', width = '15%', border = '2px solid #000'
                }:wikitext("<span style='color:#666;font-size:.9em'>with </span>" .. g)
            end

            h:tag('tr'):tag('td'):attr('colspan', 3):css{
                background = '#f0f4f9', border = '2px solid #000', padding = '6px 12px', fontSize = '.9em'
            }:wikitext("'''추가 스탯:''' " .. (s ~= '' and s or '없음'))

            local c = h:tag('tr'):tag('td'):attr('colspan', 3):css{
                padding = 0, border = '2px solid #000'
            }:tag('div'):addClass('mw-collapsible mw-collapsed')
            
            c:tag('div'):addClass('mw-collapsible-toggle'):css{
                textAlign = 'center', background = '#eee', fontSize = '.85em', padding = '4px'
            }:wikitext('▼ 상세')
            
            c:tag('div'):addClass('mw-collapsible-content'):css{
                padding = '12px', background = '#fff'
            }:wikitext((d ~= '' and d ~= '-') and d or '상세 내용이 없습니다.')

            table.insert(results, tostring(h))
        end
    end

    if not has then
        return "<div style='color:red;font-weight:bold'>-</div>"
    end

    return table.concat(results, "")
end

return p