Bearbeiten von „Modul:Infobox Animal“
Aus Eco - Deutsches Wiki
Die Bearbeitung kann rückgängig gemacht werden. Bitte prüfe den Vergleich unten, um sicherzustellen, dass du dies tun möchtest, und veröffentliche dann unten deine Änderungen, um die Bearbeitung rückgängig zu machen.
Aktuelle Version | Dein Text | ||
Zeile 27: | Zeile 27: | ||
local animal = args.name | local animal = args.name | ||
local animalTable = animalData.animals[animal] | local animalTable = animalData.animals[animal] | ||
--Check Passes | --Check Passes | ||
if animalTable == nil then | if animalTable == nil then | ||
return animal .. ' could not be found in Module:AnimalData.' | return animal .. ' could not be found in Module:AnimalData.' | ||
end | end | ||
-- string used to build the infobox | -- string used to build the infobox | ||
Zeile 45: | Zeile 41: | ||
infobox = infobox .. '|- style=\"text-align: center; color: white; background-color: ' | infobox = infobox .. '|- style=\"text-align: center; color: white; background-color: ' | ||
if animalTable.isSwimming == 'Schwimmen' then | if animalTable.isSwimming == 'Schwimmen' then | ||
infobox = infobox .. '#65a9e6;\"\n| colspan=\"2\" | \'\'\'Wassertier\'\'\' | infobox = infobox .. '#65a9e6;\"\n| colspan=\"2\" | \'\'\'Wassertier\'\'\'\n' | ||
elseif animalTable.isFlying == 'Fliegend' then | elseif animalTable.isFlying == 'Fliegend' then | ||
infobox = infobox .. '#e3bd27;\"\n| colspan=\"2\" | \'\'\'Fliegendes Tier\'\'\' | infobox = infobox .. '#e3bd27;\"\n| colspan=\"2\" | \'\'\'Fliegendes Tier\'\'\'\n' | ||
else | else | ||
infobox = infobox .. '#11af53;\"\n| colspan=\"2\" | \'\'\'Land-Tier\'\'\' | infobox = infobox .. '#11af53;\"\n| colspan=\"2\" | \'\'\'Land-Tier\'\'\'\n' | ||
end | end | ||
-- Animals Icon Image | -- Animals Icon Image | ||
local image = 'NoImage.png|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. animalimagename .. '_Animal.png|[[Category:Pages_with_missing_animal]]' | |||
if mw.title.makeTitle('File', animalimagename .. '_Animal.png').file.exists then | local animalEN = animalTable.untranslated | ||
local animalimagename = string.gsub(animalEN, ' ', '') | |||
if mw.title.makeTitle('File', animalimagename .. '_Animal.png').file.exists then | |||
image = animalimagename .. '_Animal.png' | |||
elseif mw.title.makeTitle('File', animalimagename .. '_Animal.jpg').file.exists then | |||
image = animalimagename .. '_Animal.jpg' | |||
end | |||
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | [[File:' .. image .. '|center|border|250x250px]]\n' | infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | [[File:' .. image .. '|center|border|250x250px]]\n' |