Search in sources :

Example 1 with IInstallTask

use of net.technicpack.launchercore.install.tasks.IInstallTask in project LauncherV3 by TechnicPack.

the class TechnicRelauncher method buildUpdaterTasks.

@Override
public InstallTasksQueue buildUpdaterTasks() {
    screen = new SplashScreen(resources.getImage("launch_splash.png"), 30);
    Color bg = LauncherFrame.COLOR_FORMELEMENT_INTERNAL;
    screen.getContentPane().setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(), 255));
    screen.getProgressBar().setForeground(Color.white);
    screen.getProgressBar().setBackground(LauncherFrame.COLOR_GREEN);
    screen.getProgressBar().setBackFill(LauncherFrame.COLOR_CENTRAL_BACK_OPAQUE);
    screen.getProgressBar().setFont(resources.getFont(ResourceLoader.FONT_OPENSANS, 12));
    screen.pack();
    screen.setLocationRelativeTo(null);
    screen.setVisible(true);
    InstallTasksQueue<Object> queue = new InstallTasksQueue<Object>(screen.getProgressBar(), createMirrorStore());
    ArrayList<IInstallTask> postDownloadTasks = new ArrayList<IInstallTask>();
    postDownloadTasks.add(new LaunchMoverMode(resources.getString("updater.launchmover"), getTempLauncher(), this));
    TaskGroup downloadFilesGroup = new TaskGroup(resources.getString("updater.downloads"));
    queue.addTask(new EnsureUpdateFolders(resources.getString("updater.folders"), getDirectories()));
    queue.addTask(new QueryUpdateStream(resources.getString("updater.query"), updateStream, downloadFilesGroup, getDirectories(), this, postDownloadTasks));
    queue.addTask(downloadFilesGroup);
    return queue;
}
Also used : IInstallTask(net.technicpack.launchercore.install.tasks.IInstallTask) ArrayList(java.util.ArrayList) SplashScreen(net.technicpack.ui.controls.installation.SplashScreen) InstallTasksQueue(net.technicpack.launchercore.install.InstallTasksQueue) TaskGroup(net.technicpack.launchercore.install.tasks.TaskGroup)

Aggregations

ArrayList (java.util.ArrayList)1 InstallTasksQueue (net.technicpack.launchercore.install.InstallTasksQueue)1 IInstallTask (net.technicpack.launchercore.install.tasks.IInstallTask)1 TaskGroup (net.technicpack.launchercore.install.tasks.TaskGroup)1 SplashScreen (net.technicpack.ui.controls.installation.SplashScreen)1