Không có tóm lược sửa đổi |
n (Đã khóa “Mô đun:Icon” ([edit=sysop] (vô thời hạn) [move=sysop] (vô thời hạn))) |
||
(Không hiển thị 37 phiên bản của 5 người dùng ở giữa) | |||
Dòng 1: | Dòng 1: | ||
+ | --WARFRAME Wiki Icon Module |
||
+ | --http://warframe.wikia.com/ |
||
+ | --Written by User:ChickenBar |
||
+ | |||
local p = {} |
local p = {} |
||
local IconData = mw.loadData( 'Module:Icon/data' ) |
local IconData = mw.loadData( 'Module:Icon/data' ) |
||
+ | |||
function p.Item(frame) |
function p.Item(frame) |
||
Dòng 17: | Dòng 22: | ||
end |
end |
||
if (textexist == 'text' or textexist == 'Text') then |
if (textexist == 'text' or textexist == 'Text') then |
||
− | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] |
+ | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'|'..frame.args[1]..']]' |
end |
end |
||
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
||
Dòng 44: | Dòng 49: | ||
local link = '' |
local link = '' |
||
if IconData["Factions"][iconname] == nil then |
if IconData["Factions"][iconname] == nil then |
||
− | return iconname |
+ | return '[['..iconname..']]' |
else |
else |
||
link = IconData["Factions"][iconname]["link"] |
link = IconData["Factions"][iconname]["link"] |
||
Dòng 56: | Dòng 61: | ||
end |
end |
||
if (textexist == 'text' or textexist == 'Text') then |
if (textexist == 'text' or textexist == 'Text') then |
||
− | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] |
+ | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']][['..link..']]' |
end |
end |
||
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
||
Dòng 69: | Dòng 74: | ||
local link = '' |
local link = '' |
||
if IconData["Syndicates"][iconname] == nil then |
if IconData["Syndicates"][iconname] == nil then |
||
− | return " |
+ | return "" |
else |
else |
||
link = IconData["Syndicates"][iconname]["link"] |
link = IconData["Syndicates"][iconname]["link"] |
||
Dòng 81: | Dòng 86: | ||
end |
end |
||
if (textexist == 'text' or textexist == 'Text') then |
if (textexist == 'text' or textexist == 'Text') then |
||
− | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] |
+ | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']][['..link..']]' |
end |
end |
||
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
||
Dòng 87: | Dòng 92: | ||
end |
end |
||
− | function p.Prime( frame ) |
+ | function p.Prime( frame ) |
− | + | local primename_input = frame.args[1] |
|
− | + | local partname_input = frame.args[2] |
|
− | + | local imagesize_input = frame.args.imgsize |
|
+ | return p._Prime(primename_input,partname_input,imagesize_input) |
||
⚫ | |||
+ | end |
||
⚫ | |||
+ | |||
⚫ | |||
+ | function p._Prime( primename, partname, imagesize ) |
||
⚫ | |||
+ | local primename = string.gsub(" "..string.lower( primename ), "%W%l", string.upper):sub(2) |
||
+ | local link = '' |
||
⚫ | |||
⚫ | |||
+ | else |
||
link = IconData["Primes"][primename]["link"] |
link = IconData["Primes"][primename]["link"] |
||
iconname = IconData["Primes"][primename]["icon"] |
iconname = IconData["Primes"][primename]["icon"] |
||
Dòng 100: | Dòng 110: | ||
imagesize = 'x32' |
imagesize = 'x32' |
||
end |
end |
||
− | if partname ~= nil then |
+ | if partname ~= nil then |
− | + | partname = string.gsub(" "..string.lower( partname ), "%W%l", string.upper):sub(2) |
|
+ | if primename == "Forma" then |
||
⚫ | |||
+ | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'#Acquisition|'..primename.." "..partname..']]' |
||
⚫ | |||
+ | else |
||
⚫ | |||
⚫ | |||
+ | end |
||
+ | end |
||
+ | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
||
end |
end |
||
end |
end |
||
Dòng 122: | Dòng 136: | ||
end |
end |
||
if (textexist == 'text' or textexist == 'Text') then |
if (textexist == 'text' or textexist == 'Text') then |
||
− | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] |
+ | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'|'..frame.args[1]..']]' |
end |
end |
||
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
||
Dòng 130: | Dòng 144: | ||
function p.Proc( frame ) |
function p.Proc( frame ) |
||
local iconname = frame.args[1] |
local iconname = frame.args[1] |
||
− | + | local textexist = frame.args[2] |
|
local color = frame.args[3] |
local color = frame.args[3] |
||
local imagesize = frame.args.imgsize |
local imagesize = frame.args.imgsize |
||
Dòng 149: | Dòng 163: | ||
if (textexist == 'text' or textexist == 'Text') then |
if (textexist == 'text' or textexist == 'Text') then |
||
textcolor = IconData["Procs"][frame.args[1]]["color"] |
textcolor = IconData["Procs"][frame.args[1]]["color"] |
||
− | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] |
+ | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'|<span style=\"color:'..textcolor..';\">'..frame.args[1]..'</span>]]' |
end |
end |
||
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
||
end |
end |
||
end |
end |
||
+ | |||
+ | function p.Focus( frame ) |
||
+ | local iconname = frame.args[1] |
||
+ | local textexist = frame.args[2] |
||
+ | local color = frame.args[3] |
||
+ | local icontype = frame.args[4] |
||
+ | local imagesize = frame.args.imgsize |
||
+ | if IconData["Focus"][iconname] == nil then |
||
+ | return "<span style=\"color:red;\">Invalid</span>" |
||
+ | else |
||
+ | if icontype == 'seal' then |
||
+ | if color == 'white' then |
||
+ | iconname = IconData["Focus"][iconname]["seal"][2] |
||
+ | else |
||
+ | iconname = IconData["Focus"][iconname]["seal"][1] |
||
+ | end |
||
⚫ | |||
+ | if color == 'white' then |
||
+ | iconname = IconData["Focus"][iconname]["icon"][2] |
||
+ | else |
||
+ | iconname = IconData["Focus"][iconname]["icon"][1] |
||
+ | end |
||
+ | end |
||
+ | if (imagesize == nil or imagesize == '') then |
||
+ | imagesize = 'x20' |
||
⚫ | |||
+ | if (textexist == 'text' or textexist == 'Text') then |
||
+ | textcolor = IconData["Focus"][frame.args[1]]["color"] |
||
+ | return '[[File:'..iconname..'|'..imagesize..'px|sub|link=Focus]][[Focus|'..frame.args[1]..']]' |
||
+ | end |
||
+ | return '[[File:'..iconname..'|'..imagesize..'px|link=Focus]]' |
||
+ | end |
||
+ | end |
||
+ | |||
+ | function p.Way( frame ) |
||
+ | local iconname = frame.args[1] |
||
+ | local imagesize = frame.args.imgsize |
||
⚫ | |||
+ | if IconData["Ways"][iconname] == nil then |
||
+ | return "<span style=\"color:red;\">Missing<br>Icon</span>" |
||
+ | else |
||
+ | iconname = IconData["Ways"][iconname] |
||
+ | end |
||
+ | if (imagesize == nil or imagesize == '') then |
||
+ | imagesize = 'x18' |
||
+ | end |
||
+ | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]' |
||
+ | end |
||
+ | |||
+ | |||
+ | function p.HUD( frame ) |
||
+ | local iconname = frame.args[1] |
||
+ | local textexist = frame.args[2] |
||
+ | local color = frame.args[3] |
||
+ | local imagesize = frame.args.imgsize |
||
+ | local link = '' |
||
+ | if IconData["Heads-Up Display"][iconname] == nil then |
||
+ | return '[['..iconname..']]' |
||
+ | else |
||
+ | link = IconData["Heads-Up Display"][iconname]["link"] |
||
+ | if color == 'white' then |
||
+ | iconname = IconData["Heads-Up Display"][iconname]["icon"][2] --white icon |
||
+ | else |
||
+ | iconname = IconData["Heads-Up Display"][iconname]["icon"][1] --black icon |
||
+ | end |
||
+ | if (imagesize == nil or imagesize == '') then |
||
+ | imagesize = 'x20' |
||
+ | end |
||
+ | if (textexist == 'text' or textexist == 'Text') then |
||
+ | return '[[File:'..iconname..'|'..imagesize..'px|link=Heads-Up Display]][[Heads-Up Display|'..link..']]' |
||
+ | end |
||
+ | return '[[File:'..iconname..'|'..imagesize..'px|link=Heads-Up Display]]' |
||
+ | end |
||
+ | end |
||
+ | |||
function p.Flag( frame ) |
function p.Flag( frame ) |
||
local iconname = frame.args[1] |
local iconname = frame.args[1] |
||
− | local |
+ | local tooltip = frame.args[2] |
− | local dest = frame.args[3] |
+ | local dest = frame.args[3] |
+ | local textexist = frame.args[4] |
||
if IconData["Flags"][iconname] == nil then |
if IconData["Flags"][iconname] == nil then |
||
return "<span style=\"color:red;\">Invalid</span>" |
return "<span style=\"color:red;\">Invalid</span>" |
||
else |
else |
||
iconname = IconData["Flags"][iconname] |
iconname = IconData["Flags"][iconname] |
||
− | if |
+ | if tooltip == nil then |
− | + | tooltip = '' |
|
end |
end |
||
if dest == nil then |
if dest == nil then |
||
dest = '' |
dest = '' |
||
end |
end |
||
+ | if (textexist == 'text' or textexist == 'Text') then |
||
⚫ | |||
+ | return '[[File:'..iconname..'|'..tooltip..'|16px|link='..dest..']] [['..dest..'|'..tooltip..']]' |
||
+ | end |
||
⚫ | |||
end |
end |
||
end |
end |
||
+ | |||
+ | |||
+ | function p.Weapons( frame ) |
||
+ | local iconname = frame.args[1] |
||
+ | local textexist = frame.args[2] |
||
+ | local imagesize = frame.args.imgsize |
||
+ | local link = '' |
||
+ | if IconData["Weapons"][iconname] == nil then |
||
+ | return "" |
||
+ | else |
||
+ | link = IconData["Weapons"][iconname]["link"] |
||
+ | iconname = IconData["Weapons"][iconname]["icon"] |
||
+ | if (imagesize == nil or imagesize == '') then |
||
+ | imagesize = 'x32' |
||
+ | end |
||
+ | if (textexist == 'text' or textexist == 'Text') then |
||
+ | return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'|'..frame.args[1]..']]' |
||
+ | end |
||
⚫ | |||
+ | end |
||
+ | end |
||
+ | |||
+ | |||
return p |
return p |
Bản mới nhất lúc 14:06, ngày 10 tháng 1 năm 2017
Có thể viết tài liệu về mô đun này tại Mô đun:Icon/tài liệu.
--WARFRAME Wiki Icon Module
--http://warframe.wikia.com/
--Written by User:ChickenBar
local p = {}
local IconData = mw.loadData( 'Module:Icon/data' )
function p.Item(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
local link = ''
if IconData["Items"][iconname] == nil then
return "<span style=\"color:red;\">Invalid</span>"
else
link = IconData["Items"][iconname]["link"]
iconname = IconData["Items"][iconname]["icon"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x26'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'|'..frame.args[1]..']]'
end
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]'
end
end
function p.Pol( frame )
local iconname = frame.args[1]
local imagesize = frame.args.imgsize
if IconData["Polarities"][iconname] == nil then
return "<span style=\"color:red;\">Invalid</span>"
else
iconname = IconData["Polarities"][iconname]
if (imagesize == nil or imagesize == '') then
imagesize = 'x20'
end
return '[[File:'..iconname..'|'..imagesize..'px|link=Polarity]]'
end
end
function p.Faction( frame )
local iconname = frame.args[1]
local textexist = frame.args[2]
local color = frame.args[3]
local imagesize = frame.args.imgsize
local link = ''
if IconData["Factions"][iconname] == nil then
return '[['..iconname..']]'
else
link = IconData["Factions"][iconname]["link"]
if color == 'white' then
iconname = IconData["Factions"][iconname]["icon"][2] --white icon
else
iconname = IconData["Factions"][iconname]["icon"][1] --black icon
end
if (imagesize == nil or imagesize == '') then
imagesize = 'x20'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']][['..link..']]'
end
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]'
end
end
function p.Syndicate( frame )
local iconname = frame.args[1]
local textexist = frame.args[2]
local color = frame.args[3]
local imagesize = frame.args.imgsize
local link = ''
if IconData["Syndicates"][iconname] == nil then
return ""
else
link = IconData["Syndicates"][iconname]["link"]
if color == 'white' then
iconname = IconData["Syndicates"][iconname]["icon"][2] --white icon
else
iconname = IconData["Syndicates"][iconname]["icon"][1] --black icon
end
if (imagesize == nil or imagesize == '') then
imagesize = 'x32'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']][['..link..']]'
end
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]'
end
end
function p.Prime( frame )
local primename_input = frame.args[1]
local partname_input = frame.args[2]
local imagesize_input = frame.args.imgsize
return p._Prime(primename_input,partname_input,imagesize_input)
end
function p._Prime( primename, partname, imagesize )
local primename = string.gsub(" "..string.lower( primename ), "%W%l", string.upper):sub(2)
local link = ''
if IconData["Primes"][primename] == nil then
return "Unconfirmed Item"
else
link = IconData["Primes"][primename]["link"]
iconname = IconData["Primes"][primename]["icon"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x32'
end
if partname ~= nil then
partname = string.gsub(" "..string.lower( partname ), "%W%l", string.upper):sub(2)
if primename == "Forma" then
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'#Acquisition|'..primename.." "..partname..']]'
else
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'#Acquisition|'..primename..' Prime '..partname..']]'
end
end
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]'
end
end
function p.Resource( frame )
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
local link = ''
if IconData["Resources"][iconname] == nil then
return ""
else
link = IconData["Resources"][iconname]["link"]
iconname = IconData["Resources"][iconname]["icon"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x32'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'|'..frame.args[1]..']]'
end
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]'
end
end
function p.Proc( frame )
local iconname = frame.args[1]
local textexist = frame.args[2]
local color = frame.args[3]
local imagesize = frame.args.imgsize
local link = ''
local textcolor = ''
if IconData["Procs"][iconname] == nil then
return "<span style=\"color:red;\">Invalid</span>"
else
link = IconData["Procs"][iconname]["link"]
if color == 'white' then
iconname = IconData["Procs"][iconname]["icon"][2] --white icon
else
iconname = IconData["Procs"][iconname]["icon"][1] --black icon
end
if (imagesize == nil or imagesize == '') then
imagesize = 'x18'
end
if (textexist == 'text' or textexist == 'Text') then
textcolor = IconData["Procs"][frame.args[1]]["color"]
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'|<span style=\"color:'..textcolor..';\">'..frame.args[1]..'</span>]]'
end
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]'
end
end
function p.Focus( frame )
local iconname = frame.args[1]
local textexist = frame.args[2]
local color = frame.args[3]
local icontype = frame.args[4]
local imagesize = frame.args.imgsize
if IconData["Focus"][iconname] == nil then
return "<span style=\"color:red;\">Invalid</span>"
else
if icontype == 'seal' then
if color == 'white' then
iconname = IconData["Focus"][iconname]["seal"][2]
else
iconname = IconData["Focus"][iconname]["seal"][1]
end
else
if color == 'white' then
iconname = IconData["Focus"][iconname]["icon"][2]
else
iconname = IconData["Focus"][iconname]["icon"][1]
end
end
if (imagesize == nil or imagesize == '') then
imagesize = 'x20'
end
if (textexist == 'text' or textexist == 'Text') then
textcolor = IconData["Focus"][frame.args[1]]["color"]
return '[[File:'..iconname..'|'..imagesize..'px|sub|link=Focus]][[Focus|'..frame.args[1]..']]'
end
return '[[File:'..iconname..'|'..imagesize..'px|link=Focus]]'
end
end
function p.Way( frame )
local iconname = frame.args[1]
local imagesize = frame.args.imgsize
local link = ''
if IconData["Ways"][iconname] == nil then
return "<span style=\"color:red;\">Missing<br>Icon</span>"
else
iconname = IconData["Ways"][iconname]
end
if (imagesize == nil or imagesize == '') then
imagesize = 'x18'
end
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]'
end
function p.HUD( frame )
local iconname = frame.args[1]
local textexist = frame.args[2]
local color = frame.args[3]
local imagesize = frame.args.imgsize
local link = ''
if IconData["Heads-Up Display"][iconname] == nil then
return '[['..iconname..']]'
else
link = IconData["Heads-Up Display"][iconname]["link"]
if color == 'white' then
iconname = IconData["Heads-Up Display"][iconname]["icon"][2] --white icon
else
iconname = IconData["Heads-Up Display"][iconname]["icon"][1] --black icon
end
if (imagesize == nil or imagesize == '') then
imagesize = 'x20'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:'..iconname..'|'..imagesize..'px|link=Heads-Up Display]][[Heads-Up Display|'..link..']]'
end
return '[[File:'..iconname..'|'..imagesize..'px|link=Heads-Up Display]]'
end
end
function p.Flag( frame )
local iconname = frame.args[1]
local tooltip = frame.args[2]
local dest = frame.args[3]
local textexist = frame.args[4]
if IconData["Flags"][iconname] == nil then
return "<span style=\"color:red;\">Invalid</span>"
else
iconname = IconData["Flags"][iconname]
if tooltip == nil then
tooltip = ''
end
if dest == nil then
dest = ''
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:'..iconname..'|'..tooltip..'|16px|link='..dest..']] [['..dest..'|'..tooltip..']]'
end
return '[[File:'..iconname..'|'..tooltip..'|16px|link='..dest..']]'
end
end
function p.Weapons( frame )
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
local link = ''
if IconData["Weapons"][iconname] == nil then
return ""
else
link = IconData["Weapons"][iconname]["link"]
iconname = IconData["Weapons"][iconname]["icon"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x32'
end
if (textexist == 'text' or textexist == 'Text') then
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']] [['..link..'|'..frame.args[1]..']]'
end
return '[[File:'..iconname..'|'..imagesize..'px|link='..link..']]'
end
end
return p