Add mod icons by link

This commit is contained in:
Danielv123 committed 2017-03-16 17:55:15 +01:00
1 parent e156864ccd
commit bd5956c9ed
3 files changed
+8 -1

No files matched your search

+5
View File
@@ -98,3 +98,8 @@ var imagedata = {
["accumulator"]: "Basic-accumulator",
["beacon"]: "Basic-beacon",
}
// value:link pairs where you can add modded item icons that are missing
var imagelinks = {
"fictional-modded-item": "/pictures/fictional-modded-item.png"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+3 -1
View File
@@ -4,8 +4,10 @@ function drawcontents(data) {
result = "<table>";
for(i = 0;i < data.length; i++) {
var img = "";
if(imagedata[data[i].name]){
if(imagedata[data[i].name]) {
img = "https://wiki.factorio.com/images/" + imagedata[data[i].name] + ".png"
} else if(imagelinks[data[i].name]) {
img = imagelinks[data[i].name];
} else {
img = "https://wiki.factorio.com/images/" + capitalizeFirstLetter(data[i].name) + ".png";
}