Keine Bearbeitungszusammenfassung |
K (1 Version importiert: 123) |
(kein Unterschied)
|
Aktuelle Version vom 21. Januar 2019, 16:39 Uhr
Die Dokumentation für dieses Modul kann unter Modul:Icon/Doku erstellt werden
--WARFRAME Wiki Icon Module
--http://warframe.wikia.com/
--Written by User:ChickenBar
local p = {}
local IconData = mw.loadData( 'Modul:Icon/data' )
-- Normale Icons, Größe 25px (höhe)
function p.Item(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
return p._Item(iconname, textexist, imagesize)
end
function p._Item(iconname, textexist, imagesize)
local link = ''
if IconData["Items"][iconname] == nil then
return "<span style=\"color:red;\">"..iconname.." Ungültig</span>"
else
link = IconData["Items"][iconname]["link"]
title = IconData["Items"][iconname]["title"]
iconname = IconData["Items"][iconname]["icon"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x25'
end
local imgText = '[[Datei:'..iconname..'|'..imagesize..'px'
if(link ~= nil) then
imgText = imgText..'|link='..link
elseif(title~=nil) then
imgText = imgText..'|'..title
end
imgText = imgText..']]'
if (textexist == 'text' or textexist == 'Text') then
if (link ~= nil) then
return imgText..' [['..link..']]'
elseif (title ~= nil) then
return imgText..' '..title
else
return imgText
end
end
return imgText
end
end
-- Icons für Tabellen (Setbilder mit Link), Größe 75px (höhe)
function p.BiPi(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local imagesize = frame.args.imgsize
return p._BiPi(iconname, textexist, imagesize)
end
function p._BiPi(iconname, textexist, imagesize)
--local iconname = string.gsub(" "..string.lower( iconname ), "%W%l", string.upper):sub(2)
local link = ''
if IconData["BigPics"][iconname] == nil then
return "<span style=\"color:red;\">"..iconname.." Ungültig</span>"
else
link = IconData["BigPics"][iconname]["link"]
title = IconData["BigPics"][iconname]["title"]
iconname = IconData["BigPics"][iconname]["icon"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x75'
end
local imgText = '[[Datei:'..iconname..'|'..imagesize..'px'
if(link ~= nil) then
imgText = imgText..'|link='..link
elseif(title~=nil) then
imgText = imgText..'|'..title
end
imgText = imgText..']]'
if (textexist == 'text' or textexist == 'Text') then
if (link ~= nil) then
return imgText..' [['..link..']]'
elseif (title ~= nil) then
return imgText..' '..title
else
return imgText
end
end
return imgText
end
end
-- Icons für Verweise und Quellenangaben, Größe 25px (höhe)
function p.Verw(frame)
local iconname = frame.args[1]
local textexist = frame.args[2]
local name = frame.args[3]
local imagesize = frame.args.imgsize
return p._Verw(iconname, textexist, name, imagesize)
end
function p._Verw(iconname, textexist, name, imagesize)
--local iconname = string.gsub(" "..string.lower( iconname ), "%W%l", string.upper):sub(2)
local link = ''
if IconData["Verw"][iconname] == nil then
return "<span style=\"color:red;\">"..iconname.." Ungültig</span>"
else
link = IconData["Verw"][iconname]["link"]
title = IconData["Verw"][iconname]["title"]
name = IconData["Verw"][iconname]["name"]
iconname = IconData["Verw"][iconname]["icon"]
if (imagesize == nil or imagesize == '') then
imagesize = 'x25'
end
local imgText = '[[Datei:'..iconname..'|'..imagesize..'px'
if(link ~= nil) then
imgText = imgText..'|link='..link
elseif(title~=nil) then
imgText = imgText..'|'..title
elseif(name~=nil) then
imgText = imgText..'|'..name
end
imgText = imgText..']]'
if (textexist == 'text' or textexist == 'Text') then
if (link ~= nil) then
return imgText..' '..link..' '
elseif (title ~= nil) then
return imgText..' '..title
else
return imgText
end
end
return imgText
end
end
function p.Test2(par1, par2)
spans = tooltipSpan(par1, par2)
return spans[1]..spans[2]
end
function p.Test(frame)
return p._Proc(frame.args[1])
end
return p