-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support #2376 * Add necessary @nullable annotations * Display different types of dependencies in different sections. * Fix checkstyle * Add I18N for different types of dependencies. * Enhance UI * Code cleanup * Enhance UI * Manually sort the result from curseforge when searching mods by name. * Render the search results from remote mod repositories in several pages. * Fix merge * Fix * Add a button which navigates to the modpack download page in the modpack installl page * Fix I18N * Render the mod loaders supported by the version in mod info page. * Fix #2104 * Enhance TwoLineListItem * Render the mod loader supported by this mod file on the ModListPage * Fix chinese searching and curseforge searching * Update I18N * Fix * Fix * Select the specific game version when clicking the 'download' button on ModListPage * Support HMCL to update mod_data and mod_pack data from https://github.com/huanghongxun/HMCL/raw/javafx/data-json/dynamic-remote-resources.json * Enhance :HMCL:build.gradle.kts * Revert parse_mcmod_data.py * Abstract 'new Image' to FXUtils.newBuiltinImage and FXUtils.newRemoteImage FXUtils.newBuiltinImage is used to load image which is supposed to be correct definitely and is a file within the jar. Or, it will throw ResourceNotFoundError. FXUtils.newRemoteImage is used to load image from the internet. It will cache the data of images for the further usage. The cached data will be deleted when HMCL is closed or hidden. * Add javadoc for FXUtils.newBuiltinImage and FXUtils.newRemoteImage. * Fix checkstyle * Fix * Fix * Fix * Add license for RemoteResourceManager * Remove TODO * Enhance Chinese searching * Support to decode metadata for local quilt mod. * Enhance ModManager * Fix checkstyle * Refactor * Fix * Fix * Refactor DownloadPage * Fix * Revert "Refactor DownloadPage" This reverts commit 953558d. * Refactor DownloadPage * Refactor * Fix * Fix checkstyle * Set org.jackhuang.hmcl.ui.construct.TwoLineListItem.TagChangeListener as a private static inner class. * Fix * Fix * Fix * Enhance SimpleMultimap * Revert TwoLineListItem * Fix * Code cleanup * Code cleanup * Fix * Code cleanup * Add license for IModMetadataReader * Add prefix 'Minecraft' at the supported minecrft version list in DownloadPage * Fix #2498 * Update README_cn.md * Opti ModMananger * Log a warning message when 'hmcl.update_source.override' is used. * Fix chinese searching * Enhance chinese searching. * Enhance memory usage * Close the mod version dialog window after clicking the downloading / save as button if the dependency list is empty. * Cache builtin images. * Enhance FXUtils (Make tooltip installer faster). * Fix * Fix * Fix #2560 * Fix typo * Fix remote image cache. * Fix javadoc * Fix checkstyle * Optimize FXUtils::shutdown * Fix merge * I have no idea on why the sha1 was matched. * Revert "Enhance FXUtils (Make tooltip installer faster)." This reverts commit 0a49eb2. * Support multi download source in order balance the traffic of hmcl.huangyuhui.net and the download speed in China Mainland. * Modify dynamic remote resource urls. * Optimize codes with StringUtils.DynamicCommonSubsequence. * Prevent unofficial HMCL to access HMCL Resource Update URL. * Zip the dynamic-remote-resources json by Gradle automatically. * Remove unnecessary getters. --------- Co-authored-by: Burning_TNT <[email protected]“>
- Loading branch information
1 parent
333fd0e
commit 242df8a
Showing
78 changed files
with
1,528 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,10 +33,12 @@ | |
import org.jackhuang.hmcl.task.AsyncTaskExecutor; | ||
import org.jackhuang.hmcl.task.Schedulers; | ||
import org.jackhuang.hmcl.ui.Controllers; | ||
import org.jackhuang.hmcl.upgrade.UpdateChecker; | ||
import org.jackhuang.hmcl.upgrade.UpdateHandler; | ||
import org.jackhuang.hmcl.upgrade.hmcl.UpdateChecker; | ||
import org.jackhuang.hmcl.upgrade.hmcl.UpdateHandler; | ||
import org.jackhuang.hmcl.upgrade.resource.RemoteResourceManager; | ||
import org.jackhuang.hmcl.util.CrashReporter; | ||
import org.jackhuang.hmcl.util.Lang; | ||
import org.jackhuang.hmcl.util.Logging; | ||
import org.jackhuang.hmcl.util.StringUtils; | ||
import org.jackhuang.hmcl.util.io.JarUtils; | ||
import org.jackhuang.hmcl.util.platform.Architecture; | ||
|
@@ -71,42 +73,7 @@ public void start(Stage primaryStage) { | |
|
||
CookieHandler.setDefault(COOKIE_MANAGER); | ||
|
||
Skin.registerDefaultSkinLoader((type) -> { | ||
switch (type) { | ||
case ALEX: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/alex.png"); | ||
case ARI: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/ari.png"); | ||
case EFE: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/efe.png"); | ||
case KAI: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/kai.png"); | ||
case MAKENA: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/makena.png"); | ||
case NOOR: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/noor.png"); | ||
case STEVE: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/steve.png"); | ||
case SUNNY: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/sunny.png"); | ||
case ZURI: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/zuri.png"); | ||
default: | ||
return null; | ||
} | ||
}); | ||
|
||
RemoteMod.registerEmptyRemoteMod(new RemoteMod("", "", i18n("mods.broken_dependency.title"), i18n("mods.broken_dependency.desc"), new ArrayList<>(), "", "/assets/img/icon.png", new RemoteMod.IMod() { | ||
@Override | ||
public List<RemoteMod> loadDependencies(RemoteModRepository modRepository) throws IOException { | ||
throw new IOException(); | ||
} | ||
|
||
@Override | ||
public Stream<RemoteMod.Version> loadVersions(RemoteModRepository modRepository) throws IOException { | ||
throw new IOException(); | ||
} | ||
})); | ||
register(); | ||
|
||
LOG.info("JavaFX Version: " + System.getProperty("javafx.runtime.version")); | ||
try { | ||
|
@@ -156,13 +123,56 @@ public Stream<RemoteMod.Version> loadVersions(RemoteModRepository modRepository) | |
|
||
UpdateChecker.init(); | ||
|
||
RemoteResourceManager.init(); | ||
|
||
RemoteResourceManager.register(); | ||
|
||
primaryStage.show(); | ||
}); | ||
} catch (Throwable e) { | ||
CRASH_REPORTER.uncaughtException(Thread.currentThread(), e); | ||
} | ||
} | ||
|
||
private static void register() { | ||
Skin.registerDefaultSkinLoader((type) -> { | ||
switch (type) { | ||
case ALEX: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/alex.png"); | ||
case ARI: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/ari.png"); | ||
case EFE: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/efe.png"); | ||
case KAI: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/kai.png"); | ||
case MAKENA: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/makena.png"); | ||
case NOOR: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/noor.png"); | ||
case STEVE: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/steve.png"); | ||
case SUNNY: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/sunny.png"); | ||
case ZURI: | ||
return Skin.class.getResourceAsStream("/assets/img/skin/zuri.png"); | ||
default: | ||
return null; | ||
} | ||
}); | ||
|
||
RemoteMod.registerEmptyRemoteMod(new RemoteMod("", "", i18n("mods.broken_dependency.title"), i18n("mods.broken_dependency.desc"), new ArrayList<>(), "", "/assets/img/[email protected]", new RemoteMod.IMod() { | ||
@Override | ||
public List<RemoteMod> loadDependencies(RemoteModRepository modRepository) throws IOException { | ||
throw new IOException(); | ||
} | ||
|
||
@Override | ||
public Stream<RemoteMod.Version> loadVersions(RemoteModRepository modRepository) throws IOException { | ||
throw new IOException(); | ||
} | ||
})); | ||
} | ||
|
||
private static ButtonType showAlert(AlertType alertType, String contentText, ButtonType... buttons) { | ||
return new Alert(alertType, contentText, buttons).showAndWait().orElse(null); | ||
} | ||
|
@@ -283,6 +293,10 @@ public static void main(String[] args) { | |
if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX) | ||
LOG.info("XDG Session Type: " + System.getenv("XDG_SESSION_TYPE")); | ||
|
||
if (System.getProperty("hmcl.update_source.override") != null) { | ||
Logging.LOG.log(Level.WARNING, "'hmcl.update_source.override' is deprecated! Please use 'hmcl.hmcl_update_source.override' instead"); | ||
} | ||
|
||
launch(Launcher.class, args); | ||
} catch (Throwable e) { // Fucking JavaFX will suppress the exception and will break our crash reporter. | ||
CRASH_REPORTER.uncaughtException(Thread.currentThread(), e); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.