模块:勋章:修订间差异

跳到导航 跳到搜索
删除2,456字节 、​ 2022年4月5日 (星期二)
架构重整;参数的新增应该简单一些
(补充)
(架构重整;参数的新增应该简单一些)
第2行: 第2行:
--处理勋章的模块
--处理勋章的模块
--
--
--若要新增参数,
--请在argText里加入参数名称与对应的文字
--并在displayOrder里也加入参数名称(displayOrder里面的参数相对位置代表显示顺序)
--即可完成


local p = {}
local p = {}
--参数对应的文字;大小写有区别
local argText = {
limited      = "限定贩售期间",
cost        = "获取条件",
price        = "价格",
Purchace    = "购买条件",
Effect      = "效果",
EXP          = "有效期",
upgrade      = "升级说明",
requirements = "升级要求",
ability      = "升级能力",
ranking      = "名次",
author      = "作者",
inspiration  = "灵感",
testimonials = "感言",
}
--用于决定显示顺序;大小写有区别
local displayOrder = {
limited, cost,    price,  Purchace,
Effect,  EXP,    upgrade, requirements,
ability, ranking, author,  inspiration,
testimonials,
}


--处理单个勋章
--处理单个勋章
第34行: 第64行:
         :attr('border', '1')
         :attr('border', '1')
         :attr('cellspacing', '0')
         :attr('cellspacing', '0')
    if args['limited' .. awardNum] then
          
         local EXP = infoTable:tag('tr')
     --依照displayOrder的顺序建立表格内容
        EXP
     for i, arg in ipairs(displayOrder) do
            :tag('th')
    if args[arg .. awardNum] then
            :wikitext('限定贩售期间')
    local row = infoTable:tag('tr')
            :done()
    row
            :tag('td')
    :tag('th')
            :wikitext(args['limited' .. awardNum])
            :wikitext(argText[arg])
            :done()
            :done()
     end
            :tag('td')
     if args['cost' .. awardNum] then
            :wikitext(args[arg .. awardNum])
        local cost = infoTable:tag('tr')
            :done()
        cost
end
            :tag('th')
            :wikitext('获取条件')
            :done()
            :tag('td')
            :wikitext(args['cost' .. awardNum])
            :done()
    end
   
    if args['price' .. awardNum] then
        local price = infoTable:tag('tr')
        price
            :tag('th')
            :wikitext('价格')
            :done()
            :tag('td')
            :wikitext(args['price' .. awardNum])
            :done()
    end
    if args['Purchase' .. awardNum] then
        local Purchase = infoTable:tag('tr')
        Purchase
            :tag('th')
            :wikitext('购买条件')
            :done()
            :tag('td')
            :wikitext(args['Purchase' .. awardNum])
            :done()
    end
    if args['Effect' .. awardNum] then
        local Effect = infoTable:tag('tr')
        Effect
            :tag('th')
            :wikitext('效果')
            :done()
            :tag('td')
            :wikitext(args['Effect' .. awardNum])
            :done()
    end 
    if args['EXP' .. awardNum] then
        local EXP = infoTable:tag('tr')
        EXP
            :tag('th')
            :wikitext('有效期')
            :done()
            :tag('td')
            :wikitext(args['EXP' .. awardNum])
            :done()
    end  
    if args['upgrade' .. awardNum] then
        local upgrade = infoTable:tag('tr')
        upgrade
            :tag('th')
            :wikitext('升级说明')
            :done()
            :tag('td')
            :wikitext(args['upgrade' .. awardNum])
            :done()
    end
    if args['requirements' .. awardNum] then
        local requirements = infoTable:tag('tr')
        requirements
            :tag('th')
            :wikitext('升级要求')
            :done()
            :tag('td')
            :wikitext(args['requirements' .. awardNum])
            :done()
    end
    if args['ability' .. awardNum] then
        local ability = infoTable:tag('tr')
        ability
            :tag('th')
            :wikitext('升级能力')
            :done()
            :tag('td')
            :wikitext(args['ability' .. awardNum])
            :done()
    end
        if args['ranking' .. awardNum] then
        local ranking = infoTable:tag('tr')
        ranking
            :tag('th')
            :wikitext('名次')
            :done()
            :tag('td')
            :wikitext(args['ranking' .. awardNum])
            :done()
    end
    if args['author' .. awardNum] then
        local author = infoTable:tag('tr')
        author
            :tag('th')
            :wikitext('作者')
            :done()
            :tag('td')
            :wikitext(args['author' .. awardNum])
            :done()
    end
        if args['inspiration' .. awardNum] then
        local inspiration = infoTable:tag('tr')
        inspiration
            :tag('th')
            :wikitext('灵感')
            :done()
            :tag('td')
            :wikitext(args['inspiration' .. awardNum])
            :done()
        end
    if args['testimonials' .. awardNum] then
        local testimonials = infoTable:tag('tr')
        testimonials
            :tag('th')
            :wikitext('感言')
            :done()
            :tag('td')
            :wikitext(args['testimonials' .. awardNum])
            :done()
     end
     end
     if args['description' .. awardNum] then
     if args['description' .. awardNum] then
第175行: 第88行:
     end
     end


   
 
     return awardDiv:node(infoTable)
     return awardDiv:node(infoTable)


导航菜单