cleaned up look and progress on music selection page
This commit is contained in:
parent
9880c0ed7a
commit
2c9fd2ecfd
@ -4,7 +4,6 @@ import com.badlogic.gdx.Gdx;
|
|||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
import com.badlogic.gdx.scenes.scene2d.InputEvent;
|
import com.badlogic.gdx.scenes.scene2d.InputEvent;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
|
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup;
|
import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup;
|
||||||
@ -18,8 +17,6 @@ public class MusicSelectable extends WidgetGroup implements Disposable {
|
|||||||
private Table table;
|
private Table table;
|
||||||
|
|
||||||
private ShortenedTextLabel displayName;
|
private ShortenedTextLabel displayName;
|
||||||
private Label durationLabel;
|
|
||||||
private ShortenedTextLabel authorLabel;
|
|
||||||
|
|
||||||
private boolean selected;
|
private boolean selected;
|
||||||
|
|
||||||
@ -40,12 +37,6 @@ public class MusicSelectable extends WidgetGroup implements Disposable {
|
|||||||
displayName = new ShortenedTextLabel(musicFile.nameWithoutExtension().replace('_', ' '), skin, "sub-font", skin.getColor("default"));
|
displayName = new ShortenedTextLabel(musicFile.nameWithoutExtension().replace('_', ' '), skin, "sub-font", skin.getColor("default"));
|
||||||
table.add(displayName);
|
table.add(displayName);
|
||||||
|
|
||||||
durationLabel = new Label("Loading...", skin, "sub-font", skin.getColor("default"));
|
|
||||||
table.add(durationLabel);
|
|
||||||
|
|
||||||
authorLabel = new ShortenedTextLabel("Loading...", skin, "sub-font", skin.getColor("default"));
|
|
||||||
table.add(authorLabel);
|
|
||||||
|
|
||||||
table.pack();
|
table.pack();
|
||||||
addActor(table);
|
addActor(table);
|
||||||
addListener(new ClickListener() {
|
addListener(new ClickListener() {
|
||||||
@ -66,22 +57,13 @@ public class MusicSelectable extends WidgetGroup implements Disposable {
|
|||||||
Gdx.app.debug("MusicSelectable", "Updating info for: " + getName());
|
Gdx.app.debug("MusicSelectable", "Updating info for: " + getName());
|
||||||
this.musicInfo = musicInfo;
|
this.musicInfo = musicInfo;
|
||||||
displayName.setOriginalText(musicInfo.getMusicName());
|
displayName.setOriginalText(musicInfo.getMusicName());
|
||||||
durationLabel.setText("Runtime: "
|
|
||||||
+ ((musicInfo.getDurationInSeconds() / 60 < 1) ? "00" : musicInfo.getDurationInSeconds() / 60) + ":"
|
|
||||||
+ ((musicInfo.getDurationInSeconds() - (musicInfo.getDurationInSeconds() / 60) * 60) < 10
|
|
||||||
? "0" + (musicInfo.getDurationInSeconds() - (musicInfo.getDurationInSeconds() / 60) * 60)
|
|
||||||
: (musicInfo.getDurationInSeconds() - (musicInfo.getDurationInSeconds() / 60) * 60)));
|
|
||||||
authorLabel.setOriginalText("Author: " + musicInfo.getAuthor());
|
|
||||||
authorLabel.setToOriginalText();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void layout() {
|
public void layout() {
|
||||||
displayName.setTargetWidth((int) (getWidth()*0.43f));
|
displayName.setTargetWidth((int) (getWidth()*0.8f));
|
||||||
authorLabel.setTargetWidth((int) (getWidth()/3f));
|
|
||||||
displayName.resize();
|
displayName.resize();
|
||||||
authorLabel.resize();
|
|
||||||
super.layout();
|
super.layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,6 +93,10 @@ public class AnalysisPage extends Page {
|
|||||||
speedModifierSlider.setDisabled(false);
|
speedModifierSlider.setDisabled(false);
|
||||||
healthModifierSlider.setDisabled(false);
|
healthModifierSlider.setDisabled(false);
|
||||||
difficultyModifierSlider.setDisabled(false);
|
difficultyModifierSlider.setDisabled(false);
|
||||||
|
if (aa != null) {
|
||||||
|
aa.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
aa = new AudioAnalyzer(mm);
|
aa = new AudioAnalyzer(mm);
|
||||||
aa.start();
|
aa.start();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user