mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-13 05:46:59 -04:00
Render supported mod loader in org.jackhuang.hmcl.ui.versions.DownloadPage.ModItem. Support #2284 (#2296)
This commit is contained in:
parent
9549819571
commit
cf61abcf03
@ -35,6 +35,7 @@ import javafx.scene.image.Image;
|
|||||||
import javafx.scene.image.ImageView;
|
import javafx.scene.image.ImageView;
|
||||||
import javafx.scene.layout.*;
|
import javafx.scene.layout.*;
|
||||||
import javafx.stage.FileChooser;
|
import javafx.stage.FileChooser;
|
||||||
|
import org.jackhuang.hmcl.mod.ModLoaderType;
|
||||||
import org.jackhuang.hmcl.mod.ModManager;
|
import org.jackhuang.hmcl.mod.ModManager;
|
||||||
import org.jackhuang.hmcl.mod.RemoteMod;
|
import org.jackhuang.hmcl.mod.RemoteMod;
|
||||||
import org.jackhuang.hmcl.mod.RemoteModRepository;
|
import org.jackhuang.hmcl.mod.RemoteModRepository;
|
||||||
@ -105,9 +106,9 @@ public class DownloadPage extends Control implements DecoratorPage {
|
|||||||
setFailed(false);
|
setFailed(false);
|
||||||
|
|
||||||
Task.allOf(
|
Task.allOf(
|
||||||
Task.supplyAsync(() -> addon.getData().loadDependencies(repository)),
|
Task.supplyAsync(() -> addon.getData().loadDependencies(repository)),
|
||||||
Task.supplyAsync(() -> {
|
Task.supplyAsync(() -> {
|
||||||
Stream<RemoteMod.Version> versions = addon.getData().loadVersions(repository);
|
Stream<RemoteMod.Version> versions = addon.getData().loadVersions(repository);
|
||||||
// if (StringUtils.isNotBlank(version.getVersion())) {
|
// if (StringUtils.isNotBlank(version.getVersion())) {
|
||||||
// Optional<String> gameVersion = GameVersion.minecraftVersion(versionJar);
|
// Optional<String> gameVersion = GameVersion.minecraftVersion(versionJar);
|
||||||
// if (gameVersion.isPresent()) {
|
// if (gameVersion.isPresent()) {
|
||||||
@ -115,8 +116,8 @@ public class DownloadPage extends Control implements DecoratorPage {
|
|||||||
// .filter(file -> file.getGameVersions().contains(gameVersion.get())));
|
// .filter(file -> file.getGameVersions().contains(gameVersion.get())));
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
return sortVersions(versions);
|
return sortVersions(versions);
|
||||||
}))
|
}))
|
||||||
.whenComplete(Schedulers.javafx(), (result, exception) -> {
|
.whenComplete(Schedulers.javafx(), (result, exception) -> {
|
||||||
if (exception == null) {
|
if (exception == null) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@ -409,6 +410,23 @@ public class DownloadPage extends Control implements DecoratorPage {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (ModLoaderType modLoaderType : dataItem.getLoaders()) {
|
||||||
|
switch (modLoaderType) {
|
||||||
|
case FORGE:
|
||||||
|
graphicPane.getChildren().setAll(SVG.releaseCircleOutline(Theme.blackFillBinding(), 24, 24));
|
||||||
|
content.getTags().add(i18n("install.installer.forge"));
|
||||||
|
break;
|
||||||
|
case FABRIC:
|
||||||
|
graphicPane.getChildren().setAll(SVG.releaseCircleOutline(Theme.blackFillBinding(), 24, 24));
|
||||||
|
content.getTags().add(i18n("install.installer.fabric"));
|
||||||
|
break;
|
||||||
|
case LITE_LOADER:
|
||||||
|
graphicPane.getChildren().setAll(SVG.releaseCircleOutline(Theme.blackFillBinding(), 24, 24));
|
||||||
|
content.getTags().add(i18n("install.installer.liteloader"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Workaround for https://github.com/huanghongxun/HMCL/issues/2129
|
// Workaround for https://github.com/huanghongxun/HMCL/issues/2129
|
||||||
this.setMinHeight(50);
|
this.setMinHeight(50);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user