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



900Articles

모듈:궤적시리즈/하늘의 궤적/캐릭터 스테이터스: 두 판 사이의 차이

(4767561 (토론)의 31569판 편집을 되돌림)
태그: 편집 취소
편집 요약 없음
1번째 줄: 1번째 줄:
local p = {}
local p = {}


-- 능력치 행 생성 함수
-- frame.args.name : 능력치 이름
-- frame.args.HP  : 능력치 값
-- rowIndex : 홀수/짝수 체크용
function p.renderStatRow(frame)
function p.renderStatRow(frame)
     local raw = frame.args.HP or ""
     local name = frame.args.name or ""
     local parts = mw.text.split(raw, "/")
     local value = frame.args.HP or ""
   
    local rowIndex = tonumber(frame.args.row or 1) -- 틀에서 row 번호 넘겨주면 홀수/짝수 구분
     return string.format([[
 
|-
     local tdStyleValue = (rowIndex % 2 == 1) and "background-color:#2E3B84; color:white; padding:6px;" or "padding:6px;"
! class="stat-header" | %s
    local tdStyleName  = "background-color:#EDF3FF; padding:6px;"
| class="stat-row" | %s
 
| class="stat-row" | %s
    local html = mw.html.create("tr")
| class="stat-row" | %s
    html:tag("td")
| class="stat-row" | %s
        :attr("style", tdStyleName)
]],  
        :wikitext(name)
frame.args.name or "",
    html:tag("td")
parts[1] or "",
        :attr("style", tdStyleValue)
parts[2] or "",
        :wikitext(value)
parts[3] or "",
    html:tag("td")
parts[4] or ""
        :attr("style", tdStyleValue)
)
        :wikitext("") -- Lv1 빈칸
    html:tag("td")
        :attr("style", tdStyleValue)
        :wikitext("") -- Lv50 빈칸
    html:tag("td")
        :attr("style", tdStyleValue)
        :wikitext("") -- Lv120 빈칸
 
    return tostring(html)
end
end


return p
return p

2025년 11월 22일 (토) 02:14 판

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

local p = {}

-- 능력치 행 생성 함수
-- frame.args.name : 능력치 이름
-- frame.args.HP   : 능력치 값
-- rowIndex : 홀수/짝수 체크용
function p.renderStatRow(frame)
    local name = frame.args.name or ""
    local value = frame.args.HP or ""
    local rowIndex = tonumber(frame.args.row or 1)  -- 틀에서 row 번호 넘겨주면 홀수/짝수 구분

    local tdStyleValue = (rowIndex % 2 == 1) and "background-color:#2E3B84; color:white; padding:6px;" or "padding:6px;"
    local tdStyleName  = "background-color:#EDF3FF; padding:6px;"

    local html = mw.html.create("tr")
    html:tag("td")
        :attr("style", tdStyleName)
        :wikitext(name)
    html:tag("td")
        :attr("style", tdStyleValue)
        :wikitext(value)
    html:tag("td")
        :attr("style", tdStyleValue)
        :wikitext("") -- Lv1 빈칸
    html:tag("td")
        :attr("style", tdStyleValue)
        :wikitext("") -- Lv50 빈칸
    html:tag("td")
        :attr("style", tdStyleValue)
        :wikitext("") -- Lv120 빈칸

    return tostring(html)
end

return p