HMCL modpack export

This commit is contained in:
huangyuhui 2017-08-24 13:57:01 +08:00
parent 2e3d9c22e3
commit 6da1dc5372
27 changed files with 648 additions and 150 deletions

View File

@ -33,6 +33,9 @@ import sun.tools.jar.resources.jar
import java.util.Collections.addAll
import java.util.ArrayList
import java.util.Arrays
import com.sun.javafx.scene.layout.region.BorderStyleConverter.HIDDEN
@ -49,16 +52,18 @@ import java.util.Arrays
@Throws(IOException::class, JsonParseException::class)
fun readHMCLModpackManifest(f: File): Modpack {
val manifestJson = readTextFromZipFile(f, "modpack.json")
val manifest = GSON.fromJson<Modpack>(manifestJson) ?: throw JsonParseException("`modpack.json` not found. Not a valid HMCL modpack.")
val manifest = GSON.fromJson<Modpack>(manifestJson) ?: throw JsonParseException("`modpack.json` not found. $f is not a valid HMCL modpack.")
val gameJson = readTextFromZipFile(f, "minecraft/pack.json")
val game = GSON.fromJson<Version>(gameJson) ?: throw JsonParseException("`minecraft/pack.json` not found. Not a valid HMCL modpack.")
return if (game.jar == null) manifest.copy(manifest = HMCLModpackManifest)
val game = GSON.fromJson<Version>(gameJson) ?: throw JsonParseException("`minecraft/pack.json` not found. $f iot a valid HMCL modpack.")
return if (game.jar == null)
if (manifest.gameVersion.isNullOrBlank()) throw JsonParseException("Cannot recognize the game version of modpack $f.")
else manifest.copy(manifest = HMCLModpackManifest)
else manifest.copy(manifest = HMCLModpackManifest, gameVersion = game.jar!!)
}
object HMCLModpackManifest
class HMCLModpackInstallTask(profile: Profile, private val zipFile: File, private val name: String): Task() {
class HMCLModpackInstallTask(profile: Profile, private val zipFile: File, private val modpack: Modpack, private val name: String): Task() {
private val dependency = profile.dependency
private val repository = profile.repository
override val dependencies = mutableListOf<Task>()
@ -68,9 +73,8 @@ class HMCLModpackInstallTask(profile: Profile, private val zipFile: File, privat
check(!repository.hasVersion(name), { "Version $name already exists." })
val json = readTextFromZipFile(zipFile, "minecraft/pack.json")
var version = GSON.fromJson<Version>(json)!!
val jar = version.jar!!
version = version.copy(jar = null)
dependents += dependency.gameBuilder().name(name).gameVersion(jar).buildAsync()
dependents += dependency.gameBuilder().name(name).gameVersion(modpack.gameVersion!!).buildAsync()
dependencies += dependency.checkGameCompletionAsync(version)
dependencies += VersionJSONSaveTask(dependency, version)
}
@ -86,36 +90,76 @@ class HMCLModpackInstallTask(profile: Profile, private val zipFile: File, privat
}
val MODPACK_BLACK_LIST = listOf("usernamecache.json", "asm", "logs", "backups", "versions", "assets", "usercache.json", "libraries", "crash-reports", "launcher_profiles.json", "NVIDIA", "AMD", "TCNodeTracker", "screenshots", "natives", "native", "\$native", "pack.json", "launcher.jar", "minetweaker.log", "launcher.pack.lzma", "hmclmc.log")
val MODPACK_SUGGESTED_BLACK_LIST = listOf("fonts", "saves", "servers.dat", "options.txt", "optionsof.txt", "journeymap", "optionsshaders.txt", "mods/VoxelMods")
val MODPACK_NORMAL_LIST = listOf("fonts", "saves", "servers.dat", "options.txt", "optionsof.txt", "journeymap", "optionsshaders.txt", "mods/VoxelMods")
/**
*
* @author huang
*/
interface ModAdviser {
fun advise(fileName: String, isDirectory: Boolean): ModSuggestion
enum class ModSuggestion {
SUGGESTED,
NORMAL,
HIDDEN
}
}
private fun match(l: List<String>, fileName: String, isDirectory: Boolean): Boolean {
for (s in l)
if (isDirectory) {
if (fileName.startsWith(s + "/"))
return true
} else if (fileName == s)
return true
return false
}
var MODPACK_PREDICATE = object : ModAdviser {
override fun advise(fileName: String, isDirectory: Boolean): ModAdviser.ModSuggestion {
return if (match(MODPACK_BLACK_LIST, fileName, isDirectory))
ModAdviser.ModSuggestion.HIDDEN
else if (match(MODPACK_NORMAL_LIST, fileName, isDirectory))
ModAdviser.ModSuggestion.NORMAL
else
ModAdviser.ModSuggestion.SUGGESTED
}
}
class HMCLModpackExportTask @JvmOverloads constructor(
private val repository: DefaultGameRepository,
private val version: String,
private val blacklist: List<String>,
private val whitelist: List<String>,
private val modpack: Modpack,
private val output: File,
override val id: String = ID): TaskResult<ZipEngine>() {
override fun execute() {
val b = ArrayList<String>(MODPACK_BLACK_LIST)
b.addAll(blacklist)
b.add(version + ".jar")
b.add(version + ".json")
val blackList = ArrayList<String>(MODPACK_BLACK_LIST)
blackList.add(version + ".jar")
blackList.add(version + ".json")
LOG.info("Compressing game files without some files in blacklist, including files or directories: usernamecache.json, asm, logs, backups, versions, assets, usercache.json, libraries, crash-reports, launcher_profiles.json, NVIDIA, TCNodeTracker")
ZipEngine(output).use { zip ->
zip.putDirectory(repository.getRunDirectory(version)) a@ { x: String, y: Boolean ->
for (s in b)
if (y) {
if (x.startsWith(s + "/"))
zip.putDirectory(repository.getRunDirectory(version)) a@ { pathName: String, isDirectory: Boolean ->
for (s in blackList) {
if (isDirectory) {
if (pathName.startsWith(s + "/"))
return@a null
} else if (x == s)
} else if (pathName == s)
return@a null
"minecraft/" + x
}
for (s in whitelist)
if (s + (if (isDirectory) "/" else "") == pathName)
return@a "minecraft/" + pathName
null
}
val mv = repository.getVersion(version).resolve(repository)
val gameVersion = minecraftVersion(repository.getVersionJar(version)) ?: throw IllegalStateException("Cannot parse the version of $version")
zip.putTextFile(GSON.toJson(mv), "minecraft/pack.json")
zip.putTextFile(GSON.toJson(modpack.copy(gameVersion = gameVersion)), "modpack.json")
zip.putTextFile(GSON.toJson(mv.copy(jar = gameVersion)), "minecraft/pack.json") // Making "jar" to gameVersion is to be compatible with old HMCL.
zip.putTextFile(GSON.toJson(modpack.copy(gameVersion = gameVersion)), "modpack.json") // Newer HMCL only reads 'gameVersion' field.
}
}

View File

@ -57,15 +57,8 @@ class AccountsPage() : StackPane(), DecoratorPage {
scrollPane.smoothScrolling()
txtUsername.textProperty().addListener { _ ->
txtUsername.validate()
}
txtUsername.validate()
txtPassword.textProperty().addListener { _ ->
txtPassword.validate()
}
txtPassword.validate()
txtUsername.setValidateWhileTextChanged()
txtPassword.setValidateWhileTextChanged()
cboType.selectionModel.selectedIndexProperty().onChange {
val visible = it != 0

View File

@ -141,8 +141,8 @@ class Decorator @JvmOverloads constructor(private val primaryStage: Stage, priva
animationHandler = TransitionHandler(contentPlaceHolder)
setOverflowHidden(lookup("#contentPlaceHolderRoot") as Pane)
setOverflowHidden(drawerWrapper)
(lookup("#contentPlaceHolderRoot") as Pane).setOverflowHidden()
drawerWrapper.setOverflowHidden()
}
fun onMouseMoved(mouseEvent: MouseEvent) {
@ -369,7 +369,7 @@ class Decorator @JvmOverloads constructor(private val primaryStage: Stage, priva
if (content is Region) {
content.setMinSize(0.0, 0.0)
setOverflowHidden(content)
content.setOverflowHidden()
}
backNavButton.isDisable = !wizardController.canPrev()

View File

@ -108,11 +108,11 @@ fun takeSnapshot(node: Parent, width: Double, height: Double): WritableImage {
return scene.snapshot(null)
}
fun setOverflowHidden(node: Region) {
fun Region.setOverflowHidden() {
val rectangle = Rectangle()
rectangle.widthProperty().bind(node.widthProperty())
rectangle.heightProperty().bind(node.heightProperty())
node.clip = rectangle
rectangle.widthProperty().bind(widthProperty())
rectangle.heightProperty().bind(heightProperty())
clip = rectangle
}
val stylesheets = arrayOf(
@ -238,4 +238,14 @@ fun Node.installTooltip(openDelay: Double = 1000.0, visibleDelay: Double = 5000.
LOG.log(Level.SEVERE, "Cannot install tooltip by reflection", e)
Tooltip.install(this, tooltip)
}
}
fun JFXTextField.setValidateWhileTextChanged() {
textProperty().addListener { _ -> validate() }
validate()
}
fun JFXPasswordField.setValidateWhileTextChanged() {
textProperty().addListener { _ -> validate() }
validate()
}

View File

@ -29,6 +29,7 @@ import javafx.scene.layout.StackPane
import org.jackhuang.hmcl.download.game.GameAssetIndexDownloadTask
import org.jackhuang.hmcl.i18n
import org.jackhuang.hmcl.setting.Profile
import org.jackhuang.hmcl.ui.export.ExportWizardProvider
import org.jackhuang.hmcl.ui.wizard.DecoratorPage
class VersionPage : StackPane(), DecoratorPage {
@ -40,6 +41,7 @@ class VersionPage : StackPane(), DecoratorPage {
@FXML lateinit var managementList: JFXListView<*>
@FXML lateinit var btnBrowseMenu: JFXButton
@FXML lateinit var btnManagementMenu: JFXButton
@FXML lateinit var btnExport: JFXButton
val browsePopup: JFXPopup
val managementPopup: JFXPopup
lateinit var profile: Profile
@ -56,6 +58,7 @@ class VersionPage : StackPane(), DecoratorPage {
btnBrowseMenu.installTooltip(openDelay = 0.0, closeDelay = 0.0, tooltip = Tooltip(i18n("settings.explore")))
btnManagementMenu.installTooltip(openDelay = 0.0, closeDelay = 0.0, tooltip = Tooltip(i18n("settings.manage")))
btnExport.installTooltip(openDelay = 0.0, closeDelay = 0.0, tooltip = Tooltip(i18n("modpack.task.save")))
}
fun load(id: String, profile: Profile) {
@ -77,6 +80,10 @@ class VersionPage : StackPane(), DecoratorPage {
managementPopup.show(btnManagementMenu, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, -12.0, 15.0)
}
fun onExport() {
Controllers.decorator.startWizard(ExportWizardProvider(profile, version), i18n("modpack.wizard"))
}
fun onBrowse() {
openFolder(profile.repository.getRunDirectory(version).resolve(when (browseList.selectionModel.selectedIndex) {
0 -> ""

View File

@ -84,17 +84,16 @@ class VersionSettingsController {
chkNoGameCheck.limitHeight(limitHeight)
chkShowLogs.limitHeight(limitHeight)
fun validation(field: JFXTextField) = InvalidationListener { field.validate() }
fun validator(nullable: Boolean = false) = NumberValidator(nullable).apply { message = "Must be a number." }
txtWidth.setValidators(validator())
txtWidth.textProperty().addListener(validation(txtWidth))
txtWidth.setValidateWhileTextChanged()
txtHeight.setValidators(validator())
txtHeight.textProperty().addListener(validation(txtHeight))
txtHeight.setValidateWhileTextChanged()
txtMaxMemory.setValidators(validator())
txtMaxMemory.textProperty().addListener(validation(txtMaxMemory))
txtMaxMemory.setValidateWhileTextChanged()
txtMetaspace.setValidators(validator(true))
txtMetaspace.textProperty().addListener(validation(txtMetaspace))
txtMetaspace.setValidateWhileTextChanged()
javaPane.children.clear()
javaPane.children += createJavaPane(JavaVersion.fromCurrentEnvironment(), javaGroup)

View File

@ -0,0 +1,32 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2017 huangyuhui <huanghongxun2008@126.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hmcl.ui
import javafx.scene.Scene
import javafx.scene.image.Image
import javafx.scene.web.WebView
import javafx.stage.Stage
class WebStage: Stage() {
val webView = WebView()
init {
scene = Scene(webView, 800.0, 480.0)
scene.stylesheets.addAll(*stylesheets)
icons += Image("/assets/img/icon.png")
}
}

View File

@ -81,7 +81,7 @@ class DownloadWizardProvider(): WizardProvider() {
return when (modpack.manifest) {
is CurseForgeModpackManifest -> CurseForgeModpackInstallTask(profile.dependency, selectedFile, modpack.manifest as CurseForgeModpackManifest, name)
is HMCLModpackManifest -> HMCLModpackInstallTask(profile, selectedFile, name)
is HMCLModpackManifest -> HMCLModpackInstallTask(profile, selectedFile, modpack, name)
else -> throw Error()
} with finalizeTask
}
@ -95,12 +95,10 @@ class DownloadWizardProvider(): WizardProvider() {
}
override fun createPage(controller: WizardController, step: Int, settings: MutableMap<String, Any>): Node {
return when (step) {
0 -> InstallTypePage(controller)
1 -> when (settings[InstallTypePage.INSTALL_TYPE]) {
0 -> VersionsPage(controller, "", BMCLAPIDownloadProvider, "game", { controller.onNext(InstallersPage(controller, BMCLAPIDownloadProvider)) })
0 -> VersionsPage(controller, "", BMCLAPIDownloadProvider, "game") { controller.onNext(InstallersPage(controller, profile.repository, BMCLAPIDownloadProvider)) }
1 -> ModpackPage(controller)
else -> throw Error()
}

View File

@ -17,18 +17,22 @@
*/
package org.jackhuang.hmcl.ui.download
import com.jfoenix.controls.JFXButton
import com.jfoenix.controls.JFXListView
import com.jfoenix.controls.JFXTextField
import javafx.fxml.FXML
import javafx.scene.control.Label
import javafx.scene.layout.StackPane
import org.jackhuang.hmcl.download.DownloadProvider
import org.jackhuang.hmcl.game.GameRepository
import org.jackhuang.hmcl.i18n
import org.jackhuang.hmcl.ui.construct.Validator
import org.jackhuang.hmcl.ui.loadFXML
import org.jackhuang.hmcl.ui.wizard.WizardController
import org.jackhuang.hmcl.ui.wizard.WizardPage
import org.jackhuang.hmcl.util.onChange
class InstallersPage(private val controller: WizardController, private val downloadProvider: DownloadProvider): StackPane(), WizardPage {
class InstallersPage(private val controller: WizardController, private val repository: GameRepository, private val downloadProvider: DownloadProvider): StackPane(), WizardPage {
@FXML lateinit var list: JFXListView<VersionsPageItem>
@FXML lateinit var lblGameVersion: Label
@ -36,11 +40,16 @@ class InstallersPage(private val controller: WizardController, private val downl
@FXML lateinit var lblLiteLoader: Label
@FXML lateinit var lblOptiFine: Label
@FXML lateinit var txtName: JFXTextField
@FXML lateinit var btnInstall: JFXButton
init {
loadFXML("/assets/fxml/download/installers.fxml")
val gameVersion = controller.settings["game"] as String
txtName.validators += Validator { !repository.hasVersion(it) && it.isNotBlank() }.apply { message = i18n("version.already_exists") }
txtName.textProperty().addListener { _ ->
btnInstall.isDisable = !txtName.validate()
}
txtName.text = gameVersion
list.selectionModel.selectedIndexProperty().onChange {

View File

@ -17,34 +17,35 @@
*/
package org.jackhuang.hmcl.ui.download
import com.google.gson.JsonParseException
import com.jfoenix.controls.JFXButton
import com.jfoenix.controls.JFXTextField
import javafx.application.Platform
import javafx.fxml.FXML
import javafx.scene.control.Label
import javafx.scene.layout.BorderPane
import javafx.scene.layout.Region
import javafx.scene.layout.StackPane
import javafx.stage.FileChooser
import org.jackhuang.hmcl.game.readModpackManifest
import org.jackhuang.hmcl.i18n
import org.jackhuang.hmcl.mod.readCurseForgeModpackManifest
import org.jackhuang.hmcl.mod.Modpack
import org.jackhuang.hmcl.setting.Profile
import org.jackhuang.hmcl.ui.Controllers
import org.jackhuang.hmcl.ui.*
import org.jackhuang.hmcl.ui.construct.Validator
import org.jackhuang.hmcl.ui.loadFXML
import org.jackhuang.hmcl.ui.wizard.WizardController
import org.jackhuang.hmcl.ui.wizard.WizardPage
import java.io.IOException
class ModpackPage(private val controller: WizardController): StackPane(), WizardPage {
override val title: String = "Install a modpack"
override val title: String = i18n("modpack.task.install")
@FXML lateinit var borderPane: Region
@FXML lateinit var lblName: Label
@FXML lateinit var lblVersion: Label
@FXML lateinit var lblAuthor: Label
@FXML lateinit var lblModpackLocation: Label
@FXML lateinit var txtModpackName: JFXTextField
@FXML lateinit var btnInstall: JFXButton
var manifest: Modpack? = null
init {
loadFXML("/assets/fxml/download/modpack.fxml")
@ -53,29 +54,33 @@ class ModpackPage(private val controller: WizardController): StackPane(), Wizard
val chooser = FileChooser()
chooser.title = i18n("modpack.choose")
chooser.extensionFilters += FileChooser.ExtensionFilter("Zip", "*.zip")
chooser.extensionFilters += FileChooser.ExtensionFilter(i18n("modpack"), "*.zip")
val selectedFile = chooser.showOpenDialog(Controllers.stage)
if (selectedFile == null) Platform.runLater { controller.onFinish() }
else {
// TODO: original HMCL modpack support.
controller.settings[MODPACK_FILE] = selectedFile
lblModpackLocation.text = selectedFile.absolutePath
txtModpackName.text = selectedFile.nameWithoutExtension
txtModpackName.validators += Validator { !profile.repository.hasVersion(it) }
txtModpackName.validators += Validator { !profile.repository.hasVersion(it) && it.isNotBlank() }.apply { message = i18n("version.already_exists") }
txtModpackName.textProperty().addListener { _ ->
btnInstall.isDisabled = !txtModpackName.validate()
btnInstall.isDisable = !txtModpackName.validate()
}
try {
val manifest = readModpackManifest(selectedFile)
controller.settings[MODPACK_CURSEFORGE_MANIFEST] = manifest
lblName.text = manifest.name
lblVersion.text = manifest.version
lblAuthor.text = manifest.author
manifest = readModpackManifest(selectedFile)
controller.settings[MODPACK_CURSEFORGE_MANIFEST] = manifest!!
lblName.text = manifest!!.name
lblVersion.text = manifest!!.version
lblAuthor.text = manifest!!.author
txtModpackName.text = manifest!!.name + "-" + manifest!!.version
} catch (e: Exception) {
// TODO
txtModpackName.text = i18n("modpack.task.install.error")
}
}
//borderPane.limitHeight(100.0)
borderPane.limitWidth(500.0)
}
override fun cleanup(settings: MutableMap<String, Any>) {
@ -88,6 +93,14 @@ class ModpackPage(private val controller: WizardController): StackPane(), Wizard
controller.onFinish()
}
fun onDescribe() {
if (manifest != null)
WebStage().apply {
webView.engine.loadContent(manifest!!.description)
title = i18n("modpack.wizard.step.3")
}.showAndWait()
}
companion object {
val MODPACK_FILE = "MODPACK_FILE"
val MODPACK_NAME = "MODPACK_NAME"

View File

@ -0,0 +1,56 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2017 huangyuhui <huanghongxun2008@126.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hmcl.ui.export
import javafx.scene.Node
import org.jackhuang.hmcl.game.HMCLModpackExportTask
import org.jackhuang.hmcl.game.MODPACK_PREDICATE
import org.jackhuang.hmcl.mod.Modpack
import org.jackhuang.hmcl.setting.Profile
import org.jackhuang.hmcl.ui.wizard.WizardController
import org.jackhuang.hmcl.ui.wizard.WizardProvider
import java.io.File
class ExportWizardProvider(private val profile: Profile, private val version: String) : WizardProvider() {
override fun start(settings: MutableMap<String, Any>) {
}
override fun finish(settings: MutableMap<String, Any>): Any? {
@Suppress("UNCHECKED_CAST")
return HMCLModpackExportTask(profile.repository, version, settings[ModpackFileSelectionPage.MODPACK_FILE_SELECTION] as List<String>,
Modpack(
name = settings[ModpackInfoPage.MODPACK_NAME] as String,
author = settings[ModpackInfoPage.MODPACK_AUTHOR] as String,
version = settings[ModpackInfoPage.MODPACK_VERSION] as String,
description = settings[ModpackInfoPage.MODPACK_DESCRIPTION] as String
), settings[ModpackInfoPage.MODPACK_FILE] as File)
}
override fun createPage(controller: WizardController, step: Int, settings: MutableMap<String, Any>): Node {
return when(step) {
0 -> ModpackInfoPage(controller, version)
1 -> ModpackFileSelectionPage(controller, profile, version, MODPACK_PREDICATE)
else -> throw IllegalArgumentException("step")
}
}
override fun cancel(): Boolean {
return true
}
}

View File

@ -0,0 +1,143 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2017 huangyuhui <huanghongxun2008@126.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hmcl.ui.export
import com.jfoenix.controls.JFXTreeView
import javafx.fxml.FXML
import javafx.scene.control.CheckBox
import javafx.scene.control.CheckBoxTreeItem
import javafx.scene.control.Label
import javafx.scene.control.TreeItem
import javafx.scene.layout.HBox
import javafx.scene.layout.StackPane
import org.jackhuang.hmcl.game.ModAdviser
import org.jackhuang.hmcl.i18n
import org.jackhuang.hmcl.setting.Profile
import org.jackhuang.hmcl.ui.construct.NoneMultipleSelectionModel
import org.jackhuang.hmcl.ui.loadFXML
import org.jackhuang.hmcl.ui.wizard.WizardController
import org.jackhuang.hmcl.ui.wizard.WizardPage
import java.io.File
import java.util.*
class ModpackFileSelectionPage(private val controller: WizardController, profile: Profile, private val version: String, private val adviser: ModAdviser): StackPane(), WizardPage {
override val title: String = i18n("modpack.wizard.step.2.title")
@FXML lateinit var treeView: JFXTreeView<String>
private val rootNode: CheckBoxTreeItem<String>?
init {
loadFXML("/assets/fxml/modpack/selection.fxml")
rootNode = getTreeItem(profile.repository.getRunDirectory(version), "minecraft")
treeView.root = rootNode
treeView.selectionModel = NoneMultipleSelectionModel<TreeItem<String>>()
}
private fun getTreeItem(file: File, basePath: String): CheckBoxTreeItem<String>? {
var state = ModAdviser.ModSuggestion.SUGGESTED
if (basePath.length > "minecraft/".length) {
state = adviser.advise(basePath.substringAfter("minecraft/") + (if (file.isDirectory) "/" else ""), file.isDirectory)
if (file.isFile && file.nameWithoutExtension == version)
state = ModAdviser.ModSuggestion.HIDDEN
if (file.isDirectory && file.name == version + "-natives")
state = ModAdviser.ModSuggestion.HIDDEN
if (state == ModAdviser.ModSuggestion.HIDDEN)
return null
}
val node = CheckBoxTreeItem<String>(basePath.substringAfterLast("/"))
if (state == ModAdviser.ModSuggestion.SUGGESTED)
node.isSelected = true
if (file.isDirectory) {
file.listFiles()?.forEach {
val subNode = getTreeItem(it, basePath + "/" + it.name)
if (subNode != null) {
node.isSelected = subNode.isSelected or node.isSelected
if (!subNode.isSelected)
node.isIndeterminate = true
node.children += subNode
}
}
if (!node.isSelected) node.isIndeterminate = false
// Empty folder need not to be displayed.
if (node.children.isEmpty())
return null
}
return node.apply {
graphic = HBox().apply {
val checkbox = CheckBox()
checkbox.selectedProperty().bindBidirectional(node.selectedProperty())
checkbox.indeterminateProperty().bindBidirectional(node.indeterminateProperty())
children += checkbox
if (TRANSLATION.containsKey(basePath))
children += Label().apply {
text = TRANSLATION[basePath]
style = "-fx-text-fill: gray;"
isMouseTransparent = true
}
isPickOnBounds = false
isExpanded = basePath == "minecraft"
}
}
}
private fun getFilesNeeded(node: CheckBoxTreeItem<String>?, basePath: String, list: MutableList<String>) {
if (node == null)
return
if (node.isSelected) {
if (basePath.length > "minecraft/".length)
list += basePath.substring("minecraft/".length)
for (child in node.children)
getFilesNeeded(child as? CheckBoxTreeItem<String>?, basePath + "/" + child.value, list)
return
}
}
override fun cleanup(settings: MutableMap<String, Any>) {
controller.settings.remove(MODPACK_FILE_SELECTION)
}
fun onNext() {
val list = LinkedList<String>()
getFilesNeeded(rootNode, "minecraft", list)
controller.settings[MODPACK_FILE_SELECTION] = list
controller.onFinish()
}
companion object {
val MODPACK_FILE_SELECTION = "modpack.accepted"
private val TRANSLATION = mapOf(
"minecraft/servers.dat" to i18n("modpack.files.servers_dat"),
"minecraft/saves" to i18n("modpack.files.saves"),
"minecraft/mods" to i18n("modpack.files.mods"),
"minecraft/config" to i18n("modpack.files.config"),
"minecraft/liteconfig" to i18n("modpack.files.liteconfig"),
"minecraft/resourcepacks" to i18n("modpack.files.resourcepacks"),
"minecraft/resources" to i18n("modpack.files.resourcepacks"),
"minecraft/options.txt" to i18n("modpack.files.options_txt"),
"minecraft/optionsshaders.txt" to i18n("modpack.files.optionsshaders_txt"),
"minecraft/mods/VoxelMods" to i18n("modpack.files.mods.voxelmods"),
"minecraft/dumps" to i18n("modpack.files.dumps"),
"minecraft/blueprints" to i18n("modpack.files.blueprints"),
"minecraft/scripts" to i18n("modpack.files.scripts")
)
}
}

View File

@ -0,0 +1,99 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2017 huangyuhui <huanghongxun2008@126.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hmcl.ui.export
import com.jfoenix.controls.JFXButton
import com.jfoenix.controls.JFXTextArea
import com.jfoenix.controls.JFXTextField
import com.jfoenix.controls.JFXToggleButton
import javafx.fxml.FXML
import javafx.scene.control.Label
import javafx.scene.control.ScrollPane
import javafx.scene.layout.StackPane
import javafx.stage.FileChooser
import org.jackhuang.hmcl.i18n
import org.jackhuang.hmcl.setting.Profile
import org.jackhuang.hmcl.setting.Settings
import org.jackhuang.hmcl.ui.Controllers
import org.jackhuang.hmcl.ui.loadFXML
import org.jackhuang.hmcl.ui.smoothScrolling
import org.jackhuang.hmcl.ui.wizard.WizardController
import org.jackhuang.hmcl.ui.wizard.WizardPage
class ModpackInfoPage(private val controller: WizardController, version: String): StackPane(), WizardPage {
override val title: String = i18n("modpack.wizard.step.1.title")
@FXML lateinit var lblVersionName: Label
@FXML lateinit var txtModpackName: JFXTextField
@FXML lateinit var txtModpackAuthor: JFXTextField
@FXML lateinit var txtModpackVersion: JFXTextField
@FXML lateinit var txtModpackDescription: JFXTextArea
@FXML lateinit var chkIncludeLauncher: JFXToggleButton
@FXML lateinit var btnNext: JFXButton
@FXML lateinit var scroll: ScrollPane
init {
loadFXML("/assets/fxml/modpack/info.fxml")
scroll.smoothScrolling()
txtModpackName.text = version
txtModpackName.textProperty().addListener { _ -> checkValidation() }
txtModpackAuthor.textProperty().addListener { _ -> checkValidation() }
txtModpackVersion.textProperty().addListener { _ -> checkValidation() }
txtModpackAuthor.text = Settings.selectedAccount?.username ?: ""
lblVersionName.text = version
}
fun checkValidation() {
btnNext.isDisable = !txtModpackName.validate() || !txtModpackVersion.validate() || !txtModpackAuthor.validate()
}
fun onNext() {
val fileChooser = FileChooser()
fileChooser.title = i18n("modpack.wizard.step.initialization.save")
fileChooser.extensionFilters += FileChooser.ExtensionFilter(i18n("modpack"), "*.zip")
val file = fileChooser.showSaveDialog(Controllers.stage)
if (file == null) {
Controllers.navigate(null)
return
}
controller.settings[MODPACK_NAME] = txtModpackName.text
controller.settings[MODPACK_VERSION] = txtModpackVersion.text
controller.settings[MODPACK_AUTHOR] = txtModpackAuthor.text
controller.settings[MODPACK_FILE] = file
controller.settings[MODPACK_DESCRIPTION] = txtModpackDescription.text
controller.settings[MODPACK_INCLUDE_LAUNCHER] = chkIncludeLauncher.isSelected
controller.onNext()
}
override fun cleanup(settings: MutableMap<String, Any>) {
controller.settings.remove(MODPACK_NAME)
controller.settings.remove(MODPACK_VERSION)
controller.settings.remove(MODPACK_AUTHOR)
controller.settings.remove(MODPACK_DESCRIPTION)
controller.settings.remove(MODPACK_INCLUDE_LAUNCHER)
controller.settings.remove(MODPACK_FILE)
}
companion object {
const val MODPACK_NAME = "modpack.name"
const val MODPACK_VERSION = "modpack.version"
const val MODPACK_AUTHOR = "modpack.author"
const val MODPACK_DESCRIPTION = "modpack.description"
const val MODPACK_INCLUDE_LAUNCHER = "modpack.include_launcher"
const val MODPACK_FILE = "modpack.file"
}
}

View File

@ -498,7 +498,7 @@
}
.jfx-text-area .viewport {
-fx-background-color: #F4F4F4;
-fx-background-color: #ffffff;
}
/*******************************************************************************

View File

@ -48,7 +48,7 @@
</center>
<bottom>
<HBox alignment="CENTER">
<JFXButton onMouseClicked="#onInstall" prefWidth="100" prefHeight="40" buttonType="RAISED" text="%ui.button.install" styleClass="jfx-button-raised" />
<JFXButton fx:id="btnInstall" onMouseClicked="#onInstall" prefWidth="100" prefHeight="40" buttonType="RAISED" text="%ui.button.install" styleClass="jfx-button-raised" />
</HBox>
</bottom>
</BorderPane>

View File

@ -5,27 +5,26 @@
<?import com.jfoenix.controls.JFXTextField?>
<?import com.jfoenix.controls.JFXButton?>
<?import org.jackhuang.hmcl.ui.construct.ComponentList?>
<?import javafx.geometry.Insets?>
<fx:root xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
type="StackPane">
<VBox maxWidth="500" maxHeight="500" spacing="50">
<Label text="Installing modpack" />
<Label fx:id="lblModpackLocation" />
<JFXTextField fx:id="txtModpackName" labelFloat="true" promptText="%modpack.enter_name" />
<GridPane>
<columnConstraints>
<ColumnConstraints />
<ColumnConstraints hgrow="ALWAYS" />
</columnConstraints>
<Label text="Name" GridPane.rowIndex="0" GridPane.columnIndex="0" />
<Label text="Version" GridPane.rowIndex="1" GridPane.columnIndex="0" />
<Label text="Author" GridPane.rowIndex="2" GridPane.columnIndex="0" />
<Label fx:id="lblName" GridPane.rowIndex="0" GridPane.columnIndex="1" />
<Label fx:id="lblVersion" GridPane.rowIndex="1" GridPane.columnIndex="1" />
<Label fx:id="lblAuthor" GridPane.rowIndex="2" GridPane.columnIndex="1" />
</GridPane>
<JFXButton buttonType="RAISED" fx:id="btnInstall" onMouseClicked="#onInstall" text="%ui.button.install" styleClass="jfx-button-raised" />
</VBox>
<fx:define>
<Insets fx:id="insets" bottom="12" />
</fx:define>
<VBox fx:id="borderPane" alignment="CENTER">
<HBox style="-fx-padding: 0 0 16 5;"><Label text="%modpack.task.install" /></HBox>
<ComponentList>
<BorderPane><left><Label text="%modpack.task.install.will" /></left><right><Label fx:id="lblModpackLocation" /></right></BorderPane>
<JFXTextField fx:id="txtModpackName" labelFloat="true" promptText="%modpack.enter_name" StackPane.margin="$insets" />
<BorderPane><left><Label text="%modpack.name"/></left><right><Label fx:id="lblName" /></right></BorderPane>
<BorderPane><left><Label text="%ui.label.version"/></left><right><Label fx:id="lblVersion" /></right></BorderPane>
<BorderPane><left><Label text="Author"/></left><right><Label fx:id="lblAuthor" /></right></BorderPane>
<BorderPane>
<left><JFXButton fx:id="btnDescription" onMouseClicked="#onDescribe" text="%modpack.wizard.step.3" styleClass="jfx-button" /></left>
<right><JFXButton buttonType="RAISED" fx:id="btnInstall" onMouseClicked="#onInstall" text="%ui.button.install" styleClass="jfx-button-raised" /></right>
</BorderPane>
</ComponentList>
</VBox>
</fx:root>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.*?>
<?import com.jfoenix.validation.RequiredFieldValidator?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import org.jackhuang.hmcl.ui.construct.ComponentList?>
<fx:root xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
type="StackPane">
<fx:define>
<Insets fx:id="insets" top="5" bottom="12"/>
<Insets fx:id="componetListMargin" top="16" bottom="16" />
</fx:define>
<ScrollPane fx:id="scroll" fitToWidth="true" fitToHeight="true">
<BorderPane style="-fx-padding: 16;">
<top>
<Label wrapText="true" textAlignment="JUSTIFY" text="%modpack.wizard.step.initialization.warning"/>
</top>
<center>
<ComponentList BorderPane.margin="$componetListMargin">
<BorderPane>
<left>
<Label text="%modpack.wizard.step.initialization.exported_version" />
</left>
<right>
<Label fx:id="lblVersionName"/>
</right>
</BorderPane>
<JFXTextField labelFloat="true" promptText="%modpack.name" fx:id="txtModpackName"
StackPane.margin="$insets">
<validators>
<RequiredFieldValidator message="%modpack.not_a_valid_name"/>
</validators>
</JFXTextField>
<JFXTextField labelFloat="true" promptText="%modpack.author" fx:id="txtModpackAuthor"
StackPane.margin="$insets">
<validators>
<RequiredFieldValidator/>
</validators>
</JFXTextField>
<JFXTextField labelFloat="true" promptText="%ui.label.version" fx:id="txtModpackVersion" text="1.0"
StackPane.margin="$insets">
<validators>
<RequiredFieldValidator/>
</validators>
</JFXTextField>
<JFXTextArea labelFloat="true" promptText="%modpack.desc" fx:id="txtModpackDescription"
StackPane.margin="$insets" minHeight="400" />
<BorderPane>
<left>
<Label text="%modpack.wizard.step.initialization.include_launcher"/>
</left>
<right>
<JFXToggleButton fx:id="chkIncludeLauncher" size="7" maxHeight="10.0" minHeight="10.0"/>
</right>
</BorderPane>
</ComponentList>
</center>
<bottom>
<HBox alignment="CENTER_RIGHT">
<JFXButton fx:id="btnNext" onMouseClicked="#onNext" prefWidth="100" prefHeight="40" buttonType="RAISED"
text="%wizard.next_>" styleClass="jfx-button-raised"/>
</HBox>
</bottom>
</BorderPane>
</ScrollPane>
</fx:root>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.*?>
<?import com.jfoenix.controls.JFXTreeView?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.geometry.Insets?>
<fx:root xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
type="StackPane">
<fx:define>
</fx:define>
<BorderPane>
<center>
<JFXTreeView fx:id="treeView" />
</center>
<bottom>
<HBox alignment="CENTER_RIGHT" style="-fx-padding: 16 16 16 0;">
<JFXButton fx:id="btnNext" onMouseClicked="#onNext" prefWidth="100" prefHeight="40" buttonType="RAISED"
text="%wizard.finish" styleClass="jfx-button-raised"/>
</HBox>
</bottom>
</BorderPane>
</fx:root>

View File

@ -16,6 +16,11 @@
</JFXTabPane>
<HBox alignment="TOP_RIGHT" style="-fx-padding: 3px;" pickOnBounds="false">
<JFXButton fx:id="btnExport" maxHeight="28.0" minHeight="28.0" onMouseClicked="#onExport" styleClass="toggle-icon3" ripplerFill="white">
<graphic>
<fx:include source="/assets/svg/export.fxml"/>
</graphic>
</JFXButton>
<JFXButton fx:id="btnBrowseMenu" maxHeight="28.0" minHeight="28.0" onMouseClicked="#onBrowseMenu" styleClass="toggle-icon3" ripplerFill="white">
<graphic>
<fx:include source="/assets/svg/folder-open.fxml"/>

View File

@ -176,8 +176,8 @@ ui.message.update_java=Please upgrade your Java.
ui.message.open_jdk=We have found that you started this application using OpenJDK, which will cause so many troubles drawing the UI. We suggest you using Oracle JDK instead.
ui.label.settings=Settings
ui.label.crashing=<html>Hello Minecraft! Launcher has crashed!</html>
ui.label.crashing_out_dated=<html>Hello Minecraft! Launcher has crashed! Your launcher is outdated. Update it!</html>
ui.label.crashing=Hello Minecraft! Launcher has crashed!
ui.label.crashing_out_dated=Hello Minecraft! Launcher has crashed! Your launcher is outdated. Update it!
ui.label.failed_set=Failed to set:
download=Download
@ -227,8 +227,8 @@ settings.failed_load=Failed to load settings file. Remove it?
settings.test_game=Test game
settings.type.none=No version here, please turn to game download tab.
settings.type.global=<html><a href="">Click here to switch to version specialized setting. Now it is global setting.</a></html>
settings.type.special=<html><a href="">Click here to switch to global setting. Not it is version specialized setting.</a></html>
settings.type.global=Click here to switch to version specialized setting. Now it is global setting.
settings.type.special=Click here to switch to global setting. Not it is version specialized setting.
modpack=Mod pack
modpack.choose=Choose a modpack zip file which you want to import. If you want to update the modpack, please enter the version you want to update.
@ -249,9 +249,9 @@ modpack.wizard.step.1.title=Set the basic options to the modpack.
modpack.wizard.step.initialization.include_launcher=Include the launcher
modpack.wizard.step.initialization.exported_version=The exported game version
modpack.wizard.step.initialization.save=Choose a location to export the game files to
modpack.wizard.step.initialization.warning=<html>Before making modpack, you should ensure that your game can launch successfully,<br/>and that your Minecraft is release, not snapshot.<br/>and that it is not allowed to add mods which is not allowed to distribute to the modpack.</html>
modpack.wizard.step.initialization.warning=Before making modpack, you should ensure that your game can launch successfully,\nand that your Minecraft is release, not snapshot.\nand that it is not allowed to add mods which is not allowed to distribute to the modpack.
modpack.wizard.step.2=Files selection
modpack.wizard.step.2.title=Choose the files you do not want to put in the modpack.
modpack.wizard.step.2.title=Choose the files you want to put into the modpack.
modpack.wizard.step.3=Description
modpack.wizard.step.3.title=Describe your modpack.
@ -281,7 +281,7 @@ mods.choose_mod=Choose your mods
mods.failed=Failed to add mods
mods.add=Add
mods.remove=Remove
mods.default_information=<html><font color=#c0392b>Please ensure that you have installed Forge or LiteLoader before installing mods!<br>You can drop your mod files from explorer/finder, and delete mods by the delete button.<br>Disable a mod by leaving the check box unchecked; Choose an item to get the information.</font></html>
mods.default_information=Please ensure that you have installed Forge or LiteLoader before installing mods!\nYou can drop your mod files from explorer/finder, and delete mods by the delete button.\nDisable a mod by leaving the check box unchecked; Choose an item to get the information.
advancedsettings=Advanced
advancedsettings.launcher_visible=Launcher Visibility
@ -311,7 +311,7 @@ mainwindow.enter_script_name=Enter the script name.
mainwindow.make_launch_succeed=Finished script creation.
mainwindow.no_version=No version found. Switch to Game Downloads Tab?
launcher.about=<html>About Author<br/>Minecraft Forum ID: klkl6523<br/>Copyright (c) 2013 huangyuhui<br/>Opened source under GPL v3 license:http://github.com/huanghongxun/HMCL/<br/>This software used project Gson which is under Apache License 2.0, thanks contributors.</html>
launcher.about=About Author\nMinecraft Forum ID: klkl6523\nCopyright (c) 2013 huangyuhui\nOpened source under GPL v3 license:http://github.com/huanghongxun/HMCL/\nThis software used project Gson which is under Apache License 2.0, thanks contributors.
launcher.download_source=Download Source
launcher.background_location=Background Location
launcher.common_location=Common Location
@ -321,8 +321,8 @@ launcher.versions_json_not_matched_cannot_auto_completion=The version %s lost ve
launcher.versions_json_not_formatted=The version information of %s is malformed! Redownload it?
launcher.choose_bgpath=Choose background path.
launcher.choose_commonpath=Choose common path.
launcher.commpath_tooltip=<html><body>This app will save all game libraries and assets here unless there are existant files in game folder.</body></html>
launcher.background_tooltip=<html><body>The laucher uses a default background.<br/>If you use custom background.png, link it and it will be used.<br />If there is "bg" subdirectory, this app will chooses one picture in "bgskin" randomly.<br />If you set the background setting, this app will use it.</body></html>
launcher.commpath_tooltip=This app will save all game libraries and assets here unless there are existant files in game folder.
launcher.background_tooltip=The laucher uses a default background.\nIf you use custom background.png, link it and it will be used.\nIf there is "bg" subdirectory, this app will chooses one picture in "bgskin" randomly.\nIf you set the background setting, this app will use it.
launcher.update_launcher=Check for update
launcher.enable_shadow=Enable Window Shadow
launcher.enable_animation=Enable Animation
@ -330,7 +330,7 @@ launcher.enable_blur=Enable Blur
launcher.theme=Theme
launcher.proxy=Proxy
launcher.decorated=Enable system window border(in order to fix the problem that the ui become all gray in Linux OS)
launcher.modpack=<html><a href="http://blog.163.com/huanghongxun2008@126/blog/static/7738046920160323812771/">Documentations for modpacks.</a></html>
launcher.modpack=Documentations for modpacks.
launcher.lang=Language
launcher.restart=Options will be in operations only if restart this app.
launcher.log_font=Log Font

View File

@ -176,8 +176,8 @@ ui.message.update_java=Пожалуйста, обновите ваш Java.
ui.message.open_jdk=Мы уже выяснили, что вы начали это приложение, используя OpenJDK, который станет причиной стольких бед для рисования интерфейса. Мы предлагаем Вам вместо того, чтобы с помощью Oracle версии JDK.
ui.label.settings=Настройки
ui.label.crashing=<html>Launcher крашнулся!</html>
ui.label.crashing_out_dated=<html>Launcher крашнулся! Ваш лаунчер устарел. Обновить его</html>
ui.label.crashing=Launcher крашнулся!
ui.label.crashing_out_dated=Launcher крашнулся! Ваш лаунчер устарел. Обновить его
ui.label.failed_set=Не удалось установить:
download=Скачать
@ -227,8 +227,8 @@ settings.failed_load=Не смог файл загрузить настройк
settings.test_game=Тестовая игра
settings.type.none=Нет версии игры, пожалуйста, откройте раздел скачать игру.
settings.type.global=<html><a href="">Нажмите здесь, чтобы перейти в специализированных версий. Сейчас это глобальная настройка.</a></html>
settings.type.special=<html><a href="">Нажмите здесь, чтобы перейти в глобальные настройки. Не это версии специализированных условиях.</a></html>
settings.type.global=Нажмите здесь, чтобы перейти в специализированных версий. Сейчас это глобальная настройка.
settings.type.special=Нажмите здесь, чтобы перейти в глобальные настройки. Не это версии специализированных условиях.
modpack=Мод пак
modpack.choose=Выбрать zip-файл, пакет, который вы хотите импортировать. Если вы хотите обновить пакет, пожалуйста, введите версию вы хотите обновить.
@ -249,7 +249,7 @@ modpack.wizard.step.1.title=Набор основных вариантов modpa
modpack.wizard.step.initialization.include_launcher=Включить лаунчер
modpack.wizard.step.initialization.exported_version=Экспортируемые версии игры
modpack.wizard.step.initialization.save=Выберите папку для экспорта игровых файлов для
modpack.wizard.step.initialization.warning=<html>Прежде чем сделать modpack, вы должны убедиться, что ваша игра сможет успешно запустить,<br/>и что ваш minecraft-это релиз, а не снимок.<br/>а что нельзя добавить модов, которые не позволили раздавать modpack.</html>
modpack.wizard.step.initialization.warning=Прежде чем сделать modpack, вы должны убедиться, что ваша игра сможет успешно запустить,\nи что ваш minecraft-это релиз, а не снимок.\nа что нельзя добавить модов, которые не позволили раздавать modpack.
modpack.wizard.step.2=Выбор файлов
modpack.wizard.step.2.title=Выберите файлы, которые Вы не хотите положить в modpack.
modpack.wizard.step.3=Описание
@ -281,7 +281,7 @@ mods.choose_mod=Выбрать ваши моды
mods.failed=Не удалось добавить моды
mods.add=Добавить
mods.remove=Удалить
mods.default_information=<html><font color=#c0392b>Пожалуйста, убедитесь, что у вас есть установленный Forge или LiteLoader перед установкой модов!<br>Вы можете оставить свой mod файл из проводника/Finder и удаление модов с помощью кнопки удалить.<br>Отключить мод, оставив флажок снят; выбрать товар, чтобы получить информацию.</font></html>
mods.default_information=Пожалуйста, убедитесь, что у вас есть установленный Forge или LiteLoader перед установкой модов!\nВы можете оставить свой mod файл из проводника/Finder и удаление модов с помощью кнопки удалить.\nОтключить мод, оставив флажок снят; выбрать товар, чтобы получить информацию.
advancedsettings=Расширенный
advancedsettings.launcher_visible=При запуске Minecraft
@ -311,7 +311,7 @@ mainwindow.enter_script_name=Введите имя скрипта.
mainwindow.make_launch_succeed=Закончил создание скрипта.
mainwindow.no_version=Версии Minecraft не найдены. Переключить на вкладку загрузки версии для игры в Minecraft?
launcher.about=<html>Об Авторе<br/>Майнкрафт форум ID: klkl6523<br/>Copyright (c) 2013 huangyuhui<br/>Opened source under GPL v3 license:http://github.com/huanghongxun/HMCL/<br/>This software used project Gson which is under Apache License 2.0, thanks contributors.</html>
launcher.about=Об Авторе\nМайнкрафт форум ID: klkl6523\nCopyright (c) 2013 huangyuhui\nOpened source under GPL v3 license:http://github.com/huanghongxun/HMCL/\nThis software used project Gson which is under Apache License 2.0, thanks contributors.
launcher.download_source=Скачать Исходники
launcher.background_location=Фон Расположение
launcher.common_location=Общее Расположение
@ -321,8 +321,8 @@ launcher.versions_json_not_matched_cannot_auto_completion=Версия %s пот
launcher.versions_json_not_formatted=Сведения о версии %s уродлив! Повторная загрузка?
launcher.choose_bgpath=Выберите фоновый пути.
launcher.choose_commonpath=Выбрать общий путь.
launcher.commpath_tooltip=<html><body>Это приложение будет сохранять все игровые библиотеки здесь, если там нет файлов в папке с игрой.</body></html>
launcher.background_tooltip=<html><body>Лаучер использует по умолчанию фон.<br/>Если вы используете пользовательский фон.PNG, ссылку и оно будет использоваться.<br />Если есть "БГ" подкаталог, это приложение выбирает одну картинку в "bgskin" случайно.<br />Если вы установите параметр фон, это приложение будет использовать его.</body></html>
launcher.commpath_tooltip=Это приложение будет сохранять все игровые библиотеки здесь, если там нет файлов в папке с игрой.
launcher.background_tooltip=Лаучер использует по умолчанию фон.\nЕсли вы используете пользовательский фон.PNG, ссылку и оно будет использоваться.\nЕсли есть "БГ" подкаталог, это приложение выбирает одну картинку в "bgskin" случайно.\nЕсли вы установите параметр фон, это приложение будет использовать его.
launcher.update_launcher=Проверить обновления
launcher.enable_shadow=Включить тень окна
launcher.enable_animation=Включить анимацию
@ -330,7 +330,7 @@ launcher.enable_blur=Включить размытие
launcher.theme=Тема
launcher.proxy=Прокси
launcher.decorated=Включить границы окна(для того, чтобы исправить проблему, если в пользовательском интерфейсе становится все серое в ОС Linux)
launcher.modpack=<html><a href="http://blog.163.com/huanghongxun2008@126/blog/static/7738046920160323812771/">Документация по modpacks.</a></html>
launcher.modpack=Документация по modpacks.
launcher.lang=Язык (Language)
launcher.restart=Варианты будут в операции, только если перезапустить это приложение.
launcher.log_font=Шрифт лога

View File

@ -173,8 +173,8 @@ ui.message.sure_remove=Bạn có chắc chắn xóa cấu hình %s không?
ui.message.update_java=Hãy cập nhật phiên bản java của bạn.
ui.label.settings=Cài đặt
ui.label.crashing=<html>HMCL Minecraft Launcher đã bị crash!</html>
ui.label.crashing_out_dated=<html>HL Minecraft Launcher đã bị crash! Và launcher của bạn không phải là phiên bản mới nhất. cập nhật nó đi!</html>
ui.label.crashing=HMCL Minecraft Launcher đã bị crash!
ui.label.crashing_out_dated=HL Minecraft Launcher đã bị crash! Và launcher của bạn không phải là phiên bản mới nhất. cập nhật nó đi!
ui.label.failed_set=Failed to set:
ui.message.open_jdk=We have found that you started this application using OpenJDK, which will cause so many troubles drawing the UI. We suggest you using Oracle JDK instead.
@ -225,8 +225,8 @@ settings.failed_load=Đọc file cấu hình thất bại. Xóa nó không?
settings.test_game=Chạy thử game
settings.type.none=No version here, please turn to game download tab.
settings.type.global=<html><a href="">Click here to switch to version specialized setting. Now it is global setting.</a></html>
settings.type.special=<html><a href="">Click here to switch to global setting. Not it is version specialized setting.</a></html>
settings.type.global=Click here to switch to version specialized setting. Now it is global setting.
settings.type.special=Click here to switch to global setting. Not it is version specialized setting.
modpack=Mod pack
modpack.choose=Chọn modpack zip file mà bạn muốn nhập vào. Nếu bạn muốn cập nhật phiên bản của modpack, Hãy nhập vào phiên bản bạn muốn cập nhật.
@ -247,7 +247,7 @@ modpack.wizard.step.1.title=Chọn các tùy chọn cơ bản cho modpack.
modpack.wizard.step.initialization.include_launcher=Include the launcher
modpack.wizard.step.initialization.exported_version=Phiên bản đã được xuất
modpack.wizard.step.initialization.save=Chọn một thư mục mà bạn muốn xuất game data
modpack.wizard.step.initialization.warning=<html>Trước khi tạo modpack, bạn phải chắc chắn rằng minecraft có thể chạy,<br/>và phiên bản minecraft là chính thức, không phải là snapshot.<br/>và nó không cho thêm mods mà không có quyền để tạo modpack.</html>
modpack.wizard.step.initialization.warning=Trước khi tạo modpack, bạn phải chắc chắn rằng minecraft có thể chạy,\nvà phiên bản minecraft là chính thức, không phải là snapshot.\nvà nó không cho thêm mods mà không có quyền để tạo modpack.
modpack.wizard.step.2=Chọn file
modpack.wizard.step.2.title=Chọn file bạn không muốn thêm vào modpack
modpack.wizard.step.3=Miêu tả
@ -279,7 +279,7 @@ mods.choose_mod=Chọn mods
mods.failed=Tải mods thất bại
mods.add=Thêm
mods.remove=Xóa
mods.default_information=<html><font color=#c0392b>Bạn hãy chắc chắn rằng bạn đã cài Forge hoặc LiteLoader trước khi cài mods!<br>Bạn có thể kéo file mods vào trong cửa sổ này để thêm, và xóa mods bằng cách ấn nút xóa.<br>Tắt mods bằng cách bỏ dấu v ở chỗ hộp kiểm; Chọn một mục để biết thêm thông tin.</font></html>
mods.default_information=Bạn hãy chắc chắn rằng bạn đã cài Forge hoặc LiteLoader trước khi cài mods!\nBạn có thể kéo file mods vào trong cửa sổ này để thêm, và xóa mods bằng cách ấn nút xóa.\nTắt mods bằng cách bỏ dấu v ở chỗ hộp kiểm; Chọn một mục để biết thêm thông tin.
advancedsettings=Nâng cao
advancedsettings.launcher_visible=Sự hiển thị của launcher
@ -309,7 +309,7 @@ mainwindow.enter_script_name=Nhập tên của đoạn mã.
mainwindow.make_launch_succeed=Đã tạo đoạn mã.
mainwindow.no_version=Không có phiên bản minecraft nào được tìm thấy. Chuyển sang tab Game Download?
launcher.about=<html>Về tác giả<br/>Minecraft Forum ID: klkl6523<br/>Copyright (c) 2013 huangyuhui<br/>http://github.com/huanghongxun/HMCL/<br/>Phần mềm này dùng project Gson, cảm ơn người đóng góp.</html>
launcher.about=Về tác giả\nMinecraft Forum ID: klkl6523\nCopyright (c) 2013 huangyuhui\nhttp://github.com/huanghongxun/HMCL/\nPhần mềm này dùng project Gson, cảm ơn người đóng góp.
launcher.download_source=Download Source
launcher.background_location=Background Location
launcher.common_location=Common Location
@ -319,8 +319,8 @@ launcher.versions_json_not_matched_cannot_auto_completion=The version %s lost ve
launcher.versions_json_not_formatted=The version information of %s is malformed! Redownload it?
launcher.choose_bgpath=Choose background path.
launcher.choose_commonpath=Choose common path.
launcher.commpath_tooltip=<html><body>This app will save all game libraries and assets here unless there are existant files in game folder.</body></html>
launcher.background_tooltip=<html><body>This app uses the default background at first.<br />If there is background.png in the directory, it will be used.<br />If there is "bg" subdirectory, this app will chooses one picture in "bgskin" randomly.<br />If you set the background setting, this app will use it.</body></html>
launcher.commpath_tooltip=This app will save all game libraries and assets here unless there are existant files in game folder.
launcher.background_tooltip=This app uses the default background at first.\nIf there is background.png in the directory, it will be used.\nIf there is "bg" subdirectory, this app will chooses one picture in "bgskin" randomly.\nIf you set the background setting, this app will use it.
launcher.update_launcher=Check for update
launcher.enable_shadow=Enable Window Shadow
launcher.enable_animation=Enable Animation
@ -328,7 +328,7 @@ launcher.enable_blur=Enable Blur
launcher.theme=Theme
launcher.proxy=Proxy
launcher.decorated=Enable system window border(in order to fix the problem that the ui become all gray in Linux OS)
launcher.modpack=<html><a href="http://blog.163.com/huanghongxun2008@126/blog/static/7738046920160323812771/">Documentations for modpacks.</a></html>
launcher.modpack=Documentations for modpacks.
launcher.lang=Language
launcher.restart=Options will be in operations only if restart this app.
launcher.log_font=Log Font

View File

@ -176,8 +176,8 @@ ui.message.update_java=請更新您的Java
ui.message.open_jdk=我們發現到您正在使用OpenJDK這可能會導致很多介面問題我們建議您更換Oracle JDK。
ui.label.settings=選項
ui.label.crashing=<html>Hello Minecraft! Launcher遇到了無法處理的錯誤請複制下列內容並通過mcbbs、貼吧或Minecraft Forum反饋bug。 </html>
ui.label.crashing_out_dated=<html>Hello Minecraft! Launcher遇到了無法處理的錯誤已檢測到您的啟動器不是最新版本請更新後再試 </html>
ui.label.crashing=Hello Minecraft! Launcher遇到了無法處理的錯誤請複制下列內容並通過mcbbs、貼吧或Minecraft Forum反饋bug。
ui.label.crashing_out_dated=Hello Minecraft! Launcher遇到了無法處理的錯誤已檢測到您的啟動器不是最新版本請更新後再試
ui.label.failed_set=設定失敗:
download=下載
@ -227,8 +227,8 @@ settings.failed_load=設定資料加載失敗,可能是升級了啟動器或
settings.test_game=測試遊戲
settings.type.none=缺少游戲版本,請切換到遊戲下載頁下載遊戲
settings.type.global=<html><a href="">點擊此處切換為版本特定設定。該版本正在使用全局設定,修改以下設定會影響到其他使用全局設定的版本</a></html>
settings.type.special=<html><a href="">點擊此處切換為全局設定。該版本正在使用版本特定設定,修改以下設定不會影響到其他版本設定</a></html>
settings.type.global=點擊此處切換為版本特定設定。該版本正在使用全局設定,修改以下設定會影響到其他使用全局設定的版本
settings.type.special=點擊此處切換為全局設定。該版本正在使用版本特定設定,修改以下設定不會影響到其他版本設定
modpack=懶人包
modpack.choose=選擇要導入的遊戲懶人包資料,如果您希望更新懶人包,請輸入要更新的版本名
@ -249,9 +249,9 @@ modpack.wizard.step.1.title=設定懶人包的主要資訊
modpack.wizard.step.initialization.include_launcher=包含啟動器
modpack.wizard.step.initialization.exported_version=要導出的遊戲版本
modpack.wizard.step.initialization.save=選擇要導出到的遊戲懶人包位置
modpack.wizard.step.initialization.warning=<html>在製作懶人包前,請您確認您選擇的版本可以正常啟動,<br/>並保證您的Minecraft是正式版而非快照版,<br/>而且不應當將不允許非官方途徑傳播的Mod、材質包等納入整合包。<br/>懶人包會保存您目前的下載源設定</html>
modpack.wizard.step.initialization.warning=在製作懶人包前,請您確認您選擇的版本可以正常啟動,\n並保證您的Minecraft是正式版而非快照版,\n而且不應當將不允許非官方途徑傳播的Mod、材質包等納入整合包。\n懶人包會保存您目前的下載源設定
modpack.wizard.step.2=資料選擇
modpack.wizard.step.2.title=選中你想加到懶人包中的資料(夾)
modpack.wizard.step.2.title=選中你想加到懶人包中的資料(夾)
modpack.wizard.step.3=懶人包描述
modpack.wizard.step.3.title=描述你要製作的懶人包。
@ -281,7 +281,7 @@ mods.choose_mod=選擇模組
mods.failed=添加失敗
mods.add=添加
mods.remove=刪除
mods.default_information=<html>您可以拖動mod到列表中來添加mod同時使用刪除鍵可快速刪除選中mod<br>選擇mod可以獲取mod資訊</html>
mods.default_information=您可以拖動mod到列表中來添加mod同時使用刪除鍵可快速刪除選中mod\n選擇mod可以獲取mod資訊
advancedsettings=進階設定
advancedsettings.launcher_visible=啟動器可見性
@ -311,7 +311,7 @@ mainwindow.enter_script_name=輸入要生成腳本的資料名
mainwindow.make_launch_succeed=啟動腳本已生成完畢:
mainwindow.no_version=未找到任何版本,是否進入遊戲下載?
launcher.about=<html>預設背景圖感謝gamerteam提供。<br>關於作者:<br>百度IDhuanghongxun20<br>mcbbshuanghongxun<br>Minecraft Forum ID: klkl6523<br>歡迎提交Bug哦<br/>Copyright (c) 2013-2016 huangyuhui.<br>免責聲明Minecraft軟體版權歸Mojang AB所有遊戲由於誤操作本啟動器而丟失數據的概不負責。<br>本啟動器在GPLv3協議下開源:http://github.com/huanghongxun/HMCL/ ,感謝issues和pull requests貢獻者<br>本軟體使用了基於Apache License 2.0的Gson項目感謝貢獻者。</html>
launcher.about=預設背景圖感謝gamerteam提供。\n關於作者\n百度IDhuanghongxun20\nmcbbshuanghongxun\nMinecraft Forum ID: klkl6523\n歡迎提交Bug哦\nCopyright (c) 2013-2016 huangyuhui.\n免責聲明Minecraft軟體版權歸Mojang AB所有遊戲由於誤操作本啟動器而丟失數據的概不負責。\n本啟動器在GPLv3協議下開源:http://github.com/huanghongxun/HMCL/ ,感謝issues和pull requests貢獻者\n本軟體使用了基於Apache License 2.0的Gson項目感謝貢獻者。
launcher.download_source=下載源
launcher.background_location=背景地址
launcher.common_location=公用資料夾
@ -321,8 +321,8 @@ launcher.versions_json_not_matched_cannot_auto_completion=版本%s缺失必要
launcher.versions_json_not_formatted=版本%s資訊資料格式錯誤是否重新下載
launcher.choose_bgpath=選擇背景路徑
launcher.choose_commonpath=選擇公用路徑
launcher.commpath_tooltip=<html><body>啟動器將所有遊戲資源跟執行庫檔案放在此處集中管理。如果遊戲資料夾有現成的將不會使用公用庫檔案。</body></html>
launcher.background_tooltip=<html><body>啟動器預設使用自帶的背景<br />如果當前目錄有background.png則會使用該資料作為背景<br />如果當前目錄有bg子目錄則會隨機使用裡面的一張圖作為背景<br />如果該背景位址被修改,則會使用背景位址裡的一張圖作為背景<br />背景位址允許有多個位址,使用半形分號";"(不包含雙引號)分隔</body></html>
launcher.commpath_tooltip=啟動器將所有遊戲資源跟執行庫檔案放在此處集中管理。如果遊戲資料夾有現成的將不會使用公用庫檔案。
launcher.background_tooltip=啟動器預設使用自帶的背景\n如果當前目錄有background.png則會使用該資料作為背景\n如果當前目錄有bg子目錄則會隨機使用裡面的一張圖作為背景\n如果該背景位址被修改則會使用背景位址裡的一張圖作為背景\n背景位址允許有多個位址,使用半形分號";"(不包含雙引號)分隔
launcher.update_launcher=檢查更新
launcher.enable_shadow=啟用窗口陰影
launcher.enable_animation=啟用動態效果
@ -330,7 +330,7 @@ launcher.enable_blur=啟用主介面模糊
launcher.theme=主題
launcher.proxy=代理
launcher.decorated=啟用視窗邊框(Linux下可解決程式介面全灰問題)
launcher.modpack=<html><a href="http://huangyuhui.duapp.com/link.php?type=modpack">整合包作者幫助</a></html>
launcher.modpack=整合包作者幫助
launcher.lang=語言
launcher.restart=本介面選項需要重啟本啟動器生效
launcher.log_font=日誌字體

View File

@ -176,8 +176,8 @@ ui.message.update_java=请更新您的Java
ui.message.open_jdk=我们发现您正在使用OpenJDK这会导致很多界面问题我们建议您更换Oracle JDK。
ui.label.settings=选项
ui.label.crashing=<html>Hello Minecraft!遇到了无法处理的错误请复制下列内容并通过mcbbs、贴吧、Github或Minecraft Forum反馈bug。</html>
ui.label.crashing_out_dated=<html>Hello Minecraft! Launcher遇到了无法处理的错误已检测到您的启动器不是最新版本请更新后再试</html>
ui.label.crashing=Hello Minecraft!遇到了无法处理的错误请复制下列内容并通过mcbbs、贴吧、Github或Minecraft Forum反馈bug。
ui.label.crashing_out_dated=Hello Minecraft! Launcher遇到了无法处理的错误已检测到您的启动器不是最新版本请更新后再试
ui.label.failed_set=设置失败:
download=下载
@ -227,8 +227,8 @@ settings.failed_load=设置文件加载失败,可能是升级了启动器或
settings.test_game=测试游戏
settings.type.none=缺少游戏版本,请切换到游戏下载页下载游戏
settings.type.global=<html><a href="">点击此处切换为版本特定设置。该版本正在使用全局设置,修改以下设置会影响到其他使用全局设置的版本</a></html>
settings.type.special=<html><a href="">点击此处切换为全局设置。该版本正在使用版本特定设置,修改以下设置不会影响到其他版本设置</a></html>
settings.type.global=点击此处切换为版本特定设置。该版本正在使用全局设置,修改以下设置会影响到其他使用全局设置的版本
settings.type.special=点击此处切换为全局设置。该版本正在使用版本特定设置,修改以下设置不会影响到其他版本设置
modpack=整合包
modpack.choose=选择要导入的游戏整合包文件,如果您希望更新整合包,请输入要更新的版本名
@ -237,6 +237,7 @@ modpack.export_finished=整合包导出完成,参见
modpack.included_launcher=整合包已包含启动器,可直接发布
modpack.not_included_launcher=整合包未包含启动器,可使用本软件的导入整合包功能导入整合包
modpack.enter_name=给游戏起个你喜欢的名字
modpack.author=作者
modpack.task.save=导出整合包
modpack.task.install=导入整合包
@ -249,9 +250,9 @@ modpack.wizard.step.1.title=设置整合包的主要信息
modpack.wizard.step.initialization.include_launcher=包含启动器
modpack.wizard.step.initialization.exported_version=要导出的游戏版本
modpack.wizard.step.initialization.save=选择要导出到的游戏整合包位置
modpack.wizard.step.initialization.warning=<html>在制作整合包前,请您确认您选择的版本可以正常启动,<br/>并保证您的Minecraft是正式版而非快照版<br/>而且不应当将不允许非官方途径传播的Mod、材质包等纳入整合包。<br/>整合包会保存您目前的下载源设置</html>
modpack.wizard.step.initialization.warning=在制作整合包前,请您确认您选择的版本可以正常启动,\n并保证您的Minecraft是正式版而非快照版\n而且不应当将不允许非官方途径传播的Mod、材质包等纳入整合包。\n整合包会保存您目前的下载源设置
modpack.wizard.step.2=文件选择
modpack.wizard.step.2.title=选中你想加到整合包中的文件(夹)
modpack.wizard.step.2.title=选中你想加到整合包中的文件(夹)
modpack.wizard.step.3=整合包描述
modpack.wizard.step.3.title=描述你要制作的整合包
@ -281,7 +282,7 @@ mods.choose_mod=选择模组
mods.failed=添加失败
mods.add=添加
mods.remove=删除
mods.default_information=<html><font color=#c0392b>安装Mod前你需要确保已安装Forge或LiteLoader!<br>您可以从资源管理器拖动mod文件到列表中来添加mod同时使用删除键可快速删除选中mod<br>点掉mod前面的勾可禁用mod不会加载选择mod可以获取mod信息</font></html>
mods.default_information=安装Mod前你需要确保已安装Forge或LiteLoader!\n您可以从资源管理器拖动mod文件到列表中来添加mod同时使用删除键可快速删除选中mod\n点掉mod前面的勾可禁用mod不会加载选择mod可以获取mod信息
advancedsettings=高级设置
advancedsettings.launcher_visible=启动器可见性
@ -311,7 +312,7 @@ mainwindow.enter_script_name=输入要生成脚本的文件名
mainwindow.make_launch_succeed=启动脚本已生成完毕:
mainwindow.no_version=未找到任何版本,是否进入游戏下载?
launcher.about=<html>默认背景图感谢gamerteam提供。<br/>关于作者:<br/>百度IDhuanghongxun20<br/>mcbbshuanghongxun<br/>Minecraft Forum ID: klkl6523<br/>欢迎提交Bug哦<br/>Copyright (c) 2013-2017 huangyuhui.<br/>免责声明Minecraft软件版权归Mojang AB所有使用本软件产生的版权问题本软件制作方概不负责。<br/>本启动器在GPLv3协议下开源:https://github.com/huanghongxun/HMCL/ ,感谢issues和pull requests贡献者<br/>本软件使用了基于Apache License 2.0的Gson项目感谢贡献者。</html>
launcher.about=默认背景图感谢gamerteam提供。\n关于作者\n百度IDhuanghongxun20\nmcbbshuanghongxun\nMinecraft Forum ID: klkl6523\n欢迎提交Bug哦\nCopyright (c) 2013-2017 huangyuhui.\n免责声明Minecraft软件版权归Mojang AB所有使用本软件产生的版权问题本软件制作方概不负责。\n本启动器在GPLv3协议下开源:https://github.com/huanghongxun/HMCL/ ,感谢issues和pull requests贡献者\n本软件使用了基于Apache License 2.0的Gson项目感谢贡献者。
launcher.download_source=下载源
launcher.background_location=背景地址
launcher.common_location=公共文件夹
@ -321,8 +322,8 @@ launcher.versions_json_not_matched_cannot_auto_completion=版本%s缺失必要
launcher.versions_json_not_formatted=版本%s信息文件格式错误是否重新下载
launcher.choose_bgpath=选择背景路径
launcher.choose_commonpath=选择公共路径
launcher.commpath_tooltip=<html><body>启动器将所有游戏资源及依赖库文件放于此集中管理,如果游戏文件夹内有现成的将不会使用公共库文件</body></html>
launcher.background_tooltip=<html><body>启动器默认使用自带的背景<br />如果当前目录有background.png则会使用该文件作为背景<br />如果当前目录有bg子目录则会随机使用里面的一张图作为背景<br />如果该背景地址被修改,则会使用背景地址里的一张图作为背景<br />背景地址允许有多个地址,使用半角分号";"(不包含双引号)分隔</body></html>
launcher.commpath_tooltip=启动器将所有游戏资源及依赖库文件放于此集中管理,如果游戏文件夹内有现成的将不会使用公共库文件
launcher.background_tooltip=启动器默认使用自带的背景\n如果当前目录有background.png则会使用该文件作为背景\n如果当前目录有bg子目录则会随机使用里面的一张图作为背景\n如果该背景地址被修改则会使用背景地址里的一张图作为背景\n背景地址允许有多个地址,使用半角分号";"(不包含双引号)分隔
launcher.update_launcher=检查更新
launcher.enable_shadow=启用窗口阴影
launcher.enable_animation=启用动态效果
@ -330,7 +331,7 @@ launcher.enable_blur=启用主界面模糊
launcher.theme=主题
launcher.proxy=代理
launcher.decorated=启用窗口边框(Linux下可解决程序界面全灰问题)
launcher.modpack=<html><a href="http://huangyuhui.duapp.com/link.php?type=modpack">整合包作者帮助</a></html>
launcher.modpack=整合包作者帮助
launcher.lang=语言
launcher.restart=本界面选项需要重启本启动器生效
launcher.log_font=日志字体

View File

@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicBoolean
* This class is to parse log4j classic XML layout logging, since only vanilla Minecraft will enable this layout.
* Also supports plain logs.
*/
internal class Log4jHandler(val callback: (String, Log4jLevel) -> Unit) : Thread() {
internal class Log4jHandler(private val callback: (String, Log4jLevel) -> Unit) : Thread() {
val reader = XMLReaderFactory.createXMLReader().apply {
contentHandler = Log4jHandlerImpl()
}
@ -94,10 +94,10 @@ internal class Log4jHandler(val callback: (String, Log4jLevel) -> Unit) : Thread
message = StringBuilder()
val d = Date(attributes.getValue("timestamp").toLong())
date = df.format(d)
try {
l = Log4jLevel.valueOf(attributes.getValue("level"))
l = try {
Log4jLevel.valueOf(attributes.getValue("level"))
} catch (e: IllegalArgumentException) {
l = Log4jLevel.INFO
Log4jLevel.INFO
}
thread = attributes.getValue("thread")

View File

@ -19,9 +19,9 @@ package org.jackhuang.hmcl.mod
data class Modpack @JvmOverloads constructor(
val name: String = "",
val author: String = "",
val version: String = "",
val gameVersion: String = "",
val description: String = "",
val author: String? = null,
val version: String? = null,
val gameVersion: String? = null,
val description: String? = null,
val manifest: Any? = null
)

View File

@ -30,6 +30,7 @@ import org.jackhuang.hmcl.launch.ProcessListener
import org.jackhuang.hmcl.util.makeCommand
import org.jackhuang.hmcl.task.Task
import org.jackhuang.hmcl.task.TaskListener
import org.jackhuang.hmcl.util.Log4jLevel
import java.io.File
import java.net.InetSocketAddress
import java.net.Proxy
@ -53,15 +54,11 @@ class Test {
account = OfflineAccount.fromUsername("player007").logIn(),
options = LaunchOptions(gameDir = repository.baseDirectory),
listener = object : ProcessListener {
override fun onLog(log: String) {
override fun onLog(log: String, level: Log4jLevel) {
println(log)
}
override fun onErrorLog(log: String) {
System.err.println(log)
}
override fun onExit(exitCode: Int) {
override fun onExit(exitCode: Int, exitType: ProcessListener.ExitType) {
println("Process exited then exit code $exitCode")
}