From b96a20e23f14ce67b8cb1d667c041b5c6f12cec1 Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Mon, 2 Feb 2015 01:39:19 -0500 Subject: [PATCH] Small fixes. Signed-off-by: Jeffrey Han --- .../opsu/downloads/DownloadList.java | 1 + .../opsu/downloads/DownloadNode.java | 2 +- .../opsu/states/DownloadsMenu.java | 26 +++++++++++-------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/itdelatrisu/opsu/downloads/DownloadList.java b/src/itdelatrisu/opsu/downloads/DownloadList.java index 8b7442b5..4af6ac9f 100644 --- a/src/itdelatrisu/opsu/downloads/DownloadList.java +++ b/src/itdelatrisu/opsu/downloads/DownloadList.java @@ -136,6 +136,7 @@ public class DownloadList { DownloadNode node = iter.next(); Download dl = node.getDownload(); if (dl != null && !dl.isActive()) { + node.clearDownload(); iter.remove(); map.remove(node.getID()); } diff --git a/src/itdelatrisu/opsu/downloads/DownloadNode.java b/src/itdelatrisu/opsu/downloads/DownloadNode.java index e0ddb8ea..5ebd1070 100644 --- a/src/itdelatrisu/opsu/downloads/DownloadNode.java +++ b/src/itdelatrisu/opsu/downloads/DownloadNode.java @@ -337,7 +337,7 @@ public class DownloadNode { float marginY = infoHeight * 0.04f; // rectangle outline - g.setColor((id % 2 == 0) ? BG_FOCUS : BG_NORMAL); + g.setColor((id % 2 == 0) ? BG_HOVER : BG_NORMAL); g.fillRect(infoBaseX, y, infoWidth, infoHeight); // text diff --git a/src/itdelatrisu/opsu/states/DownloadsMenu.java b/src/itdelatrisu/opsu/states/DownloadsMenu.java index 0908c376..bfae5428 100644 --- a/src/itdelatrisu/opsu/states/DownloadsMenu.java +++ b/src/itdelatrisu/opsu/states/DownloadsMenu.java @@ -182,9 +182,10 @@ public class DownloadsMenu extends BasicGameState { nextPage.setHoverExpand(1.5f); // buttons - float buttonWidth = width * 0.12f; float buttonMarginX = width * 0.004f; float buttonHeight = height * 0.038f; + float topButtonWidth = width * 0.14f; + float lowerButtonWidth = width * 0.12f; float topButtonY = searchY + Utils.FONT_MEDIUM.getLineHeight() / 2f; float lowerButtonY = height * 0.995f - searchY - buttonHeight / 2f; Image button = GameImage.MENU_BUTTON_MID.getImage(); @@ -192,16 +193,18 @@ public class DownloadsMenu extends BasicGameState { Image buttonR = GameImage.MENU_BUTTON_RIGHT.getImage(); buttonL = buttonL.getScaledCopy(buttonHeight / buttonL.getHeight()); buttonR = buttonR.getScaledCopy(buttonHeight / buttonR.getHeight()); - button = button.getScaledCopy((int) buttonWidth - buttonL.getWidth() - buttonR.getWidth(), (int) buttonHeight); - float fullButtonWidth = button.getWidth() + buttonL.getWidth() + buttonR.getWidth(); - clearButton = new MenuButton(button, buttonL, buttonR, - width * 0.75f + buttonMarginX + fullButtonWidth / 2f, lowerButtonY); - importButton = new MenuButton(button, buttonL, buttonR, - width - buttonMarginX - fullButtonWidth / 2f, lowerButtonY); - resetButton = new MenuButton(button, buttonL, buttonR, - baseX + searchWidth + buttonMarginX + fullButtonWidth / 2f, topButtonY); - rankedButton = new MenuButton(button, buttonL, buttonR, - baseX + searchWidth + buttonMarginX * 2f + fullButtonWidth * 3 / 2f, topButtonY); + Image topButton = button.getScaledCopy((int) topButtonWidth - buttonL.getWidth() - buttonR.getWidth(), (int) buttonHeight); + Image lowerButton = button.getScaledCopy((int) lowerButtonWidth - buttonL.getWidth() - buttonR.getWidth(), (int) buttonHeight); + float fullTopButtonWidth = topButton.getWidth() + buttonL.getWidth() + buttonR.getWidth(); + float fullLowerButtonWidth = lowerButton.getWidth() + buttonL.getWidth() + buttonR.getWidth(); + clearButton = new MenuButton(lowerButton, buttonL, buttonR, + width * 0.75f + buttonMarginX + fullLowerButtonWidth / 2f, lowerButtonY); + importButton = new MenuButton(lowerButton, buttonL, buttonR, + width - buttonMarginX - fullLowerButtonWidth / 2f, lowerButtonY); + resetButton = new MenuButton(topButton, buttonL, buttonR, + baseX + searchWidth + buttonMarginX + fullTopButtonWidth / 2f, topButtonY); + rankedButton = new MenuButton(topButton, buttonL, buttonR, + baseX + searchWidth + buttonMarginX * 2f + fullTopButtonWidth * 3 / 2f, topButtonY); clearButton.setText("Clear", Utils.FONT_MEDIUM, Color.white); importButton.setText("Import All", Utils.FONT_MEDIUM, Color.white); resetButton.setText("Reset Search", Utils.FONT_MEDIUM, Color.white); @@ -543,6 +546,7 @@ public class DownloadsMenu extends BasicGameState { if (index >= n) break; if (DownloadNode.downloadIconContains(x, y, i)) { + SoundController.playSound(SoundEffect.MENUCLICK); DownloadNode node = DownloadList.get().getNode(index); Download dl = node.getDownload(); switch (dl.getStatus()) {