模块:勋章:修订间差异

跳到导航 跳到搜索
添加2,341字节 、​ 2022年6月7日 (星期二)
已还原Fezz240对话)的编辑至最后由攸萨修订的版本
无编辑摘要
(已还原Fezz240对话)的编辑至最后由攸萨修订的版本)
标签回退
 
(未显示同一用户的3个中间版本)
第2行: 第2行:
--处理勋章的模块
--处理勋章的模块
--
--
--若要新增参数,
--请在argText里加入参数名称与对应的文字
--并在displayOrder里也加入参数名称(displayOrder里面的参数相对位置代表显示顺序)
--即可完成


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


--处理单个勋章
--处理单个勋章
第64行: 第34行:
         :attr('border', '1')
         :attr('border', '1')
         :attr('cellspacing', '0')
         :attr('cellspacing', '0')
 
    if args['limited' .. awardNum] then
     --依照displayOrder的顺序建立表格内容
        local EXP = infoTable:tag('tr')
     for i, arg in ipairs(displayOrder) do
        EXP
         if args[arg .. awardNum] then
            :tag('th')
             local row = infoTable:tag('tr')
            :wikitext('限定贩售期间')
             row
            :done()
                :tag('th')
            :tag('td')
                :wikitext(argText[arg])
            :wikitext(args['limited' .. awardNum])
                :done()
            :done()
                :tag('td')
     end
                :wikitext(args[arg .. awardNum])
     if args['cost' .. awardNum] then
                :done()
        local cost = infoTable:tag('tr')
         cost
            :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
         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
第88行: 第175行:
     end
     end


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


导航菜单