Module:Data:修订间差异

添加6,242字节 、​ 2021年5月20日 (星期四)
无编辑摘要
无编辑摘要
无编辑摘要
第125行: 第125行:
return switch[args[1]]()
return switch[args[1]]()
end
function p.getMobile(name)
   local json=require("Module:LoadJson").Songlist()
   local s,list="",{}
   for i,k in ipairs(json['songs']) do
     s=k['title_localized']['en']
     list[s]=k
   end
   return function(mold)
     local info=list[name]
    
     if list[name]==nil then return "无" end
     local switch = {
       ["id"] = function()
         return info["id"]
       end,
       ["title"] = function()
         return info['title_localized']['en']
       end,
      ["artist"] = function()
         return info["artist"]
       end,
       ["bpm"] = function()
         return info["bpm"]
       end,
       ["set"] = function()
         return info["set"]
       end,
       ["side"] = function()
         return info["side"]
       end,
       ["date"] = function()
         return info["date"]
       end,
       ["version"] = function()
         return info["version"]
       end,
       ["bg"] = function()
         return info["bg"]
       end,
       ["pstChartDesigner"] = function()
         return info["difficulties"][1]['chartDesigner']
       end,
       ["pstJacketDesigner"] = function()
         return info["difficulties"][1]['jacketDesigner']
       end,
       ["pstRating"] = function()
         return info["difficulties"][1]['rating']
       end,
       ["prsChartDesigner"] = function()
         return info["difficulties"][2]['chartDesigner']
       end,
       ["prsJacketDesigner"] = function()
         return info["difficulties"][2]['jacketDesigner']
       end,
       ["prsRating"] = function()
         return info["difficulties"][2]['rating']
       end,
       ["ftrChartDesigner"] = function()
         return info["difficulties"][3]['chartDesigner']
       end,
       ["ftrJacketDesigner"] = function()
         return info["difficulties"][3]['jacketDesigner']
       end,
       ["ftrRating"] = function()
         if info["difficulties"][3]['ratingPlus']
         then
           return info["difficulties"][3]['rating']..'+'
         else
           return info["difficulties"][3]['rating']
         end
       end,
       ["bydChartDesigner"] = function()
         if info["difficulties"][4] then
           return info["difficulties"][4]['chartDesigner']
         end
       end,
       ["bydJacketDesigner"] = function()
         if info["difficulties"][4] then
           return info["difficulties"][4]['jacketDesigner']
         end
       end,
       ["bydRating"] = function()
         if info["difficulties"][4] then
           return info["difficulties"][4]['rating']
         end
       end
     }
if switch[mold]==nil then return "无" end
   return switch[mold]()
   end
end
function p.getNS(name)
   local json=require("Module:LoadJson").SonglistNS()
   local s,list="",{}
   for i,k in ipairs(json['songs']) do
     s=k['title_localized']['en']
     list[s]=k
   end
   return function(mold)
     local info=list[name]
    
     if list[name]==nil then return "无" end
     local switch = {
       ["id"] = function()
         return info["id"]
       end,
       ["title"] = function()
         return info['title_localized']['en']
       end,
      ["artist"] = function()
         return info["artist"]
       end,
       ["bpm"] = function()
         return info["bpm"]
       end,
       ["set"] = function()
         return info["set"]
       end,
       ["side"] = function()
         return info["side"]
       end,
       ["date"] = function()
         return info["date"]
       end,
       ["version"] = function()
         return info["version"]
       end,
       ["bg"] = function()
         return info["bg"]
       end,
       ["pstChartDesigner"] = function()
         return info["difficulties"][1]['chartDesigner']
       end,
       ["pstJacketDesigner"] = function()
         return info["difficulties"][1]['jacketDesigner']
       end,
       ["pstRating"] = function()
         return info["difficulties"][1]['rating']
       end,
       ["prsChartDesigner"] = function()
         return info["difficulties"][2]['chartDesigner']
       end,
       ["prsJacketDesigner"] = function()
         return info["difficulties"][2]['jacketDesigner']
       end,
       ["prsRating"] = function()
         return info["difficulties"][2]['rating']
       end,
       ["ftrChartDesigner"] = function()
         return info["difficulties"][3]['chartDesigner']
       end,
       ["ftrJacketDesigner"] = function()
         return info["difficulties"][3]['jacketDesigner']
       end,
       ["ftrRating"] = function()
         if info["difficulties"][3]['ratingPlus']
         then
           return info["difficulties"][3]['rating']..'+'
         else
           return info["difficulties"][3]['rating']
         end
       end,
       ["bydChartDesigner"] = function()
         if info["difficulties"][4] then
           return info["difficulties"][4]['chartDesigner']
         end
       end,
       ["bydJacketDesigner"] = function()
         if info["difficulties"][4] then
           return info["difficulties"][4]['jacketDesigner']
         end
       end,
       ["bydRating"] = function()
         if info["difficulties"][4] then
           return info["difficulties"][4]['rating']
         end
       end
     }
if switch[mold]==nil then return "无" end
   return switch[mold]()
   end
end
end


return p
return p