From a7813e1ffe6f5c1d789ffd34bc3b7af921f7ec92 Mon Sep 17 00:00:00 2001 From: yugecin Date: Thu, 2 Feb 2017 01:15:10 +0100 Subject: [PATCH] revert 39b24b5 (attempt to load normal image if there's no array (load sliderb if there's no sliderb0, sliderb1 etc)) and fix it by loading the skin image before checking if default skin has multiple images (animation) --- src/itdelatrisu/opsu/GameImage.java | 33 +++++++++-------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index a30400f7..c96ebbaa 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -678,7 +678,7 @@ public enum GameImage { if (defaultImage != null || defaultImages != null || Options.getSkin() == null) return; - // try to load multiple images + // try to load skin images File skinDir = Options.getSkin().getDirectory(); if (filenameFormat != null) { if (skinDir != null && ((defaultImages = loadImageArray(skinDir)) != null)) { @@ -686,19 +686,21 @@ public enum GameImage { process(); return; } + } + if (skinDir != null && ((defaultImage = loadImageSingle(skinDir)) != null)) { + isSkinned = true; + process(); + return; + } + + // default images + if (filenameFormat != null) { if ((defaultImages = loadImageArray(null)) != null) { isSkinned = false; process(); return; } } - - // try to load a single image - if (skinDir != null && ((defaultImage = loadImageSingle(skinDir)) != null)) { - isSkinned = true; - process(); - return; - } if ((defaultImage = loadImageSingle(null)) != null) { isSkinned = false; process(); @@ -778,21 +780,6 @@ 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) { - EventBus.instance.post(new BubbleNotificationEvent(String.format("Failed to set image '%s'.", name), BubbleNotificationEvent.COMMONCOLOR_RED)); - break; - } - } - } if (!list.isEmpty()) return list.toArray(new Image[list.size()]); }