Small fixes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2015-02-02 01:39:19 -05:00
parent ec90d6fd03
commit b96a20e23f
3 changed files with 17 additions and 12 deletions

View File

@ -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());
}

View File

@ -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

View File

@ -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()) {