attempt to load normal image if there's no array (load sliderb if there's no sliderb0, sliderb1 etc)

This commit is contained in:
yugecin 2016-09-30 21:11:03 +02:00
parent 08d9f4165a
commit 39b24b5f1c

View File

@ -746,6 +746,21 @@ public enum GameImage {
break; break;
} }
} }
if (list.isEmpty()) {
// look for image without 0-1 etc
String name = getImageFileName(filename, dir, type, true);
if (name != null) {
try {
Image img = new Image(name);
if (suffix.equals(HD_SUFFIX))
img = img.getScaledCopy(0.5f);
list.add(img);
} catch (SlickException e) {
ErrorHandler.error(String.format("Failed to set image '%s'.", name), null, false);
break;
}
}
}
if (!list.isEmpty()) if (!list.isEmpty())
return list.toArray(new Image[list.size()]); return list.toArray(new Image[list.size()]);
} }