From cf53c3d46f7650af6db8938f506e6ad10e1e074f Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Sun, 8 Jan 2017 01:31:34 -0500 Subject: [PATCH] Fixed a bug in image loading priorities. Multi-image default images were being loaded with higher priority than single-image skin images. Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/GameImage.java | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index a2f2e2ee..2899824c 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -622,28 +622,22 @@ public void setDefaultImage() { if (defaultImage != null || defaultImages != null || Options.getSkin() == null) return; - // try to load multiple images + // check for multiple images first, then single images + + // try to load from skin directory File skinDir = Options.getSkin().getDirectory(); - if (filenameFormat != null) { - if (skinDir != null && ((defaultImages = loadImageArray(skinDir)) != null)) { + if (skinDir != null) { + if ((filenameFormat != null && (defaultImages = loadImageArray(skinDir)) != null) || + (defaultImage = loadImageSingle(skinDir)) != null) { isSkinned = true; process(); return; } - 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) { + // try to load default image + if ((filenameFormat != null && (defaultImages = loadImageArray(null)) != null) || + (defaultImage = loadImageSingle(null)) != null) { isSkinned = false; process(); return;