Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions HMCL/src/main/java/org/jackhuang/hmcl/game/LauncherHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,6 @@ private void launch0() {
return null;
return Task.allOf(
dependencyManager.checkGameCompletionAsync(version.get(), integrityCheck),
Task.composeAsync(() -> {
try {
ModpackConfiguration<?> configuration = ModpackHelper.readModpackConfiguration(repository.getModpackConfiguration(selectedVersion));
ModpackProvider provider = ModpackHelper.getProviderByType(configuration.getType());
if (provider == null) return null;
else return provider.createCompletionTask(dependencyManager, selectedVersion);
} catch (IOException e) {
return null;
}
}),
Task.composeAsync(() -> {
Renderer renderer = setting.getRenderer();
if (renderer != Renderer.DEFAULT && OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
Expand Down Expand Up @@ -196,6 +186,21 @@ private void launch0() {
})
);
}).withStage("launch.state.dependencies")
.thenComposeAsync(() -> {
if (setting.isNotCheckpack()) {
return null;
}
return Task.composeAsync(() -> {
try {
ModpackConfiguration<?> configuration = ModpackHelper.readModpackConfiguration(repository.getModpackConfiguration(selectedVersion));
ModpackProvider provider = ModpackHelper.getProviderByType(configuration.getType());
if (provider == null) return null;
else return provider.createCompletionTask(dependencyManager, selectedVersion);
} catch (IOException e) {
return null;
}
});
}).withStage("launch.state.dependencies")
.thenComposeAsync(() -> gameVersion.map(s -> new GameVerificationFixTask(dependencyManager, s, version.get())).orElse(null))
.thenComposeAsync(() -> logIn(account).withStage("launch.state.logging_in"))
.thenComposeAsync(authInfo -> Task.supplyAsync(() -> {
Expand Down
17 changes: 17 additions & 0 deletions HMCL/src/main/java/org/jackhuang/hmcl/setting/VersionSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,23 @@ public void setNotCheckGame(boolean notCheckGame) {
notCheckGameProperty.set(notCheckGame);
}

private final BooleanProperty notCheckModpackProperty = new SimpleBooleanProperty(this, "notCheckModpackMod", false);

public BooleanProperty notCheckModpackProperty() {
return notCheckModpackProperty;
}

/**
* True if HMCL does not check modpack's completeness.
*/
public boolean isNotCheckpack() {
return notCheckModpackProperty.get();
}

public void setNotCheckModpack(boolean notCheckModpackMod) {
notCheckModpackProperty.set(notCheckModpackMod);
}

private final BooleanProperty notPatchNativesProperty = new SimpleBooleanProperty(this, "notPatchNatives", false);

public BooleanProperty notPatchNativesProperty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public final class AdvancedVersionSettingPage extends StackPane implements Decor
private final OptionToggleButton noJVMArgsPane;
private final OptionToggleButton noOptimizingJVMArgsPane;
private final OptionToggleButton noGameCheckPane;
private final OptionToggleButton noModpackCheckPane;
private final OptionToggleButton noJVMCheckPane;
private final OptionToggleButton noNativesPatchPane;
private final OptionToggleButton useNativeGLFWPane;
Expand Down Expand Up @@ -193,6 +194,9 @@ public AdvancedVersionSettingPage(Profile profile, @Nullable String versionId, V
noGameCheckPane = new OptionToggleButton();
noGameCheckPane.setTitle(i18n("settings.advanced.dont_check_game_completeness"));

noModpackCheckPane = new OptionToggleButton();
noModpackCheckPane.setTitle(i18n("settings.advanced.dont_check_modpack_completeness"));

noJVMCheckPane = new OptionToggleButton();
noJVMCheckPane.setTitle(i18n("settings.advanced.dont_check_jvm_validity"));

Expand All @@ -206,7 +210,7 @@ public AdvancedVersionSettingPage(Profile profile, @Nullable String versionId, V
useNativeOpenALPane.setTitle(i18n("settings.advanced.use_native_openal"));

workaroundPane.getContent().setAll(
nativesDirSublist, rendererPane, noJVMArgsPane, noOptimizingJVMArgsPane, noGameCheckPane,
nativesDirSublist, rendererPane, noJVMArgsPane, noOptimizingJVMArgsPane, noGameCheckPane, noModpackCheckPane,
noJVMCheckPane, noNativesPatchPane
);

Expand Down Expand Up @@ -240,6 +244,7 @@ void bindProperties() {
FXUtils.bindString(txtPostExitCommand, versionSetting.postExitCommandProperty());
FXUtils.bindEnum(cboRenderer, versionSetting.rendererProperty());
noGameCheckPane.selectedProperty().bindBidirectional(versionSetting.notCheckGameProperty());
noModpackCheckPane.selectedProperty().bindBidirectional(versionSetting.notCheckModpackProperty());
noJVMCheckPane.selectedProperty().bindBidirectional(versionSetting.notCheckJVMProperty());
noJVMArgsPane.selectedProperty().bindBidirectional(versionSetting.noJVMArgsProperty());
noOptimizingJVMArgsPane.selectedProperty().bindBidirectional(versionSetting.noOptimizingJVMArgsProperty());
Expand Down Expand Up @@ -282,6 +287,7 @@ void unbindProperties() {
FXUtils.unbind(txtPostExitCommand, versionSetting.postExitCommandProperty());
FXUtils.unbindEnum(cboRenderer, versionSetting.rendererProperty());
noGameCheckPane.selectedProperty().unbindBidirectional(versionSetting.notCheckGameProperty());
noModpackCheckPane.selectedProperty().unbindBidirectional(versionSetting.notCheckModpackProperty());
noJVMCheckPane.selectedProperty().unbindBidirectional(versionSetting.notCheckJVMProperty());
noJVMArgsPane.selectedProperty().unbindBidirectional(versionSetting.noJVMArgsProperty());
noOptimizingJVMArgsPane.selectedProperty().unbindBidirectional(versionSetting.noOptimizingJVMArgsProperty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.locks.ReentrantLock;

import static org.jackhuang.hmcl.util.logging.Logger.LOG;
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
import static org.jackhuang.hmcl.util.logging.Logger.LOG;

public final class ModListPage extends ListPageBase<ModListPageSkin.ModInfoObject> implements VersionPage.VersionLoadable, PageAware {
private final BooleanProperty modded = new SimpleBooleanProperty(this, "modded", false);
Expand Down Expand Up @@ -250,11 +250,14 @@ public void checkUpdates() {
.withStagesHint(Collections.singletonList("update.checking")),
i18n("mods.check_updates"), TaskCancellationAction.NORMAL);

if (profile.getRepository().isModpack(instanceId)) {
if (!(profile.getVersionSetting(instanceId).isNotCheckpack()) && profile.getRepository().isModpack(instanceId)) {
Controllers.confirm(
i18n("mods.update_modpack_mod.warning"), null,
MessageDialogPane.MessageType.WARNING,
action, null);
() -> {
profile.getVersionSetting(instanceId).setNotCheckModpack(true);
action.run();
}, null);
} else {
action.run();
}
Expand Down
3 changes: 2 additions & 1 deletion HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ mods.name=Name
mods.not_modded=You must install a modloader (Forge, NeoForge, Fabric, Quilt, or LiteLoader) first to manage your mods!
mods.restore=Restore
mods.url=Official Page
mods.update_modpack_mod.warning=Updating mods in a modpack can lead to irreparable results, possibly corrupting the modpack so that it cannot launch. Are you sure you want to update?
mods.update_modpack_mod.warning=Mod updates may cause irreversible damage and launch failures. Enable "Do not check modpack integrity" and update?
mods.warning.loader_mismatch=Mod loader mismatch
mods.install=Install
mods.save_as=Save As
Expand Down Expand Up @@ -1275,6 +1275,7 @@ settings.advanced.custom_commands.hint=The following environment variables are p
\ · $INST_FABRIC: set if Fabric is installed.\n\
\ · $INST_QUILT: set if Quilt is installed.
settings.advanced.dont_check_game_completeness=Do not check game integrity
settings.advanced.dont_check_modpack_completeness=Do not check modpack integrity
settings.advanced.dont_check_jvm_validity=Do not check JVM compatibility
settings.advanced.dont_patch_natives=Do not attempt to automatically replace native libraries
settings.advanced.environment_variables=Environment Variables
Expand Down
3 changes: 2 additions & 1 deletion HMCL/src/main/resources/assets/lang/I18N_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ mods.name=名稱
mods.not_modded=你需要先在「自動安裝」頁面安裝 Forge、NeoForge、Fabric、Quilt 或 LiteLoader 才能管理模組。
mods.restore=回退
mods.url=官方頁面
mods.update_modpack_mod.warning=更新模組包中的模組可能導致模組包損壞,使模組包無法正常啟動。該操作不可逆,確定要更新嗎
mods.update_modpack_mod.warning=更新模組可能損壞模組包並導致無法啟動。此操作不可逆,確定要開啟「不檢查模組包完整性」並更新嗎
mods.warning.loader_mismatch=模組載入器不匹配
mods.install=安裝到目前實例
mods.save_as=下載到本機目錄
Expand Down Expand Up @@ -1068,6 +1068,7 @@ settings.advanced.custom_commands.hint=自訂指令被呼叫時將包含如下
\ · $INST_FABRIC: 若安裝了 Fabric,將會存在本環境變數;\n\
\ · $INST_QUILT: 若安裝了 Quilt,將會存在本環境變數。
settings.advanced.dont_check_game_completeness=不檢查遊戲完整性
settings.advanced.dont_check_modpack_completeness=不檢查模組包完整性
settings.advanced.dont_check_jvm_validity=不檢查 Java 虛擬機與遊戲的相容性
settings.advanced.dont_patch_natives=不嘗試自動取代本機庫
settings.advanced.environment_variables=環境變數
Expand Down
3 changes: 2 additions & 1 deletion HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ mods.name=名称
mods.not_modded=你需要先在“自动安装”页面安装 Forge、NeoForge、Fabric、Quilt 或 LiteLoader 才能管理模组。
mods.restore=回退
mods.url=官方页面
mods.update_modpack_mod.warning=更新整合包中的模组可能导致整合包损坏,使整合包无法正常启动。该操作不可逆,确定要更新吗
mods.update_modpack_mod.warning=更新模组可能损坏整合包并导致无法启动。此操作不可逆,确定要开启“不检查整合包完整性”并更新吗
mods.warning.loader_mismatch=模组加载器不匹配
mods.install=安装到当前实例
mods.save_as=下载到本地文件夹
Expand Down Expand Up @@ -1078,6 +1078,7 @@ settings.advanced.custom_commands.hint=自定义命令被调用时将包含如
\ · $INST_FABRIC: 若安装了 Fabric,将会存在本环境变量;\n\
\ · $INST_QUILT: 若安装了 Quilt,将会存在本环境变量。
settings.advanced.dont_check_game_completeness=不检查游戏完整性
settings.advanced.dont_check_modpack_completeness=不检查整合包完整性
settings.advanced.dont_check_jvm_validity=不检查 Java 虚拟机与游戏的兼容性
settings.advanced.dont_patch_natives=不尝试自动替换本地库
settings.advanced.environment_variables=环境变量
Expand Down