mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-01-30 14:39:56 +08:00
parent
5afeb3d019
commit
f972c49762
@ -192,7 +192,8 @@ public final class ExportWizardProvider implements WizardProvider {
|
|||||||
/* overrideJavaArgs */ true,
|
/* overrideJavaArgs */ true,
|
||||||
/* overrideConsole */ true,
|
/* overrideConsole */ true,
|
||||||
/* overrideCommands */ true,
|
/* overrideCommands */ true,
|
||||||
/* overrideWindow */ true
|
/* overrideWindow */ true,
|
||||||
|
/* iconKey */ null // TODO
|
||||||
), modpackFile);
|
), modpackFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ public final class MultiMCInstanceConfiguration implements ModpackManifest {
|
|||||||
private final boolean overrideConsole; // OverrideConsole
|
private final boolean overrideConsole; // OverrideConsole
|
||||||
private final boolean overrideCommands; // OverrideCommands
|
private final boolean overrideCommands; // OverrideCommands
|
||||||
private final boolean overrideWindow; // OverrideWindow
|
private final boolean overrideWindow; // OverrideWindow
|
||||||
|
private final String iconKey;
|
||||||
|
|
||||||
private final MultiMCManifest mmcPack;
|
private final MultiMCManifest mmcPack;
|
||||||
|
|
||||||
@ -94,6 +95,7 @@ public final class MultiMCInstanceConfiguration implements ModpackManifest {
|
|||||||
wrapperCommand = readValue(p, "WrapperCommand");
|
wrapperCommand = readValue(p, "WrapperCommand");
|
||||||
name = defaultName;
|
name = defaultName;
|
||||||
notes = Optional.ofNullable(readValue(p, "notes")).orElse("");
|
notes = Optional.ofNullable(readValue(p, "notes")).orElse("");
|
||||||
|
iconKey = readValue(p, "iconKey");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,7 +114,7 @@ public final class MultiMCInstanceConfiguration implements ModpackManifest {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MultiMCInstanceConfiguration(String instanceType, String name, String gameVersion, Integer permGen, String wrapperCommand, String preLaunchCommand, String postExitCommand, String notes, String javaPath, String jvmArgs, boolean fullscreen, Integer width, Integer height, Integer maxMemory, Integer minMemory, boolean showConsole, boolean showConsoleOnError, boolean autoCloseConsole, boolean overrideMemory, boolean overrideJavaLocation, boolean overrideJavaArgs, boolean overrideConsole, boolean overrideCommands, boolean overrideWindow) {
|
public MultiMCInstanceConfiguration(String instanceType, String name, String gameVersion, Integer permGen, String wrapperCommand, String preLaunchCommand, String postExitCommand, String notes, String javaPath, String jvmArgs, boolean fullscreen, Integer width, Integer height, Integer maxMemory, Integer minMemory, boolean showConsole, boolean showConsoleOnError, boolean autoCloseConsole, boolean overrideMemory, boolean overrideJavaLocation, boolean overrideJavaArgs, boolean overrideConsole, boolean overrideCommands, boolean overrideWindow, String iconKey) {
|
||||||
this.instanceType = instanceType;
|
this.instanceType = instanceType;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.gameVersion = gameVersion;
|
this.gameVersion = gameVersion;
|
||||||
@ -138,6 +140,7 @@ public final class MultiMCInstanceConfiguration implements ModpackManifest {
|
|||||||
this.overrideCommands = overrideCommands;
|
this.overrideCommands = overrideCommands;
|
||||||
this.overrideWindow = overrideWindow;
|
this.overrideWindow = overrideWindow;
|
||||||
this.mmcPack = null;
|
this.mmcPack = null;
|
||||||
|
this.iconKey = iconKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInstanceType() {
|
public String getInstanceType() {
|
||||||
@ -310,6 +313,10 @@ public final class MultiMCInstanceConfiguration implements ModpackManifest {
|
|||||||
return overrideWindow;
|
return overrideWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIconKey() {
|
||||||
|
return iconKey;
|
||||||
|
}
|
||||||
|
|
||||||
public Properties toProperties() {
|
public Properties toProperties() {
|
||||||
Properties p = new Properties();
|
Properties p = new Properties();
|
||||||
if (instanceType != null) p.setProperty("InstanceType", instanceType);
|
if (instanceType != null) p.setProperty("InstanceType", instanceType);
|
||||||
@ -336,6 +343,7 @@ public final class MultiMCInstanceConfiguration implements ModpackManifest {
|
|||||||
if (wrapperCommand != null) p.setProperty("WrapperCommand", wrapperCommand);
|
if (wrapperCommand != null) p.setProperty("WrapperCommand", wrapperCommand);
|
||||||
if (name != null) p.setProperty("name", name);
|
if (name != null) p.setProperty("name", name);
|
||||||
if (notes != null) p.setProperty("notes", notes);
|
if (notes != null) p.setProperty("notes", notes);
|
||||||
|
if (iconKey != null) p.setProperty("iconKey", iconKey);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,6 +199,14 @@ public final class MultiMCModpackInstallTask extends Task<Void> {
|
|||||||
Path jarmods = root.resolve("jarmods");
|
Path jarmods = root.resolve("jarmods");
|
||||||
if (Files.exists(jarmods))
|
if (Files.exists(jarmods))
|
||||||
FileUtils.copyDirectory(jarmods, repository.getVersionRoot(name).toPath().resolve("jarmods"));
|
FileUtils.copyDirectory(jarmods, repository.getVersionRoot(name).toPath().resolve("jarmods"));
|
||||||
|
|
||||||
|
String iconKey = this.manifest.getIconKey();
|
||||||
|
if (iconKey != null) {
|
||||||
|
Path iconFile = root.resolve(iconKey + ".png");
|
||||||
|
if (Files.exists(iconFile)) {
|
||||||
|
FileUtils.copyFile(iconFile, repository.getVersionRoot(name).toPath().resolve("icon.png"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies.add(repository.saveAsync(version));
|
dependencies.add(repository.saveAsync(version));
|
||||||
|
Loading…
Reference in New Issue
Block a user