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



1,013Articles

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

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


function p.render(frame)
function p.render(f)
     local args = frame.args
     local a = {}
     local html = mw.html.create('table')
     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


     html:addClass('wikitable')
     local results = {}
        :css({
    local has = false
            ['width'] = '100%',
            ['border-collapse'] = 'collapse',
            ['table-layout'] = 'fixed'
        })


     local i = 1
     for i = 1, 50 do
    local hasRow = false
        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 ''


    while args['타입' .. i] or args['이름' .. i] do
        if t ~= '' or n ~= '' then
        hasRow = true
            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 m_type  = args['타입' .. i]  or ''
            local r1 = h:tag('tr')
        local m_name  = args['이름' .. i]  or ''
            r1:tag('td'):css{
        local m_guest  = args['게스트' .. i] or ''
                background = '#3478bf', width = '20%', border = '2px solid #000'
        local m_detail = args['내용' .. i]  or ''
            }:wikitext("<div style='text-align:center;font-weight:bold;color:#fff'>" .. t .. "</div>")


        -- ① 요약 행
            if g == '' or g:match '^%s*$' then
        local row = html:tag('tr')
                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{
        row:tag('td')
                 background = '#f0f4f9', border = '2px solid #000', padding = '6px 12px', fontSize = '.9em'
            :css({
            }:wikitext("'''추가 스탯:''' " .. (s ~= '' and s or '없음'))
                 ['background-color'] = '#3478bf',
                ['color'] = 'white',
                ['font-weight'] = 'bold',
                ['text-align'] = 'center',
                ['width'] = '20%',
                ['border'] = '2px solid #000'
            })
            :wikitext(m_type)


        if m_guest == '' then
            local c = h:tag('tr'):tag('td'):attr('colspan', 3):css{
            -- 게스트 없음 → 이름 2칸 합침
                padding = 0, border = '2px solid #000'
            row:tag('td')
            }:tag('div'):addClass('mw-collapsible mw-collapsed')
                :attr('colspan', '2')
              
                :css({
             c:tag('div'):addClass('mw-collapsible-toggle'):css{
                    ['font-weight'] = 'bold',
                textAlign = 'center', background = '#eee', fontSize = '.85em', padding = '4px'
                    ['border'] = '2px solid #000'
            }:wikitext('▼ 상세')
                })
           
                :wikitext(m_name)
            c:tag('div'):addClass('mw-collapsible-content'):css{
        else
                padding = '12px', background = '#fff'
             -- 게스트 있음 → with 출력
            }:wikitext((d ~= '' and d ~= '-') and d or '상세 내용이 없습니다.')
             row:tag('td')
                :css({
                    ['font-weight'] = 'bold',
                    ['width'] = '50%',
                    ['border'] = '2px solid #000'
                })
                :wikitext(m_name)


             row:tag('td')
             table.insert(results, tostring(h))
                :css({
                    ['text-align'] = 'center',
                    ['width'] = '30%',
                    ['border'] = '2px solid #000'
                })
                :wikitext('with ' .. m_guest)
         end
         end
        -- ② 상세 행
        if m_detail ~= '' then
            local detailRow = html:tag('tr')
            detailRow:tag('td')
                :attr('colspan', '3')
                :css({
                    ['padding'] = '10px',
                    ['border-left'] = '2px solid #000',
                    ['border-right'] = '2px solid #000',
                    ['border-bottom'] = '2px solid #000'
                })
                :wikitext(m_detail)
        end
        i = i + 1
     end
     end


     if not hasRow then
     if not has then
         return ''
         return "<div style='color:red;font-weight:bold'>-</div>"
     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