Fixed SongInstanceDifficultyButtons and added colors
This commit is contained in:
@@ -15,6 +15,8 @@ public class AudioPlayer {
|
|||||||
|
|
||||||
public void setClip(Song s) {
|
public void setClip(Song s) {
|
||||||
try {
|
try {
|
||||||
|
if(clip!=null)
|
||||||
|
clip.close();
|
||||||
clip = null;
|
clip = null;
|
||||||
AudioInputStream ais = s.getAudioStream();
|
AudioInputStream ais = s.getAudioStream();
|
||||||
AudioFormat baseFormat = ais.getFormat();
|
AudioFormat baseFormat = ais.getFormat();
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.awt.Polygon;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import model.GameModel;
|
||||||
import model.SongHandler;
|
import model.SongHandler;
|
||||||
import model.objects.DifficultyButton;
|
import model.objects.DifficultyButton;
|
||||||
import model.objects.MenuButton;
|
import model.objects.MenuButton;
|
||||||
@@ -74,12 +75,12 @@ public class MenuState extends GameState {
|
|||||||
}
|
}
|
||||||
oldselected = selected;
|
oldselected = selected;
|
||||||
|
|
||||||
buttons2.clear();
|
buttons2.clear();
|
||||||
int instanceNr = 0;
|
int instanceNr = 0;
|
||||||
for(SongInstance si : sh.getCurrentSong().getSongs()){
|
for(int i = sh.getCurrentSong().getSongs().size()-1; i>0; i--){
|
||||||
buttons2.add(new DifficultyButton(yPosDiffButton-instanceNr,si.getDifficulty(), Color.BLUE));
|
SongInstance si = sh.getCurrentSong().getSongs().get(i-1);
|
||||||
|
buttons2.add(new DifficultyButton(yPosDiffButton-instanceNr,si.getDifficulty(), GameModel.colors[i-1]));
|
||||||
instanceNr += 100;
|
instanceNr += 100;
|
||||||
System.out.println(sh.getCurrentSong().getSongs().size());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,6 +154,7 @@ public class MenuState extends GameState {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onJoystickMoved(JoystickEvent e) {
|
public void onJoystickMoved(JoystickEvent e) {
|
||||||
|
|
||||||
if(subscreen){ //Screen for Song details
|
if(subscreen){ //Screen for Song details
|
||||||
|
|
||||||
}else{ //Screen for selecting song
|
}else{ //Screen for selecting song
|
||||||
@@ -162,7 +164,7 @@ public class MenuState extends GameState {
|
|||||||
selected--;
|
selected--;
|
||||||
}
|
}
|
||||||
sh.set(songs.indexOf(selectedToSong(selected)));
|
sh.set(songs.indexOf(selectedToSong(selected)));
|
||||||
sh.play();
|
sh.play(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user