Now launcher has a nice launch ui and it can launch MiNeCRaFt.
This commit is contained in:
@@ -306,11 +306,16 @@ def fetch_specific_version_manifest(version_manifest: dict, spec_version: str) -
|
||||
# mapping
|
||||
get_specific_version_manifest = fetch_specific_version_manifest
|
||||
|
||||
def find_useful_part_in_specific_version_manifest(spec_version_manifest: dict)\
|
||||
def default_java_version():
|
||||
return {"component": "jre-legacy", "majorVersion": 8}
|
||||
|
||||
def find_useful_part_in_specific_version_manifest(spec_version_manifest: dict,
|
||||
failback_java_version: dict | None=None) \
|
||||
-> tuple[dict | None, dict | None, dict | None, dict | None, list | None, str | None, str | None]:
|
||||
"""
|
||||
Return useful part from version manifest.
|
||||
:param spec_version_manifest: Specific version's data
|
||||
:param failback_java_version: Failback java version data (default is Java 8)
|
||||
:return:
|
||||
arguments: dict (contains jvm and game args, for newer version of Minecraft)
|
||||
asset_index: dict
|
||||
@@ -323,11 +328,15 @@ def find_useful_part_in_specific_version_manifest(spec_version_manifest: dict)\
|
||||
arguments = spec_version_manifest.get("arguments", {})
|
||||
asset_index = spec_version_manifest.get("assetIndex", {})
|
||||
downloads = spec_version_manifest.get("downloads", {})
|
||||
java_version = spec_version_manifest.get("javaVersion", {})
|
||||
libraries = spec_version_manifest.get("libraries", [])
|
||||
main_class = spec_version_manifest.get("mainClass", None)
|
||||
legacy_game_args = spec_version_manifest.get("minecraftArguments", None)
|
||||
|
||||
if failback_java_version is None:
|
||||
failback_java_version = default_java_version()
|
||||
|
||||
java_version = spec_version_manifest.get("javaVersion", failback_java_version)
|
||||
|
||||
if not arguments and not legacy_game_args:
|
||||
raise VersionDataKeyNotFoundException(
|
||||
"No version manifest available in version manifest. (\"arguments\" or \"minecraftArguments\")"
|
||||
@@ -500,4 +509,10 @@ def download_core_file(manifest: dict, destination: Path, is_server=False, raise
|
||||
"Core file url is None. Unable to download it."
|
||||
)
|
||||
|
||||
return file
|
||||
return file
|
||||
|
||||
|
||||
LATEST_VERSION_ALIASES = {
|
||||
"latest-release": {"displayName": "Latest Release"},
|
||||
"latest-snapshot": {"displayName": "Latest Snapshot"},
|
||||
}
|
||||
|
||||
@@ -46,6 +46,38 @@ def warning(parent: QWidget, title: str, message: str,
|
||||
).exec()
|
||||
|
||||
|
||||
def error_with_plain_text(
|
||||
parent: QWidget,
|
||||
title: str,
|
||||
message: str,
|
||||
content: str,
|
||||
) -> None:
|
||||
dialog = QDialog(parent)
|
||||
dialog.setWindowTitle(title)
|
||||
dialog.resize(720, 420)
|
||||
|
||||
layout = QVBoxLayout(dialog)
|
||||
|
||||
label = QLabel(message)
|
||||
label.setWordWrap(True)
|
||||
|
||||
details_box = QPlainTextEdit()
|
||||
details_box.setReadOnly(True)
|
||||
details_box.setPlainText(content)
|
||||
details_box.setSizePolicy(
|
||||
QSizePolicy.Policy.Expanding,
|
||||
QSizePolicy.Policy.Expanding,
|
||||
)
|
||||
|
||||
buttons = QDialogButtonBox(QDialogButtonBox.StandardButton.Ok)
|
||||
buttons.accepted.connect(dialog.accept)
|
||||
|
||||
layout.addWidget(label)
|
||||
layout.addWidget(details_box, 1)
|
||||
layout.addWidget(buttons)
|
||||
dialog.exec()
|
||||
|
||||
|
||||
def ask_yes_no_with_plain_text(parent: QWidget, title: str, message: str, content: str):
|
||||
dialog = QDialog(parent)
|
||||
dialog.setWindowTitle(title)
|
||||
|
||||
Reference in New Issue
Block a user