diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index a099a283..d44b78de 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -538,12 +538,8 @@ public class GameData { public void drawRankingElements(Graphics g, OsuFile osu) { // grade Grade grade = getGrade(); - if (grade != Grade.NULL) { - Image gradeImage = grade.getLargeImage(); - float gradeScale = (height * 0.5f) / gradeImage.getHeight(); - gradeImage = gradeImage.getScaledCopy(gradeScale); - gradeImage.draw(width - gradeImage.getWidth(), height * 0.09f); - } + if (grade != Grade.NULL) + grade.getLargeImage().draw(width * 0.985f - grade.getLargeImage().getWidth(), height * 0.09f); // header & "Ranking" text Image rankingTitle = GameImage.RANKING_TITLE.getImage(); diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index d56a732c..065566dc 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -190,21 +190,61 @@ public enum GameImage { HIT_300G ("hit300g", "png"), HIT_SLIDER10 ("sliderpoint10", "png"), HIT_SLIDER30 ("sliderpoint30", "png"), - RANKING_SS ("ranking-X", "png"), + RANKING_SS ("ranking-X", "png") { + @Override + protected Image process_sub(Image img, int w, int h) { + return img.getScaledCopy((h / 2f) / img.getHeight()); + } + }, RANKING_SS_SMALL ("ranking-X-small", "png"), - RANKING_SSH ("ranking-XH", "png"), + RANKING_SSH ("ranking-XH", "png") { + @Override + protected Image process_sub(Image img, int w, int h) { + return img.getScaledCopy((h / 2f) / img.getHeight()); + } + }, RANKING_SSH_SMALL ("ranking-XH-small", "png"), - RANKING_S ("ranking-S", "png"), + RANKING_S ("ranking-S", "png") { + @Override + protected Image process_sub(Image img, int w, int h) { + return img.getScaledCopy((h / 2f) / img.getHeight()); + } + }, RANKING_S_SMALL ("ranking-S-small", "png"), - RANKING_SH ("ranking-SH", "png"), + RANKING_SH ("ranking-SH", "png") { + @Override + protected Image process_sub(Image img, int w, int h) { + return img.getScaledCopy((h / 2f) / img.getHeight()); + } + }, RANKING_SH_SMALL ("ranking-SH-small", "png"), - RANKING_A ("ranking-A", "png"), + RANKING_A ("ranking-A", "png") { + @Override + protected Image process_sub(Image img, int w, int h) { + return img.getScaledCopy((h / 2f) / img.getHeight()); + } + }, RANKING_A_SMALL ("ranking-A-small", "png"), - RANKING_B ("ranking-B", "png"), + RANKING_B ("ranking-B", "png") { + @Override + protected Image process_sub(Image img, int w, int h) { + return img.getScaledCopy((h / 2f) / img.getHeight()); + } + }, RANKING_B_SMALL ("ranking-B-small", "png"), - RANKING_C ("ranking-C", "png"), + RANKING_C ("ranking-C", "png") { + @Override + protected Image process_sub(Image img, int w, int h) { + return img.getScaledCopy((h / 2f) / img.getHeight()); + } + }, RANKING_C_SMALL ("ranking-C-small", "png"), - RANKING_D ("ranking-D", "png"), + RANKING_D ("ranking-D", "png") { + @Override + protected Image process_sub(Image img, int w, int h) { + return img.getScaledCopy((h / 2f) / img.getHeight()); + } + }, RANKING_D_SMALL ("ranking-D-small", "png"), RANKING_PANEL ("ranking-panel", "png") { @Override diff --git a/src/itdelatrisu/opsu/GameMod.java b/src/itdelatrisu/opsu/GameMod.java index 5944f56c..16503fb1 100644 --- a/src/itdelatrisu/opsu/GameMod.java +++ b/src/itdelatrisu/opsu/GameMod.java @@ -125,9 +125,11 @@ public enum GameMod { float y = (height * 0.8f) + (img.getHeight() / 2); // create button - img.setAlpha(0.5f); this.button = new MenuButton(img, x + (offsetX * id), y); this.button.setHoverScale(1.15f); + + // reset state + this.active = false; } /** @@ -160,7 +162,6 @@ public enum GameMod { * @param checkInverse if true, perform checks for mutual exclusivity */ public void toggle(boolean checkInverse) { - button.getImage().setAlpha(active ? 0.5f : 1.0f); active = !active; if (checkInverse) { @@ -205,7 +206,12 @@ public enum GameMod { /** * Draws the game mod. */ - public void draw() { button.draw(); } + public void draw() { + if (!active) + button.getImage().setAlpha(0.5f); + button.draw(); + button.getImage().setAlpha(1.0f); + } /** * Checks if the coordinates are within the image bounds. diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index ec9ab3e9..d3d5df87 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -484,7 +484,7 @@ public class Game extends BasicGameState { data.changeHealth(delta * -1 * GameData.HP_DRAIN_MULTIPLIER); if (!data.isAlive()) { // "Easy" mod - if (GameMod.EASY.isActive()) { + if (GameMod.EASY.isActive() && !GameMod.SUDDEN_DEATH.isActive()) { deaths++; if (deaths < 3) { deathTime = trackPosition;