minor changes to aesthetics, added rated difficulty to selection screen
This commit is contained in:
parent
4c86b17807
commit
6aa03bd344
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@ -43,18 +43,16 @@ public class MusicSelectionPage extends Page implements Observer {
|
||||
private ScrollPane musicTableScrollPane;
|
||||
private TextButton back;
|
||||
|
||||
private Table musicInfoTable;
|
||||
private ScrollText songTitle;
|
||||
private Label author;
|
||||
private Label songLength;
|
||||
private Label previousTop;
|
||||
private Table musicInfoTable;
|
||||
private Label ratedDifficulty;
|
||||
private Image albumCover;
|
||||
|
||||
private MusicSelectable currentlySelected;
|
||||
|
||||
private FileHandle selectedMusic;
|
||||
private SongInfo selectedMusicInfo;
|
||||
|
||||
private Skin skin;
|
||||
private AssetManager assets;
|
||||
|
||||
@ -115,7 +113,7 @@ public class MusicSelectionPage extends Page implements Observer {
|
||||
});
|
||||
|
||||
musicInfoTable = new Table();
|
||||
musicInfoTable.defaults().center().space(10f);
|
||||
musicInfoTable.defaults().center().space(5f);
|
||||
musicInfoTable.setPosition(musicTableScrollPane.getWidth() + musicTableScrollPane.getX(), 0);
|
||||
musicInfoTable.setSize(getWidth()-musicTableScrollPane.getWidth(), getHeight());
|
||||
addActor(musicInfoTable);
|
||||
@ -124,6 +122,7 @@ public class MusicSelectionPage extends Page implements Observer {
|
||||
author = 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"));
|
||||
ratedDifficulty = new Label(null, skin, "sub-font", skin.getColor("default"));
|
||||
albumCover = new Image(assetManager.get("defaultCover.png", Texture.class));
|
||||
|
||||
refresh();
|
||||
@ -167,11 +166,11 @@ public class MusicSelectionPage extends Page implements Observer {
|
||||
}
|
||||
|
||||
public FileHandle getSelectedMusic() {
|
||||
return selectedMusic;
|
||||
return currentlySelected.getMusicFile();
|
||||
}
|
||||
|
||||
public SongInfo getSelectedMusicInfo() {
|
||||
return selectedMusicInfo;
|
||||
return currentlySelected.getAudioInfo();
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
@ -204,7 +203,7 @@ public class MusicSelectionPage extends Page implements Observer {
|
||||
}
|
||||
extraInfoDone = true;
|
||||
|
||||
musicInfoTable.add(songTitle).width(musicInfoTable.getWidth()*0.7f);
|
||||
musicInfoTable.add(songTitle).width(musicInfoTable.getWidth()*0.7f).spaceBottom(10f);
|
||||
musicInfoTable.row();
|
||||
musicInfoTable.add(author);
|
||||
musicInfoTable.row();
|
||||
@ -212,6 +211,8 @@ public class MusicSelectionPage extends Page implements Observer {
|
||||
musicInfoTable.row();
|
||||
musicInfoTable.add(previousTop);
|
||||
musicInfoTable.row();
|
||||
musicInfoTable.add(ratedDifficulty);
|
||||
musicInfoTable.row();
|
||||
musicInfoTable.add(albumCover).size(musicInfoTable.getWidth()/2f);
|
||||
if (currentlySelected != null) {
|
||||
updateInformation();
|
||||
@ -303,6 +304,12 @@ public class MusicSelectionPage extends Page implements Observer {
|
||||
songLength.setText("Length: " + min + ":" + sec);
|
||||
|
||||
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()))));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user