Adjust timing windows to work with changing slider velocities
This commit is contained in:
parent
68d3b1f222
commit
8e41a3d125
Binary file not shown.
Binary file not shown.
@ -9,6 +9,7 @@ import java.io.IOException;
|
|||||||
import java.io.SequenceInputStream;
|
import java.io.SequenceInputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import javax.swing.JFileChooser;
|
import javax.swing.JFileChooser;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
@ -25,6 +26,7 @@ public class Convert {
|
|||||||
|
|
||||||
List<ListItem> maps = new ArrayList<ListItem>();
|
List<ListItem> maps = new ArrayList<ListItem>();
|
||||||
List<String> points = new ArrayList<String>();
|
List<String> points = new ArrayList<String>();
|
||||||
|
List<TimingPoint> timingDatabase = new ArrayList<TimingPoint>();
|
||||||
double timePoint=0;
|
double timePoint=0;
|
||||||
double remainder=0;
|
double remainder=0;
|
||||||
for (int i=0;i<osuMapCombiner.model.getSize();i++) {
|
for (int i=0;i<osuMapCombiner.model.getSize();i++) {
|
||||||
@ -40,25 +42,22 @@ public class Convert {
|
|||||||
remainder--;
|
remainder--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timePoint!=0) {
|
for (int j=0;j<l.timingPoints.size();j++) {
|
||||||
for (int j=0;j<l.timingPoints.size();j++) {
|
String timingPoint = l.timingPoints.get(j);
|
||||||
String timingPoint = l.timingPoints.get(j);
|
String[] split = timingPoint.split(",");
|
||||||
String[] split = timingPoint.split(",");
|
Double timing = Double.parseDouble(split[0]);
|
||||||
Double timing = Double.parseDouble(split[0]);
|
/*if (j==0) {
|
||||||
/*if (j==0) {
|
timing=(int)timePoint;
|
||||||
timing=(int)timePoint;
|
} else {*/
|
||||||
} else {*/
|
timing+=timePoint;
|
||||||
timing+=timePoint;
|
//}
|
||||||
//}
|
StringBuilder newString = new StringBuilder(Double.toString(timing));
|
||||||
StringBuilder newString = new StringBuilder(Double.toString(timing));
|
for (int k=1;k<split.length;k++) {
|
||||||
for (int k=1;k<split.length;k++) {
|
newString.append(",");
|
||||||
newString.append(",");
|
newString.append(split[k]);
|
||||||
newString.append(split[k]);
|
|
||||||
}
|
|
||||||
points.add(newString.toString());
|
|
||||||
}
|
}
|
||||||
} else {
|
timingDatabase.add(new TimingPoint(l.sliderMultiplier,newString.toString()));
|
||||||
points.addAll(l.timingPoints);
|
points.add(newString.toString());
|
||||||
}
|
}
|
||||||
timePoint+=l.songDuration;
|
timePoint+=l.songDuration;
|
||||||
}
|
}
|
||||||
@ -219,8 +218,16 @@ BeatmapSetID:-1
|
|||||||
"//Storyboard Sound Samples");
|
"//Storyboard Sound Samples");
|
||||||
marathonMap.add("");
|
marathonMap.add("");
|
||||||
marathonMap.add("[TimingPoints]");
|
marathonMap.add("[TimingPoints]");
|
||||||
for(int i=0;i<points.size();i++) {
|
for(int i=0;i<timingDatabase.size();i++) {
|
||||||
marathonMap.add(points.get(i));
|
String[] timingPoint = timingDatabase.get(i).timingPointData.split(Pattern.quote(","));
|
||||||
|
//marathonMap.add(timingDatabase.get(i));
|
||||||
|
if (Double.parseDouble(timingPoint[1])>=0) {
|
||||||
|
marathonMap.add(timingDatabase.get(i).timingPointData);
|
||||||
|
marathonMap.add(timingPoint[0]+","+((-((maxSliderMultiplier/timingDatabase.get(i).initialSliderVelocity)*100)))+","+timingPoint[2]+","+timingPoint[3]+","+timingPoint[4]+","+timingPoint[5]+","+timingPoint[6]+","+timingPoint[7]);
|
||||||
|
} else {
|
||||||
|
marathonMap.add(timingPoint[0]+","+((-(1d/(100/(-Double.parseDouble(timingPoint[1])))*(maxSliderMultiplier/timingDatabase.get(i).initialSliderVelocity)))*100)+","+timingPoint[2]+","+timingPoint[3]+","+timingPoint[4]+","+timingPoint[5]+","+timingPoint[6]+","+timingPoint[7]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
marathonMap.add("");
|
marathonMap.add("");
|
||||||
|
|
||||||
@ -237,10 +244,10 @@ BeatmapSetID:-1
|
|||||||
timePoint++;
|
timePoint++;
|
||||||
remainder--;
|
remainder--;
|
||||||
}
|
}
|
||||||
double sliderMultiplierRatio = maxSliderMultiplier/map.sliderMultiplier;
|
|
||||||
for (int j=0;j<map.hitObjects.size();j++) {
|
for (int j=0;j<map.hitObjects.size();j++) {
|
||||||
String hitobject = map.hitObjects.get(j);
|
String hitobject = map.hitObjects.get(j);
|
||||||
String[] split = hitobject.split(",");
|
String[] split = hitobject.split(",");
|
||||||
|
int originalTime = Integer.parseInt(split[2]);
|
||||||
split[2] = Integer.toString(Integer.parseInt(split[2])+(int)timePoint);
|
split[2] = Integer.toString(Integer.parseInt(split[2])+(int)timePoint);
|
||||||
if (j==0 && breakStartPoint!=-1) {
|
if (j==0 && breakStartPoint!=-1) {
|
||||||
//Setup a break.
|
//Setup a break.
|
||||||
@ -265,11 +272,6 @@ BeatmapSetID:-1
|
|||||||
split[5] = Integer.toString(Integer.parseInt(split[5])+(int)timePoint);
|
split[5] = Integer.toString(Integer.parseInt(split[5])+(int)timePoint);
|
||||||
} else {
|
} else {
|
||||||
//This is a slider.
|
//This is a slider.
|
||||||
if (split.length>=8) {
|
|
||||||
//Verified.
|
|
||||||
double sliderlength = Double.parseDouble(split[7]);
|
|
||||||
split[7] = Double.toString(sliderlength * sliderMultiplierRatio);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Re-write the hit object.
|
//Re-write the hit object.
|
||||||
|
10
osuMapCombiner/src/osuMapCombiner/TimingPoint.java
Normal file
10
osuMapCombiner/src/osuMapCombiner/TimingPoint.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package osuMapCombiner;
|
||||||
|
|
||||||
|
public class TimingPoint {
|
||||||
|
double initialSliderVelocity;
|
||||||
|
String timingPointData;
|
||||||
|
TimingPoint(double initialVelocity, String timingPoint) {
|
||||||
|
this.initialSliderVelocity=initialVelocity;
|
||||||
|
this.timingPointData=timingPoint;
|
||||||
|
}
|
||||||
|
}
|
@ -61,7 +61,8 @@ public class osuMapCombiner extends JPanel implements ActionListener, ListSelect
|
|||||||
l.setDropMode(DropMode.INSERT);
|
l.setDropMode(DropMode.INSERT);
|
||||||
l.setTransferHandler(new ListTransferHandler());
|
l.setTransferHandler(new ListTransferHandler());
|
||||||
|
|
||||||
l.setPreferredSize(new Dimension(280,360));
|
//l.setMinimumSize(new Dimension(280,720));
|
||||||
|
pane.setPreferredSize(new Dimension(280,360));
|
||||||
l.addListSelectionListener(this);
|
l.addListSelectionListener(this);
|
||||||
|
|
||||||
Component c = Box.createRigidArea(new Dimension(240,32));
|
Component c = Box.createRigidArea(new Dimension(240,32));
|
||||||
@ -92,7 +93,7 @@ public class osuMapCombiner extends JPanel implements ActionListener, ListSelect
|
|||||||
FlowLayout layout = new FlowLayout();
|
FlowLayout layout = new FlowLayout();
|
||||||
f.setLayout(layout);
|
f.setLayout(layout);
|
||||||
|
|
||||||
f.add(l);
|
f.add(pane);
|
||||||
f.add(button3);
|
f.add(button3);
|
||||||
f.add(button4);
|
f.add(button4);
|
||||||
//f.add(c);
|
//f.add(c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user