WIKI公告栏
欢迎各位引航者访问卡拉彼丘WIKI,由于游客访问页面会有一定的页面旧版缓存,建议你登陆B站账号进行浏览,如果您觉得本WIKI有帮助到你,欢迎推荐给身边的引航者。
欢迎各位引航者访问卡拉彼丘WIKI,由于游客访问页面会有一定的页面旧版缓存,建议你登陆B站账号进行浏览,如果您觉得本WIKI有帮助到你,欢迎推荐给身边的引航者。
全站通知:
模块:图标
刷
历
编
跳到导航
跳到搜索
此模块的文档可以在模块:图标/doc创建
local p = {}
p["道具图标"] = function(frame)
local itemType = frame.args["类型"]
local itemName = frame.args[1]
local size = frame.args["size"]
local imgsize = frame.args["imgsize"]
local itemIcon = ""
local itemFunctions = {
["角色"] = p["角色时装"],
["武器"] = p["武器外观"],
["礼物"] = p["礼物"],
["喷漆"] = p["喷漆"],
["基板"] = p["基板"],
["封装"] = p["封装"],
["勋章"] = p["勋章"],
["表情"] = p["表情"],
["语音"] = p["语音"],
[""] = p["功能道具"]
}
if itemFunctions[itemType] then
itemIcon = itemFunctions[itemType](itemName, size, imgsize)
else
itemIcon = p["其它"](frame.args[1], frame.args["File"], frame.args["Quality"], size, imgsize)
end
return itemIcon
end
p["角色时装"] = function(itemName, size, imgsize)
local data = mw.loadData("Module:皮肤/RoleSkinData")
for key, RoleSkin in pairs(data) do
if RoleSkin.Name == itemName then
local RoleSkinIcon = p.iconstyle("角色时装:" .. RoleSkin.Name, RoleSkin.File, RoleSkin.Quality, size, imgsize)
return RoleSkinIcon
end
end
return "时装名称错误或无数据"
end
p["武器外观"] = function(itemName, size, imgsize)
local data = mw.loadData("Module:皮肤/WeaponSkinData")
for key, WeaponSkin in pairs(data) do
if WeaponSkin.Name == itemName then
local WeaponSkinIcon = p.iconstyle("武器外观:" .. WeaponSkin.Name, WeaponSkin.File, WeaponSkin.Quality, size, imgsize)
return WeaponSkinIcon
end
end
return "皮肤名称错误或无数据"
end
p["礼物"] = function(itemName, size, imgsize)
local data = mw.text.jsonDecode(mw.title.new('Module:角色礼物/Data.json'):getContent() or '{}')
for key, gift in pairs(data) do
if itemName == gift.Name then
local giftIcon = p.iconstyle(gift.Name, gift.File, gift.Quality, size, imgsize)
return giftIcon
end
end
return "礼物名称错误或无数据"
end
p["喷漆"] = function(itemName, size, imgsize)
local data = mw.loadData("Module:喷漆/Data")
for key, Decal in pairs(data) do
if Decal.Name == itemName then
local DecalIcon = p.iconstyle("喷漆:" .. Decal.Name, Decal.File, Decal.Quality, size, imgsize)
return DecalIcon
end
end
return "喷漆名称错误或无数据"
end
p["基板"] = function(itemName, size, imgsize)
local data = mw.loadData("Module:基板/Data")
for key, IdCard in pairs(data) do
if IdCard.Name == itemName then
local IdCardIcon = p.iconstyle("基板:" .. IdCard.Name, IdCard.File, IdCard.Quality, size, imgsize)
return IdCardIcon
end
end
return "基板名称错误或无数据"
end
p["封装"] = function(itemName, size, imgsize)
local data = mw.text.jsonDecode(mw.title.new('Module:封装/Data.json'):getContent() or '{}')
for key, Frame in pairs(data) do
if Frame.Name == itemName then
local FrameIcon = p.iconstyle("封装:" .. Frame.Name, Frame.File, Frame.Quality, size, imgsize)
return FrameIcon
end
end
return "封装名称错误或无数据"
end
p["勋章"] = function(itemName, size, imgsize)
local data = mw.loadData("Module:勋章/Data")
for key, Badge in pairs(data) do
if Badge.Name == itemName then
local BadgeIcon = p.iconstyle("勋章:" .. Badge.Name, Badge.File, Badge.Quality, size, imgsize)
return BadgeIcon
end
end
return "勋章名称错误或无数据"
end
p["表情"] = function(itemName, size, imgsize)
local data = mw.text.jsonDecode(mw.title.new('模块:角色表情/Data.json'):getContent() or '{}')
local Emote = data[itemName]
if not Emote then
return "表情名称错误或无数据"
end
local EmoteIcon = p.iconstyle("表情:" .. itemName, Emote['File'], Emote['Quality'], size, imgsize)
return EmoteIcon
end
p["语音"] = function(itemName, size, imgsize)
local VoiceFile = "图标-" .. itemName .. "语音.png"
local VoiceIcon = p.iconstyle( itemName .. "语音", VoiceFile, "精致", size, imgsize)
return VoiceIcon
end
p["功能道具"] = function(itemName, size, imgsize)
local data = mw.loadData("Module:Items/Data")
local item = data[itemName]
if not item then
return "道具名称错误或无数据"
end
local itemIcon = p.iconstyle(itemName, item.File, item.Quality, size, imgsize)
return itemIcon
end
p["其它"] = function(Name, File, Quality, size, imgsize)
local itemIcon = p.iconstyle(Name, File, Quality, size, imgsize)
return itemIcon
end
function p.iconstyle(itemName, itemFile, itemQuality, size, imgsize)
local QualityColor = {
["私服"] = "#F78653",
["传说"] = "#F85555",
["完美"] = "#FFC555",
["卓越"] = "#F285FF",
["精致"] = "#60A3F7",
["初始"] = "#ECECEC"
}
local html = mw.html.create()
local borderColor = QualityColor[itemQuality]
local icon_html = html
:tag('span'):addClass('items-icon')
:tag('span'):addClass('items-icon-img'):cssText("border-color:" .. borderColor):wikitext("[[file:" ..
itemFile .. "|" .. imgsize .. "|class=items-img|link=]]"):done()
:tag('span'):addClass('items-icon-text'):cssText("font-size:" .. size):wikitext(itemName):done()
:done()
return tostring(icon_html)
end
return p