Search in sources :

Example 1 with ModuleInstaller

use of org.terasology.engine.core.module.ModuleInstaller in project Terasology by MovingBlocks.

the class ModuleDetailsScreen method downloadModules.

private void downloadModules(Iterable<Module> modulesToDownload) {
    final WaitPopup<List<Module>> popup = getManager().pushScreen(WaitPopup.ASSET_URI, WaitPopup.class);
    ModuleInstaller operation = moduleManager.getInstallManager().createInstaller(modulesToDownload, new DownloadPopupProgressListener(popup));
    popup.startOperation(operation, true);
}
Also used : DownloadPopupProgressListener(org.terasology.engine.rendering.nui.layers.mainMenu.advancedGameSetupScreen.DownloadPopupProgressListener) ModuleInstaller(org.terasology.engine.core.module.ModuleInstaller) List(java.util.List) UIList(org.terasology.nui.widgets.UIList)

Example 2 with ModuleInstaller

use of org.terasology.engine.core.module.ModuleInstaller in project Terasology by MovingBlocks.

the class AdvancedGameSetupScreen method downloadModules.

private void downloadModules(Iterable<Module> modulesToDownload) {
    final WaitPopup<List<Module>> popup = getManager().pushScreen(WaitPopup.ASSET_URI, WaitPopup.class);
    popup.onSuccess(newModules -> {
        for (Module module : newModules) {
            modulesLookup.get(module.getId()).setLocalVersion(module);
            updateValidToSelect();
        }
    });
    ModuleInstaller operation = moduleManager.getInstallManager().createInstaller(modulesToDownload, new DownloadPopupProgressListener(popup));
    popup.startOperation(operation, true);
}
Also used : ModuleInstaller(org.terasology.engine.core.module.ModuleInstaller) List(java.util.List) UIList(org.terasology.nui.widgets.UIList) ArrayList(java.util.ArrayList) Module(org.terasology.gestalt.module.Module)

Aggregations

List (java.util.List)2 ModuleInstaller (org.terasology.engine.core.module.ModuleInstaller)2 UIList (org.terasology.nui.widgets.UIList)2 ArrayList (java.util.ArrayList)1 DownloadPopupProgressListener (org.terasology.engine.rendering.nui.layers.mainMenu.advancedGameSetupScreen.DownloadPopupProgressListener)1 Module (org.terasology.gestalt.module.Module)1