From 0f40ff4c10f60835b2eb4c5a88dd787cd1044d6b Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Sun, 8 Jan 2017 02:38:57 -0500 Subject: [PATCH] Support more skin options; dropped option to use old cursor style. - Now supported: SliderBallFlip, CursorCentre, AnimationFramerate - Better cursor loading (only load cursor-middle from whichever directory cursor came from). - Assume new style cursors if cursor-middle is loaded. Signed-off-by: Jeffrey Han --- res/cursor2.png | Bin 6422 -> 0 bytes res/cursortrail2.png | Bin 4022 -> 0 bytes src/itdelatrisu/opsu/GameData.java | 5 +- src/itdelatrisu/opsu/GameImage.java | 19 +++++++- src/itdelatrisu/opsu/OptionGroup.java | 1 - src/itdelatrisu/opsu/Options.java | 13 ------ src/itdelatrisu/opsu/objects/Slider.java | 2 + src/itdelatrisu/opsu/skins/Skin.java | 2 +- src/itdelatrisu/opsu/states/Game.java | 2 +- src/itdelatrisu/opsu/ui/Cursor.java | 56 +++++++++++++---------- src/itdelatrisu/opsu/ui/UI.java | 2 +- 11 files changed, 56 insertions(+), 46 deletions(-) delete mode 100644 res/cursor2.png delete mode 100644 res/cursortrail2.png diff --git a/res/cursor2.png b/res/cursor2.png deleted file mode 100644 index 5fef2fd7d90a2ea9d1a7c0d7cd626adb545ae8d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6422 zcmV+x8R_PUP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu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wk2G;rQhFgqn4b<$R}Q(K5lXf zFz4lM2-I&TX;z|*6~bvkr>%^$!nVm_oeVy3S(X1BFHQMdR6)ENBgD6 zwSM^#t@Fcj>zMtkom?EzI(4tg|4h#B2H~c2{yF-^5v|xf|Nlp{KIib<`T4UCz1D+t kpE@}AOHT!!f%)G708r0+o#i_&#{d8T07*qoM6N<$f&{=S0{{R3 diff --git a/res/cursortrail2.png b/res/cursortrail2.png deleted file mode 100644 index 9b644d0a941dfa28e761431f812590864073dd07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4022 zcmV;n4@vNeP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|c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6>`Y%o`DXuQ1k1S7_iOm;0E2 zKs9R;FP?j~iJpTd?CJ>3V&s1VdIJkx3=qcAX3Nk(oCpNCt|vw4>BQ**GOp^mFDG)If0T5(Ztc4U0Cpm6~!;kW=yFQbJq<2@^} zK-vR7BmREwZ-WG|Ob!tecu~^$}IU>gXr0{`3|By{^)#fehqt%TyP$3V=KA z7G*qjvfb9@*=wTRx`E$wGY%kn={tK8fG$~*h4a<1N(nTXj<}h9IFu=BjD;!aQPf!% zvufLZ*3p#QE1Klo(Go}=hIOsU=}e<1XT>RqWkWkK{7AzCBD1RK!HhfxROhaH`w~3N z-TZupI+B}$_~PWf01Xn0Zs=L`9`6BYAa|m-FGgW{ebg|>2#j`~<@3Nh1C-q13~uu# z8?2ITC4d?E&7Mo${dJQbVDvV{sO!?!`1mZ0Ca%N5JMn_y7O^ diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index d291429e..3d4f7449 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -414,8 +414,9 @@ public void loadImages() { comboBurstImages = new Image[]{ GameImage.COMBO_BURST.getImage() }; // scorebar-colour animation - Image[] scorebar = GameImage.SCOREBAR_COLOUR.getImages(); - scorebarColour = (scorebar != null) ? new Animation(scorebar, 60) : null; + scorebarColour = null; + if (GameImage.SCOREBAR_COLOUR.getImages() != null) + scorebarColour = GameImage.SCOREBAR_COLOUR.getAnimation(); // default symbol images defaultSymbols = new Image[10]; diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index 2899824c..2a90eaa8 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -37,8 +37,6 @@ public enum GameImage { CURSOR ("cursor", "png"), CURSOR_MIDDLE ("cursormiddle", "png"), CURSOR_TRAIL ("cursortrail", "png"), - CURSOR_OLD ("cursor2", "png", false, false), // custom - CURSOR_TRAIL_OLD ("cursortrail2", "png", false, false), // custom // Game SECTION_PASS ("section-pass", "png"), @@ -565,6 +563,22 @@ public Image getImage() { return (skinImage != null) ? skinImage : defaultImage; } + /** + * Returns an Animation based on the image array. + * If no image array exists, returns the single image as an animation. + */ + public Animation getAnimation() { + Image[] images = getImages(); + if (images == null) + images = new Image[] { getImage() }; + + int fps = Options.getSkin().getAnimationFramerate(); + if (fps == -1) + fps = images.length; + + return new Animation(images, 1000 / fps); + } + /** * Returns an Animation based on the image array. * If no image array exists, returns the single image as an animation. @@ -574,6 +588,7 @@ public Animation getAnimation(int duration){ Image[] images = getImages(); if (images == null) images = new Image[] { getImage() }; + return new Animation(images, duration); } diff --git a/src/itdelatrisu/opsu/OptionGroup.java b/src/itdelatrisu/opsu/OptionGroup.java index 741d9590..3928b93c 100644 --- a/src/itdelatrisu/opsu/OptionGroup.java +++ b/src/itdelatrisu/opsu/OptionGroup.java @@ -65,7 +65,6 @@ public class OptionGroup { GameOption.DISABLE_MOUSE_WHEEL, GameOption.DISABLE_MOUSE_BUTTONS, GameOption.CURSOR_SIZE, - GameOption.NEW_CURSOR, GameOption.DISABLE_CURSOR }), new OptionGroup("Custom", new GameOption[] { diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index 9fc303ec..0cb6db99 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -479,13 +479,6 @@ public void read(String s) { val = i; } }, - NEW_CURSOR ("Enable New Cursor", "NewCursor", "Use the new cursor style (may cause higher CPU usage).", true) { - @Override - public void toggle(GameContainer container) { - super.toggle(container); - UI.getCursor().reset(); - } - }, DYNAMIC_BACKGROUND ("Enable Dynamic Backgrounds", "DynamicBackground", "The song background will be used as the main menu background.", true), LOAD_VERBOSE ("Show Detailed Loading Progress", "LoadVerbose", "Display more specific loading information in the splash screen.", false), MASTER_VOLUME ("Master Volume", "VolumeUniversal", "Global volume level.", 35, 0, 100) { @@ -1039,12 +1032,6 @@ public static void setDisplayMode(Container app) { */ public static float getCursorScale() { return GameOption.CURSOR_SIZE.getIntegerValue() / 100f; } - /** - * Returns whether or not the new cursor type is enabled. - * @return true if enabled - */ - public static boolean isNewCursorEnabled() { return GameOption.NEW_CURSOR.getBooleanValue(); } - /** * Returns whether or not the main menu background should be the current track image. * @return true if enabled diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 0a08bd05..0968f92a 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -325,6 +325,8 @@ public void draw(Graphics g, int trackPosition) { // float dis = hitObject.getPixelLength() * HitObject.getXMultiplier() * (t - (int) t); // Image sliderBallFrame = sliderBallImages[(int) (dis / (diameter * Math.PI) * 30) % sliderBallImages.length]; Image sliderBallFrame = sliderBallImages[(int) (t * sliderTime * 60 / 1000) % sliderBallImages.length]; + if (currentRepeats % 2 == 1 && Options.getSkin().isSliderBallFlipped()) + sliderBallFrame = sliderBallFrame.getFlippedCopy(true, false); float angle = (float) (Math.atan2(c2.y - c.y, c2.x - c.x) * 180 / Math.PI); sliderBallFrame.setRotation(angle); sliderBallFrame.drawCentered(c.x, c.y); diff --git a/src/itdelatrisu/opsu/skins/Skin.java b/src/itdelatrisu/opsu/skins/Skin.java index 81f36955..3e9b4e21 100644 --- a/src/itdelatrisu/opsu/skins/Skin.java +++ b/src/itdelatrisu/opsu/skins/Skin.java @@ -273,7 +273,7 @@ public Skin(File dir) { /** * Returns the frame rate of animations. - * @return the FPS, or {@code -1} (TODO) + * @return the FPS, or {@code -1} if not set */ public int getAnimationFramerate() { return animationFramerate; } diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 96631c28..3aed57de 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -1723,7 +1723,7 @@ private void loadImages() { // skip button if (GameImage.SKIP.getImages() != null) { - Animation skip = GameImage.SKIP.getAnimation(120); + Animation skip = GameImage.SKIP.getAnimation(); skipButton = new MenuButton(skip, width - skip.getWidth() / 2f, height - (skip.getHeight() / 2f)); } else { Image skip = GameImage.SKIP.getImage(); diff --git a/src/itdelatrisu/opsu/ui/Cursor.java b/src/itdelatrisu/opsu/ui/Cursor.java index 63304874..62346033 100644 --- a/src/itdelatrisu/opsu/ui/Cursor.java +++ b/src/itdelatrisu/opsu/ui/Cursor.java @@ -118,24 +118,19 @@ public void draw(int mouseX, int mouseY, boolean mousePressed) { if (Options.isCursorDisabled()) return; - // determine correct cursor image - Image cursor = null, cursorMiddle = null, cursorTrail = null; - boolean beatmapSkinned = GameImage.CURSOR.hasBeatmapSkinImage(); - boolean newStyle, hasMiddle; Skin skin = Options.getSkin(); - if (beatmapSkinned) { - newStyle = true; // osu! currently treats all beatmap cursors as new-style cursors - hasMiddle = GameImage.CURSOR_MIDDLE.hasBeatmapSkinImage(); + + // determine correct cursor image + Image cursor = GameImage.CURSOR.getImage(); + Image cursorTrail = GameImage.CURSOR_TRAIL.getImage(); + Image cursorMiddle = null; + if (GameImage.CURSOR.hasBeatmapSkinImage()) { + if (GameImage.CURSOR_MIDDLE.hasBeatmapSkinImage()) + cursorMiddle = GameImage.CURSOR_MIDDLE.getImage(); + } else if (GameImage.CURSOR.hasGameSkinImage()) { + if (GameImage.CURSOR_MIDDLE.hasGameSkinImage()) + cursorMiddle = GameImage.CURSOR_MIDDLE.getImage(); } else - newStyle = hasMiddle = Options.isNewCursorEnabled(); - if (newStyle || beatmapSkinned) { - cursor = GameImage.CURSOR.getImage(); - cursorTrail = GameImage.CURSOR_TRAIL.getImage(); - } else { - cursor = GameImage.CURSOR.hasGameSkinImage() ? GameImage.CURSOR.getImage() : GameImage.CURSOR_OLD.getImage(); - cursorTrail = GameImage.CURSOR_TRAIL.hasGameSkinImage() ? GameImage.CURSOR_TRAIL.getImage() : GameImage.CURSOR_TRAIL_OLD.getImage(); - } - if (hasMiddle) cursorMiddle = GameImage.CURSOR_MIDDLE.getImage(); // scale cursor @@ -159,7 +154,7 @@ public void draw(int mouseX, int mouseY, boolean mousePressed) { // TODO: use an image buffer int removeCount = 0; float FPSmod = Math.max(container.getFPS(), 1) / 60f; - if (newStyle) { + if (cursorMiddle != null) { // new style: add all points between cursor movements if (lastPosition == null) { lastPosition = new Point(mouseX, mouseY); @@ -187,25 +182,36 @@ public void draw(int mouseX, int mouseY, boolean mousePressed) { float t = 2f / trail.size(); int cursorTrailWidth = cursorTrail.getWidth(), cursorTrailHeight = cursorTrail.getHeight(); float cursorTrailRotation = (skin.isCursorTrailRotated()) ? cursorAngle : 0; + float offsetX = -cursorTrailWidth / 2f, offsetY = -cursorTrailHeight / 2f; + if (!skin.isCursorCentered()) + offsetX = offsetY = 0f; cursorTrail.startUse(); for (Point p : trail) { alpha += t; cursorTrail.setImageColor(1f, 1f, 1f, alpha); cursorTrail.drawEmbedded( - p.x - (cursorTrailWidth / 2f), p.y - (cursorTrailHeight / 2f), - cursorTrailWidth, cursorTrailHeight, cursorTrailRotation); + p.x + offsetX, p.y + offsetY, + cursorTrailWidth, cursorTrailHeight, cursorTrailRotation + ); } cursorTrail.drawEmbedded( - mouseX - (cursorTrailWidth / 2f), mouseY - (cursorTrailHeight / 2f), - cursorTrailWidth, cursorTrailHeight, cursorTrailRotation); + mouseX + offsetX, mouseY + offsetY, + cursorTrailWidth, cursorTrailHeight, cursorTrailRotation + ); cursorTrail.endUse(); // draw the other components - if (newStyle && skin.isCursorRotated()) + if (skin.isCursorRotated()) cursor.setRotation(cursorAngle); - cursor.drawCentered(mouseX, mouseY); - if (hasMiddle) - cursorMiddle.drawCentered(mouseX, mouseY); + if (skin.isCursorCentered()) { + cursor.drawCentered(mouseX, mouseY); + if (cursorMiddle != null) + cursorMiddle.drawCentered(mouseX, mouseY); + } else { + cursor.draw(mouseX, mouseY); + if (cursorMiddle != null) + cursorMiddle.drawCentered(mouseX + cursor.getWidth() / 2, mouseY + cursor.getHeight() / 2); + } } /** diff --git a/src/itdelatrisu/opsu/ui/UI.java b/src/itdelatrisu/opsu/ui/UI.java index 2aa3f62f..b750e07c 100644 --- a/src/itdelatrisu/opsu/ui/UI.java +++ b/src/itdelatrisu/opsu/ui/UI.java @@ -97,7 +97,7 @@ public static void init(GameContainer container, StateBasedGame game) { // back button if (GameImage.MENU_BACK.getImages() != null) { - Animation back = GameImage.MENU_BACK.getAnimation(120); + Animation back = GameImage.MENU_BACK.getAnimation(); backButton = new MenuButton(back, back.getWidth() / 2f, container.getHeight() - (back.getHeight() / 2f)); } else { Image back = GameImage.MENU_BACK.getImage();