Small fixes.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
ec90d6fd03
commit
b96a20e23f
|
@ -136,6 +136,7 @@ public class DownloadList {
|
||||||
DownloadNode node = iter.next();
|
DownloadNode node = iter.next();
|
||||||
Download dl = node.getDownload();
|
Download dl = node.getDownload();
|
||||||
if (dl != null && !dl.isActive()) {
|
if (dl != null && !dl.isActive()) {
|
||||||
|
node.clearDownload();
|
||||||
iter.remove();
|
iter.remove();
|
||||||
map.remove(node.getID());
|
map.remove(node.getID());
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,7 +337,7 @@ public class DownloadNode {
|
||||||
float marginY = infoHeight * 0.04f;
|
float marginY = infoHeight * 0.04f;
|
||||||
|
|
||||||
// rectangle outline
|
// 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);
|
g.fillRect(infoBaseX, y, infoWidth, infoHeight);
|
||||||
|
|
||||||
// text
|
// text
|
||||||
|
|
|
@ -182,9 +182,10 @@ public class DownloadsMenu extends BasicGameState {
|
||||||
nextPage.setHoverExpand(1.5f);
|
nextPage.setHoverExpand(1.5f);
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
float buttonWidth = width * 0.12f;
|
|
||||||
float buttonMarginX = width * 0.004f;
|
float buttonMarginX = width * 0.004f;
|
||||||
float buttonHeight = height * 0.038f;
|
float buttonHeight = height * 0.038f;
|
||||||
|
float topButtonWidth = width * 0.14f;
|
||||||
|
float lowerButtonWidth = width * 0.12f;
|
||||||
float topButtonY = searchY + Utils.FONT_MEDIUM.getLineHeight() / 2f;
|
float topButtonY = searchY + Utils.FONT_MEDIUM.getLineHeight() / 2f;
|
||||||
float lowerButtonY = height * 0.995f - searchY - buttonHeight / 2f;
|
float lowerButtonY = height * 0.995f - searchY - buttonHeight / 2f;
|
||||||
Image button = GameImage.MENU_BUTTON_MID.getImage();
|
Image button = GameImage.MENU_BUTTON_MID.getImage();
|
||||||
|
@ -192,16 +193,18 @@ public class DownloadsMenu extends BasicGameState {
|
||||||
Image buttonR = GameImage.MENU_BUTTON_RIGHT.getImage();
|
Image buttonR = GameImage.MENU_BUTTON_RIGHT.getImage();
|
||||||
buttonL = buttonL.getScaledCopy(buttonHeight / buttonL.getHeight());
|
buttonL = buttonL.getScaledCopy(buttonHeight / buttonL.getHeight());
|
||||||
buttonR = buttonR.getScaledCopy(buttonHeight / buttonR.getHeight());
|
buttonR = buttonR.getScaledCopy(buttonHeight / buttonR.getHeight());
|
||||||
button = button.getScaledCopy((int) buttonWidth - buttonL.getWidth() - buttonR.getWidth(), (int) buttonHeight);
|
Image topButton = button.getScaledCopy((int) topButtonWidth - buttonL.getWidth() - buttonR.getWidth(), (int) buttonHeight);
|
||||||
float fullButtonWidth = button.getWidth() + buttonL.getWidth() + buttonR.getWidth();
|
Image lowerButton = button.getScaledCopy((int) lowerButtonWidth - buttonL.getWidth() - buttonR.getWidth(), (int) buttonHeight);
|
||||||
clearButton = new MenuButton(button, buttonL, buttonR,
|
float fullTopButtonWidth = topButton.getWidth() + buttonL.getWidth() + buttonR.getWidth();
|
||||||
width * 0.75f + buttonMarginX + fullButtonWidth / 2f, lowerButtonY);
|
float fullLowerButtonWidth = lowerButton.getWidth() + buttonL.getWidth() + buttonR.getWidth();
|
||||||
importButton = new MenuButton(button, buttonL, buttonR,
|
clearButton = new MenuButton(lowerButton, buttonL, buttonR,
|
||||||
width - buttonMarginX - fullButtonWidth / 2f, lowerButtonY);
|
width * 0.75f + buttonMarginX + fullLowerButtonWidth / 2f, lowerButtonY);
|
||||||
resetButton = new MenuButton(button, buttonL, buttonR,
|
importButton = new MenuButton(lowerButton, buttonL, buttonR,
|
||||||
baseX + searchWidth + buttonMarginX + fullButtonWidth / 2f, topButtonY);
|
width - buttonMarginX - fullLowerButtonWidth / 2f, lowerButtonY);
|
||||||
rankedButton = new MenuButton(button, buttonL, buttonR,
|
resetButton = new MenuButton(topButton, buttonL, buttonR,
|
||||||
baseX + searchWidth + buttonMarginX * 2f + fullButtonWidth * 3 / 2f, topButtonY);
|
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);
|
clearButton.setText("Clear", Utils.FONT_MEDIUM, Color.white);
|
||||||
importButton.setText("Import All", Utils.FONT_MEDIUM, Color.white);
|
importButton.setText("Import All", Utils.FONT_MEDIUM, Color.white);
|
||||||
resetButton.setText("Reset Search", 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)
|
if (index >= n)
|
||||||
break;
|
break;
|
||||||
if (DownloadNode.downloadIconContains(x, y, i)) {
|
if (DownloadNode.downloadIconContains(x, y, i)) {
|
||||||
|
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||||
DownloadNode node = DownloadList.get().getNode(index);
|
DownloadNode node = DownloadList.get().getNode(index);
|
||||||
Download dl = node.getDownload();
|
Download dl = node.getDownload();
|
||||||
switch (dl.getStatus()) {
|
switch (dl.getStatus()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user