Search in sources :

Example 1 with DependencyResolutionFailedException

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

the class ModuleDetailsScreen method startDownloadingNewestModulesRequiredFor.

private void startDownloadingNewestModulesRequiredFor(final DependencyInfo dependencyInfo) {
    final Set<Module> modulesToDownload;
    try {
        modulesToDownload = moduleManager.getInstallManager().getAllModulesToDownloadFor(dependencyInfo.getId());
    } catch (DependencyResolutionFailedException ex) {
        MessagePopup messagePopup = getManager().pushScreen(MessagePopup.ASSET_URI, MessagePopup.class);
        messagePopup.setMessage("Error", ex.getMessage());
        return;
    }
    final ConfirmPopup confirmPopup = getManager().pushScreen(ConfirmPopup.ASSET_URI, ConfirmPopup.class);
    confirmPopup.setMessage("Confirm Download", modulesToDownload.size() + " modules will be downloaded");
    confirmPopup.setOkHandler(() -> downloadModules(modulesToDownload));
}
Also used : ConfirmPopup(org.terasology.engine.rendering.nui.layers.mainMenu.ConfirmPopup) DependencyResolutionFailedException(org.terasology.engine.core.module.DependencyResolutionFailedException) MessagePopup(org.terasology.engine.rendering.nui.layers.mainMenu.MessagePopup) Module(org.terasology.gestalt.module.Module)

Example 2 with DependencyResolutionFailedException

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

the class AdvancedGameSetupScreen method startDownloadingNewestModulesRequiredFor.

private void startDownloadingNewestModulesRequiredFor(ModuleSelectionInfo moduleMetadata) {
    Set<Module> modulesToDownload;
    try {
        modulesToDownload = moduleManager.getInstallManager().getAllModulesToDownloadFor(moduleMetadata.getMetadata().getId());
    } catch (DependencyResolutionFailedException ex) {
        MessagePopup messagePopup = getManager().pushScreen(MessagePopup.ASSET_URI, MessagePopup.class);
        messagePopup.setMessage("Error", ex.getMessage());
        return;
    }
    ConfirmPopup confirmPopup = getManager().pushScreen(ConfirmPopup.ASSET_URI, ConfirmPopup.class);
    confirmPopup.setMessage("Confirm Download", modulesToDownload.size() + " modules will be downloaded");
    confirmPopup.setOkHandler(() -> downloadModules(modulesToDownload));
}
Also used : ConfirmPopup(org.terasology.engine.rendering.nui.layers.mainMenu.ConfirmPopup) DependencyResolutionFailedException(org.terasology.engine.core.module.DependencyResolutionFailedException) MessagePopup(org.terasology.engine.rendering.nui.layers.mainMenu.MessagePopup) Module(org.terasology.gestalt.module.Module)

Aggregations

DependencyResolutionFailedException (org.terasology.engine.core.module.DependencyResolutionFailedException)2 ConfirmPopup (org.terasology.engine.rendering.nui.layers.mainMenu.ConfirmPopup)2 MessagePopup (org.terasology.engine.rendering.nui.layers.mainMenu.MessagePopup)2 Module (org.terasology.gestalt.module.Module)2