minor changes to aesthetics, added rated difficulty to selection screen

This commit is contained in:
Harrison Deng 2017-11-24 23:37:44 -06:00
parent 4c86b17807
commit 6aa03bd344
2 changed files with 15 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -43,18 +43,16 @@ public class MusicSelectionPage extends Page implements Observer {
private ScrollPane musicTableScrollPane; private ScrollPane musicTableScrollPane;
private TextButton back; private TextButton back;
private Table musicInfoTable;
private ScrollText songTitle; private ScrollText songTitle;
private Label author; private Label author;
private Label songLength; private Label songLength;
private Label previousTop; private Label previousTop;
private Table musicInfoTable; private Label ratedDifficulty;
private Image albumCover; private Image albumCover;
private MusicSelectable currentlySelected; private MusicSelectable currentlySelected;
private FileHandle selectedMusic;
private SongInfo selectedMusicInfo;
private Skin skin; private Skin skin;
private AssetManager assets; private AssetManager assets;
@ -115,7 +113,7 @@ public class MusicSelectionPage extends Page implements Observer {
}); });
musicInfoTable = new Table(); musicInfoTable = new Table();
musicInfoTable.defaults().center().space(10f); musicInfoTable.defaults().center().space(5f);
musicInfoTable.setPosition(musicTableScrollPane.getWidth() + musicTableScrollPane.getX(), 0); musicInfoTable.setPosition(musicTableScrollPane.getWidth() + musicTableScrollPane.getX(), 0);
musicInfoTable.setSize(getWidth()-musicTableScrollPane.getWidth(), getHeight()); musicInfoTable.setSize(getWidth()-musicTableScrollPane.getWidth(), getHeight());
addActor(musicInfoTable); addActor(musicInfoTable);
@ -124,6 +122,7 @@ public class MusicSelectionPage extends Page implements Observer {
author = new Label(null, skin, "sub-font", skin.getColor("default")); author = new Label(null, skin, "sub-font", skin.getColor("default"));
songLength = new Label(null, skin, "sub-font", skin.getColor("default")); songLength = new Label(null, skin, "sub-font", skin.getColor("default"));
previousTop = new Label(null, skin, "sub-font", skin.getColor("default")); previousTop = new Label(null, skin, "sub-font", skin.getColor("default"));
ratedDifficulty = new Label(null, skin, "sub-font", skin.getColor("default"));
albumCover = new Image(assetManager.get("defaultCover.png", Texture.class)); albumCover = new Image(assetManager.get("defaultCover.png", Texture.class));
refresh(); refresh();
@ -167,11 +166,11 @@ public class MusicSelectionPage extends Page implements Observer {
} }
public FileHandle getSelectedMusic() { public FileHandle getSelectedMusic() {
return selectedMusic; return currentlySelected.getMusicFile();
} }
public SongInfo getSelectedMusicInfo() { public SongInfo getSelectedMusicInfo() {
return selectedMusicInfo; return currentlySelected.getAudioInfo();
} }
public void refresh() { public void refresh() {
@ -204,7 +203,7 @@ public class MusicSelectionPage extends Page implements Observer {
} }
extraInfoDone = true; extraInfoDone = true;
musicInfoTable.add(songTitle).width(musicInfoTable.getWidth()*0.7f); musicInfoTable.add(songTitle).width(musicInfoTable.getWidth()*0.7f).spaceBottom(10f);
musicInfoTable.row(); musicInfoTable.row();
musicInfoTable.add(author); musicInfoTable.add(author);
musicInfoTable.row(); musicInfoTable.row();
@ -212,6 +211,8 @@ public class MusicSelectionPage extends Page implements Observer {
musicInfoTable.row(); musicInfoTable.row();
musicInfoTable.add(previousTop); musicInfoTable.add(previousTop);
musicInfoTable.row(); musicInfoTable.row();
musicInfoTable.add(ratedDifficulty);
musicInfoTable.row();
musicInfoTable.add(albumCover).size(musicInfoTable.getWidth()/2f); musicInfoTable.add(albumCover).size(musicInfoTable.getWidth()/2f);
if (currentlySelected != null) { if (currentlySelected != null) {
updateInformation(); updateInformation();
@ -303,6 +304,12 @@ public class MusicSelectionPage extends Page implements Observer {
songLength.setText("Length: " + min + ":" + sec); songLength.setText("Length: " + min + ":" + sec);
previousTop.setText("Highscore: " + currentlySelected.getAudioInfo().getPreviousTop()); previousTop.setText("Highscore: " + currentlySelected.getAudioInfo().getPreviousTop());
String difficulty = (getSelectedMusicInfo().getRatedDifficulty() == -1 ? "N/A" : String.valueOf(getSelectedMusicInfo().getRatedDifficulty()));
ratedDifficulty.setText("Rated Difficulty: " + difficulty);
albumCover.setDrawable((new TextureRegionDrawable(new TextureRegion(currentlySelected.getAudioInfo().getAlbumCover())))); albumCover.setDrawable((new TextureRegionDrawable(new TextureRegion(currentlySelected.getAudioInfo().getAlbumCover()))));
} }
} }