Search in sources :

Example 1 with PackBuildItem

use of net.technicpack.launcher.ui.listitems.PackBuildItem in project LauncherV3 by TechnicPack.

the class ModpackOptionsDialog method selectRecommended.

protected void selectRecommended() {
    manualBuildList.setBorder(new RoundBorder(LauncherFrame.COLOR_GREY_TEXT, 1, 10));
    manualBuildList.setEnabled(false);
    manualBuildList.setSelectedItem(new PackBuildItem(modpack.getRecommendedBuild(), resources, modpack));
    this.modpack.setBuild(InstalledPack.RECOMMENDED);
}
Also used : PackBuildItem(net.technicpack.launcher.ui.listitems.PackBuildItem) RoundBorder(net.technicpack.ui.controls.borders.RoundBorder)

Example 2 with PackBuildItem

use of net.technicpack.launcher.ui.listitems.PackBuildItem in project LauncherV3 by TechnicPack.

the class ModpackOptionsDialog method selectManual.

protected void selectManual() {
    if (manualBuildList.getItemCount() == 0)
        return;
    // (could be an actual build string (like "1.0"), "recommended" or "latest")
    if (manualBuildList.getSelectedItem() == null)
        manualBuildList.setSelectedItem(new PackBuildItem(modpack.getBuild(), resources, modpack));
    // Still nothing is selected, try to fallback to the recommended build
    if (manualBuildList.getSelectedItem() == null)
        manualBuildList.setSelectedItem(new PackBuildItem(modpack.getRecommendedBuild(), resources, modpack));
    // so we try to select the first available one (we already know there's at least 1 build available)
    if (manualBuildList.getSelectedIndex() == -1) {
        manualBuildList.setSelectedIndex(0);
    }
    this.modpack.setBuild(((PackBuildItem) manualBuildList.getSelectedItem()).getBuildNumber());
    manualBuildList.setBorder(new RoundBorder(LauncherFrame.COLOR_BUTTON_BLUE, 1, 10));
    manualBuildList.setEnabled(true);
}
Also used : PackBuildItem(net.technicpack.launcher.ui.listitems.PackBuildItem) RoundBorder(net.technicpack.ui.controls.borders.RoundBorder)

Example 3 with PackBuildItem

use of net.technicpack.launcher.ui.listitems.PackBuildItem in project LauncherV3 by TechnicPack.

the class ModpackOptionsDialog method selectLatest.

protected void selectLatest() {
    manualBuildList.setBorder(new RoundBorder(LauncherFrame.COLOR_GREY_TEXT, 1, 10));
    manualBuildList.setEnabled(false);
    manualBuildList.setSelectedItem(new PackBuildItem(modpack.getLatestBuild(), resources, modpack));
    this.modpack.setBuild(InstalledPack.LATEST);
}
Also used : PackBuildItem(net.technicpack.launcher.ui.listitems.PackBuildItem) RoundBorder(net.technicpack.ui.controls.borders.RoundBorder)

Example 4 with PackBuildItem

use of net.technicpack.launcher.ui.listitems.PackBuildItem in project LauncherV3 by TechnicPack.

the class ModpackOptionsDialog method initValues.

private void initValues() {
    File installDir = modpack.getInstalledDirectory();
    if (installDir == null) {
        installField.setText(resources.getString("modpackoptions.installfolder.none"));
    } else {
        installField.setText(installDir.getAbsolutePath());
    }
    for (String build : modpack.getBuilds()) {
        manualBuildList.insertItemAt(new PackBuildItem(build, resources, modpack), 0);
    }
    if (manualBuildList.getItemCount() == 0) {
        recommended.setEnabled(false);
        latest.setEnabled(false);
        manual.setEnabled(false);
        recommended.setSelected(true);
        manualBuildList.addItem(new PackBuildItem(resources.getString("modpackoptions.version.missing"), resources, modpack));
        manualBuildList.setEnabled(false);
        return;
    }
    String build = modpack.getBuild();
    if (build.equals(InstalledPack.RECOMMENDED)) {
        recommended.setSelected(true);
        selectRecommended();
    } else if (build.equals(InstalledPack.LATEST)) {
        latest.setSelected(true);
        selectLatest();
    } else {
        manual.setSelected(true);
        selectManual();
    }
}
Also used : PackBuildItem(net.technicpack.launcher.ui.listitems.PackBuildItem) File(java.io.File)

Aggregations

PackBuildItem (net.technicpack.launcher.ui.listitems.PackBuildItem)4 RoundBorder (net.technicpack.ui.controls.borders.RoundBorder)3 File (java.io.File)1