diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index 5947ebfb..b2a065ca 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -132,7 +132,7 @@ public class GameData { return menuImage; Image img = getSmallImage(); - if (!small.hasSkinImage()) // save default image only + if (!small.hasBeatmapSkinImage()) // save default image only this.menuImage = img; return img; } @@ -408,8 +408,8 @@ public class GameData { // gameplay-specific images if (isGameplay()) { // combo burst images - if (GameImage.COMBO_BURST.hasSkinImages() || - (!GameImage.COMBO_BURST.hasSkinImage() && GameImage.COMBO_BURST.getImages() != null)) + if (GameImage.COMBO_BURST.hasBeatmapSkinImages() || + (!GameImage.COMBO_BURST.hasBeatmapSkinImage() && GameImage.COMBO_BURST.getImages() != null)) comboBurstImages = GameImage.COMBO_BURST.getImages(); else comboBurstImages = new Image[]{ GameImage.COMBO_BURST.getImage() }; diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index 8d0dda19..1789636d 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -37,8 +37,8 @@ public enum GameImage { CURSOR ("cursor", "png"), CURSOR_MIDDLE ("cursormiddle", "png"), CURSOR_TRAIL ("cursortrail", "png"), - CURSOR_OLD ("cursor2", "png", false, false), - CURSOR_TRAIL_OLD ("cursortrail2", "png", false, false), + CURSOR_OLD ("cursor2", "png", false, false), // custom + CURSOR_TRAIL_OLD ("cursortrail2", "png", false, false), // custom // Game SECTION_PASS ("section-pass", "png"), @@ -496,7 +496,7 @@ public enum GameImage { } /** - * Constructor for game-related images (skinnable and preloaded). + * Constructor for game-related images (beatmap-skinnable and preloaded). * @param filename the image file name * @param type the file types (separated by '|') */ @@ -505,7 +505,7 @@ public enum GameImage { } /** - * Constructor for an array of game-related images (skinnable and preloaded). + * Constructor for an array of game-related images (beatmap-skinnable and preloaded). * @param filename the image file name * @param filenameFormat the formatted file name string (for loading multiple images) * @param type the file types (separated by '|') @@ -519,7 +519,7 @@ public enum GameImage { * Constructor for general images. * @param filename the image file name * @param type the file types (separated by '|') - * @param skinnable whether or not the image is skinnable + * @param skinnable whether or not the image is beatmap-skinnable * @param preload whether or not to preload the image */ GameImage(String filename, String type, boolean skinnable, boolean preload) { @@ -530,10 +530,10 @@ public enum GameImage { } /** - * Returns whether or not the image is skinnable. + * Returns whether or not the image is beatmap-skinnable. * @return true if skinnable */ - public boolean isSkinnable() { return skinnable; } + public boolean isBeatmapSkinnable() { return skinnable; } /** * Returns whether or not to preload the image when the program starts. @@ -543,7 +543,7 @@ public enum GameImage { /** * Returns the image associated with this resource. - * The skin image takes priority over the default image. + * The beatmap skin image takes priority over the default image. */ public Image getImage() { setDefaultImage(); @@ -564,7 +564,7 @@ public enum GameImage { /** * Returns the image array associated with this resource. - * The skin images takes priority over the default images. + * The beatmap skin images takes priority over the default images. */ public Image[] getImages() { setDefaultImage(); @@ -573,7 +573,7 @@ public enum GameImage { /** * Sets the image associated with this resource to another image. - * The skin image takes priority over the default image. + * The beatmap skin image takes priority over the default image. * @param img the image to set */ public void setImage(Image img) { @@ -585,7 +585,7 @@ public enum GameImage { /** * Sets an image associated with this resource to another image. - * The skin image takes priority over the default image. + * The beatmap skin image takes priority over the default image. * @param img the image to set * @param index the index in the image array */ @@ -628,17 +628,17 @@ public enum GameImage { } /** - * Sets the associated skin image. + * Sets the associated beatmap skin image. * If the path does not contain the image, the default image is used. * @param dir the image directory to search * @return true if a new skin image is loaded, false otherwise */ - public boolean setSkinImage(File dir) { + public boolean setBeatmapSkinImage(File dir) { if (dir == null) return false; // destroy the existing images, if any - destroySkinImage(); + destroyBeatmapSkinImage(); // beatmap skins disabled if (Options.isBeatmapSkinIgnored()) @@ -717,21 +717,21 @@ public enum GameImage { } /** - * Returns whether a skin image is currently loaded. - * @return true if skin image exists + * Returns whether a beatmap skin image is currently loaded. + * @return true if a beatmap skin image exists */ - public boolean hasSkinImage() { return (skinImage != null && !skinImage.isDestroyed()); } + public boolean hasBeatmapSkinImage() { return (skinImage != null && !skinImage.isDestroyed()); } /** - * Returns whether skin images are currently loaded. - * @return true if any skin image exists + * Returns whether beatmap skin images are currently loaded. + * @return true if any beatmap skin image exists */ - public boolean hasSkinImages() { return (skinImages != null); } + public boolean hasBeatmapSkinImages() { return (skinImages != null); } /** - * Destroys the associated skin image(s), if any. + * Destroys the associated beatmap skin image(s), if any. */ - public void destroySkinImage() { + public void destroyBeatmapSkinImage() { if (skinImage == null && skinImages == null) return; try { @@ -748,7 +748,7 @@ public enum GameImage { skinImages = null; } } catch (SlickException e) { - ErrorHandler.error(String.format("Failed to destroy skin images for '%s'.", this.name()), e, true); + ErrorHandler.error(String.format("Failed to destroy beatmap skin images for '%s'.", this.name()), e, true); } } diff --git a/src/itdelatrisu/opsu/Opsu.java b/src/itdelatrisu/opsu/Opsu.java index b97166ea..49cf9f45 100644 --- a/src/itdelatrisu/opsu/Opsu.java +++ b/src/itdelatrisu/opsu/Opsu.java @@ -210,7 +210,7 @@ public class Opsu extends StateBasedGame { } else songMenu.resetTrackOnLoad(); } - if (UI.getCursor().isSkinned()) + if (UI.getCursor().isBeatmapSkinned()) UI.getCursor().reset(); songMenu.resetGameDataOnLoad(); this.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black)); diff --git a/src/itdelatrisu/opsu/Utils.java b/src/itdelatrisu/opsu/Utils.java index 6126dcc0..b5e811c4 100644 --- a/src/itdelatrisu/opsu/Utils.java +++ b/src/itdelatrisu/opsu/Utils.java @@ -427,7 +427,7 @@ public class Utils { if (str.length() != 0) list.add(str); return list; - } + } /** * Returns a the contents of a URL as a string. diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 65f513f5..160f74aa 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -128,8 +128,8 @@ public class Slider implements GameObject { followRadius = diameter / 2 * 3f; // slider ball - if (GameImage.SLIDER_BALL.hasSkinImages() || - (!GameImage.SLIDER_BALL.hasSkinImage() && GameImage.SLIDER_BALL.getImages() != null)) + if (GameImage.SLIDER_BALL.hasBeatmapSkinImages() || + (!GameImage.SLIDER_BALL.hasBeatmapSkinImage() && GameImage.SLIDER_BALL.getImages() != null)) sliderBallImages = GameImage.SLIDER_BALL.getImages(); else sliderBallImages = new Image[]{ GameImage.SLIDER_BALL.getImage() }; diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 5d44d7a2..985406f4 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -1424,9 +1424,9 @@ public class Game extends BasicGameState { // set images File parent = beatmap.getFile().getParentFile(); for (GameImage img : GameImage.values()) { - if (img.isSkinnable()) { + if (img.isBeatmapSkinnable()) { img.setDefaultImage(); - img.setSkinImage(parent); + img.setBeatmapSkinImage(parent); } } diff --git a/src/itdelatrisu/opsu/states/GamePauseMenu.java b/src/itdelatrisu/opsu/states/GamePauseMenu.java index 84d61535..35f943f8 100644 --- a/src/itdelatrisu/opsu/states/GamePauseMenu.java +++ b/src/itdelatrisu/opsu/states/GamePauseMenu.java @@ -87,10 +87,10 @@ public class GamePauseMenu extends BasicGameState { // don't draw default background if button skinned and background unskinned boolean buttonsSkinned = - GameImage.PAUSE_CONTINUE.hasSkinImage() || - GameImage.PAUSE_RETRY.hasSkinImage() || - GameImage.PAUSE_BACK.hasSkinImage(); - if (!buttonsSkinned || bg.hasSkinImage()) + GameImage.PAUSE_CONTINUE.hasBeatmapSkinImage() || + GameImage.PAUSE_RETRY.hasBeatmapSkinImage() || + GameImage.PAUSE_BACK.hasBeatmapSkinImage(); + if (!buttonsSkinned || bg.hasBeatmapSkinImage()) bg.getImage().draw(); else g.setBackground(Color.black); @@ -134,7 +134,7 @@ public class GamePauseMenu extends BasicGameState { SoundController.playSound(SoundEffect.MENUBACK); ((SongMenu) game.getState(Opsu.STATE_SONGMENU)).resetGameDataOnLoad(); MusicController.playAt(MusicController.getBeatmap().previewTime, true); - if (UI.getCursor().isSkinned()) + if (UI.getCursor().isBeatmapSkinned()) UI.getCursor().reset(); game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black)); } else { @@ -188,7 +188,7 @@ public class GamePauseMenu extends BasicGameState { MusicController.playAt(MusicController.getBeatmap().previewTime, true); else MusicController.resume(); - if (UI.getCursor().isSkinned()) + if (UI.getCursor().isBeatmapSkinned()) UI.getCursor().reset(); game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black)); } diff --git a/src/itdelatrisu/opsu/states/GameRanking.java b/src/itdelatrisu/opsu/states/GameRanking.java index b449763d..8a9c9d18 100644 --- a/src/itdelatrisu/opsu/states/GameRanking.java +++ b/src/itdelatrisu/opsu/states/GameRanking.java @@ -247,7 +247,7 @@ public class GameRanking extends BasicGameState { if (data.isGameplay()) songMenu.resetTrackOnLoad(); songMenu.resetGameDataOnLoad(); - if (UI.getCursor().isSkinned()) + if (UI.getCursor().isBeatmapSkinned()) UI.getCursor().reset(); game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black)); } diff --git a/src/itdelatrisu/opsu/states/SongMenu.java b/src/itdelatrisu/opsu/states/SongMenu.java index 2fd00018..be7ea09b 100644 --- a/src/itdelatrisu/opsu/states/SongMenu.java +++ b/src/itdelatrisu/opsu/states/SongMenu.java @@ -1006,8 +1006,8 @@ public class SongMenu extends BasicGameState { // destroy skin images, if any for (GameImage img : GameImage.values()) { - if (img.isSkinnable()) - img.destroySkinImage(); + if (img.isBeatmapSkinnable()) + img.destroyBeatmapSkinImage(); } // reload scores @@ -1333,7 +1333,7 @@ public class SongMenu extends BasicGameState { if (fullReload) { // clear the beatmap cache BeatmapDB.clearDatabase(); - + // invoke unpacker OszUnpacker.unpackAllFiles(Options.getOSZDir(), beatmapDir); } diff --git a/src/itdelatrisu/opsu/ui/Cursor.java b/src/itdelatrisu/opsu/ui/Cursor.java index e9eea817..cc9149a3 100644 --- a/src/itdelatrisu/opsu/ui/Cursor.java +++ b/src/itdelatrisu/opsu/ui/Cursor.java @@ -107,11 +107,11 @@ public class Cursor { public void draw(int mouseX, int mouseY, boolean mousePressed) { // determine correct cursor image Image cursor = null, cursorMiddle = null, cursorTrail = null; - boolean skinned = GameImage.CURSOR.hasSkinImage(); + boolean skinned = GameImage.CURSOR.hasBeatmapSkinImage(); boolean newStyle, hasMiddle; if (skinned) { newStyle = true; // osu! currently treats all beatmap cursors as new-style cursors - hasMiddle = GameImage.CURSOR_MIDDLE.hasSkinImage(); + hasMiddle = GameImage.CURSOR_MIDDLE.hasBeatmapSkinImage(); } else newStyle = hasMiddle = Options.isNewCursorEnabled(); if (skinned || newStyle) { @@ -253,13 +253,13 @@ public class Cursor { } /** - * Resets all cursor data and skins. + * Resets all cursor data and beatmap skins. */ public void reset() { // destroy skin images - GameImage.CURSOR.destroySkinImage(); - GameImage.CURSOR_MIDDLE.destroySkinImage(); - GameImage.CURSOR_TRAIL.destroySkinImage(); + GameImage.CURSOR.destroyBeatmapSkinImage(); + GameImage.CURSOR_MIDDLE.destroyBeatmapSkinImage(); + GameImage.CURSOR_TRAIL.destroyBeatmapSkinImage(); // reset locations resetLocations(); @@ -282,10 +282,10 @@ public class Cursor { /** * Returns whether or not the cursor is skinned. */ - public boolean isSkinned() { - return (GameImage.CURSOR.hasSkinImage() || - GameImage.CURSOR_MIDDLE.hasSkinImage() || - GameImage.CURSOR_TRAIL.hasSkinImage()); + public boolean isBeatmapSkinned() { + return (GameImage.CURSOR.hasBeatmapSkinImage() || + GameImage.CURSOR_MIDDLE.hasBeatmapSkinImage() || + GameImage.CURSOR_TRAIL.hasBeatmapSkinImage()); } /**