Love Live parser with sig data implemented (#1)
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
9de057852a
commit
111c27e3fc
@ -59,6 +59,6 @@ public class ArcadeReader {
|
||||
*
|
||||
*/
|
||||
public static void retrieveData(Path img) {
|
||||
new PopnReader().interpretBoxes(img);
|
||||
new LoveLiveReader().interpretBoxes(img);
|
||||
}
|
||||
}
|
||||
|
@ -218,9 +218,7 @@ public class LoveLiveReader extends Reader{
|
||||
ImageIO.write(subRegion,"png",new File("sub.png"));
|
||||
cutImg.setRGB(0,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
|
||||
String val = interpretImage(subRegion,i);
|
||||
if (!val.isEmpty()) {
|
||||
sig_data[counter++]=val;
|
||||
}
|
||||
//System.out.println(i+": "+currentHeight+"-"+(currentHeight+readRegions.get(i).h+REGION_PADDING));
|
||||
currentHeight+=readRegions.get(i).h+REGION_PADDING;
|
||||
}
|
||||
@ -235,7 +233,7 @@ public class LoveLiveReader extends Reader{
|
||||
System.out.println(Arrays.toString(ja_data));
|
||||
System.out.println(Arrays.toString(en_data));
|
||||
System.out.println(Arrays.toString(sig_data));
|
||||
//interpretOutput(ja_data,en_data);
|
||||
interpretOutput(ja_data,en_data,sig_data);
|
||||
g.dispose();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@ -297,43 +295,26 @@ public class LoveLiveReader extends Reader{
|
||||
notes[4]=convertToInt("MISS",splitter);
|
||||
}break;
|
||||
case 7:{
|
||||
difficulty=getDifficulty(convertToString(splitter).toLowerCase());
|
||||
//difficulty=getDifficulty(convertToString(splitter).toLowerCase()); //I think we'll use the number instead. Assume CHALLENGE.
|
||||
}break;
|
||||
case 8:{
|
||||
title=convertToString(splitter);
|
||||
}break;
|
||||
case 9:{
|
||||
pct=convertToPct(splitter);
|
||||
//pct=convertToPct(splitter); //No longer used.
|
||||
pct=convertToDouble(splitter);
|
||||
}break;
|
||||
case 10:{
|
||||
maxcombo=convertToInt(splitter);
|
||||
}break;
|
||||
case 11:{
|
||||
difficulty=convertToInt(splitter);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
System.out.println(this);
|
||||
}
|
||||
|
||||
double convertToPct(String[] str) {
|
||||
int front=convertToInt(new String[]{str[1]});
|
||||
int decimal=convertToInt(new String[]{str[2]});
|
||||
double numb=0;
|
||||
int placeValue=0;
|
||||
int decimalPlaces=0;
|
||||
while (decimal!=0) {
|
||||
numb+=(decimal%10)*(Math.pow(10,placeValue++));
|
||||
decimal/=10;
|
||||
decimalPlaces++;
|
||||
}
|
||||
while (front!=0) {
|
||||
numb+=(front%10)*(Math.pow(10,placeValue++));
|
||||
front/=10;
|
||||
}
|
||||
for (int i=0;i<decimalPlaces;i++) {
|
||||
numb/=10;
|
||||
}
|
||||
return numb;
|
||||
}
|
||||
|
||||
int getDifficulty(String str) {
|
||||
final String[] diffs={"easy","normal","hard","master","challenge"};
|
||||
for (int i=0;i<diffs.length;i++) {
|
||||
|
BIN
result.png
BIN
result.png
Binary file not shown.
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 33 KiB |
@ -116,7 +116,7 @@ public class sigPlace {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
ArcadeReader.retrieveData(Paths.get("popn12.png"));
|
||||
ArcadeReader.retrieveData(Paths.get("lovelive1.png"));
|
||||
/* Path secretFile = Paths.get(".clientsecret");
|
||||
List<String> data;
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user