Sound Voltex Grade implemeentation complete (#3)
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
a0c92e7b38
commit
ea48c681b4
@ -59,6 +59,6 @@ public class ArcadeReader {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static void retrieveData(Path img) {
|
public static void retrieveData(Path img) {
|
||||||
new ITGReader().interpretBoxes(img);
|
new SoundVoltexReader().interpretBoxes(img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,8 @@ public class SoundVoltexReader extends Reader{
|
|||||||
final static int REGION_PADDING = 32;
|
final static int REGION_PADDING = 32;
|
||||||
List<Box> extraRegions = new ArrayList<>();
|
List<Box> extraRegions = new ArrayList<>();
|
||||||
static int lastJump=0;
|
static int lastJump=0;
|
||||||
|
boolean effectiveRate=false;
|
||||||
|
boolean failed=false;
|
||||||
public SoundVoltexReader(){
|
public SoundVoltexReader(){
|
||||||
addRegion(new Box(385,1006,454,29)); //title[0]
|
addRegion(new Box(385,1006,454,29)); //title[0]
|
||||||
addRegion(new Box(476,1075,242,57),NUMBER); //bigscore[1]
|
addRegion(new Box(476,1075,242,57),NUMBER); //bigscore[1]
|
||||||
@ -337,6 +339,12 @@ public class SoundVoltexReader extends Reader{
|
|||||||
sig_data[counter++]=val;
|
sig_data[counter++]=val;
|
||||||
currentHeight+=readRegions.get(i).h+REGION_PADDING;
|
currentHeight+=readRegions.get(i).h+REGION_PADDING;
|
||||||
}
|
}
|
||||||
|
//912,1204
|
||||||
|
Color col = new Color(originalImg.getRGB(912,1204),true);
|
||||||
|
ColorRange range = new ColorRange(90,110,225,245,250,255);
|
||||||
|
if (range.colorInRange(col)) {
|
||||||
|
effectiveRate=true;
|
||||||
|
}
|
||||||
Path output = Paths.get("result.png");
|
Path output = Paths.get("result.png");
|
||||||
ImageIO.write(cutImg,"png",output.toFile());
|
ImageIO.write(cutImg,"png",output.toFile());
|
||||||
String dataString = readAllBoxes(output);
|
String dataString = readAllBoxes(output);
|
||||||
@ -414,10 +422,13 @@ public class SoundVoltexReader extends Reader{
|
|||||||
score=convertToInt(new String[]{Integer.toString(score),Integer.toString(score2)});
|
score=convertToInt(new String[]{Integer.toString(score),Integer.toString(score2)});
|
||||||
}break;
|
}break;
|
||||||
case 3:{
|
case 3:{
|
||||||
other+="ex:"+Integer.toString(convertToInt("EX SCORE",splitter))+",";
|
other+="{ex:"+Integer.toString(convertToInt("EX SCORE",splitter))+",";
|
||||||
}break;
|
}break;
|
||||||
case 4:{
|
case 4:{
|
||||||
pct=convertToDouble(splitter);//We're lucky excessive and effective rate have the same number of characters...
|
pct=convertToDouble(splitter);//We're lucky excessive and effective rate have the same number of characters...
|
||||||
|
if (effectiveRate&&pct<70) {
|
||||||
|
failed=true;
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
case 5:{
|
case 5:{
|
||||||
notes[0]=convertToInt("ERROR",splitter);
|
notes[0]=convertToInt("ERROR",splitter);
|
||||||
@ -470,6 +481,19 @@ public class SoundVoltexReader extends Reader{
|
|||||||
case 21:{
|
case 21:{
|
||||||
difficulty=convertToInt("EXH",splitter);
|
difficulty=convertToInt("EXH",splitter);
|
||||||
}break;
|
}break;
|
||||||
|
case 22:{
|
||||||
|
other+="failed:"+failed+"}";
|
||||||
|
if (score>=9900000) {rank=0;/*S*/} else
|
||||||
|
if (score>=9800000) {rank=1;/*AAA+*/} else
|
||||||
|
if (score>=9700000) {rank=2;/*AAA*/} else
|
||||||
|
if (score>=9500000) {rank=3;/*AA+*/} else
|
||||||
|
if (score>=9300000) {rank=4;/*AA*/} else
|
||||||
|
if (score>=9000000) {rank=5;/*A+*/} else
|
||||||
|
if (score>=8700000) {rank=6;/*A*/} else
|
||||||
|
if (score>=8000000) {rank=7;/*B*/} else
|
||||||
|
if (score>=7000000) {rank=8;/*C*/} else
|
||||||
|
{rank=9;/*D*/}
|
||||||
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println(this);
|
System.out.println(this);
|
||||||
|
BIN
result.png
BIN
result.png
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
@ -116,7 +116,7 @@ public class sigPlace {
|
|||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}*/
|
}*/
|
||||||
ArcadeReader.retrieveData(Paths.get("itg15.png"));
|
ArcadeReader.retrieveData(Paths.get("sdvx4.png"));
|
||||||
/* Path secretFile = Paths.get(".clientsecret");
|
/* Path secretFile = Paths.get(".clientsecret");
|
||||||
List<String> data;
|
List<String> data;
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user