Fix up the backtracking editing feature

main
Joshua Sigona 4 years ago
parent 3205982791
commit 84b6ddaf0d
  1. 9
      LLSIG/src/main/java/LLSIG/LLSIG.java

@ -46,11 +46,11 @@ public class LLSIG implements KeyListener{
final static Dimension WINDOW_SIZE = new Dimension(1280,1050); final static Dimension WINDOW_SIZE = new Dimension(1280,1050);
public boolean EDITMODE = false; public boolean EDITMODE = true;
public boolean METRONOME = false; public boolean METRONOME = false;
public boolean BPM_MEASURE = false; public boolean BPM_MEASURE = false;
public boolean PLAYING = true; //Whether or not a song is loaded and playing. public boolean PLAYING = true; //Whether or not a song is loaded and playing.
public boolean EDITOR = true; //Whether or not we are in beatmap editing mode. public boolean EDITOR = false; //Whether or not we are in beatmap editing mode.
public static double EDITOR_CURSOR_BEAT = 0; public static double EDITOR_CURSOR_BEAT = 0;
public static double PREVIOUS_CURSOR_BEAT = 0; public static double PREVIOUS_CURSOR_BEAT = 0;
@ -229,6 +229,7 @@ public class LLSIG implements KeyListener{
String[] data = FileUtils.readFromFile("music/"+song+".sig"); String[] data = FileUtils.readFromFile("music/"+song+".sig");
for (String line : data) { for (String line : data) {
String[] split = line.split(Pattern.quote(",")); String[] split = line.split(Pattern.quote(","));
if (split[0].length()>0) {
if (split[0].equals("B")) { if (split[0].equals("B")) {
offset=Double.parseDouble(split[1]); offset=Double.parseDouble(split[1]);
bpm=Integer.parseInt(split[2]); bpm=Integer.parseInt(split[2]);
@ -255,6 +256,7 @@ public class LLSIG implements KeyListener{
} }
} }
} }
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -366,9 +368,8 @@ public class LLSIG implements KeyListener{
beatNumber=Math.max(0,beatNumber-12); beatNumber=Math.max(0,beatNumber-12);
} }
musicPlayer.seek((long)(Math.floor(musicPlayer.getPlayPosition()-(beatDelay*12)))); musicPlayer.seek((long)(Math.floor(musicPlayer.getPlayPosition()-(beatDelay*12))));
double noteBeat = Math.round(((musicPlayer.getPlayPosition()-offset)/beatDelay)*NOTE_RECORD_BEAT_SNAP_MULTIPLE)/(double)NOTE_RECORD_BEAT_SNAP_MULTIPLE;
LLSIG.game.lanes.forEach((l)->{ LLSIG.game.lanes.forEach((l)->{
l.noteChart.forEach((note)->{if (note.getBeatSnap()>noteBeat) {note.markForDeletion();}}); l.noteChart.forEach((note)->{if (note.start>musicPlayer.getPlayPosition()) {note.markForDeletion();System.out.println("Marked "+note);}});
}); });
}break; }break;
case KeyEvent.VK_S:{lane=1;}break; case KeyEvent.VK_S:{lane=1;}break;

Loading…
Cancel
Save