Skip to content

Commit

Permalink
Fixed a bug in image loading priorities.
Browse files Browse the repository at this point in the history
Multi-image default images were being loaded with higher priority than single-image skin images.

Signed-off-by: Jeffrey Han <[email protected]>
  • Loading branch information
itdelatrisu committed Jan 8, 2017
1 parent 1d0f0b8 commit cf53c3d
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/itdelatrisu/opsu/GameImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cf53c3d

Please sign in to comment.