diff --git a/ArcadeReader.java b/ArcadeReader.java index d288478..b7e0753 100644 --- a/ArcadeReader.java +++ b/ArcadeReader.java @@ -59,6 +59,6 @@ public class ArcadeReader { * */ public static void retrieveData(Path img) { - new LoveLiveReader().interpretBoxes(img); + new PopnReader().interpretBoxes(img); } } diff --git a/readers/PopnReader.java b/readers/PopnReader.java index 37b1858..d5825c6 100644 --- a/readers/PopnReader.java +++ b/readers/PopnReader.java @@ -2,6 +2,7 @@ package readers; import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; +import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; @@ -12,20 +13,23 @@ import java.util.regex.Pattern; import javax.imageio.ImageIO; +import readers.fonts.Font; +import readers.fonts.Glyph; + public class PopnReader extends Reader{ List extraRegions = new ArrayList<>(); static int lastJump=0; public PopnReader(){ - readRegions.add(new Box(941,609,275,54)); //score[0] - readRegions.add(new Box(1060,684,157,40)); //cool[1] - readRegions.add(new Box(1060,724,157,39)); //great[2] - readRegions.add(new Box(1060,761,157,40)); //good[3] - readRegions.add(new Box(1060,800,157,40)); //bad[4] - readRegions.add(new Box(1060,858,157,42)); //combo[5] - readRegions.add(new Box(970,288,271,50)); //diff[6] - readRegions.add(new Box(689,345,547,128)); //song[7] - readRegions.add(new Box(502,23,314,288)); //rating[8] - readRegions.add(new Box(692,525,532,16)); //lifebar[9] + addRegion(new Box(941,609,275,54),NUMBER); //score[0] + addRegion(new Box(1060,684,157,40),NUMBER); //cool[1] + addRegion(new Box(1060,724,157,39),NUMBER); //great[2] + addRegion(new Box(1060,761,157,40),NUMBER); //good[3] + addRegion(new Box(1060,800,157,40),NUMBER); //bad[4] + addRegion(new Box(1060,858,157,42),NUMBER); //combo[5] + addRegion(new Box(970,288,271,50)); //diff[6] + addRegion(new Box(689,345,547,128)); //song[7] + addRegion(new Box(502,23,314,288)); //rating[8] + addRegion(new Box(692,525,532,16)); //lifebar[9] extraRegions.add(new Box(699,616,179,44)); //score text[0] extraRegions.add(new Box(712,680,164,40)); //cool text[1] @@ -34,6 +38,7 @@ public class PopnReader extends Reader{ extraRegions.add(new Box(712,800,101,38)); //bad text[4] extraRegions.add(new Box(708,861,170,39)); //combo text[5] extraRegions.add(new Box(970,290,194,47)); //diff text[6] + init(); } void ColorFilter(int[] arr,int region,int width) { @@ -123,6 +128,7 @@ public class PopnReader extends Reader{ int regionHeights = 0; int maxWidth = 0; + int counter = 0; for (int i=0;imaxWidth) { @@ -135,37 +141,21 @@ public class PopnReader extends Reader{ Graphics2D g = cutImg.createGraphics(); int currentHeight=0; for (int i=0;irightMost) { - rightMost=j%extraRegions.get(i).w; - } - } - //cutImg.setRGB(rightMost-leftMost,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w); - cutImg.setRGB(0,currentHeight,extraRegions.get(i).w,extraRegions.get(i).h,arr2,0,extraRegions.get(i).w); - final int PADDING = 4; - for (int x=leftMost;x glyphs = Glyph.split(cutImg); + return f.convertGlyphs(glyphs); + } + case 1: + case 2: + case 3: + case 4:{ + Font f = Font.FONT_POPN_NOTECOUNT; + List glyphs = Glyph.split(cutImg); + return f.convertGlyphs(glyphs); + } + case 5:{ + Font f = Font.FONT_POPN_COMBO; + List glyphs = Glyph.split(cutImg); + return f.convertGlyphs(glyphs); + } + } + return ""; + } + @Override void interpretResults(String[] finalData) { for (int i=0;i data; try { diff --git a/sub.png b/sub.png index 83bd239..2819cb6 100644 Binary files a/sub.png and b/sub.png differ