From 39b24b5f1c308039fb58eade00d5bae87016949c Mon Sep 17 00:00:00 2001 From: yugecin Date: Fri, 30 Sep 2016 21:11:03 +0200 Subject: [PATCH] attempt to load normal image if there's no array (load sliderb if there's no sliderb0, sliderb1 etc) --- src/itdelatrisu/opsu/GameImage.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index dde6369e..ac18af23 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -746,6 +746,21 @@ public enum GameImage { 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()) return list.toArray(new Image[list.size()]); }