DDR Reader shows correct letter grades (#3)

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 2 years ago
parent 777d585c68
commit f1dd7dff87
  1. 28
      readers/DDRReader.java
  2. BIN
      result.png
  3. 2
      sigPlace.java

@ -20,6 +20,7 @@ public class DDRReader extends Reader{
final static int REGION_PADDING = 32;
List<Box> extraRegions = new ArrayList<>();
static int lastJump=0;
boolean failed=false;
public DDRReader(){
addRegion(new Box(305,428,402,69),NUMBER); //score[0]+
@ -155,6 +156,13 @@ public class DDRReader extends Reader{
arr = new int[readRegions.get(i).w*readRegions.get(i).h];
cutImg.setRGB(0,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
}
if (i==13) {
Color col = new Color(subRegion.getRGB(131,84),true);
ColorRange range = new ColorRange(130,135,130,135,130,135);
if (range.colorInRange(col)) {
failed=true;
}
}
currentHeight+=readRegions.get(i).h+REGION_PADDING;
}
Path output = Paths.get("result.png");
@ -264,6 +272,26 @@ public class DDRReader extends Reader{
case 12:{
other=other+",playstyle:\""+convertToString(splitter)+"\"";
}break;
case 13:{
if (failed) {
rank=15;/*F*/
} else
if (score>=999000) {rank=0;/*AAA*/} else
if (score>=950000) {rank=1;/*AA+*/} else
if (score>=900000) {rank=2;/*AA*/} else
if (score>=890000) {rank=3;/*AA-*/} else
if (score>=850000) {rank=4;/*A+*/} else
if (score>=800000) {rank=5;/*A*/} else
if (score>=790000) {rank=6;/*A-*/} else
if (score>=750000) {rank=7;/*B+*/} else
if (score>=700000) {rank=8;/*B*/} else
if (score>=690000) {rank=9;/*B-*/} else
if (score>=650000) {rank=10;/*C+*/} else
if (score>=600000) {rank=11;/*C*/} else
if (score>=590000) {rank=12;/*C-*/} else
if (score>=550000) {rank=13;/*D+*/} else
{rank=14;/*D*/}
}break;
case 14:{
title=convertToString(splitter);
}break;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 159 KiB

@ -116,7 +116,7 @@ public class sigPlace {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
ArcadeReader.retrieveData(Paths.get("ddr8.png"));
ArcadeReader.retrieveData(Paths.get("ddr10.png"));
/* Path secretFile = Paths.get(".clientsecret");
List<String> data;
try {

Loading…
Cancel
Save