diff --git a/HMCL/build.gradle b/HMCL/build.gradle index 56c1c4aed0..49b52dbdc2 100755 --- a/HMCL/build.gradle +++ b/HMCL/build.gradle @@ -26,7 +26,7 @@ if (!hasProperty('mainClass')) { ext.mainClass = 'org.jackhuang.hellominecraft.launcher.Main' } -def buildnumber = System.getenv("BUILD_NUMBER") == null ? ".7" : "."+System.getenv("BUILD_NUMBER") +def buildnumber = System.getenv("BUILD_NUMBER") == null ? ".8" : "."+System.getenv("BUILD_NUMBER") String mavenGroupId = 'HMCL' String mavenVersion = '2.3.5' + buildnumber diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/Main.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/Main.java index 301341b96d..80a4490f99 100755 --- a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/Main.java +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/Main.java @@ -47,7 +47,6 @@ import org.jackhuang.hellominecraft.utils.MathUtils; import org.jackhuang.hellominecraft.utils.StrUtils; import org.jackhuang.hellominecraft.utils.VersionNumber; -import org.jackhuang.hellominecraft.utils.system.Compressor; import rx.concurrency.Schedulers; /** diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/download/MinecraftDownloadService.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/download/MinecraftDownloadService.java index b64b64cee0..6c121f4bca 100755 --- a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/download/MinecraftDownloadService.java +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/download/MinecraftDownloadService.java @@ -33,6 +33,7 @@ import org.jackhuang.hellominecraft.utils.NetUtils; import org.jackhuang.hellominecraft.utils.system.FileUtils; import org.jackhuang.hellominecraft.utils.system.IOUtils; +import org.jackhuang.hellominecraft.utils.tasks.Task; import org.jackhuang.hellominecraft.utils.version.MinecraftRemoteVersion; import org.jackhuang.hellominecraft.utils.version.MinecraftRemoteVersions; import rx.Observable; @@ -119,16 +120,9 @@ public boolean downloadMinecraftJar(String id) { } @Override - public boolean downloadMinecraftJarTo(String id, File mvt) { + public Task downloadMinecraftJarTo(String id, File mvt) { String vurl = service.getDownloadType().getProvider().getVersionsDownloadURL() + id + "/"; - if (TaskWindow.getInstance() - .addTask(new FileDownloadTask(vurl + id + ".jar", IOUtils.tryGetCanonicalFile(mvt)).setTag(id + ".jar")) - .start()) - return true; - else { - mvt.delete(); - return false; - } + return new FileDownloadTask(vurl + id + ".jar", IOUtils.tryGetCanonicalFile(mvt)).setTag(id + ".jar"); } @Override diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/mod/ModpackManager.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/mod/ModpackManager.java index b7caec4b64..472ce7e335 100644 --- a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/mod/ModpackManager.java +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/mod/ModpackManager.java @@ -20,10 +20,10 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; -import java.nio.file.FileAlreadyExistsException; import java.nio.file.FileSystemException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import org.jackhuang.hellominecraft.utils.C; @@ -32,10 +32,13 @@ import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftProvider; import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService; import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion; +import org.jackhuang.hellominecraft.utils.functions.BiFunction; import org.jackhuang.hellominecraft.utils.system.Compressor; import org.jackhuang.hellominecraft.utils.system.FileUtils; import org.jackhuang.hellominecraft.utils.system.ZipEngine; +import org.jackhuang.hellominecraft.utils.tasks.Task; import org.jackhuang.hellominecraft.utils.version.MinecraftVersionRequest; +import org.jackhuang.hellominecraft.utils.views.wizard.spi.ResultProgressHandle; /** * A mod pack(*.zip) includes these things: @@ -57,61 +60,112 @@ */ public final class ModpackManager { - public static void install(File input, IMinecraftService service, String id) throws IOException, FileAlreadyExistsException { - File versions = new File(service.baseDirectory(), "versions"); - File oldFile = new File(versions, "minecraft"), newFile = null; - if (oldFile.exists()) { - newFile = new File(versions, "minecraft-" + System.currentTimeMillis()); - if (newFile.isDirectory()) - FileUtils.deleteDirectory(newFile); - else if (newFile.isFile()) - newFile.delete(); - oldFile.renameTo(newFile); - } + public static Task install(File input, IMinecraftService service, String id) { + return new Task() { + Collection c = new ArrayList<>(); - File preVersion = new File(versions, id), preVersionRenamed = null; - if (preVersion.exists()) { - String preId = id + "-" + System.currentTimeMillis(); - preVersion.renameTo(preVersionRenamed = new File(versions, preId)); - new File(preVersionRenamed, id + ".json").renameTo(new File(preVersionRenamed, preId + ".json")); - new File(preVersionRenamed, id + ".jar").renameTo(new File(preVersionRenamed, preId + ".jar")); - } + @Override + public void executeTask() throws Throwable { + File versions = new File(service.baseDirectory(), "versions"); + File oldFile = new File(versions, "minecraft"), newFile = null; + if (oldFile.exists()) { + newFile = new File(versions, "minecraft-" + System.currentTimeMillis()); + if (newFile.isDirectory()) + FileUtils.deleteDirectory(newFile); + else if (newFile.isFile()) + newFile.delete(); + oldFile.renameTo(newFile); + } - try { - AtomicInteger b = new AtomicInteger(0); - HMCLog.log("Decompressing modpack"); - Compressor.unzip(input, versions, t -> { - if (t.equals("minecraft/pack.json")) - b.incrementAndGet(); - return true; - }, true); - if (b.get() < 1) - throw new FileNotFoundException(C.i18n("modpack.incorrect_format.no_json")); - File nowFile = new File(versions, id); - oldFile.renameTo(nowFile); - - File json = new File(nowFile, "pack.json"); - MinecraftVersion mv = C.gson.fromJson(FileUtils.readFileToString(json), MinecraftVersion.class); - if (mv.jar == null) - throw new FileNotFoundException(C.i18n("modpack.incorrect_format.no_jar")); - service.download().downloadMinecraftJarTo(mv.jar, new File(nowFile, id + ".jar")); - mv.jar = null; - FileUtils.writeStringToFile(json, C.gsonPrettyPrinting.toJson(mv)); - json.renameTo(new File(nowFile, id + ".json")); - - if (preVersionRenamed != null) { - File presaves = new File(preVersionRenamed, "saves"); - File saves = new File(nowFile, "saves"); - if (presaves.exists()) { - FileUtils.deleteDirectory(saves); - FileUtils.copyDirectory(presaves, saves); + File preVersion = new File(versions, id), preVersionRenamed = null; + if (preVersion.exists()) { + HMCLog.log("Backing up the game"); + String preId = id + "-" + System.currentTimeMillis(); + preVersion.renameTo(preVersionRenamed = new File(versions, preId)); + new File(preVersionRenamed, id + ".json").renameTo(new File(preVersionRenamed, preId + ".json")); + new File(preVersionRenamed, id + ".jar").renameTo(new File(preVersionRenamed, preId + ".jar")); + } + + try { + AtomicInteger b = new AtomicInteger(0); + HMCLog.log("Decompressing modpack"); + Compressor.unzip(input, versions, t -> { + if (t.equals("minecraft/pack.json")) + b.incrementAndGet(); + return true; + }, true); + if (b.get() < 1) + throw new FileNotFoundException(C.i18n("modpack.incorrect_format.no_json")); + File nowFile = new File(versions, id); + oldFile.renameTo(nowFile); + + File json = new File(nowFile, "pack.json"); + MinecraftVersion mv = C.gson.fromJson(FileUtils.readFileToString(json), MinecraftVersion.class); + if (mv.jar == null) + throw new FileNotFoundException(C.i18n("modpack.incorrect_format.no_jar")); + + c.add(service.download().downloadMinecraftJarTo(mv.jar, new File(nowFile, id + ".jar"))); + mv.jar = null; + FileUtils.writeStringToFile(json, C.gsonPrettyPrinting.toJson(mv)); + json.renameTo(new File(nowFile, id + ".json")); + + if (preVersionRenamed != null) { + HMCLog.log("Restoring saves"); + File presaves = new File(preVersionRenamed, "saves"); + File saves = new File(nowFile, "saves"); + if (presaves.exists()) { + FileUtils.deleteDirectory(saves); + FileUtils.copyDirectory(presaves, saves); + } + } + } finally { + FileUtils.deleteDirectoryQuietly(oldFile); + if (newFile != null) + newFile.renameTo(oldFile); } } - } finally { - FileUtils.deleteDirectoryQuietly(oldFile); - if (newFile != null) - newFile.renameTo(oldFile); - } + + @Override + public String getInfo() { + return C.i18n("modpack.install.task"); + } + + @Override + public Collection getAfterTasks() { + return c; + } + }; + + } + + public static final List MODPACK_BLACK_LIST = Arrays.asList(new String[] { "usernamecache.json", "asm", "logs", "backups", "versions", "assets", "usercache.json", "libraries", "crash-reports", "launcher_profiles.json", "NVIDIA", "TCNodeTracker", "screenshots", "natives", "native" }); + public static final List MODPACK_SUGGESTED_BLACK_LIST = Arrays.asList(new String[] { "saves", "servers.dat", "options.txt", "optionsshaders.txt", "mods/VoxelMods" }); + + /** + * < String, Boolean, Boolean >: Folder/File name, Is Directory, + * Return 0: non blocked, 1: non shown, 2: suggested, checked. + */ + public static final BiFunction MODPACK_PREDICATE = (String x, Boolean y) -> { + if (ModpackManager.MODPACK_BLACK_LIST_PREDICATE.apply(x, y)) + return 1; + if (ModpackManager.MODPACK_SUGGESTED_BLACK_LIST_PREDICATE.apply(x, y)) + return 2; + return 0; + }; + + public static final BiFunction MODPACK_BLACK_LIST_PREDICATE = modpackPredicateMaker(MODPACK_BLACK_LIST); + public static final BiFunction MODPACK_SUGGESTED_BLACK_LIST_PREDICATE = modpackPredicateMaker(MODPACK_SUGGESTED_BLACK_LIST); + + private static BiFunction modpackPredicateMaker(List l) { + return (String x, Boolean y) -> { + for (String s : l) + if (y) { + if (x.startsWith(s + "/")) + return true; + } else if (x.equals(s)) + return true; + return false; + }; } /** @@ -125,7 +179,7 @@ else if (newFile.isFile()) * @throws IOException if create tmp directory failed */ public static void export(File output, IMinecraftProvider provider, String version, List blacklist) throws IOException, GameException { - ArrayList b = new ArrayList<>(Arrays.asList(new String[] { "usernamecache.json", "asm", "logs", "backups", "versions", "assets", "usercache.json", "libraries", "crash-reports", "launcher_profiles.json", "NVIDIA", "TCNodeTracker" })); + ArrayList b = new ArrayList<>(MODPACK_BLACK_LIST); if (blacklist != null) b.addAll(blacklist); HMCLog.log("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"); diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/service/IMinecraftDownloadService.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/service/IMinecraftDownloadService.java index e3e8e51ff6..6918909430 100755 --- a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/service/IMinecraftDownloadService.java +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/core/service/IMinecraftDownloadService.java @@ -22,6 +22,7 @@ import org.jackhuang.hellominecraft.launcher.core.GameException; import org.jackhuang.hellominecraft.launcher.core.download.DownloadLibraryJob; import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion; +import org.jackhuang.hellominecraft.utils.tasks.Task; import org.jackhuang.hellominecraft.utils.version.MinecraftRemoteVersion; import rx.Observable; @@ -39,7 +40,7 @@ public IMinecraftDownloadService(IMinecraftService service) { public abstract boolean downloadMinecraftJar(String id); - public abstract boolean downloadMinecraftJarTo(String id, File f); + public abstract Task downloadMinecraftJarTo(String id, File f); public abstract boolean downloadMinecraftVersionJson(String id); diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/settings/Profile.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/settings/Profile.java index 6d2b7c0f2e..bb1137f249 100755 --- a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/settings/Profile.java +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/settings/Profile.java @@ -116,11 +116,12 @@ public String getSettingsSelectedMinecraftVersion() { public String getSelectedVersion() { String v = selectedMinecraftVersion; if (StrUtils.isBlank(v) || service.version().getVersionById(v) == null) { - v = service.version().getOneVersion().id; - if (v != null) + if (service.version().getVersionCount() > 0) + v = service.version().getOneVersion().id; + if (StrUtils.isNotBlank(v)) setSelectedMinecraftVersion(v); } - return v; + return StrUtils.isBlank(v) ? null : v; } public transient final EventHandler selectedVersionChangedEvent = new EventHandler<>(this); diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/GameSettingsPanel.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/GameSettingsPanel.java index 8beb3668c4..7d3f212722 100755 --- a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/GameSettingsPanel.java +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/GameSettingsPanel.java @@ -1149,31 +1149,14 @@ private void btnImportModpackActionPerformed(java.awt.event.ActionEvent evt) {// if (fc.getSelectedFile() == null) return; String suggestedModpackId = JOptionPane.showInputDialog("Please enter your favourite game name", FileUtils.getBaseName(fc.getSelectedFile().getName())); - TaskWindow.getInstance().addTask(new TaskRunnable(C.i18n("modpack.install.task"), () -> { - try { - ModpackManager.install(fc.getSelectedFile(), getProfile().service(), suggestedModpackId); - } catch (IOException ex) { - MessageBox.Show(C.i18n("modpack.install_error")); - HMCLog.err("Failed to install modpack", ex); - } - })).start(); + TaskWindow.getInstance().addTask(ModpackManager.install(fc.getSelectedFile(), getProfile().service(), suggestedModpackId)).start(); + refreshVersions(); }//GEN-LAST:event_btnImportModpackActionPerformed private void btnExportModpackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExportModpackActionPerformed - Map settings = (Map) WizardDisplayer.showWizard(new ModpackWizard(getProfile().service().version()).createWizard()); - if (settings != null) - TaskWindow.getInstance().addTask(new TaskRunnable(C.i18n("modpack.save.task"), - () -> { - try { - ModpackManager.export(new File((String) settings.get(ModpackInitializationPanel.KEY_MODPACK_LOCATION)), - getProfile().service().version(), - (String) settings.get(ModpackInitializationPanel.KEY_GAME_VERSION), - ((Boolean) settings.get(ModpackInitializationPanel.KEY_SAVE) == false) ? Arrays.asList("saves") : null); - } catch (IOException | GameException ex) { - MessageBox.Show(C.i18n("modpack.export_error")); - HMCLog.err("Failed to export modpack", ex); - } - })).start(); + if (getProfile().service().version().getVersionCount() <= 0) + return; + WizardDisplayer.showWizard(new ModpackWizard(getProfile().service()).createWizard()); }//GEN-LAST:event_btnExportModpackActionPerformed // @@ -1229,7 +1212,6 @@ void prepare(Profile profile) { cboJavaItemStateChanged(new ItemEvent(cboJava, 0, cboJava.getSelectedItem(), ItemEvent.SELECTED)); loadVersions(); - loadMinecraftVersion(); } void loadVersions() { @@ -1248,6 +1230,8 @@ void loadVersions() { cboVersions.setSelectedIndex(index); reloadMods(); + + loadMinecraftVersion(); } void loadMinecraftVersion() { diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackFileSelectionPanel.form b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackFileSelectionPanel.form new file mode 100644 index 0000000000..11e0196b74 --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackFileSelectionPanel.form @@ -0,0 +1,41 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackFileSelectionPanel.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackFileSelectionPanel.java new file mode 100644 index 0000000000..69fd060fa8 --- /dev/null +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackFileSelectionPanel.java @@ -0,0 +1,121 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * 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.hellominecraft.launcher.views.modpack; + +import java.io.File; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import javax.swing.tree.DefaultTreeModel; +import org.jackhuang.hellominecraft.utils.functions.BiFunction; +import org.jackhuang.hellominecraft.utils.system.FileUtils; +import org.jackhuang.hellominecraft.utils.views.checktree.CheckBoxTreeCellRenderer; +import org.jackhuang.hellominecraft.utils.views.checktree.CheckBoxTreeNode; +import org.jackhuang.hellominecraft.utils.views.checktree.CheckBoxTreeNodeSelectionListener; +import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardController; + +/** + * + * @author huangyuhui + */ +public class ModpackFileSelectionPanel extends javax.swing.JPanel { + + private final WizardController controller; + private final Map wizardData; + private final BiFunction blackList; + private final Set bannedFiles = new HashSet<>(); + + /** + * Creates new form ModpackFileSelectionPanel + * + * @param blackList Return 0: non blocked, 1: non shown, 2: suggested, + * checked + */ + public ModpackFileSelectionPanel(WizardController controller, Map wizardData, File gameDir, BiFunction blackList) { + initComponents(); + + this.controller = controller; + this.wizardData = wizardData; + this.blackList = blackList; + + CheckBoxTreeNode root = create(gameDir, "minecraft"); + + jTree1.setModel(new DefaultTreeModel(root)); + jTree1.setCellRenderer(new CheckBoxTreeCellRenderer()); + jTree1.addMouseListener(new CheckBoxTreeNodeSelectionListener()); + + wizardData.put("blackList", root); + } + + CheckBoxTreeNode create(File file, String basePath) { + int state = 0; + if (basePath.length() > "minecraft/".length()) + if ((state = blackList.apply(basePath.substring("minecraft/".length()) + (file.isDirectory() ? "/" : ""), file.isDirectory())) == 1) + return null; + CheckBoxTreeNode node = new CheckBoxTreeNode(FileUtils.getName(basePath)); + if (state == 2) + node.setSelected(true); + + if (file.isDirectory()) { + File[] f = file.listFiles(); + for (File subFile : f) { + CheckBoxTreeNode subNode = create(subFile, basePath + "/" + subFile.getName()); + if (subNode != null) { + subNode.setSelected(subNode.isSelected() | node.isSelected()); + node.add(subNode); + } + } + if (!node.children().hasMoreElements()) + return null; + } + + return node; + } + + /** + * This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + jTree1 = new javax.swing.JTree(); + + jScrollPane1.setViewportView(jTree1); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTree jTree1; + // End of variables declaration//GEN-END:variables +} diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackInitializationPanel.form b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackInitializationPanel.form index cfabb536f7..41b1592724 100644 --- a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackInitializationPanel.form +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackInitializationPanel.form @@ -29,7 +29,6 @@ - @@ -44,7 +43,7 @@ - + @@ -56,8 +55,6 @@ - - @@ -101,14 +98,6 @@ - - - - - - - - diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackInitializationPanel.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackInitializationPanel.java index d8dbc72c57..583991c8b3 100644 --- a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackInitializationPanel.java +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackInitializationPanel.java @@ -32,7 +32,6 @@ public class ModpackInitializationPanel extends javax.swing.JPanel { public static final String KEY_GAME_VERSION = "gameVersion"; public static final String KEY_MODPACK_LOCATION = "modpackLocation"; - public static final String KEY_SAVE = "save"; private final WizardController controller; private final Map wizardData; @@ -47,18 +46,15 @@ public ModpackInitializationPanel(WizardController controller, Map wizardData, S this.wizardData = wizardData; wizardData.put(KEY_GAME_VERSION, versions); - wizardData.put(KEY_SAVE, false); - configureComboContents(); controller.setProblem(C.i18n("modpack.not_a_valid_location")); - - controller.setForwardNavigationMode(WizardController.MODE_CAN_FINISH); } private void configureComboContents() { String[] versions = (String[]) wizardData.get(KEY_GAME_VERSION); cboGameVersion.setModel(new DefaultComboBoxModel<>(versions)); - + if (versions.length > 0) + wizardData.put(KEY_GAME_VERSION, versions[0]); } /** @@ -76,7 +72,6 @@ private void initComponents() { cboModpackLocation = new javax.swing.JButton(); lblGameVersion = new javax.swing.JLabel(); cboGameVersion = new javax.swing.JComboBox<>(); - chkSave = new javax.swing.JCheckBox(); jLabel1 = new javax.swing.JLabel(); lblModpackLocation.setText(C.i18n("modpack.save")); // NOI18N @@ -102,13 +97,6 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) { } }); - chkSave.setText("允许导出存档"); - chkSave.addItemListener(new java.awt.event.ItemListener() { - public void itemStateChanged(java.awt.event.ItemEvent evt) { - chkSaveItemStateChanged(evt); - } - }); - jLabel1.setText(C.i18n("modpack.warning")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); @@ -127,7 +115,6 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) { .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(lblGameVersion) - .addComponent(chkSave) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 67, Short.MAX_VALUE))) .addContainerGap()) @@ -137,7 +124,7 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) { .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 92, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 120, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblModpackLocation) .addComponent(cboModpackLocation)) @@ -147,8 +134,6 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) { .addComponent(lblGameVersion) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cboGameVersion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(chkSave) .addContainerGap()) ); }// //GEN-END:initComponents @@ -173,10 +158,6 @@ private void txtModpackLocationCaretUpdate(javax.swing.event.CaretEvent evt) {// controller.setProblem(null); }//GEN-LAST:event_txtModpackLocationCaretUpdate - private void chkSaveItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chkSaveItemStateChanged - wizardData.put(KEY_SAVE, chkSave.isSelected()); - }//GEN-LAST:event_chkSaveItemStateChanged - private void cboGameVersionItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cboGameVersionItemStateChanged wizardData.put(KEY_GAME_VERSION, cboGameVersion.getSelectedItem()); }//GEN-LAST:event_cboGameVersionItemStateChanged @@ -184,7 +165,6 @@ private void cboGameVersionItemStateChanged(java.awt.event.ItemEvent evt) {//GEN // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JComboBox cboGameVersion; private javax.swing.JButton cboModpackLocation; - private javax.swing.JCheckBox chkSave; private javax.swing.JLabel jLabel1; private javax.swing.JLabel lblGameVersion; private javax.swing.JLabel lblModpackLocation; diff --git a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackWizard.java b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackWizard.java index 61fa124044..52dbe4932b 100644 --- a/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackWizard.java +++ b/HMCL/src/main/java/org/jackhuang/hellominecraft/launcher/views/modpack/ModpackWizard.java @@ -17,14 +17,29 @@ */ package org.jackhuang.hellominecraft.launcher.views.modpack; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Enumeration; import java.util.Iterator; +import java.util.List; import java.util.Map; import javax.swing.JComponent; -import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftProvider; +import org.jackhuang.hellominecraft.launcher.core.GameException; +import org.jackhuang.hellominecraft.launcher.core.mod.ModpackManager; +import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService; import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion; import org.jackhuang.hellominecraft.utils.C; +import org.jackhuang.hellominecraft.utils.MessageBox; +import org.jackhuang.hellominecraft.utils.logging.HMCLog; +import org.jackhuang.hellominecraft.utils.views.checktree.CheckBoxTreeNode; +import org.jackhuang.hellominecraft.utils.views.wizard.spi.DeferredWizardResult; +import org.jackhuang.hellominecraft.utils.views.wizard.spi.ResultProgressHandle; +import org.jackhuang.hellominecraft.utils.views.wizard.spi.Summary; import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardBranchController; import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardController; +import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardException; import org.jackhuang.hellominecraft.utils.views.wizard.spi.WizardPanelProvider; /** @@ -33,18 +48,62 @@ */ public class ModpackWizard extends WizardBranchController { - public ModpackWizard(IMinecraftProvider provider) { - super(new WizardPanelProvider(C.i18n("modpack.wizard"), new String[] { C.i18n("modpack.wizard.step.1") }, new String[] { C.i18n("modpack.wizard.step.1.title") }) { + static void process(CheckBoxTreeNode node, String basePath, List list) { + if (node.isSelected()) { + if (basePath.length() > "minecraft/".length()) + list.add(basePath.substring("minecraft/".length())); + return; + } + Enumeration e = node.children(); + for (; e.hasMoreElements();) { + CheckBoxTreeNode n = e.nextElement(); + process(n, basePath + "/" + n.getUserObject(), list); + } + } + + public ModpackWizard(IMinecraftService service) { + super(new WizardPanelProvider(C.i18n("modpack.wizard"), new String[] { C.i18n("modpack.wizard.step.1"), C.i18n("modpack.wizard.step.2") }, new String[] { C.i18n("modpack.wizard.step.1.title"), C.i18n("modpack.wizard.step.2.title") }) { + + @Override + protected Object finish(Map settings) throws WizardException { + return new DeferredWizardResult(false) { + @Override + public void start(Map settings, ResultProgressHandle progress) { + progress.setBusy("Processing modpack"); + ArrayList blackList = new ArrayList<>(ModpackManager.MODPACK_BLACK_LIST); + CheckBoxTreeNode root = (CheckBoxTreeNode) settings.get("blackList"); + process(root, "minecraft", blackList); + try { + File loc = new File((String) settings.get(ModpackInitializationPanel.KEY_MODPACK_LOCATION)); + ModpackManager.export(loc, + service.version(), + (String) settings.get(ModpackInitializationPanel.KEY_GAME_VERSION), + blackList); + progress.finished(Summary.create(C.i18n("modpack.export_finished") + ": " + loc.getAbsolutePath(), null)); + } catch (IOException | GameException ex) { + HMCLog.err("Failed to export modpack", ex); + progress.failed(C.i18n("modpack.export_error") + ": " + ex.getClass().getName() + ", " + ex.getLocalizedMessage(), true); + } + } + }; + } @Override protected JComponent createPanel(WizardController controller, String id, Map settings) { switch (indexOfStep(id)) { case 0: - String[] s = new String[provider.getVersionCount()]; - Iterator it = provider.getVersions().iterator(); + String[] s = new String[service.version().getVersionCount()]; + Iterator it = service.version().getVersions().iterator(); for (int i = 0; i < s.length; i++) s[i] = it.next().id; + + controller.setForwardNavigationMode(WizardController.MODE_CAN_CONTINUE); + return new ModpackInitializationPanel(controller, settings, s); + case 1: + controller.setForwardNavigationMode(WizardController.MODE_CAN_FINISH); + + return new ModpackFileSelectionPanel(controller, settings, service.baseDirectory(), ModpackManager.MODPACK_PREDICATE); default: throw new IllegalArgumentException(id); } diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/logging/HMCLog.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/logging/HMCLog.java index 4bbcfe387e..cb56f8f588 100755 --- a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/logging/HMCLog.java +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/logging/HMCLog.java @@ -25,7 +25,7 @@ */ public class HMCLog { - public static Logger logger = new Logger("Hello Minecraft!"); + private static final Logger logger = new Logger("Hello Minecraft!"); public static void log(String message) { logger.info(message); diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/system/ZipEngine.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/system/ZipEngine.java index 9d3868cdcd..a7d94dba08 100644 --- a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/system/ZipEngine.java +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/system/ZipEngine.java @@ -102,7 +102,7 @@ private void putDirectoryImpl(File source, String basePath, BiFunction + * + * 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.hellominecraft.utils.views.checktree; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; + +import javax.swing.JCheckBox; +import javax.swing.JPanel; +import javax.swing.JTree; +import javax.swing.UIManager; +import javax.swing.plaf.ColorUIResource; +import javax.swing.tree.TreeCellRenderer; + +public class CheckBoxTreeCellRenderer extends JPanel implements TreeCellRenderer { + + protected JCheckBox check; + protected CheckBoxTreeLabel label; + + public CheckBoxTreeCellRenderer() { + setLayout(null); + add(check = new JCheckBox()); + add(label = new CheckBoxTreeLabel()); + check.setBackground(UIManager.getColor("Tree.textBackground")); + label.setForeground(UIManager.getColor("Tree.textForeground")); + } + + /** + * 返回的是一个JPanel对象,该对象中包含一个JCheckBox对象 + * 和一个JLabel对象。并且根据每个结点是否被选中来决定JCheckBox + * 是否被选中。 + */ + @Override + public Component getTreeCellRendererComponent(JTree tree, Object value, + boolean selected, boolean expanded, boolean leaf, int row, + boolean hasFocus) { + String stringValue = tree.convertValueToText(value, selected, expanded, leaf, row, hasFocus); + setEnabled(tree.isEnabled()); + check.setSelected(((CheckBoxTreeNode) value).isSelected()); + label.setFont(tree.getFont()); + label.setText(stringValue); + label.setSelected(selected); + label.setFocus(hasFocus); + if (leaf) + label.setIcon(UIManager.getIcon("Tree.leafIcon")); + else if (expanded) + label.setIcon(UIManager.getIcon("Tree.openIcon")); + else + label.setIcon(UIManager.getIcon("Tree.closedIcon")); + + return this; + } + + @Override + public Dimension getPreferredSize() { + Dimension dCheck = check.getPreferredSize(); + Dimension dLabel = label.getPreferredSize(); + return new Dimension(dCheck.width + dLabel.width, dCheck.height < dLabel.height ? dLabel.height : dCheck.height); + } + + @Override + public void doLayout() { + Dimension dCheck = check.getPreferredSize(); + Dimension dLabel = label.getPreferredSize(); + int yCheck = 0; + int yLabel = 0; + if (dCheck.height < dLabel.height) + yCheck = (dLabel.height - dCheck.height) / 2; + else + yLabel = (dCheck.height - dLabel.height) / 2; + check.setLocation(0, yCheck); + check.setBounds(0, yCheck, dCheck.width, dCheck.height); + label.setLocation(dCheck.width, yLabel); + label.setBounds(dCheck.width, yLabel, dLabel.width, dLabel.height); + } + + @Override + public void setBackground(Color color) { + if (color instanceof ColorUIResource) + color = null; + super.setBackground(color); + } +} diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/checktree/CheckBoxTreeLabel.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/checktree/CheckBoxTreeLabel.java new file mode 100644 index 0000000000..553d0c37ff --- /dev/null +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/checktree/CheckBoxTreeLabel.java @@ -0,0 +1,82 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * 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.hellominecraft.utils.views.checktree; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; + +import javax.swing.Icon; +import javax.swing.JLabel; +import javax.swing.UIManager; +import javax.swing.plaf.ColorUIResource; + +public class CheckBoxTreeLabel extends JLabel { + + private boolean isSelected; + private boolean hasFocus; + + public CheckBoxTreeLabel() { + } + + @Override + public void setBackground(Color color) { + if (color instanceof ColorUIResource) + color = null; + super.setBackground(color); + } + + @Override + public void paint(Graphics g) { + /*String str; + if ((str = getText()) != null) + if (0 < str.length()) { + if (isSelected) + g.setColor(UIManager.getColor("Tree.selectionBackground")); + else + g.setColor(UIManager.getColor("Tree.textBackground")); + Dimension d = getPreferredSize(); + int imageOffset = 0; + Icon currentIcon = getIcon(); + if (currentIcon != null) + imageOffset = currentIcon.getIconWidth() + Math.max(0, getIconTextGap() - 1); + g.fillRect(imageOffset, 0, d.width - 1 - imageOffset, d.height); + if (hasFocus) { + g.setColor(UIManager.getColor("Tree.selectionBorderColor")); + g.drawRect(imageOffset, 0, d.width - 1 - imageOffset, d.height - 1); + } + }*/ + super.paint(g); + } + + @Override + public Dimension getPreferredSize() { + Dimension retDimension = super.getPreferredSize(); + if (retDimension != null) + retDimension = new Dimension(retDimension.width + 3, retDimension.height); + return retDimension; + } + + public void setSelected(boolean isSelected) { + this.isSelected = isSelected; + } + + public void setFocus(boolean hasFocus) { + this.hasFocus = hasFocus; + } +} diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/checktree/CheckBoxTreeNode.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/checktree/CheckBoxTreeNode.java new file mode 100644 index 0000000000..e06b463801 --- /dev/null +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/checktree/CheckBoxTreeNode.java @@ -0,0 +1,105 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * 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.hellominecraft.utils.views.checktree; + +import javax.swing.tree.DefaultMutableTreeNode; + +/** + * + * @author huangyuhui + */ +public class CheckBoxTreeNode extends DefaultMutableTreeNode { + + protected boolean isSelected; + + public CheckBoxTreeNode() { + this(null); + } + + public CheckBoxTreeNode(Object userObject) { + this(userObject, true, false); + } + + public CheckBoxTreeNode(Object userObject, boolean allowsChildren, boolean isSelected) { + super(userObject, allowsChildren); + this.isSelected = isSelected; + } + + public boolean isSelected() { + return isSelected; + } + + public void setSelected(boolean _isSelected) { + this.isSelected = _isSelected; + + if (_isSelected) { + // 如果选中,则将其所有的子结点都选中 + if (children != null) + for (Object obj : children) { + CheckBoxTreeNode node = (CheckBoxTreeNode) obj; + if (_isSelected != node.isSelected()) + node.setSelected(_isSelected); + } + // 向上检查,如果父结点的所有子结点都被选中,那么将父结点也选中 + CheckBoxTreeNode pNode = (CheckBoxTreeNode) parent; + // 开始检查pNode的所有子节点是否都被选中 + if (pNode != null) { + int index = 0; + for (; index < pNode.children.size(); ++index) { + CheckBoxTreeNode pChildNode = (CheckBoxTreeNode) pNode.children.get(index); + if (!pChildNode.isSelected()) + break; + } + /* + * 表明pNode所有子结点都已经选中,则选中父结点, + * 该方法是一个递归方法,因此在此不需要进行迭代,因为 + * 当选中父结点后,父结点本身会向上检查的。 + */ + if (index == pNode.children.size()) + if (pNode.isSelected() != _isSelected) + pNode.setSelected(_isSelected); + } + } else { + /* + * 如果是取消父结点导致子结点取消,那么此时所有的子结点都应该是选择上的; + * 否则就是子结点取消导致父结点取消,然后父结点取消导致需要取消子结点,但 + * 是这时候是不需要取消子结点的。 + */ + if (children != null) { + int index = 0; + for (; index < children.size(); ++index) { + CheckBoxTreeNode childNode = (CheckBoxTreeNode) children.get(index); + if (!childNode.isSelected()) + break; + } + // 从上向下取消的时候 + if (index == children.size()) + for (int i = 0; i < children.size(); ++i) { + CheckBoxTreeNode node = (CheckBoxTreeNode) children.get(i); + if (node.isSelected() != _isSelected) + node.setSelected(_isSelected); + } + } + + // 向上取消,只要存在一个子节点不是选上的,那么父节点就不应该被选上。 + CheckBoxTreeNode pNode = (CheckBoxTreeNode) parent; + if (pNode != null && pNode.isSelected() != _isSelected) + pNode.setSelected(_isSelected); + } + } +} diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/checktree/CheckBoxTreeNodeSelectionListener.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/checktree/CheckBoxTreeNodeSelectionListener.java new file mode 100644 index 0000000000..25e609d857 --- /dev/null +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/checktree/CheckBoxTreeNodeSelectionListener.java @@ -0,0 +1,45 @@ +/* + * Hello Minecraft! Launcher. + * Copyright (C) 2013 huangyuhui + * + * 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.hellominecraft.utils.views.checktree; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JTree; +import javax.swing.tree.TreePath; +import javax.swing.tree.DefaultTreeModel; + +public class CheckBoxTreeNodeSelectionListener extends MouseAdapter { + + @Override + public void mouseClicked(MouseEvent event) { + JTree tree = (JTree) event.getSource(); + int x = event.getX(); + int y = event.getY(); + int row = tree.getRowForLocation(x, y); + TreePath path = tree.getPathForRow(row); + if (path != null) { + CheckBoxTreeNode node = (CheckBoxTreeNode) path.getLastPathComponent(); + if (node != null) { + boolean isSelected = !node.isSelected(); + node.setSelected(isSelected); + ((DefaultTreeModel) tree.getModel()).nodeStructureChanged(node); + } + } + } +} diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/api/displayer/NavProgress.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/api/displayer/NavProgress.java index 6c28708277..0defbac20b 100644 --- a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/api/displayer/NavProgress.java +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/api/displayer/NavProgress.java @@ -3,11 +3,8 @@ import java.awt.Container; import java.awt.EventQueue; import java.lang.reflect.InvocationTargetException; -import java.net.URL; import java.util.logging.Logger; -import javax.swing.Icon; -import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JProgressBar; import javax.swing.border.EmptyBorder; @@ -38,14 +35,10 @@ public class NavProgress implements ResultProgressHandle { JLabel lbl = new JLabel(); - JLabel busy = new JLabel(); - WizardDisplayerImpl parent; String failMessage = null; - boolean isUseBusy = false; - Container ipanel = null; boolean isInitialized = false; @@ -55,18 +48,13 @@ public class NavProgress implements ResultProgressHandle { */ boolean isRunning = true; - NavProgress(WizardDisplayerImpl impl, boolean useBusy) { + NavProgress(WizardDisplayerImpl impl) { this.parent = impl; - isUseBusy = useBusy; } public void addProgressComponents(Container panel) { panel.add(lbl); - if (isUseBusy) { - ensureBusyInitialized(); - panel.add(busy); - } else - panel.add(progressBar); + panel.add(progressBar); isInitialized = true; ipanel = panel; } @@ -93,8 +81,6 @@ public void setProgress(final int currentStep, final int totalSteps) { progressBar.setMaximum(totalSteps); progressBar.setValue(currentStep); } - - setUseBusy(false); }); } @@ -103,34 +89,9 @@ public void setBusy(final String description) { lbl.setText(description == null ? " " : description); progressBar.setIndeterminate(true); - - setUseBusy(true); }); } - protected void setUseBusy(boolean useBusy) { - if (isInitialized) - if (useBusy && (!isUseBusy)) { - ipanel.remove(progressBar); - ensureBusyInitialized(); - ipanel.add(busy); - ipanel.invalidate(); - } else if (!useBusy && isUseBusy) { - ipanel.remove(busy); - ipanel.add(progressBar); - ipanel.invalidate(); - } - isUseBusy = useBusy; - } - - private void ensureBusyInitialized() { - if (busy.getIcon() == null) { - URL url = getClass().getResource("/org/jackhuang/hellominecraft/busy.gif"); - Icon icon = new ImageIcon(url); - busy.setIcon(icon); - } - } - private void invoke(Runnable r) { if (EventQueue.isDispatchThread()) r.run(); diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/api/displayer/WizardDisplayerImpl.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/api/displayer/WizardDisplayerImpl.java index b00e3cd825..7b3edc3394 100644 --- a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/api/displayer/WizardDisplayerImpl.java +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/api/displayer/WizardDisplayerImpl.java @@ -413,8 +413,8 @@ void handleSummary(Summary summary) { } - protected ResultProgressHandle createProgressDisplay(boolean isUseBusy) { - return new NavProgress(this, isUseBusy); + protected ResultProgressHandle createProgressDisplay() { + return new NavProgress(this); } void handleDeferredWizardResult(final DeferredWizardResult r, final boolean inSummary) { @@ -422,7 +422,7 @@ void handleDeferredWizardResult(final DeferredWizardResult r, final boolean inSu deferredResult = r; } wizardPanel.setEnabled(false); - progress = createProgressDisplay(r.isUseBusy()); + progress = createProgressDisplay(); Container inst = instructions.getComponent(); progress.addProgressComponents(inst); inst.invalidate(); diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/spi/DeferredWizardResult.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/spi/DeferredWizardResult.java index da41cd1b7c..286cd41312 100644 --- a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/spi/DeferredWizardResult.java +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/spi/DeferredWizardResult.java @@ -9,7 +9,7 @@ and Distribution License (the License). You may not use this file except in enclosed by brackets [] replaced by your own identifying information: "Portions Copyrighted [year] [name of copyright owner]" */ -/* + /* * DeferredWizardResult.java * * Created on September 24, 2006, 3:42 AM @@ -17,95 +17,84 @@ and Distribution License (the License). You may not use this file except in * To change this template, choose Tools | Template Manager * and open the template in the editor. */ - package org.jackhuang.hellominecraft.utils.views.wizard.spi; import java.util.Map; - /** - * Object which can be returned from + * Object which can be returned from * WizardPage.WizardResultProducer.finish() - * or WizardPanelProvider.finish(). A DeferredWizardResult does - * not immediately calculate its result; it is used for cases where some + * or WizardPanelProvider.finish(). A DeferredWizardResult does + * not immediately calculate its result; it is used for cases where some * time consuming work needs to be performed to compute the result (such as * creating files on disk), and a progress bar should be shown until the work * is completed. + * * @see org.jackhuang.hellominecraft.utils.views.wizard.spi.ResultProgressHandle * * @author Tim Boudreau */ public abstract class DeferredWizardResult { + private final boolean canAbort; - private final boolean useBusy; - /** - * Creates a new instance of DeferredWizardResult which cannot be + + /** + * Creates a new instance of DeferredWizardResult which cannot be * aborted and shows a progress bar. */ public DeferredWizardResult() { - useBusy = false; canAbort = false; } - - /** Creates a new instance of DeferredWizardResult which may or may not - * be able to be aborted. + + /** + * Creates a new instance of DeferredWizardResult which may or may not + * be able to be aborted. + * * @param canAbort determine if background computation can be aborted by - * calling the abort() method - */ - public DeferredWizardResult (boolean canAbort) { - this.canAbort = canAbort; - this.useBusy = false; - } - - /** Creates a new instance of DeferredWizardResult which may or may not - * be able to be aborted, and which may simply disable the wizard's UI - * instead of showing a progress bar while the background work runs. - * - * @param canAbort - * @param useBusy + * calling the abort() method */ - public DeferredWizardResult (boolean canAbort, boolean useBusy) { + public DeferredWizardResult(boolean canAbort) { this.canAbort = canAbort; - this.useBusy = useBusy; } - - - /** - * Begin computing the result. This method is called on a background + + /** + * Begin computing the result. This method is called on a background * thread, not the AWT event thread, and computation can immediately begin. - * Use the progress handle to set progress as the work progresses. - * - * IMPORTANT: This method MUST call either progress.finished with the result, - * or progress.failed with an error message. If this method returns without + * Use the progress handle to set progress as the work progresses. + * + * IMPORTANT: This method MUST call either progress.finished with the + * result, + * or progress.failed with an error message. If this method returns without * calling either of those methods, it will be assumed to have failed. - * + * * @param settings The settings gathered over the course of the wizard * @param progress A handle which can be used to affect the progress bar. */ - public abstract void start (Map settings, ResultProgressHandle progress); - + public abstract void start(Map settings, ResultProgressHandle progress); + /** - * If true, the background thread can be aborted. If it is possible to + * If true, the background thread can be aborted. If it is possible to * abort, then the UI may allow the dialog to be closed while the result * is being computed. - */ + */ public final boolean canAbort() { return canAbort; } - + /** - * Abort computation of the result. This method will usually be called on + * Abort computation of the result. This method will usually be called on * the event thread, after start() has been called, and before - * finished() has been called on the ResultProgressHandle + * finished() has been called on the + * ResultProgressHandle * that is passed to start(), for example, if the user clicks * the close button on the dialog showing the wizard while the result is * being computed. *

* This method does nothing by default - it is left empty so * that people who do not want to support aborting background work do not - * have to override it. It is up to the implementor - * to set a flag or otherwise notify the background thread to halt - * computation. A simple method for doing so is as follows: + * have to override it. It is up to the implementor + * to set a flag or otherwise notify the background thread to halt + * computation. A simple method for doing so is as follows: *

      * volatile Thread thread;
      * public void start (Map settings, ResultProgressHandle handle) {
@@ -113,8 +102,8 @@ public final boolean canAbort() {
      *  synchronized (this) {
      *     thread = Thread.currentThread();
      *  }
-     *  
-     *  //do the background computation, update progress.  Every so often, 
+     *
+     *  //do the background computation, update progress.  Every so often,
      *  //check Thread.interrupted() and exit if true
      * } finally {
      *    synchronized (this) {
@@ -122,31 +111,17 @@ public final boolean canAbort() {
      *    }
      *  }
      * }
-     * 
+     *
      * public synchronized void abort() {
      *  if (thread != null) thread.interrupt();
      * }
      * 
* or you can use a volatile boolean flag that you set in - * abort() and periodically check in the body of start(). - * - */ + * abort() and periodically check in the body of + * start(). + * + */ public void abort() { //do nothing } - - /** - * Determine if the UI should be completely disabled while the background - * work is running (i.e. you do not want a progress bar, you just want all - * navigation disabled [note on some window managers, the user will still - * be able to click the dialog's window drag-bar close button, so you still - * should override abort() to stop computation if possible]). - * - * @return true if no progress bar should be displayed and the UI should - * just disable itself - */ - public final boolean isUseBusy() - { - return useBusy; - } } diff --git a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/spi/WizardPanelNavResult.java b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/spi/WizardPanelNavResult.java index a39c45271f..8577272b86 100644 --- a/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/spi/WizardPanelNavResult.java +++ b/HMCLAPI/src/main/java/org/jackhuang/hellominecraft/utils/views/wizard/spi/WizardPanelNavResult.java @@ -5,23 +5,22 @@ and Distribution License (the License). You may not use this file except in or http://www.netbeans.org/cddl.txt. When distributing Covered Code, include this CDDL Header Notice in each file and include the License file at http://www.netbeans.org/cddl.txt. -*/ - + */ package org.jackhuang.hellominecraft.utils.views.wizard.spi; import java.util.Map; /** * Result class for the methods in WizardPanel. - * + * * For immediate action, one of the two constantants PROCEED or REMAIN_ON_PAGE - * should be returned. Otherwise an instance of a subclass should be returned + * should be returned. Otherwise an instance of a subclass should be returned * that computes a Boolean result. - * + * * @author stanley@stanleyknutson.com */ -public abstract class WizardPanelNavResult extends DeferredWizardResult -{ +public abstract class WizardPanelNavResult extends DeferredWizardResult { + /** * value for procced to next step in the wizard. */ @@ -31,59 +30,43 @@ public abstract class WizardPanelNavResult extends DeferredWizardResult */ public static final WizardPanelNavResult REMAIN_ON_PAGE = new WPNRimmediate(false); - public WizardPanelNavResult(boolean useBusy) { - super (false, useBusy); + private WizardPanelNavResult() { + super(); } - public WizardPanelNavResult(boolean useBusy, boolean canAbort) { - super (canAbort, useBusy); - } - - public WizardPanelNavResult() { - super (false, false); - } - - public boolean isDeferredComputation() - { + public boolean isDeferredComputation() { return true; } - + /* * internal class for the constants only */ - private final static class WPNRimmediate extends WizardPanelNavResult - { + private final static class WPNRimmediate extends WizardPanelNavResult { + boolean value; - - WPNRimmediate (boolean v) - { + + WPNRimmediate(boolean v) { value = v; } - public boolean isDeferredComputation() - { + + public boolean isDeferredComputation() { return false; } - - public boolean equals (Object o) - { - if (o instanceof WPNRimmediate && ((WPNRimmediate)o).value == value) - { + + public boolean equals(Object o) { + if (o instanceof WPNRimmediate && ((WPNRimmediate) o).value == value) return true; - } return false; } - - public int hashCode() - { + + public int hashCode() { return value ? 1 : 2; } - - public void start(Map settings, ResultProgressHandle progress) - { + + public void start(Map settings, ResultProgressHandle progress) { // Should never get here, this is supposed to be immediate! throw new RuntimeException("Immediate result was called as deferral!"); } - + } } - diff --git a/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N.properties b/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N.properties index 9b5c5ac46b..774472a9e4 100755 --- a/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N.properties +++ b/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N.properties @@ -215,10 +215,13 @@ modpack.install_error=\u5b89\u88c5\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u6574\u54 modpack.save=\u9009\u62e9\u8981\u5bfc\u51fa\u5230\u7684\u6e38\u620f\u6574\u5408\u5305\u4f4d\u7f6e modpack.save.task=\u5bfc\u51fa\u6574\u5408\u5305 modpack.export_error=\u5bfc\u51fa\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u6e38\u620f\u6587\u4ef6\u5939\u683c\u5f0f\u4e0d\u6b63\u786e\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u8d25 +modpack.export_finished=\u6574\u5408\u5305\u5bfc\u51fa\u5b8c\u6210\uff0c\u53c2\u89c1 modpack.enter_name=\u7ed9\u6e38\u620f\u8d77\u4e2a\u4f60\u559c\u6b22\u7684\u540d\u5b57 modpack.wizard=\u5bfc\u51fa\u6574\u5408\u5305\u5411\u5bfc modpack.wizard.step.1=\u57fa\u672c\u8bbe\u7f6e modpack.wizard.step.1.title=\u8bbe\u7f6e\u6574\u5408\u5305\u7684\u4e3b\u8981\u4fe1\u606f +modpack.wizard.step.2=\u6587\u4ef6\u9009\u62e9 +modpack.wizard.step.2.title=\u9009\u4e2d\u4f60\u4e0d\u60f3\u52a0\u5230\u6574\u5408\u5305\u4e2d\u7684\u6587\u4ef6(\u5939) modpack.incorrect_format.no_json=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931 modpack.incorrect_format.no_jar=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931jar\u5b57\u6bb5 modpack.cannot_read_version=\u8bfb\u53d6\u6e38\u620f\u7248\u672c\u5931\u8d25 diff --git a/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_en.properties b/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_en.properties index 66160fb7b4..9500fadf62 100755 --- a/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_en.properties +++ b/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_en.properties @@ -215,10 +215,13 @@ modpack.install_error=Failed to install the modpack, maybe the modpack file is i modpack.save=Choose a location which you want to export the game files to. modpack.save.task=Export the modpack modpack.export_error=Failed to export the modpack, maybe the format of your game directory is incorrect or failed to manage files. +modpack.export_finished=Exporting the modpack finished. See modpack.enter_name=Give this game a name which is your favorite. modpack.wizard=Exporting the modpack wizard modpack.wizard.step.1=Basic options modpack.wizard.step.1.title=Set the basic options 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.incorrect_format.no_json=The format of the modpack is incorrect, pack.json is missing. modpack.incorrect_format.no_jar=The format of the modpack is incorrect, pack.json does not have attribute 'jar' modpack.cannot_read_version=Failed to gather the game version diff --git a/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_zh.properties b/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_zh.properties index 9f2a1b35b9..32a3cbf9a8 100755 --- a/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_zh.properties +++ b/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_zh.properties @@ -15,7 +15,7 @@ # along with this program. If not, see {http://www.gnu.org/licenses/}. launch.failed=\u555f\u52d5\u5931\u6557 launch.failed_creating_process=\u555f\u52d5\u5931\u6557\uff0c\u5728\u5275\u5efa\u65b0\u9032\u7a0b\u6642\u767c\u751f\u932f\u8aa4\uff0c\u53ef\u80fd\u662fJava\u8def\u5f91\u932f\u8aa4\u3002 -launch.failed_sh_permission=\u70ba\u555f\u52d5\u6587\u4ef6\u6dfb\u52a0\u6b0a\u9650\u6642\u767c\u751f\u932f\u8aa4 +launch.failed_sh_permission=\u70ba\u555f\u52d5\u8cc7\u6599\u6dfb\u52a0\u6b0a\u9650\u6642\u767c\u751f\u932f\u8aa4 launch.failed_pa\u200b\u200bcking_jar=\u5728\u6253\u5305jar\u6642\u767c\u751f\u932f\u8aa4 launch.unsupported_launcher_version=\u5c0d\u4e0d\u8d77\uff0c\u672c\u555f\u52d5\u5668\u73fe\u5728\u53ef\u80fd\u4e0d\u80fd\u555f\u52d5\u9019\u500b\u7248\u672c\u7684Minecraft\uff0c\u4f46\u555f\u52d5\u5668\u9084\u662f\u6703\u5617\u8a66\u555f\u52d5\uff0c\u8acb\u76e1\u5feb\u5c07\u6b64\u554f\u984c\u5831\u544a\u7d66\u4f5c\u8005\u3002 launch.too_big_memory_alloc_64bit=\u60a8\u8bbe\u7f6e\u7684\u5185\u5b58\u5927\u5c0f\u8fc7\u5927\uff0c\u7531\u4e8e\u53ef\u80fd\u8d85\u8fc7\u4e8632\u4f4dJava\u7684\u5185\u5b58\u5206\u914d\u9650\u5236\uff0c\u6240\u4ee5\u53ef\u80fd\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\uff0c\u8bf7\u5c06\u5185\u5b58\u8c03\u81f31024MB\u6216\u66f4\u5c0f\uff0c\u542f\u52a8\u5668\u4ecd\u4f1a\u5c1d\u8bd5\u542f\u52a8\u3002 @@ -25,7 +25,7 @@ launch.circular_dependency_versions=\u767c\u73fe\u904a\u6232\u7248\u672c\u5faa\u launch.not_finished_downloading_libraries=\u672a\u5b8c\u6210\u904a\u6232\u4f9d\u8cf4\u5eab\u7684\u4e0b\u8f09\uff0c\u9084\u8981\u7e7c\u7e8c\u555f\u52d5\u904a\u6232\u55ce\uff1f launch.not_finished_decompressing_natives=\u672a\u80fd\u89e3\u58d3\u904a\u6232\u672c\u5730\u5eab\uff0c\u9084\u8981\u7e7c\u7e8c\u555f\u52d5\u904a\u6232\u55ce\uff1f launch.wrong_javadir=\u932f\u8aa4\u7684Java\u8def\u5f91\uff0c\u5c07\u81ea\u52d5\u91cd\u7f6e\u70ba\u9ed8\u8a8dJava\u8def\u5f91\u3002 -launch.exited_abnormally=\u904a\u6232\u975e\u6b63\u5e38\u9000\u51fa\uff0c\u8acb\u67e5\u770b\u65e5\u8a8c\u6587\u4ef6\uff0c\u6216\u806f\u7e6b\u4ed6\u4eba\u5c0b\u6c42\u5e6b\u52a9\u3002 +launch.exited_abnormally=\u904a\u6232\u975e\u6b63\u5e38\u9000\u51fa\uff0c\u8acb\u67e5\u770b\u65e5\u8a8c\u8cc7\u6599\uff0c\u6216\u806f\u7e6b\u4ed6\u4eba\u5c0b\u6c42\u5e6b\u52a9\u3002 install.no_version=\u672a\u627e\u5230\u8981\u5b89\u88dd\u7684\u5c0d\u61c9MC\u7248\u672c install.no_version_if_intall=\u672a\u627e\u5230\u8981\u5b89\u88dd\u7684\u5c0d\u61c9MC\u7248\u672c\uff0c\u662f\u5426\u81ea\u52a8\u5b89\u88c5\u9700\u8981\u7684MC\u7248\u672c\uff1f @@ -107,10 +107,10 @@ ui.more=\u66f4\u591a crash.advice.UnsupportedClassVersionError=\u9019\u53ef\u80fd\u662f\u56e0\u70ba\u60a8\u7684Java\u7248\u672c\u904e\u65bc\u8001\u820a\uff0c\u53ef\u4ee5\u5617\u8a66\u66f4\u63db\u6700\u65b0Java\u4e26\u5728\u7248\u672c\u8a2d\u5b9a\u7684Java\u8def\u5f91\u4e2d\u8a2d\u5b9a. crash.advice.ConcurrentModificationException=\u9019\u53ef\u80fd\u662f\u56e0\u70ba\u60a8\u7684Java\u7248\u672c\u9ad8\u65bcJava 1.8.0_11\u5c0e\u81f4\u7684,\u53ef\u4ee5\u5617\u8a66\u5378\u8f09Java8\u5b89\u88ddJava7\u3002 -crash.advice.ClassNotFoundException=Minecraft\u4e0d\u5b8c\u6574\u6216Mod\u885d\u7a81\uff0c\u5982\u679c\u6709\u672a\u80fd\u4e0b\u8f7d\u7684\u6587\u4ef6\u8bf7\u4e0b\u8f7d\u6210\u529f\u540e\u91cd\u8bd5\u6216\u662f\u5ba2\u6237\u7aef\u635f\u574f\u8bf7\u91cd\u8bd5\u8bf7\u91cd\u65b0\u5236\u4f5c\u5ba2\u6237\u7aef\u6216\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002 -crash.advice.NoSuchFieldError=Minecraft\u4e0d\u5b8c\u6574\u6216Mod\u885d\u7a81\uff0c\u5982\u679c\u6709\u672a\u80fd\u4e0b\u8f7d\u7684\u6587\u4ef6\u8bf7\u4e0b\u8f7d\u6210\u529f\u540e\u91cd\u8bd5\u6216\u662f\u5ba2\u6237\u7aef\u635f\u574f\u8bf7\u91cd\u8bd5\u8bf7\u91cd\u65b0\u5236\u4f5c\u5ba2\u6237\u7aef\u6216\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002 +crash.advice.ClassNotFoundException=Minecraft\u4e0d\u5b8c\u6574\u6216Mod\u885d\u7a81\uff0c\u5982\u679c\u6709\u672a\u80fd\u4e0b\u8f7d\u7684\u8cc7\u6599\u8bf7\u4e0b\u8f7d\u6210\u529f\u540e\u91cd\u8bd5\u6216\u662f\u5ba2\u6237\u7aef\u635f\u574f\u8bf7\u91cd\u8bd5\u8bf7\u91cd\u65b0\u5236\u4f5c\u5ba2\u6237\u7aef\u6216\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002 +crash.advice.NoSuchFieldError=Minecraft\u4e0d\u5b8c\u6574\u6216Mod\u885d\u7a81\uff0c\u5982\u679c\u6709\u672a\u80fd\u4e0b\u8f7d\u7684\u8cc7\u6599\u8bf7\u4e0b\u8f7d\u6210\u529f\u540e\u91cd\u8bd5\u6216\u662f\u5ba2\u6237\u7aef\u635f\u574f\u8bf7\u91cd\u8bd5\u8bf7\u91cd\u65b0\u5236\u4f5c\u5ba2\u6237\u7aef\u6216\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002 crash.advice.LWJGLException=\u60a8\u7684\u7535\u8111\u4e0d\u6b63\u5e38\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u9a71\u52a8\u7cbe\u7075\u6216\u5176\u4ed6\u5b89\u88c5\u5668\u66f4\u65b0\u663e\u5361\u9a71\u52a8\u3002 -crash.advice.SecurityException=\u53ef\u80fd\u662f\u60a8\u4fee\u6539\u4e86minecraft.jar\u4f46\u672a\u522a\u9664META-INF\u6587\u4ef6\u593e\u7684\u539f\u56e0\u3002\u8acb\u901a\u904e\u58d3\u7e2e\u8edf\u4ef6\u522a\u9664jar\u4e2d\u7684META-INF\u6587\u4ef6\u593e\u3002 +crash.advice.SecurityException=\u53ef\u80fd\u662f\u60a8\u4fee\u6539\u4e86minecraft.jar\u4f46\u672a\u522a\u9664META-INF\u8cc7\u6599\u593e\u7684\u539f\u56e0\u3002\u8acb\u901a\u904e\u58d3\u7e2e\u8edf\u4ef6\u522a\u9664jar\u4e2d\u7684META-INF\u8cc7\u6599\u593e\u3002 crash.advice.OutOfMemoryError=\u5185\u5b58\u6ea2\u51fa\uff0c\u60a8\u8bbe\u7f6e\u7684Minecraft\u6700\u5927\u5185\u5b58\u8fc7\u5c0f\uff0c\u8bf7\u8c03\u5927\uff01 crash.advice.otherwise=\u53ef\u80fd\u662fMod\u6216\u5176\u4ed6\u554f\u984c\u3002 @@ -124,7 +124,7 @@ crash.headless=\u5982\u679c\u60a8\u7684\u64cd\u4f5c\u7cfb\u7d71\u662fLinux\uff0c crash.NoClassDefFound=\u8acb\u78ba\u8a8dHMCL\u672c\u9ad4\u662f\u5426\u5b8c\u6574 crash.error=\u60a8\u7684Minecraft\u5d29\u6f70\u4e86\u3002 -crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u985e\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u6587\u4ef6\u586b\u5beb\u932f\u8aa4\u3002\u7121\u6cd5\u555f\u52d5\u904a\u6232\u3002\u53ef\u4ee5\u901a\u904e\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002 +crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u985e\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u8cc7\u6599\u586b\u5beb\u932f\u8aa4\u3002\u7121\u6cd5\u555f\u52d5\u904a\u6232\u3002\u53ef\u4ee5\u901a\u904e\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002 crash.class_path_wrong=\u89e3\u6790Class Path\u6642\u51fa\u73fe\u932f\u8aa4\uff0c\u6b64\u932f\u8aa4\u672c\u4e0d\u61c9\u8a72\u767c\u751f\u3002\u53ef\u80fd\u662f\u555f\u52d5\u8173\u672c\u932f\u8aa4\uff0c\u8acb\u4ed4\u7d30\u6aa2\u67e5\u555f\u52d5\u8173\u672c\u3002 ui.label.newProfileWindow.new_profile_name=\u65b0\u914d\u7f6e\u540d: @@ -175,17 +175,17 @@ download.failed=\u4e0b\u8f09\u5931\u6557 download.successfully=\u4e0b\u8f09\u5b8c\u6210 message.error=\u932f\u8aa4 -message.cannot_open_explorer=\u7121\u6cd5\u6253\u958b\u6587\u4ef6\u7ba1\u7406\u5668: +message.cannot_open_explorer=\u7121\u6cd5\u6253\u958b\u8cc7\u6599\u7ba1\u7406\u5668: message.cancelled=\u5df2\u53d6\u6d88 message.info=\u63d0\u793a -folder.game=\u904a\u6232\u6587\u4ef6\u593e -folder.mod=MOD\u6587\u4ef6\u593e -folder.coremod=\u6838\u5fc3MOD\u6587\u4ef6\u593e -folder.config=\u914d\u7f6e\u6587\u4ef6\u593e -folder.resourcepacks=\u8cc7\u6e90\u5305\u6587\u4ef6\u593e -folder.screenshots=\u622a\u5716\u6587\u4ef6\u593e -folder.saves=\u5b58\u6a94\u6587\u4ef6\u593e +folder.game=\u904a\u6232\u8cc7\u6599\u593e +folder.mod=MOD\u8cc7\u6599\u593e +folder.coremod=\u6838\u5fc3MOD\u8cc7\u6599\u593e +folder.config=\u914d\u7f6e\u8cc7\u6599\u593e +folder.resourcepacks=\u8cc7\u6e90\u5305\u8cc7\u6599\u593e +folder.screenshots=\u622a\u5716\u8cc7\u6599\u593e +folder.saves=\u5b58\u6a94\u8cc7\u6599\u593e settings.tabs.game_download=\u904a\u6232\u4e0b\u8f09 settings.tabs.installers=\u81ea\u52d5\u5b89\u88dd @@ -200,25 +200,28 @@ settings.java_dir=Java\u8def\u5f91 settings.game_directory=\u904a\u6232\u8def\u5f91 settings.dimension=\u5206\u8fa8\u7387 settings.fullscreen=\u5168\u5c4f -settings.update_version=\u66f4\u65b0\u7248\u672c\u6587\u4ef6 +settings.update_version=\u66f4\u65b0\u7248\u672c\u8cc7\u6599 settings.physical_memory=\u7269\u7406\u5185\u5b58\u5927\u5c0f settings.choose_javapath=\u9009\u62e9Java\u8def\u5f84 settings.default=\u9ed8\u8a8d settings.custom=\u81ea\u5b9a\u7fa9 settings.choose_gamedir=\u9009\u62e9\u6e38\u620f\u8def\u5f84 -settings.failed_load=\u8a2d\u5b9a\u6587\u4ef6\u52a0\u8f09\u5931\u6557\uff0c\u53ef\u80fd\u662f\u5347\u7d1a\u4e86\u555f\u52d5\u5668\u6216\u88ab\u4eba\u5de5\u4fee\u6539\u9020\u6210\u932f\u8aa4\uff0c\u662f\u5426\u6e05\u9664\uff1f +settings.failed_load=\u8a2d\u5b9a\u8cc7\u6599\u52a0\u8f09\u5931\u6557\uff0c\u53ef\u80fd\u662f\u5347\u7d1a\u4e86\u555f\u52d5\u5668\u6216\u88ab\u4eba\u5de5\u4fee\u6539\u9020\u6210\u932f\u8aa4\uff0c\u662f\u5426\u6e05\u9664\uff1f modpack=\u61f6\u4eba\u5305 -modpack.choose=\u9078\u64c7\u8981\u5c0e\u5165\u7684\u904a\u6232\u61f6\u4eba\u5305\u6587\u4ef6\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u66f4\u65b0\u6574\u5408\u5305\uff0c\u8bf7\u8f93\u5165\u8981\u66f4\u65b0\u7684\u7248\u672c\u540d +modpack.choose=\u9078\u64c7\u8981\u5c0e\u5165\u7684\u904a\u6232\u61f6\u4eba\u5305\u8cc7\u6599\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u66f4\u65b0\u6574\u5408\u5305\uff0c\u8bf7\u8f93\u5165\u8981\u66f4\u65b0\u7684\u7248\u672c\u540d modpack.install.task=\u5c0e\u5165\u61f6\u4eba\u5305 -modpack.install_error=\u5b89\u88dd\u5931\u6557\uff0c\u53ef\u80fd\u662f\u6574\u5408\u5305\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u6557 +modpack.install_error=\u5b89\u88dd\u5931\u6557\uff0c\u53ef\u80fd\u662f\u6574\u5408\u5305\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u8cc7\u6599\u5931\u6557 modpack.save=\u9078\u64c7\u8981\u5c0e\u51fa\u5230\u7684\u904a\u6232\u61f6\u4eba\u5305\u4f4d\u7f6e modpack.save.task=\u5c0e\u51fa\u61f6\u4eba\u5305 -modpack.export_error=\u5c0e\u51fa\u5931\u6557\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u904a\u6232\u6587\u4ef6\u593e\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u6557 +modpack.export_error=\u5c0e\u51fa\u5931\u6557\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u904a\u6232\u8cc7\u6599\u593e\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u8cc7\u6599\u5931\u6557 +modpack.export_finished=\u61f6\u4eba\u5305\u5c0e\u51fa\u5b8c\u6210\uff0c\u53c2\u89c1 modpack.enter_name=\u7d66\u904a\u6232\u8d77\u500b\u4f60\u559c\u6b61\u7684\u540d\u5b57 modpack.wizard=\u5c0e\u51fa\u61f6\u4eba\u5305\u56ae\u5c0e modpack.wizard.step.1=\u57fa\u672c\u8a2d\u5b9a modpack.wizard.step.1.title=\u8a2d\u7f6e\u61f6\u4eba\u5305\u7684\u4e3b\u8981\u4fe1\u606f +modpack.wizard.step.2=\u8cc7\u6599\u9078\u64c7 +modpack.wizard.step.2.title=\u9078\u4e2d\u4f60\u4e0d\u60f3\u52a0\u5230\u6574\u5408\u5305\u4e2d\u7684\u8cc7\u6599(\u593e) modpack.incorrect_format.no_json=\u61f6\u4eba\u5305\u683c\u5f0f\u932f\u8aa4\uff0cpack.json\u4e1f\u5931 modpack.incorrect_format.no_jar=\u61f6\u4eba\u5305\u683c\u5f0f\u932f\u8aa4\uff0cpack.json\u4e1f\u5931jar\u5b57\u6bb5 modpack.cannot_read_version=\u8b80\u53d6\u904a\u6232\u7248\u672c\u5931\u6557 @@ -253,7 +256,7 @@ advancedsettings.cancel_wrapper_launcher=\u53d6\u6d88\u5305\u88f9\u555f\u52d5\u5 mainwindow.show_log=\u67e5\u770b\u65e5\u8a8c mainwindow.make_launch_script=\u751f\u6210\u555f\u52d5\u8173\u672c mainwindow.make_launch_script_failed=\u751f\u6210\u555f\u52d5\u8173\u672c\u5931\u6557 -mainwindow.enter_script_name=\u8f38\u5165\u8981\u751f\u6210\u8173\u672c\u7684\u6587\u4ef6\u540d +mainwindow.enter_script_name=\u8f38\u5165\u8981\u751f\u6210\u8173\u672c\u7684\u8cc7\u6599\u540d mainwindow.make_launch_succeed=\u555f\u52d5\u8173\u672c\u5df2\u751f\u6210\u5b8c\u7562: mainwindow.no_version=\u672a\u627e\u5230\u4efb\u4f55\u7248\u672c\uff0c\u662f\u5426\u9032\u5165\u904a\u6232\u4e0b\u8f09\uff1f @@ -261,11 +264,11 @@ launcher.about=\u9ed8\u8a8d\u80cc\u666f\u5716\u4f86\u81eaLiberty Dome\u670 launcher.download_source=\u4e0b\u8f09\u6e90 launcher.background_location=\u80cc\u666f\u5730\u5740 launcher.exit_failed=\u5f37\u5236\u9000\u51fa\u5931\u6557\uff0c\u53ef\u80fd\u662fForge 1.7.10\u53ca\u66f4\u9ad8\u7248\u672c\u5c0e\u81f4\u7684\uff0c\u7121\u6cd5\u89e3\u6c7a\u3002 -launcher.versions_json_not_matched=\u7248\u672c%s\u683c\u5f0f\u4e0d\u898f\u7bc4\uff01\u8a72\u7248\u672c\u6587\u4ef6\u593e\u4e0b\u6709json:%s\uff0c\u662f\u5426\u66f4\u540d\u9019\u500b\u6587\u4ef6\u4f86\u898f\u7bc4\u683c\u5f0f\uff1f -launcher.versions_json_not_matched_cannot_auto_completion=\u7248\u672c%s\u7f3a\u5931\u5fc5\u8981\u7684\u7248\u672c\u4fe1\u606f\u6587\u4ef6\uff0c\u662f\u5426\u5220\u9664\u8be5\u7248\u672c\uff1f -launcher.versions_json_not_formatted=\u7248\u672c%s\u4fe1\u606f\u6587\u4ef6\u683c\u5f0f\u9519\u8bef\uff0c\u662f\u5426\u91cd\u65b0\u4e0b\u8f7d\uff1f +launcher.versions_json_not_matched=\u7248\u672c%s\u683c\u5f0f\u4e0d\u898f\u7bc4\uff01\u8a72\u7248\u672c\u8cc7\u6599\u593e\u4e0b\u6709json:%s\uff0c\u662f\u5426\u66f4\u540d\u9019\u500b\u8cc7\u6599\u4f86\u898f\u7bc4\u683c\u5f0f\uff1f +launcher.versions_json_not_matched_cannot_auto_completion=\u7248\u672c%s\u7f3a\u5931\u5fc5\u8981\u7684\u7248\u672c\u4fe1\u606f\u8cc7\u6599\uff0c\u662f\u5426\u5220\u9664\u8be5\u7248\u672c\uff1f +launcher.versions_json_not_formatted=\u7248\u672c%s\u4fe1\u606f\u8cc7\u6599\u683c\u5f0f\u9519\u8bef\uff0c\u662f\u5426\u91cd\u65b0\u4e0b\u8f7d\uff1f launcher.choose_bgpath=\u9078\u64c7\u80cc\u666f\u8def\u5f91 -launcher.background_tooltip=\n\n\u555f\u52d5\u5668\u9ed8\u8a8d\u4f7f\u7528\u81ea\u5e36\u7684\u80cc\u666f
\n\u5982\u679c\u7576\u524d\u76ee\u9304\u6709background.png\uff0c\u5247\u6703\u4f7f\u7528\u8a72\u6587\u4ef6\u4f5c\u70ba\u80cc\u666f
\n\u5982\u679c\u7576\u524d\u76ee\u9304\u6709bg\u5b50\u76ee\u9304\uff0c\u5247\u6703\u96a8\u6a5f\u4f7f\u7528\u88e1\u9762\u7684\u4e00\u5f35\u5716\u4f5c\u70ba\u80cc\u666f
\n\u5982\u679c\u8a72\u80cc\u666f\u5730\u5740\u88ab\u4fee\u6539\uff0c\u5247\u6703\u4f7f\u7528\u80cc\u666f\u5730\u5740\u88e1\u7684\u4e00\u5f35\u5716\u4f5c\u70ba\u80cc\u666f
\n\u80cc\u666f\u5730\u5740\u5141\u8a31\u6709\u591a\u500b\u5730\u5740\uff0c\u4f7f\u7528\u534a\u89d2\u5206\u865f";"(\u4e0d\u5305\u542b\u96d9\u5f15\u865f)\u5206\u9694\n\n +launcher.background_tooltip=\n\n\u555f\u52d5\u5668\u9ed8\u8a8d\u4f7f\u7528\u81ea\u5e36\u7684\u80cc\u666f
\n\u5982\u679c\u7576\u524d\u76ee\u9304\u6709background.png\uff0c\u5247\u6703\u4f7f\u7528\u8a72\u8cc7\u6599\u4f5c\u70ba\u80cc\u666f
\n\u5982\u679c\u7576\u524d\u76ee\u9304\u6709bg\u5b50\u76ee\u9304\uff0c\u5247\u6703\u96a8\u6a5f\u4f7f\u7528\u88e1\u9762\u7684\u4e00\u5f35\u5716\u4f5c\u70ba\u80cc\u666f
\n\u5982\u679c\u8a72\u80cc\u666f\u5730\u5740\u88ab\u4fee\u6539\uff0c\u5247\u6703\u4f7f\u7528\u80cc\u666f\u5730\u5740\u88e1\u7684\u4e00\u5f35\u5716\u4f5c\u70ba\u80cc\u666f
\n\u80cc\u666f\u5730\u5740\u5141\u8a31\u6709\u591a\u500b\u5730\u5740\uff0c\u4f7f\u7528\u534a\u89d2\u5206\u865f";"(\u4e0d\u5305\u542b\u96d9\u5f15\u865f)\u5206\u9694\n\n launcher.update_launcher=\u68c0\u67e5\u66f4\u65b0 launcher.enable_shadow=\u542f\u7528\u7a97\u53e3\u9634\u5f71(\u91cd\u542f\u542f\u52a8\u5668\u751f\u6548) launcher.theme=\u4e3b\u9898 @@ -291,7 +294,7 @@ versions.manage.redownload_assets_index=\u91cd\u65b0\u4e0b\u8f09\u8cc7\u6e90\u91 advice.os64butjdk32=\u60a8\u7684\u7cfb\u7d71\u662f64\u4f4d\u7684\u4f46\u662fJava\u662f32\u4f4d\u7684\uff0c\u63a8\u85a6\u60a8\u5b89\u88dd64\u4f4dJava. -assets.download_all=\u4e0b\u8f7d\u8d44\u6e90\u6587\u4ef6 +assets.download_all=\u4e0b\u8f7d\u8d44\u6e90\u8cc7\u6599 assets.not_refreshed=\u8cc7\u6e90\u5217\u8868\u672a\u5237\u65b0\uff0c\u8acb\u5237\u65b0\u4e00\u6b21\u3002 assets.failed=\u7372\u53d6\u5217\u8868\u5931\u6557\uff0c\u8acb\u5237\u65b0\u91cd\u8a66\u3002 assets.list.1_7_3_after=1.7.3\u53ca\u4ee5\u5f8c @@ -299,8 +302,8 @@ assets.list.1_6=1.6(BMCLAPI) assets.unkown_type_select_one=\u7121\u6cd5\u89e3\u6790\u904a\u6232\u7248\u672c\uff1a%s\uff0c\u8acb\u9078\u64c7\u4e00\u7a2e\u8cc7\u6e90\u985e\u578b\u4e0b\u8f09\u3002 assets.type=\u8cc7\u6e90\u985e\u578b assets.download=\u4e0b\u8f09\u8cc7\u6e90 -assets.no_assets=\u8cc7\u6e90\u6587\u4ef6\u4e0d\u5b8c\u6574\uff0c\u662f\u5426\u88dc\u5168\uff1f -assets.failed_download=\u4e0b\u8f09\u8cc7\u6e90\u6587\u4ef6\u5931\u6557\uff0c\u53ef\u80fd\u5c0e\u81f4\u6c92\u6709\u4e2d\u6587\u548c\u8072\u97f3\u3002 +assets.no_assets=\u8cc7\u6e90\u8cc7\u6599\u4e0d\u5b8c\u6574\uff0c\u662f\u5426\u88dc\u5168\uff1f +assets.failed_download=\u4e0b\u8f09\u8cc7\u6e90\u8cc7\u6599\u5931\u6557\uff0c\u53ef\u80fd\u5c0e\u81f4\u6c92\u6709\u4e2d\u6587\u548c\u8072\u97f3\u3002 gamedownload.not_refreshed=\u904a\u6232\u4e0b\u8f09\u5217\u8868\u672a\u5237\u65b0\uff0c\u8acb\u518d\u5237\u65b0\u4e00\u6b21\u3002 @@ -312,12 +315,12 @@ taskwindow.no_more_instance=\u53ef\u80fd\u540c\u6642\u6253\u958b\u4e86\u591a\u50 taskwindow.file_name=\u4efb\u52d9 taskwindow.download_progress=\u9032\u5ea6 -setupwindow.include_minecraft=\u5c0e\u5165\u904a\u6232\u6587\u4ef6\u593e +setupwindow.include_minecraft=\u5c0e\u5165\u904a\u6232\u8cc7\u6599\u593e setupwindow.find_in_configurations=\u5c0e\u5165\u5b8c\u6210\uff0c\u5feb\u5230\u914d\u7f6e\u4e0b\u62c9\u6846\u4e2d\u627e\u65b0\u904a\u6232\u8def\u5f91\u5427\uff01 setupwindow.give_a_name=\u7d66\u65b0\u904a\u6232\u8def\u5f91\u8d77\u500b\u540d\u5b57\u5427 setupwindow.new=\u65b0\u5efa setupwindow.no_empty_name=\u540d\u5b57\u4e0d\u53ef\u70ba\u7a7a -setupwindow.clean=\u6e05\u7406\u904a\u6232\u6587\u4ef6 +setupwindow.clean=\u6e05\u7406\u904a\u6232\u8cc7\u6599 update.no_browser=\u7121\u6cd5\u6253\u958b\u700f\u89bd\u5668\uff0c\u7db2\u5740\u5df2\u7d93\u5fa9\u88fd\u5230\u526a\u8cbc\u677f\u4e86\uff0c\u60a8\u53ef\u4ee5\u624b\u52d5\u7c98\u8cbc\u7db2\u5740\u6253\u958b\u9801\u9762 update.should_open_link=\u662f\u5426\u524d\u5f80\u767c\u5e03\u9801\u9762\u66f4\u65b0\uff1f @@ -339,7 +342,7 @@ serverlistview.info=\u4fe1\u606f minecraft.invalid=\u7121\u6548\u7684 minecraft.invalid_jar=\u7121\u6548\u7684jar\u5305 -minecraft.not_a_file=\u4e0d\u662f\u6587\u4ef6 +minecraft.not_a_file=\u4e0d\u662f\u8cc7\u6599 minecraft.not_found=\u627e\u4e0d\u5230minecraft.jar minecraft.not_readable=minecraft.jar\u4e0d\u53ef\u8b80 minecraft.modified=(\u4fee\u6539\u7684!) diff --git a/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_zh_CN.properties b/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_zh_CN.properties index c85e8d29b9..60b8772ee6 100755 --- a/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_zh_CN.properties +++ b/HMCLAPI/src/main/resources/org/jackhuang/hellominecraft/launcher/I18N_zh_CN.properties @@ -215,10 +215,13 @@ modpack.install_error=\u5b89\u88c5\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u6574\u54 modpack.save=\u9009\u62e9\u8981\u5bfc\u51fa\u5230\u7684\u6e38\u620f\u6574\u5408\u5305\u4f4d\u7f6e modpack.save.task=\u5bfc\u51fa\u6574\u5408\u5305 modpack.export_error=\u5bfc\u51fa\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u6e38\u620f\u6587\u4ef6\u5939\u683c\u5f0f\u4e0d\u6b63\u786e\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u8d25 +modpack.export_finished=\u6574\u5408\u5305\u5bfc\u51fa\u5b8c\u6210\uff0c\u53c2\u89c1 modpack.enter_name=\u7ed9\u6e38\u620f\u8d77\u4e2a\u4f60\u559c\u6b22\u7684\u540d\u5b57 modpack.wizard=\u5bfc\u51fa\u6574\u5408\u5305\u5411\u5bfc modpack.wizard.step.1=\u57fa\u672c\u8bbe\u7f6e modpack.wizard.step.1.title=\u8bbe\u7f6e\u6574\u5408\u5305\u7684\u4e3b\u8981\u4fe1\u606f +modpack.wizard.step.2=\u6587\u4ef6\u9009\u62e9 +modpack.wizard.step.2.title=\u9009\u4e2d\u4f60\u4e0d\u60f3\u52a0\u5230\u6574\u5408\u5305\u4e2d\u7684\u6587\u4ef6(\u5939) modpack.incorrect_format.no_json=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931 modpack.incorrect_format.no_jar=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931jar\u5b57\u6bb5 modpack.cannot_read_version=\u8bfb\u53d6\u6e38\u620f\u7248\u672c\u5931\u8d25 diff --git a/MetroLookAndFeel/src/main/java/org/jackhuang/hellominecraft/lookandfeel/HelloMinecraftLookAndFeel.java b/MetroLookAndFeel/src/main/java/org/jackhuang/hellominecraft/lookandfeel/HelloMinecraftLookAndFeel.java index 7c0b9e33c7..2e286c151d 100755 --- a/MetroLookAndFeel/src/main/java/org/jackhuang/hellominecraft/lookandfeel/HelloMinecraftLookAndFeel.java +++ b/MetroLookAndFeel/src/main/java/org/jackhuang/hellominecraft/lookandfeel/HelloMinecraftLookAndFeel.java @@ -22,6 +22,7 @@ import java.text.ParseException; import java.util.Map; import javax.swing.UIDefaults; +import javax.swing.UIManager; import javax.swing.plaf.synth.SynthLookAndFeel; import org.jackhuang.hellominecraft.utils.logging.HMCLog; import org.jackhuang.hellominecraft.utils.NetUtils; diff --git a/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_closed.gif b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_closed.gif new file mode 100644 index 0000000000..fa34e2f5e1 Binary files /dev/null and b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_closed.gif differ diff --git a/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_collapsed.gif b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_collapsed.gif new file mode 100644 index 0000000000..a93f61b109 Binary files /dev/null and b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_collapsed.gif differ diff --git a/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_expanded.gif b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_expanded.gif new file mode 100644 index 0000000000..85da77acf8 Binary files /dev/null and b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_expanded.gif differ diff --git a/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_leaf.gif b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_leaf.gif new file mode 100644 index 0000000000..800b562934 Binary files /dev/null and b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_leaf.gif differ diff --git a/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_open.gif b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_open.gif new file mode 100644 index 0000000000..fa34e2f5e1 Binary files /dev/null and b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/images/tree_open.gif differ diff --git a/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/synth.xml b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/synth.xml index ca42492f85..cee1b3df3d 100755 --- a/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/synth.xml +++ b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/synth.xml @@ -380,7 +380,8 @@ - + + + + + + + + + diff --git a/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/synth_backup.xml b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/synth_backup.xml index 5324dd5d67..451a3c0ae4 100644 --- a/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/synth_backup.xml +++ b/MetroLookAndFeel/src/main/resources/org/jackhuang/hellominecraft/lookandfeel/synth_backup.xml @@ -390,4 +390,48 @@ + + 6 + + + + + + + \ No newline at end of file