Color unplayed beatmaps pink in the menu.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2016-12-22 17:37:29 -05:00
parent 0d92d79ed7
commit e3276a3365
4 changed files with 17 additions and 6 deletions

View File

@ -208,4 +208,15 @@ public class BeatmapSet implements Iterable<Beatmap> {
BeatmapDB.updateFavoriteStatus(map);
}
}
/**
* Returns whether any beatmap in this set has been played.
*/
public boolean isPlayed() {
for (Beatmap map : beatmaps) {
if (map.playCount > 0)
return true;
}
return false;
}
}

View File

@ -75,7 +75,7 @@ public class BeatmapSetNode {
public void draw(float x, float y, Grade grade, boolean focus) {
Image bg = GameImage.MENU_BUTTON_BG.getImage();
boolean expanded = (beatmapIndex > -1);
Beatmap beatmap;
Beatmap beatmap = beatmapSet.get(expanded ? beatmapIndex : 0);
bg.setAlpha(0.9f);
Color bgColor;
Color textColor = Options.getSkin().getSongSelectInactiveTextColor();
@ -88,11 +88,10 @@ public class BeatmapSetNode {
textColor = Options.getSkin().getSongSelectActiveTextColor();
} else
bgColor = Colors.BLUE_BUTTON;
beatmap = beatmapSet.get(beatmapIndex);
} else {
} else if (beatmapSet.isPlayed())
bgColor = Colors.ORANGE_BUTTON;
beatmap = beatmapSet.get(0);
}
else
bgColor = Colors.PINK_BUTTON;
bg.draw(x, y, bgColor);
float cx = x + (bg.getWidth() * 0.043f);

View File

@ -943,7 +943,7 @@ public class SongMenu extends BasicGameState {
focusScores = null;
search.setText("");
searchTimer = SEARCH_DELAY;
searchTransitionTimer = 0;
searchTransitionTimer = SEARCH_TRANSITION_TIME;
searchResultString = null;
BeatmapSetList.get().reset();
BeatmapSetList.get().init();

View File

@ -31,6 +31,7 @@ public class Colors {
BLUE_BACKGROUND = new Color(74, 130, 255),
BLUE_BUTTON = new Color(40, 129, 237),
ORANGE_BUTTON = new Color(200, 90, 3),
PINK_BUTTON = new Color(223, 71, 147),
YELLOW_ALPHA = new Color(255, 255, 0, 0.4f),
WHITE_FADE = new Color(255, 255, 255, 1f),
RED_HOVER = new Color(255, 112, 112),