Search in sources :

Example 1 with MyAssetDownloader

use of jack.rm.files.MyAssetDownloader in project rom-manager by Jakz.

the class Main method loadRomSet.

public static void loadRomSet(GameSet romSet) throws FileNotFoundException, IOException {
    if (current != null)
        setManager.saveSetStatus(current);
    GameSet set = setManager.loadSet(romSet);
    current = set;
    boolean wasInit = setManager.loadSetStatus(set);
    MyGameSetFeatures helper = set.helper();
    helper.pluginStateChanged();
    mainFrame.romSetLoaded(set);
    MyGameSetFeatures features = set.helper();
    features.organizer().computeStatus();
    helper.scanner().scanForRoms(!wasInit && GlobalSettings.settings.shouldScanWhenLoadingRomset());
    downloader = new MyAssetDownloader(set);
/*List<Game> favourites = set.filter("is:fav");
    Fetcher<GameEntry> source = new MultipleGameSource(favourites);
    Mutuator<GameEntry> sorter = new OrganizeByAttribute(GameAttribute.TAG, false);
    Mutuator<GameEntry> renamer = new RenameByExportTitle();
    Dumper<GameEntry> dumper = new GameConsolidator(Paths.get("/Users/jack/Desktop/everdrive"));
    Workflow<GameEntry> workflow = new Workflow<>(source,dumper);
    workflow.addStep(new LogOperation());
    workflow.addStep(sorter);
    workflow.addStep(renamer);
    workflow.addStep(e -> {
      Game g = e.getGame();
      if (g.hasAnyCustomAttribute() && !g.isFavourite())
        System.out.println("Missing favorite on "+g.getTitle());
      return e;
    });
    workflow.execute();
    java.lang.System.exit(0);*/
/*List<Rom> favourites = set.filter("is:fav");*/
/*List<Rom> favs = set.filter("is:fav");
    final Optional<Integer> c = Optional.of(0);
    Fetcher<RomHandle> source = new MultipleRomSource(favs);
    Dumper<RomHandle> dumper = new RomConsolidator(Paths.get("/Volumes/Vicky/nds"));
    Workflow<RomHandle> workflow = new Workflow<>(source, dumper);
    workflow.addStep(rh -> { java.lang.System.out.println(c.get()+" of "+favs.size()); return rh; });
    workflow.execute();*/
// IPSPatchOperation ipsOperation = new IPSPatchOperation();
// ipsOperation.toggleAutomaticPatching(true);
// workflow.addBenchmarkedStep(new LogOperation());
// workflow.addBenchmarkedStep(ipsOperation);
// workflow.addBenchmarkedStep(new GBASleepHackOperation());
// workflow.addBenchmarkedStep(new TrimOperation(new byte[] {0x00, (byte)0xff}));
// workflow.addStep(new SortByAttributeOperation(RomAttribute.TAG, false));
// workflow.execute();
// java.lang.System.exit(0);
/*
    try
    {
      BinaryBuffer buffer = new BinaryBuffer("/Users/jack/Documents/Dev/gba/sma-m.gba", BinaryBuffer.Mode.WRITE, ByteOrder.LITTLE_ENDIAN);
      java.lang.System.out.println(buffer.length());
      new GBASleepHack().patch(buffer);
      buffer.close();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    
    java.lang.System.exit(0);*/
}
Also used : MyGameSetFeatures(jack.rm.data.romset.MyGameSetFeatures) MyAssetDownloader(jack.rm.files.MyAssetDownloader) GameSet(com.github.jakz.romlib.data.set.GameSet)

Aggregations

GameSet (com.github.jakz.romlib.data.set.GameSet)1 MyGameSetFeatures (jack.rm.data.romset.MyGameSetFeatures)1 MyAssetDownloader (jack.rm.files.MyAssetDownloader)1