Removed Hit Error Bar during breaks
Keep Hit Error Ticks inside bar Removed Miss Locations
This commit is contained in:
@@ -153,12 +153,14 @@ public class GameData {
|
|||||||
/** List of hit result objects associated with hit objects. */
|
/** List of hit result objects associated with hit objects. */
|
||||||
private LinkedList<OsuHitObjectResult> hitResultList;
|
private LinkedList<OsuHitObjectResult> hitResultList;
|
||||||
|
|
||||||
|
/**
|
||||||
class ErrorInfo {
|
* class to store Hit Error information.
|
||||||
|
* @author fluddokt
|
||||||
|
*/
|
||||||
|
class HitErrorInfo {
|
||||||
int time, x, y, timeDiff;
|
int time, x, y, timeDiff;
|
||||||
|
|
||||||
public ErrorInfo(int time, int x, int y, int timeDiff) {
|
public HitErrorInfo(int time, int x, int y, int timeDiff) {
|
||||||
super();
|
|
||||||
this.time = time;
|
this.time = time;
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
@@ -167,8 +169,10 @@ public class GameData {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private LinkedList<ErrorInfo> errorRateList = new LinkedList<ErrorInfo>();
|
/**
|
||||||
private LinkedList<ErrorInfo> mouseMissList = new LinkedList<ErrorInfo>();
|
* List of stored Hit Error Info
|
||||||
|
*/
|
||||||
|
private LinkedList<HitErrorInfo> hitErrorList = new LinkedList<HitErrorInfo>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hit result helper class.
|
* Hit result helper class.
|
||||||
@@ -304,8 +308,7 @@ public class GameData {
|
|||||||
comboEnd = 0;
|
comboEnd = 0;
|
||||||
comboBurstIndex = -1;
|
comboBurstIndex = -1;
|
||||||
scoreData = null;
|
scoreData = null;
|
||||||
errorRateList.clear();
|
hitErrorList.clear();
|
||||||
mouseMissList.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -544,6 +547,50 @@ public class GameData {
|
|||||||
// combo count
|
// combo count
|
||||||
if (combo > 0) // 0 isn't a combo
|
if (combo > 0) // 0 isn't a combo
|
||||||
drawSymbolString(String.format("%dx", combo), 10, height - 10 - symbolHeight, 1.0f, false);
|
drawSymbolString(String.format("%dx", combo), 10, height - 10 - symbolHeight, 1.0f, false);
|
||||||
|
|
||||||
|
//*
|
||||||
|
//Draw Hit Error bar
|
||||||
|
final int fadeDelay = 5000;
|
||||||
|
int hitErrorY = 30;
|
||||||
|
Iterator<HitErrorInfo> iter2 = hitErrorList.iterator();
|
||||||
|
g.setColor(Color.black);
|
||||||
|
g.fillRect(width / 2f - 3 - hitResultOffset[HIT_50],
|
||||||
|
height - marginX - hitErrorY - 10,
|
||||||
|
hitResultOffset[HIT_50] * 2,
|
||||||
|
20);
|
||||||
|
g.setColor(Utils.COLOR_LIGHT_ORANGE);
|
||||||
|
g.fillRect(width / 2f - 3 - hitResultOffset[HIT_50],
|
||||||
|
height - marginX - hitErrorY - 3,
|
||||||
|
hitResultOffset[HIT_50] * 2,
|
||||||
|
6);
|
||||||
|
g.setColor(Utils.COLOR_LIGHT_GREEN);
|
||||||
|
g.fillRect(width / 2f - 3 - hitResultOffset[HIT_100],
|
||||||
|
height - marginX - hitErrorY - 3,
|
||||||
|
hitResultOffset[HIT_100] * 2,
|
||||||
|
6);
|
||||||
|
g.setColor(Utils.COLOR_LIGHT_BLUE);
|
||||||
|
g.fillRect(width / 2f - 3 - hitResultOffset[HIT_300],
|
||||||
|
height- marginX - hitErrorY - 3,
|
||||||
|
hitResultOffset[HIT_300] * 2,
|
||||||
|
6);
|
||||||
|
g.setColor(Color.white);
|
||||||
|
g.drawRect(width / 2f - 3, height - marginX - hitErrorY - 10, 6, 20);
|
||||||
|
while (iter2.hasNext()) {
|
||||||
|
HitErrorInfo info = iter2.next();
|
||||||
|
int time = info.time;
|
||||||
|
if (Math.abs(info.timeDiff) < hitResultOffset[GameData.HIT_50]
|
||||||
|
&& time + fadeDelay > trackPosition) {
|
||||||
|
float alpha = 1 - ((float) (trackPosition - time) / fadeDelay);
|
||||||
|
Color col = new Color(Color.white);
|
||||||
|
col.a = alpha;
|
||||||
|
g.setColor(col);
|
||||||
|
g.fillRect(width / 2 + info.timeDiff - 1, height - marginX
|
||||||
|
- hitErrorY - 10, 2, 20);
|
||||||
|
} else {
|
||||||
|
iter2.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//*/
|
||||||
} else {
|
} else {
|
||||||
// grade
|
// grade
|
||||||
Grade grade = getGrade();
|
Grade grade = getGrade();
|
||||||
@@ -557,45 +604,7 @@ public class GameData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//*
|
|
||||||
//Draw Error bar
|
|
||||||
final int fadeDelay = 5000;
|
|
||||||
int hitErrorY = 30;
|
|
||||||
Iterator<ErrorInfo> iter2 = errorRateList.iterator();
|
|
||||||
g.setColor(Color.black);
|
|
||||||
g.fillRect(width/2f-3-hitResultOffset[HIT_50], height-marginX-hitErrorY-10,hitResultOffset[HIT_50]*2,20);
|
|
||||||
g.setColor(Utils.COLOR_LIGHT_ORANGE);
|
|
||||||
g.fillRect(width/2f-3-hitResultOffset[HIT_50], height-marginX-hitErrorY-3,hitResultOffset[HIT_50]*2,6);
|
|
||||||
g.setColor(Utils.COLOR_LIGHT_GREEN);
|
|
||||||
g.fillRect(width/2f-3-hitResultOffset[HIT_100], height-marginX-hitErrorY-3,hitResultOffset[HIT_100]*2,6);
|
|
||||||
g.setColor(Utils.COLOR_LIGHT_BLUE);
|
|
||||||
g.fillRect(width/2f-3-hitResultOffset[HIT_300], height-marginX-hitErrorY-3,hitResultOffset[HIT_300]*2,6);
|
|
||||||
g.setColor(Color.white);
|
|
||||||
g.drawRect(width/2f-3, height-marginX-hitErrorY-10, 6, 20);
|
|
||||||
while (iter2.hasNext()) {
|
|
||||||
ErrorInfo info = iter2.next();
|
|
||||||
int time = info.time;
|
|
||||||
if (time + fadeDelay > trackPosition) {
|
|
||||||
float alpha = 1 - ((float) (trackPosition - time) / fadeDelay);
|
|
||||||
g.setColor(Color.white.scaleCopy(alpha));
|
|
||||||
g.fillRect(width/2 + info.timeDiff-1, height-marginX-hitErrorY-10, 2, 20);
|
|
||||||
}else{
|
|
||||||
iter2.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
iter2 = mouseMissList.iterator();
|
|
||||||
while (iter2.hasNext()) {
|
|
||||||
ErrorInfo info = iter2.next();
|
|
||||||
int time = info.time;
|
|
||||||
if (time + fadeDelay > trackPosition) {
|
|
||||||
//float alpha = 1 - ((float) (trackPosition - time) / fadeDelay);
|
|
||||||
//g.setColor(Color.green.scaleCopy(alpha));
|
|
||||||
//g.fillRect(info.x-5, info.y-5, 10, 10);
|
|
||||||
}else{
|
|
||||||
iter2.remove();
|
|
||||||
}
|
|
||||||
}//*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1080,12 +1089,14 @@ public class GameData {
|
|||||||
*/
|
*/
|
||||||
public boolean isGameplay() { return gameplay; }
|
public boolean isGameplay() { return gameplay; }
|
||||||
|
|
||||||
public void addMouseMissPoint(int time, int x, int y, int button) {
|
/**
|
||||||
mouseMissList.add(new ErrorInfo(time, x, y, 0));
|
* add a Hit Error Info to the list.
|
||||||
}
|
* @param time when it should have been hit
|
||||||
|
* @param x, y the location that it hit
|
||||||
public void addErrorRate(int time, int x, int y, int timeDiff) {
|
* @param timeDiff the difference from the time from when it was actually hit
|
||||||
errorRateList.add(new ErrorInfo(time, x, y, timeDiff));
|
*/
|
||||||
|
public void addHitError(int time, int x, int y, int timeDiff) {
|
||||||
|
hitErrorList.add(new HitErrorInfo(time, x, y, timeDiff));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ public class Circle implements HitObject {
|
|||||||
int result = hitResult(timeDiff);
|
int result = hitResult(timeDiff);
|
||||||
|
|
||||||
if (result > -1) {
|
if (result > -1) {
|
||||||
data.addErrorRate(hitObject.getTime(), x, y, timeDiff);
|
data.addHitError(hitObject.getTime(), x, y, timeDiff);
|
||||||
data.hitResult(
|
data.hitResult(
|
||||||
hitObject.getTime(), result,
|
hitObject.getTime(), result,
|
||||||
hitObject.getX(), hitObject.getY(),
|
hitObject.getX(), hitObject.getY(),
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ public class Slider implements HitObject {
|
|||||||
//else not a hit
|
//else not a hit
|
||||||
|
|
||||||
if (result > -1) {
|
if (result > -1) {
|
||||||
data.addErrorRate(hitObject.getTime(), x,y,trackPosition - hitObject.getTime());
|
data.addHitError(hitObject.getTime(), x,y,trackPosition - hitObject.getTime());
|
||||||
sliderClicked = true;
|
sliderClicked = true;
|
||||||
data.sliderTickResult(hitObject.getTime(), result,
|
data.sliderTickResult(hitObject.getTime(), result,
|
||||||
hitObject.getX(), hitObject.getY(), hitObject.getHitSoundType());
|
hitObject.getX(), hitObject.getY(), hitObject.getHitSoundType());
|
||||||
|
|||||||
@@ -664,13 +664,8 @@ public class Game extends BasicGameState {
|
|||||||
objectIndex++; // circle hit
|
objectIndex++; // circle hit
|
||||||
|
|
||||||
// sliders
|
// sliders
|
||||||
else if (hitObject.isSlider() && hitObjects[objectIndex].mousePressed(x, y)){
|
else if (hitObject.isSlider())
|
||||||
|
hitObjects[objectIndex].mousePressed(x, y);
|
||||||
}
|
|
||||||
|
|
||||||
//Nothing hit
|
|
||||||
else
|
|
||||||
data.addMouseMissPoint(MusicController.getPosition(), x,y,button);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user