Api
2
.gitignore
vendored
@@ -27,3 +27,5 @@ HMCSM/build/
|
|||||||
MetroLookAndFeel/build/
|
MetroLookAndFeel/build/
|
||||||
/HMCUtils/build/
|
/HMCUtils/build/
|
||||||
/HMCLaF/build/
|
/HMCLaF/build/
|
||||||
|
/HMCLUtils/build/
|
||||||
|
/HMCLCore/build/
|
||||||
@@ -39,7 +39,7 @@ import java.util.zip.ZipEntry
|
|||||||
import java.util.zip.ZipFile
|
import java.util.zip.ZipFile
|
||||||
|
|
||||||
if (!hasProperty('mainClass')) {
|
if (!hasProperty('mainClass')) {
|
||||||
ext.mainClass = 'org.jackhuang.hellominecraft.launcher.Main'
|
ext.mainClass = 'org.jackhuang.hmcl.Main'
|
||||||
}
|
}
|
||||||
|
|
||||||
def buildnumber = System.getenv("TRAVIS_BUILD_NUMBER")
|
def buildnumber = System.getenv("TRAVIS_BUILD_NUMBER")
|
||||||
@@ -63,7 +63,6 @@ String mavenArtifactId = name
|
|||||||
|
|
||||||
task generateSources(type: Copy) {
|
task generateSources(type: Copy) {
|
||||||
from 'src/main/java'
|
from 'src/main/java'
|
||||||
from 'src/core/java'
|
|
||||||
into "$buildDir/generated-src"
|
into "$buildDir/generated-src"
|
||||||
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
|
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
|
||||||
'HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING': mavenVersion
|
'HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING': mavenVersion
|
||||||
@@ -85,30 +84,6 @@ macAppBundle {
|
|||||||
javaProperties.put("apple.laf.useScreenMenuBar", "true")
|
javaProperties.put("apple.laf.useScreenMenuBar", "true")
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
java {
|
|
||||||
srcDirs = [
|
|
||||||
'src/core/java/',
|
|
||||||
'src/main/java/'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
resources {
|
|
||||||
srcDirs = ['src/main/resources/']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
core {
|
|
||||||
java {
|
|
||||||
compileClasspath += main.compileClasspath
|
|
||||||
runtimeClasspath += main.runtimeClasspath
|
|
||||||
srcDirs 'src/core/java/'
|
|
||||||
}
|
|
||||||
resources {
|
|
||||||
srcDirs 'src/main/resources/'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
coreCompile.extendsFrom compile
|
coreCompile.extendsFrom compile
|
||||||
coreRuntime.extendsFrom runtime
|
coreRuntime.extendsFrom runtime
|
||||||
@@ -124,26 +99,26 @@ configure(install.repositories.mavenInstaller) {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(":HMCLaF")
|
compile project(":HMCLaF")
|
||||||
compile project(":HMCUtils")
|
compile project(":HMCLAPI")
|
||||||
compile group: "org.commonjava.googlecode.markdown4j", name: "markdown4j", version: "2.2-cj-1.0"
|
compile project(":HMCLCore")
|
||||||
}
|
}
|
||||||
|
|
||||||
retrolambda {
|
retrolambda {
|
||||||
javaVersion = JavaVersion.VERSION_1_6
|
javaVersion = JavaVersion.VERSION_1_7
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Created-By' : 'Copyright(c) 2013-2016 huangyuhui.',
|
attributes 'Created-By' : 'Copyright(c) 2013-2017 huangyuhui.',
|
||||||
'Main-Class' : mainClass
|
'Main-Class' : mainClass
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
launch4j {
|
launch4j {
|
||||||
supportUrl = 'http://www.mcbbs.net/thread-142335-1-1.html'
|
supportUrl = 'http://www.mcbbs.net/thread-142335-1-1.html'
|
||||||
jreMinVersion = '1.6.0'
|
jreMinVersion = '1.7.0'
|
||||||
|
|
||||||
mainClassName = mainClass
|
mainClassName = mainClass
|
||||||
icon = new File(project.buildDir, '../icon.ico').absolutePath
|
icon = new File(project.buildDir, '../icon.ico').absolutePath
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
* Hello Minecraft!.
|
|
||||||
* Copyright (C) 2013 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.hellominecraft.launcher.core.download;
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author huangyuhui
|
|
||||||
*/
|
|
||||||
public class MinecraftRemoteLatestVersion {
|
|
||||||
|
|
||||||
@SerializedName("snapshot")
|
|
||||||
public String snapshot;
|
|
||||||
|
|
||||||
@SerializedName("release")
|
|
||||||
public String release;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher;
|
package org.jackhuang.hmcl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@@ -36,25 +36,27 @@ import javax.swing.ImageIcon;
|
|||||||
import javax.swing.RepaintManager;
|
import javax.swing.RepaintManager;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.UnsupportedLookAndFeelException;
|
import javax.swing.UnsupportedLookAndFeelException;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.PluginManager;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher;
|
import org.jackhuang.hmcl.api.ILogger;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.CrashReporter;
|
import org.jackhuang.hmcl.api.PluginManager;
|
||||||
import org.jackhuang.hellominecraft.util.log.Configuration;
|
import org.jackhuang.hmcl.api.VersionNumber;
|
||||||
import org.jackhuang.hellominecraft.util.log.appender.ConsoleAppender;
|
import org.jackhuang.hmcl.laf.HelloMinecraftLookAndFeel;
|
||||||
import org.jackhuang.hellominecraft.util.log.layout.DefaultLayout;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.util.ui.LogWindow;
|
import org.jackhuang.hmcl.ui.LogWindow;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.ui.MainFrame;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.upgrade.IUpgrader;
|
import org.jackhuang.hmcl.util.CrashReporter;
|
||||||
import org.jackhuang.hellominecraft.launcher.ui.MainFrame;
|
import org.jackhuang.hmcl.util.DefaultPlugin;
|
||||||
import org.jackhuang.hellominecraft.util.ui.MyRepaintManager;
|
import org.jackhuang.hmcl.util.MathUtils;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.DefaultPlugin;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.lookandfeel.HelloMinecraftLookAndFeel;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.util.MathUtils;
|
import org.jackhuang.hmcl.util.lang.SupportedLocales;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.util.log.Configuration;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.log.appender.ConsoleAppender;
|
||||||
import org.jackhuang.hellominecraft.util.lang.SupportedLocales;
|
import org.jackhuang.hmcl.util.log.layout.DefaultLayout;
|
||||||
import org.jackhuang.hellominecraft.util.VersionNumber;
|
import org.jackhuang.hmcl.util.sys.ProcessManager;
|
||||||
|
import org.jackhuang.hmcl.util.ui.MyRepaintManager;
|
||||||
|
import org.jackhuang.hmcl.util.upgrade.IUpgrader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -82,10 +84,6 @@ public final class Main implements Runnable {
|
|||||||
public static final String LAUNCHER_VERSION = "@HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING@";
|
public static final String LAUNCHER_VERSION = "@HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING@";
|
||||||
public static final int MINIMUM_LAUNCHER_VERSION = 16;
|
public static final int MINIMUM_LAUNCHER_VERSION = 16;
|
||||||
|
|
||||||
public static VersionNumber getVersionNumber() {
|
|
||||||
return VersionNumber.check(LAUNCHER_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make the main window title.
|
* Make the main window title.
|
||||||
*
|
*
|
||||||
@@ -105,6 +103,8 @@ public final class Main implements Runnable {
|
|||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
{
|
{
|
||||||
|
HMCLApi.HMCL_VERSION = VersionNumber.check(LAUNCHER_VERSION);
|
||||||
|
|
||||||
PluginManager.getPlugin(DefaultPlugin.class);
|
PluginManager.getPlugin(DefaultPlugin.class);
|
||||||
for (String s : args)
|
for (String s : args)
|
||||||
if (s.startsWith("--plugin=")) {
|
if (s.startsWith("--plugin=")) {
|
||||||
@@ -121,7 +121,7 @@ public final class Main implements Runnable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IUpgrader.NOW_UPGRADER.parseArguments(getVersionNumber(), args);
|
IUpgrader.NOW_UPGRADER.parseArguments(HMCLApi.HMCL_VERSION, args);
|
||||||
|
|
||||||
System.setProperty("awt.useSystemAAFontSettings", "on");
|
System.setProperty("awt.useSystemAAFontSettings", "on");
|
||||||
System.setProperty("swing.aatext", "true");
|
System.setProperty("swing.aatext", "true");
|
||||||
@@ -148,6 +148,34 @@ public final class Main implements Runnable {
|
|||||||
LOGGER.log(Level.SEVERE, "Failed to add log appender File because an error occurred while creating or opening hmcl.log", ex);
|
LOGGER.log(Level.SEVERE, "Failed to add log appender File because an error occurred while creating or opening hmcl.log", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
org.jackhuang.hmcl.util.log.logger.Logger logger = new org.jackhuang.hmcl.util.log.logger.Logger("HMCL");
|
||||||
|
HMCLog.LOGGER = new ILogger() {
|
||||||
|
@Override
|
||||||
|
public void log(String msg) {
|
||||||
|
logger.info(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void warn(String msg) {
|
||||||
|
logger.warn(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void warn(String msg, Throwable t) {
|
||||||
|
logger.warn(msg, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void err(String msg) {
|
||||||
|
logger.error(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void err(String msg, Throwable t) {
|
||||||
|
logger.error(msg, t);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
HMCLog.log("*** " + Main.makeTitle() + " ***");
|
HMCLog.log("*** " + Main.makeTitle() + " ***");
|
||||||
|
|
||||||
String s = Settings.getInstance().getLocalization();
|
String s = Settings.getInstance().getLocalization();
|
||||||
@@ -169,7 +197,7 @@ public final class Main implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogWindow.INSTANCE.clean();
|
LogWindow.INSTANCE.clean();
|
||||||
LogWindow.INSTANCE.setTerminateGame(GameLauncher.PROCESS_MANAGER::stopAllProcesses);
|
LogWindow.INSTANCE.setTerminateGame(ProcessManager::stopAllProcesses);
|
||||||
|
|
||||||
Settings.UPDATE_CHECKER.upgrade.register(IUpgrader.NOW_UPGRADER);
|
Settings.UPDATE_CHECKER.upgrade.register(IUpgrader.NOW_UPGRADER);
|
||||||
Settings.UPDATE_CHECKER.process(false).reg(t -> Main.invokeUpdate()).execute();
|
Settings.UPDATE_CHECKER.process(false).reg(t -> Main.invokeUpdate()).execute();
|
||||||
@@ -193,7 +221,7 @@ public final class Main implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
GameLauncher.PROCESS_MANAGER.stopAllProcesses();
|
ProcessManager.stopAllProcesses();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void invokeUpdate() {
|
public static void invokeUpdate() {
|
||||||
@@ -202,7 +230,7 @@ public final class Main implements Runnable {
|
|||||||
|
|
||||||
public static ImageIcon getIcon(String path) {
|
public static ImageIcon getIcon(String path) {
|
||||||
try {
|
try {
|
||||||
return new ImageIcon(Main.class.getResource("/org/jackhuang/hellominecraft/launcher/" + path));
|
return new ImageIcon(Main.class.getResource("/org/jackhuang/hmcl/" + path));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
HMCLog.err("Failed to load icon", e);
|
HMCLog.err("Failed to load icon", e);
|
||||||
return null;
|
return null;
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.config;
|
package org.jackhuang.hmcl.api.event.config;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when the selected profile changed.
|
* This event gets fired when the selected profile changed.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.setting.Settings}
|
* @param source {@link org.jackhuang.hmcl.setting.Settings}
|
||||||
* @param Profile the new profile.
|
* @param Profile the new profile.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
@@ -15,15 +15,15 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.config;
|
package org.jackhuang.hmcl.api.event.config;
|
||||||
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when loading profiles.
|
* This event gets fired when loading profiles.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.setting.Settings}
|
* @param source {@link org.jackhuang.hmcl.setting.Settings}
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public class ProfileLoadingEvent extends EventObject {
|
public class ProfileLoadingEvent extends EventObject {
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.setting;
|
package org.jackhuang.hmcl.setting;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
import org.jackhuang.hmcl.core.download.DownloadType;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -25,15 +25,17 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
import org.jackhuang.hmcl.core.auth.AbstractAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.lookandfeel.Theme;
|
import org.jackhuang.hmcl.laf.LAFTheme;
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.AuthenticatorChangedEvent;
|
import org.jackhuang.hmcl.api.event.config.AuthenticatorChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.DownloadTypeChangedEvent;
|
import org.jackhuang.hmcl.api.event.config.DownloadTypeChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.ThemeChangedEvent;
|
import org.jackhuang.hmcl.api.event.config.ThemeChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.MCUtils;
|
import org.jackhuang.hmcl.core.MCUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.JdkVersion;
|
import org.jackhuang.hmcl.util.sys.JdkVersion;
|
||||||
import org.jackhuang.hellominecraft.util.sys.OS;
|
import org.jackhuang.hmcl.util.sys.OS;
|
||||||
|
import org.jackhuang.hmcl.api.auth.IAuthenticator;
|
||||||
|
import org.jackhuang.hmcl.api.ui.Theme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -66,7 +68,7 @@ public final class Config implements Cloneable {
|
|||||||
@SerializedName("decorated")
|
@SerializedName("decorated")
|
||||||
private boolean decorated;
|
private boolean decorated;
|
||||||
@SerializedName("theme")
|
@SerializedName("theme")
|
||||||
private int theme;
|
private String theme;
|
||||||
@SerializedName("java")
|
@SerializedName("java")
|
||||||
private List<JdkVersion> java;
|
private List<JdkVersion> java;
|
||||||
@SerializedName("localization")
|
@SerializedName("localization")
|
||||||
@@ -85,14 +87,14 @@ public final class Config implements Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Theme getTheme() {
|
public Theme getTheme() {
|
||||||
if (theme >= Theme.values().length)
|
if (!Theme.THEMES.containsKey(theme))
|
||||||
theme = 0;
|
theme = LAFTheme.BLUE.id;
|
||||||
return Theme.values()[theme];
|
return Theme.THEMES.get(theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTheme(int theme) {
|
public void setTheme(String theme) {
|
||||||
this.theme = theme;
|
this.theme = theme;
|
||||||
HMCAPI.EVENT_BUS.fireChannel(new ThemeChangedEvent(this, getTheme()));
|
HMCLApi.EVENT_BUS.fireChannel(new ThemeChangedEvent(this, getTheme()));
|
||||||
Settings.save();
|
Settings.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,20 +171,20 @@ public final class Config implements Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IAuthenticator getAuthenticator() {
|
public IAuthenticator getAuthenticator() {
|
||||||
return IAuthenticator.LOGINS.get(getLoginType());
|
return AbstractAuthenticator.LOGINS.get(getLoginType());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLoginType() {
|
public int getLoginType() {
|
||||||
if (logintype < 0 || logintype >= IAuthenticator.LOGINS.size())
|
if (logintype < 0 || logintype >= AbstractAuthenticator.LOGINS.size())
|
||||||
logintype = 0;
|
logintype = 0;
|
||||||
return logintype;
|
return logintype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLoginType(int logintype) {
|
public void setLoginType(int logintype) {
|
||||||
if (logintype < 0 || logintype >= IAuthenticator.LOGINS.size())
|
if (logintype < 0 || logintype >= AbstractAuthenticator.LOGINS.size())
|
||||||
return;
|
return;
|
||||||
this.logintype = logintype;
|
this.logintype = logintype;
|
||||||
HMCAPI.EVENT_BUS.fireChannel(new AuthenticatorChangedEvent(this, IAuthenticator.LOGINS.get(logintype)));
|
HMCLApi.EVENT_BUS.fireChannel(new AuthenticatorChangedEvent(this, AbstractAuthenticator.LOGINS.get(logintype)));
|
||||||
Settings.save();
|
Settings.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +194,7 @@ public final class Config implements Cloneable {
|
|||||||
|
|
||||||
public void setDownloadType(int downloadtype) {
|
public void setDownloadType(int downloadtype) {
|
||||||
this.downloadtype = downloadtype;
|
this.downloadtype = downloadtype;
|
||||||
HMCAPI.EVENT_BUS.fireChannel(new DownloadTypeChangedEvent(this, getDownloadSource()));
|
HMCLApi.EVENT_BUS.fireChannel(new DownloadTypeChangedEvent(this, getDownloadSource().name()));
|
||||||
Settings.save();
|
Settings.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +221,7 @@ public final class Config implements Cloneable {
|
|||||||
clientToken = UUID.randomUUID().toString();
|
clientToken = UUID.randomUUID().toString();
|
||||||
logintype = downloadtype = 0;
|
logintype = downloadtype = 0;
|
||||||
enableAnimation = enableBlur = enableShadow = true;
|
enableAnimation = enableBlur = enableShadow = true;
|
||||||
theme = 4;
|
theme = LAFTheme.BLUE.id;
|
||||||
decorated = OS.os() == OS.LINUX;
|
decorated = OS.os() == OS.LINUX;
|
||||||
auth = new HashMap<>();
|
auth = new HashMap<>();
|
||||||
commonpath = MCUtils.getLocation().getAbsolutePath();
|
commonpath = MCUtils.getLocation().getAbsolutePath();
|
||||||
@@ -15,19 +15,19 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.setting;
|
package org.jackhuang.hmcl.setting;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.HMCLGameLauncher;
|
import org.jackhuang.hmcl.util.HMCLGameLauncher;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.HMCLMinecraftService;
|
import org.jackhuang.hmcl.util.HMCLMinecraftService;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.MCUtils;
|
import org.jackhuang.hmcl.core.MCUtils;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hmcl.core.version.MinecraftVersion;
|
||||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
import org.jackhuang.hmcl.util.sys.IOUtils;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.api.EventHandler;
|
import org.jackhuang.hmcl.api.event.EventHandler;
|
||||||
import org.jackhuang.hellominecraft.api.PropertyChangedEvent;
|
import org.jackhuang.hmcl.api.event.PropertyChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.util.sys.OS;
|
import org.jackhuang.hmcl.util.sys.OS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,26 +15,25 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.setting;
|
package org.jackhuang.hmcl.setting;
|
||||||
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.Main;
|
import org.jackhuang.hmcl.core.MCUtils;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.MCUtils;
|
import org.jackhuang.hmcl.core.download.DownloadType;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
import org.jackhuang.hmcl.util.CollectionUtils;
|
||||||
import org.jackhuang.hellominecraft.util.CollectionUtils;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hmcl.api.event.config.ProfileChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.ProfileChangedEvent;
|
import org.jackhuang.hmcl.api.event.config.ProfileLoadingEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.ProfileLoadingEvent;
|
import org.jackhuang.hmcl.util.sys.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.util.UpdateChecker;
|
||||||
import org.jackhuang.hellominecraft.util.UpdateChecker;
|
import org.jackhuang.hmcl.util.sys.IOUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -48,7 +47,7 @@ public final class Settings {
|
|||||||
public static final File SETTINGS_FILE = new File("hmcl.json");
|
public static final File SETTINGS_FILE = new File("hmcl.json");
|
||||||
|
|
||||||
private static final Config SETTINGS;
|
private static final Config SETTINGS;
|
||||||
public static final UpdateChecker UPDATE_CHECKER = new UpdateChecker(Main.getVersionNumber(), "hmcl");
|
public static final UpdateChecker UPDATE_CHECKER = new UpdateChecker(HMCLApi.HMCL_VERSION, "hmcl");
|
||||||
|
|
||||||
public static Config getInstance() {
|
public static Config getInstance() {
|
||||||
return SETTINGS;
|
return SETTINGS;
|
||||||
@@ -56,7 +55,7 @@ public final class Settings {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
SETTINGS = initSettings();
|
SETTINGS = initSettings();
|
||||||
DownloadType.setSuggestedDownloadType(SETTINGS.getDownloadSource());
|
DownloadType.setSuggestedDownloadType(SETTINGS.getDownloadSource().name());
|
||||||
if (!getProfiles().containsKey(DEFAULT_PROFILE))
|
if (!getProfiles().containsKey(DEFAULT_PROFILE))
|
||||||
getProfiles().put(DEFAULT_PROFILE, new Profile(DEFAULT_PROFILE));
|
getProfiles().put(DEFAULT_PROFILE, new Profile(DEFAULT_PROFILE));
|
||||||
|
|
||||||
@@ -161,12 +160,12 @@ public final class Settings {
|
|||||||
Profile p = getLastProfile();
|
Profile p = getLastProfile();
|
||||||
if (p == null)
|
if (p == null)
|
||||||
throw new Error("No profiles here, it should not happen");
|
throw new Error("No profiles here, it should not happen");
|
||||||
HMCAPI.EVENT_BUS.fireChannel(new ProfileChangedEvent(SETTINGS, p));
|
HMCLApi.EVENT_BUS.fireChannel(new ProfileChangedEvent(SETTINGS, p));
|
||||||
p.onSelected();
|
p.onSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onProfileLoading() {
|
public static void onProfileLoading() {
|
||||||
HMCAPI.EVENT_BUS.fireChannel(new ProfileLoadingEvent(SETTINGS));
|
HMCLApi.EVENT_BUS.fireChannel(new ProfileLoadingEvent(SETTINGS));
|
||||||
onProfileChanged();
|
onProfileChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,23 +15,21 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.setting;
|
package org.jackhuang.hmcl.setting;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import org.jackhuang.hmcl.Main;
|
||||||
import org.jackhuang.hellominecraft.launcher.Main;
|
import org.jackhuang.hmcl.util.LauncherVisibility;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.LauncherVisibility;
|
import org.jackhuang.hmcl.api.game.LaunchOptions;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.LaunchOptions;
|
import org.jackhuang.hmcl.api.game.GameDirType;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.GameDirType;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.api.event.EventHandler;
|
||||||
import org.jackhuang.hellominecraft.api.EventHandler;
|
import org.jackhuang.hmcl.api.event.PropertyChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.api.PropertyChangedEvent;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.util.sys.Java;
|
||||||
import org.jackhuang.hellominecraft.util.sys.Java;
|
import org.jackhuang.hmcl.util.sys.OS;
|
||||||
import org.jackhuang.hellominecraft.util.sys.JdkVersion;
|
|
||||||
import org.jackhuang.hellominecraft.util.sys.OS;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -338,19 +336,6 @@ public class VersionSetting {
|
|||||||
setJava(null);
|
setJava(null);
|
||||||
str = getJavaDir();
|
str = getJavaDir();
|
||||||
}
|
}
|
||||||
JdkVersion jv = new JdkVersion(str);
|
|
||||||
if (Settings.getInstance().getJava().contains(jv))
|
|
||||||
jv = Settings.getInstance().getJava().get(Settings.getInstance().getJava().indexOf(jv));
|
|
||||||
else
|
|
||||||
try {
|
|
||||||
jv = JdkVersion.getJavaVersionFromExecutable(str);
|
|
||||||
Settings.getInstance().getJava().add(jv);
|
|
||||||
Settings.save();
|
|
||||||
} catch (IOException ex) {
|
|
||||||
HMCLog.warn("Failed to get java version", ex);
|
|
||||||
jv = null;
|
|
||||||
}
|
|
||||||
x.setJava(jv);
|
|
||||||
x.setJavaDir(str);
|
x.setJavaDir(str);
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseListener;
|
import java.awt.event.MouseListener;
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnDownload">
|
<Component class="javax.swing.JButton" name="btnDownload">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.download" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.button.download" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnRefreshGameDownloads">
|
<Component class="javax.swing.JButton" name="btnRefreshGameDownloads">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.refresh" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.button.refresh" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -15,17 +15,17 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.ui.Page;
|
import org.jackhuang.hmcl.util.ui.Page;
|
||||||
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.DefaultTableModel;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.MinecraftRemoteVersions;
|
import org.jackhuang.hmcl.core.download.MinecraftRemoteVersions;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.util.task.TaskWindow;
|
import org.jackhuang.hmcl.util.task.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
import org.jackhuang.hmcl.util.ui.SwingUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||||
<JTabbedPaneConstraints tabName="<settings>">
|
<JTabbedPaneConstraints tabName="<settings>">
|
||||||
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</JTabbedPaneConstraints>
|
</JTabbedPaneConstraints>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblGameDir">
|
<Component class="javax.swing.JLabel" name="lblGameDir">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings.game_directory" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings.game_directory" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -220,7 +220,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblDimension">
|
<Component class="javax.swing.JLabel" name="lblDimension">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings.dimension" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings.dimension" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -245,7 +245,7 @@
|
|||||||
<Component class="javax.swing.JCheckBox" name="chkFullscreen">
|
<Component class="javax.swing.JCheckBox" name="chkFullscreen">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings.fullscreen" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings.fullscreen" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -260,14 +260,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblJavaDir">
|
<Component class="javax.swing.JLabel" name="lblJavaDir">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings.java_dir" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings.java_dir" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblMaxMemory">
|
<Component class="javax.swing.JLabel" name="lblMaxMemory">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings.max_memory" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings.max_memory" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -286,7 +286,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnDownloadAllAssets">
|
<Component class="javax.swing.JButton" name="btnDownloadAllAssets">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="assets.download_all" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="assets.download_all" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||||
</Properties>
|
</Properties>
|
||||||
@@ -307,14 +307,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblLauncherVisibility">
|
<Component class="javax.swing.JLabel" name="lblLauncherVisibility">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.launcher_visible" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="advancedsettings.launcher_visible" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblRunDirectory">
|
<Component class="javax.swing.JLabel" name="lblRunDirectory">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings.run_directory" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings.run_directory" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -331,7 +331,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnChoosingJavaDir">
|
<Component class="javax.swing.JButton" name="btnChoosingJavaDir">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.button.explore" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="ui.button.explore" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -351,7 +351,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnChoosingGameDir">
|
<Component class="javax.swing.JButton" name="btnChoosingGameDir">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.button.explore" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="ui.button.explore" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -361,7 +361,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnCleanGame">
|
<Component class="javax.swing.JButton" name="btnCleanGame">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="setupwindow.clean" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="setupwindow.clean" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -389,7 +389,7 @@
|
|||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||||
<JTabbedPaneConstraints tabName="<advancedsettings>">
|
<JTabbedPaneConstraints tabName="<advancedsettings>">
|
||||||
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="advancedsettings" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</JTabbedPaneConstraints>
|
</JTabbedPaneConstraints>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
@@ -479,14 +479,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblJavaArgs">
|
<Component class="javax.swing.JLabel" name="lblJavaArgs">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.jvm_args" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="advancedsettings.jvm_args" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JTextField" name="txtJavaArgs">
|
<Component class="javax.swing.JTextField" name="txtJavaArgs">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.java_args_default" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="advancedsettings.java_args_default" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -501,14 +501,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblMinecraftArgs">
|
<Component class="javax.swing.JLabel" name="lblMinecraftArgs">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.Minecraft_arguments" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="advancedsettings.Minecraft_arguments" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblPermSize">
|
<Component class="javax.swing.JLabel" name="lblPermSize">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.java_permanent_generation_space" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="advancedsettings.java_permanent_generation_space" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -520,7 +520,7 @@
|
|||||||
<Component class="javax.swing.JCheckBox" name="chkNoJVMArgs">
|
<Component class="javax.swing.JCheckBox" name="chkNoJVMArgs">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.no_jvm_args" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="advancedsettings.no_jvm_args" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -530,7 +530,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblPrecalledCommand">
|
<Component class="javax.swing.JLabel" name="lblPrecalledCommand">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="advancedsettings.precall_command" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="advancedsettings.precall_command" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -542,7 +542,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblServerIP">
|
<Component class="javax.swing.JLabel" name="lblServerIP">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.server_ip" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="advancedsettings.server_ip" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -554,7 +554,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblPrecalledCommand1">
|
<Component class="javax.swing.JLabel" name="lblPrecalledCommand1">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="advancedsettings.wrapper_launcher" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="advancedsettings.wrapper_launcher" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -566,7 +566,7 @@
|
|||||||
<Component class="javax.swing.JCheckBox" name="chkDontCheckGame">
|
<Component class="javax.swing.JCheckBox" name="chkDontCheckGame">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="advancedsettings.dont_check_game_completeness" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="advancedsettings.dont_check_game_completeness" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -583,7 +583,7 @@
|
|||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||||
<JTabbedPaneConstraints tabName="<mods>">
|
<JTabbedPaneConstraints tabName="<mods>">
|
||||||
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="mods" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="mods" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</JTabbedPaneConstraints>
|
</JTabbedPaneConstraints>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
@@ -672,7 +672,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnAddMod">
|
<Component class="javax.swing.JButton" name="btnAddMod">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="mods.add" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="mods.add" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -682,7 +682,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnRemoveMod">
|
<Component class="javax.swing.JButton" name="btnRemoveMod">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="mods.remove" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="mods.remove" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -692,7 +692,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblModInfo">
|
<Component class="javax.swing.JLabel" name="lblModInfo">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="mods.default_information" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="mods.default_information" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||||
<Color id="默认光标"/>
|
<Color id="默认光标"/>
|
||||||
@@ -711,7 +711,7 @@
|
|||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
|
||||||
<JTabbedPaneConstraints tabName="<settings.tabs.installers>">
|
<JTabbedPaneConstraints tabName="<settings.tabs.installers>">
|
||||||
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings.tabs.installers" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings.tabs.installers" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</JTabbedPaneConstraints>
|
</JTabbedPaneConstraints>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
@@ -807,7 +807,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblProfile">
|
<Component class="javax.swing.JLabel" name="lblProfile">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.label.profile" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="ui.label.profile" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -840,7 +840,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblVersions">
|
<Component class="javax.swing.JLabel" name="lblVersions">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.label.version" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="ui.label.version" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -895,7 +895,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnModify">
|
<Component class="javax.swing.JButton" name="btnModify">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings.manage" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings.manage" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -905,7 +905,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnRefreshVersions">
|
<Component class="javax.swing.JButton" name="btnRefreshVersions">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.button.refresh" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="ui.button.refresh" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -920,7 +920,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnNewProfile">
|
<Component class="javax.swing.JButton" name="btnNewProfile">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="setupwindow.new" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="setupwindow.new" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -930,7 +930,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnRemoveProfile">
|
<Component class="javax.swing.JButton" name="btnRemoveProfile">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.button.delete" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="ui.button.delete" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -940,7 +940,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnExplore">
|
<Component class="javax.swing.JButton" name="btnExplore">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="settings.explore" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/launcher/I18N.properties" key="settings.explore" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||||
</Properties>
|
</Properties>
|
||||||
@@ -955,7 +955,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnTestGame">
|
<Component class="javax.swing.JButton" name="btnTestGame">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="settings.test_game" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="settings.test_game" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -965,7 +965,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnShowLog">
|
<Component class="javax.swing.JButton" name="btnShowLog">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="mainwindow.show_log" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="mainwindow.show_log" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -975,7 +975,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnMakeLaunchScript">
|
<Component class="javax.swing.JButton" name="btnMakeLaunchScript">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="mainwindow.make_launch_script" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="mainwindow.make_launch_script" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -985,7 +985,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnIncludeMinecraft">
|
<Component class="javax.swing.JButton" name="btnIncludeMinecraft">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="setupwindow.include_minecraft" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="setupwindow.include_minecraft" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.ui.Page;
|
import org.jackhuang.hmcl.util.ui.Page;
|
||||||
import java.awt.datatransfer.DataFlavor;
|
import java.awt.datatransfer.DataFlavor;
|
||||||
import java.awt.datatransfer.Transferable;
|
import java.awt.datatransfer.Transferable;
|
||||||
import java.awt.datatransfer.UnsupportedFlavorException;
|
import java.awt.datatransfer.UnsupportedFlavorException;
|
||||||
@@ -43,34 +43,33 @@ import javax.swing.event.ChangeEvent;
|
|||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
import javax.swing.event.TableModelEvent;
|
import javax.swing.event.TableModelEvent;
|
||||||
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.DefaultTableModel;
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.ProfileChangedEvent;
|
import org.jackhuang.hmcl.api.event.config.ProfileChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.ProfileLoadingEvent;
|
import org.jackhuang.hmcl.api.event.config.ProfileLoadingEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.version.RefreshedVersionsEvent;
|
import org.jackhuang.hmcl.api.event.version.RefreshedVersionsEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.GameException;
|
import org.jackhuang.hmcl.core.GameException;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.LauncherVisibility;
|
import org.jackhuang.hmcl.util.LauncherVisibility;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.FileNameFilter;
|
import org.jackhuang.hmcl.util.FileNameFilter;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.mod.ModInfo;
|
import org.jackhuang.hmcl.core.mod.ModInfo;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.install.InstallerType;
|
import org.jackhuang.hmcl.core.install.InstallerType;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.GameDirType;
|
import org.jackhuang.hmcl.api.game.GameDirType;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hmcl.core.version.MinecraftVersion;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.VersionSetting;
|
import org.jackhuang.hmcl.setting.VersionSetting;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.AbstractSwingWorker;
|
import org.jackhuang.hmcl.util.AbstractSwingWorker;
|
||||||
import org.jackhuang.hellominecraft.util.MinecraftVersionRequest;
|
import org.jackhuang.hmcl.util.MinecraftVersionRequest;
|
||||||
import org.jackhuang.hellominecraft.util.sys.OS;
|
import org.jackhuang.hmcl.util.sys.OS;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hmcl.api.func.Consumer;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hmcl.util.sys.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
import org.jackhuang.hmcl.util.ui.SwingUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.Java;
|
import org.jackhuang.hmcl.util.sys.Java;
|
||||||
import org.jackhuang.hellominecraft.util.task.TaskWindow;
|
import org.jackhuang.hmcl.util.task.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.util.ui.JSystemFileChooser;
|
import org.jackhuang.hmcl.util.ui.JSystemFileChooser;
|
||||||
import org.jackhuang.hellominecraft.util.ui.LogWindow;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -86,8 +85,8 @@ public final class GameSettingsPanel extends RepaintPage implements DropTargetLi
|
|||||||
final InstallerPanel installerPanels[] = new InstallerPanel[InstallerType.values().length];
|
final InstallerPanel installerPanels[] = new InstallerPanel[InstallerType.values().length];
|
||||||
|
|
||||||
public GameSettingsPanel() {
|
public GameSettingsPanel() {
|
||||||
HMCAPI.EVENT_BUS.channel(RefreshedVersionsEvent.class).register(t -> {
|
HMCLApi.EVENT_BUS.channel(RefreshedVersionsEvent.class).register(t -> {
|
||||||
if (Settings.getLastProfile().service() == t.getValue() && t.getValue().version().getVersions().isEmpty())
|
if (Settings.getLastProfile().service().version() == t.getSource() && Settings.getLastProfile().service().version().getVersions().isEmpty())
|
||||||
if (!showedNoVersion && Settings.getLastProfile().service().checkingModpack) {
|
if (!showedNoVersion && Settings.getLastProfile().service().checkingModpack) {
|
||||||
showedNoVersion = true;
|
showedNoVersion = true;
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
@@ -123,9 +122,9 @@ public final class GameSettingsPanel extends RepaintPage implements DropTargetLi
|
|||||||
cboJava.addItem(j.getLocalizedName());
|
cboJava.addItem(j.getLocalizedName());
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|
||||||
HMCAPI.EVENT_BUS.channel(ProfileLoadingEvent.class).register(onLoadingProfiles);
|
HMCLApi.EVENT_BUS.channel(ProfileLoadingEvent.class).register(onLoadingProfiles);
|
||||||
HMCAPI.EVENT_BUS.channel(ProfileChangedEvent.class).register(onSelectedProfilesChanged);
|
HMCLApi.EVENT_BUS.channel(ProfileChangedEvent.class).register(onSelectedProfilesChanged);
|
||||||
HMCAPI.EVENT_BUS.channel(RefreshedVersionsEvent.class).register(onRefreshedVersions);
|
HMCLApi.EVENT_BUS.channel(RefreshedVersionsEvent.class).register(onRefreshedVersions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initExplorationMenu() {
|
void initExplorationMenu() {
|
||||||
@@ -1454,7 +1453,7 @@ public final class GameSettingsPanel extends RepaintPage implements DropTargetLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Consumer<RefreshedVersionsEvent> onRefreshedVersions = t -> {
|
final Consumer<RefreshedVersionsEvent> onRefreshedVersions = t -> {
|
||||||
if (Settings.getLastProfile().service() == t.getValue())
|
if (Settings.getLastProfile().service().version() == t.getSource())
|
||||||
loadVersions();
|
loadVersions();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import java.awt.EventQueue;
|
import java.awt.EventQueue;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnInstall">
|
<Component class="javax.swing.JButton" name="btnInstall">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.install" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.button.install" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnRefresh">
|
<Component class="javax.swing.JButton" name="btnRefresh">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.refresh" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.button.refresh" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -15,22 +15,22 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.ui.Page;
|
import org.jackhuang.hmcl.util.ui.Page;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.DefaultTableModel;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.install.InstallerType;
|
import org.jackhuang.hmcl.core.install.InstallerType;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.install.InstallerVersionList;
|
import org.jackhuang.hmcl.core.install.InstallerVersionList;
|
||||||
import org.jackhuang.hellominecraft.util.task.TaskRunnable;
|
import org.jackhuang.hmcl.util.task.TaskRunnable;
|
||||||
import org.jackhuang.hellominecraft.util.task.TaskWindow;
|
import org.jackhuang.hmcl.util.task.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.util.task.Task;
|
import org.jackhuang.hmcl.util.task.Task;
|
||||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
import org.jackhuang.hmcl.util.ui.SwingUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblAbout">
|
<Component class="javax.swing.JLabel" name="lblAbout">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.about" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.about" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||||
<Color id="默认光标"/>
|
<Color id="默认光标"/>
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnSelBackgroundPath">
|
<Component class="javax.swing.JButton" name="btnSelBackgroundPath">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.explore" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.button.explore" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -189,7 +189,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblBackground">
|
<Component class="javax.swing.JLabel" name="lblBackground">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.background_location" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.background_location" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||||
</Properties>
|
</Properties>
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
<Component class="javax.swing.JTextField" name="txtBackgroundPath">
|
<Component class="javax.swing.JTextField" name="txtBackgroundPath">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.background_tooltip" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.background_tooltip" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -207,14 +207,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblDownloadSource">
|
<Component class="javax.swing.JLabel" name="lblDownloadSource">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.download_source" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.download_source" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnCheckUpdate">
|
<Component class="javax.swing.JButton" name="btnCheckUpdate">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.update_launcher" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.update_launcher" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
<Component class="javax.swing.JCheckBox" name="chkEnableShadow">
|
<Component class="javax.swing.JCheckBox" name="chkEnableShadow">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.enable_shadow" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.enable_shadow" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -234,16 +234,11 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblTheme">
|
<Component class="javax.swing.JLabel" name="lblTheme">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.theme" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.theme" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JComboBox" name="cboTheme">
|
<Component class="javax.swing.JComboBox" name="cboTheme">
|
||||||
<Properties>
|
|
||||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
|
||||||
<Connection code="new DefaultComboBoxModel(new String[]{C.i18n("color.blue"),C.i18n("color.green"),C.i18n("color.purple"),C.i18n("color.dark_blue"),C.i18n("color.orange"),C.i18n("color.red")})" type="code"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cboThemeItemStateChanged"/>
|
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cboThemeItemStateChanged"/>
|
||||||
</Events>
|
</Events>
|
||||||
@@ -251,7 +246,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblProxy">
|
<Component class="javax.swing.JLabel" name="lblProxy">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.proxy" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.proxy" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -263,7 +258,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblProxyHost">
|
<Component class="javax.swing.JLabel" name="lblProxyHost">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="proxy.host" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="proxy.host" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -275,14 +270,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblProxyPort">
|
<Component class="javax.swing.JLabel" name="lblProxyPort">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="proxy.port" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="proxy.port" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblProxyUserName">
|
<Component class="javax.swing.JLabel" name="lblProxyUserName">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="proxy.username" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="proxy.username" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -299,14 +294,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblProxyPassword">
|
<Component class="javax.swing.JLabel" name="lblProxyPassword">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="proxy.password" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="proxy.password" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JCheckBox" name="chkDecorated">
|
<Component class="javax.swing.JCheckBox" name="chkDecorated">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.decorated" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.decorated" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -316,7 +311,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblModpack">
|
<Component class="javax.swing.JLabel" name="lblModpack">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.modpack" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.modpack" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||||
<Color id="手型光标"/>
|
<Color id="手型光标"/>
|
||||||
@@ -339,14 +334,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblLang">
|
<Component class="javax.swing.JLabel" name="lblLang">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.lang" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.lang" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblRestart">
|
<Component class="javax.swing.JLabel" name="lblRestart">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.restart" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.restart" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -362,7 +357,7 @@
|
|||||||
<Component class="javax.swing.JCheckBox" name="chkEnableBlur">
|
<Component class="javax.swing.JCheckBox" name="chkEnableBlur">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.enable_blur" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.enable_blur" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -372,7 +367,7 @@
|
|||||||
<Component class="javax.swing.JCheckBox" name="chkEnableAnimation">
|
<Component class="javax.swing.JCheckBox" name="chkEnableAnimation">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.enable_animation" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.enable_animation" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -382,14 +377,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblCommonPath">
|
<Component class="javax.swing.JLabel" name="lblCommonPath">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.common_location" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.common_location" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JTextField" name="txtCommonPath">
|
<Component class="javax.swing.JTextField" name="txtCommonPath">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="launcher.commpath_tooltip" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="launcher.commpath_tooltip" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -399,7 +394,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnSetCommonPath">
|
<Component class="javax.swing.JButton" name="btnSetCommonPath">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.explore" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.button.explore" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -15,20 +15,21 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.api.ui.Theme;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
import org.jackhuang.hmcl.core.download.DownloadType;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.util.sys.IOUtils;
|
||||||
import org.jackhuang.hellominecraft.util.lang.SupportedLocales;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.ui.JSystemFileChooser;
|
import org.jackhuang.hmcl.util.lang.SupportedLocales;
|
||||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
import org.jackhuang.hmcl.util.ui.JSystemFileChooser;
|
||||||
|
import org.jackhuang.hmcl.util.ui.SwingUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -63,6 +64,10 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
cboLang.setModel(d);
|
cboLang.setModel(d);
|
||||||
cboLang.setSelectedIndex(id);
|
cboLang.setSelectedIndex(id);
|
||||||
|
|
||||||
|
DefaultComboBoxModel<Theme> g = new DefaultComboBoxModel<>();
|
||||||
|
for (Theme t : Theme.THEMES.values())
|
||||||
|
cboTheme.addItem(t);
|
||||||
|
|
||||||
txtBackgroundPath.setText(Settings.getInstance().getBgpath());
|
txtBackgroundPath.setText(Settings.getInstance().getBgpath());
|
||||||
txtCommonPath.setText(Settings.getInstance().getCommonpath());
|
txtCommonPath.setText(Settings.getInstance().getCommonpath());
|
||||||
txtProxyHost.setText(Settings.getInstance().getProxyHost());
|
txtProxyHost.setText(Settings.getInstance().getProxyHost());
|
||||||
@@ -70,7 +75,7 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
txtProxyUsername.setText(Settings.getInstance().getProxyUserName());
|
txtProxyUsername.setText(Settings.getInstance().getProxyUserName());
|
||||||
txtProxyPassword.setText(Settings.getInstance().getProxyPassword());
|
txtProxyPassword.setText(Settings.getInstance().getProxyPassword());
|
||||||
cboDownloadSource.setSelectedIndex(Settings.getInstance().getDownloadType());
|
cboDownloadSource.setSelectedIndex(Settings.getInstance().getDownloadType());
|
||||||
cboTheme.setSelectedIndex(Settings.getInstance().getTheme().ordinal());
|
cboTheme.setSelectedItem(Settings.getInstance().getTheme());
|
||||||
chkEnableShadow.setSelected(Settings.getInstance().isEnableShadow());
|
chkEnableShadow.setSelected(Settings.getInstance().isEnableShadow());
|
||||||
chkEnableBlur.setSelected(Settings.getInstance().isEnableBlur());
|
chkEnableBlur.setSelected(Settings.getInstance().isEnableBlur());
|
||||||
chkEnableAnimation.setSelected(Settings.getInstance().isEnableAnimation());
|
chkEnableAnimation.setSelected(Settings.getInstance().isEnableAnimation());
|
||||||
@@ -167,7 +172,6 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
|
|
||||||
lblTheme.setText(C.i18n("launcher.theme")); // NOI18N
|
lblTheme.setText(C.i18n("launcher.theme")); // NOI18N
|
||||||
|
|
||||||
cboTheme.setModel(new DefaultComboBoxModel(new String[]{C.i18n("color.blue"),C.i18n("color.green"),C.i18n("color.purple"),C.i18n("color.dark_blue"),C.i18n("color.orange"),C.i18n("color.red")}));
|
|
||||||
cboTheme.addItemListener(new java.awt.event.ItemListener() {
|
cboTheme.addItemListener(new java.awt.event.ItemListener() {
|
||||||
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
||||||
cboThemeItemStateChanged(evt);
|
cboThemeItemStateChanged(evt);
|
||||||
@@ -306,12 +310,12 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
.addComponent(chkEnableBlur)
|
.addComponent(chkEnableBlur)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(chkEnableAnimation))
|
.addComponent(chkEnableAnimation))
|
||||||
.addComponent(lblAbout, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(lblAbout)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(btnCheckUpdate)
|
.addComponent(btnCheckUpdate)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(btnMCBBS))
|
.addComponent(btnMCBBS))
|
||||||
.addComponent(lblModpack, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(lblModpack)
|
||||||
.addComponent(lblRestart))
|
.addComponent(lblRestart))
|
||||||
.addGap(0, 0, Short.MAX_VALUE))
|
.addGap(0, 0, Short.MAX_VALUE))
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
@@ -386,9 +390,9 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(lblRestart)
|
.addComponent(lblRestart)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(lblModpack, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(lblModpack)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(lblAbout, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(lblAbout)
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
@@ -430,7 +434,7 @@ public class LauncherSettingsPanel extends RepaintPage {
|
|||||||
}//GEN-LAST:event_btnCheckUpdateActionPerformed
|
}//GEN-LAST:event_btnCheckUpdateActionPerformed
|
||||||
|
|
||||||
private void cboThemeItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cboThemeItemStateChanged
|
private void cboThemeItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cboThemeItemStateChanged
|
||||||
Settings.getInstance().setTheme(cboTheme.getSelectedIndex());
|
Settings.getInstance().setTheme(((Theme) cboTheme.getSelectedItem()).id);
|
||||||
}//GEN-LAST:event_cboThemeItemStateChanged
|
}//GEN-LAST:event_cboThemeItemStateChanged
|
||||||
|
|
||||||
private void lblModpackMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblModpackMouseClicked
|
private void lblModpackMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblModpackMouseClicked
|
||||||
@@ -15,32 +15,31 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.api.event.process.JVMLaunchFailedEvent;
|
import org.jackhuang.hmcl.api.event.process.JVMLaunchFailedEvent;
|
||||||
import org.jackhuang.hellominecraft.api.event.process.JavaProcessExitedAbnormallyEvent;
|
import org.jackhuang.hmcl.api.event.process.JavaProcessExitedAbnormallyEvent;
|
||||||
import org.jackhuang.hellominecraft.api.event.process.JavaProcessStoppedEvent;
|
import org.jackhuang.hmcl.api.event.process.JavaProcessStoppedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.LaunchEvent;
|
import org.jackhuang.hmcl.api.event.launch.LaunchEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.LaunchSucceededEvent;
|
import org.jackhuang.hmcl.api.event.launch.LaunchSucceededEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.LaunchingStateChangedEvent;
|
import org.jackhuang.hmcl.api.event.launch.LaunchingStateChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.LauncherVisibility;
|
import org.jackhuang.hmcl.util.LauncherVisibility;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher;
|
import org.jackhuang.hmcl.core.launch.GameLauncher;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.HMCLGameLauncher;
|
import org.jackhuang.hmcl.util.HMCLGameLauncher;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.MinecraftCrashAdvicer;
|
import org.jackhuang.hmcl.util.MinecraftCrashAdvicer;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hmcl.api.func.Consumer;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hmcl.util.sys.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.JavaProcessMonitor;
|
import org.jackhuang.hmcl.util.sys.ProcessMonitor;
|
||||||
import org.jackhuang.hellominecraft.util.ui.LogWindow;
|
import org.jackhuang.hmcl.util.net.WebFrame;
|
||||||
import org.jackhuang.hellominecraft.util.net.WebFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -49,8 +48,8 @@ import org.jackhuang.hellominecraft.util.net.WebFrame;
|
|||||||
public class LaunchingUIDaemon {
|
public class LaunchingUIDaemon {
|
||||||
|
|
||||||
public LaunchingUIDaemon() {
|
public LaunchingUIDaemon() {
|
||||||
HMCAPI.EVENT_BUS.channel(LaunchingStateChangedEvent.class).register(LAUNCHING_STATE_CHANGED);
|
HMCLApi.EVENT_BUS.channel(LaunchingStateChangedEvent.class).register(LAUNCHING_STATE_CHANGED);
|
||||||
HMCAPI.EVENT_BUS.channel(LaunchEvent.class).register(p -> {
|
HMCLApi.EVENT_BUS.channel(LaunchEvent.class).register(p -> {
|
||||||
GameLauncher obj = (GameLauncher) p.getSource();
|
GameLauncher obj = (GameLauncher) p.getSource();
|
||||||
HMCLGameLauncher.GameLauncherTag tag = (HMCLGameLauncher.GameLauncherTag) obj.getTag();
|
HMCLGameLauncher.GameLauncherTag tag = (HMCLGameLauncher.GameLauncherTag) obj.getTag();
|
||||||
if (tag.launcherVisibility == LauncherVisibility.CLOSE && !LogWindow.INSTANCE.isVisible()) {
|
if (tag.launcherVisibility == LauncherVisibility.CLOSE && !LogWindow.INSTANCE.isVisible()) {
|
||||||
@@ -65,19 +64,19 @@ public class LaunchingUIDaemon {
|
|||||||
}
|
}
|
||||||
// We promise that JavaProcessMonitor.tag is LauncherVisibility
|
// We promise that JavaProcessMonitor.tag is LauncherVisibility
|
||||||
// See events below.
|
// See events below.
|
||||||
JavaProcessMonitor monitor = new JavaProcessMonitor(p.getValue());
|
ProcessMonitor monitor = new ProcessMonitor(p.getValue());
|
||||||
monitor.setTag(tag.launcherVisibility);
|
monitor.setTag(tag.launcherVisibility);
|
||||||
monitor.start();
|
monitor.start();
|
||||||
});
|
});
|
||||||
HMCAPI.EVENT_BUS.channel(LaunchSucceededEvent.class).register(p -> {
|
HMCLApi.EVENT_BUS.channel(LaunchSucceededEvent.class).register(p -> {
|
||||||
int state = ((HMCLGameLauncher.GameLauncherTag) ((GameLauncher) p.getSource()).getTag()).state;
|
int state = ((HMCLGameLauncher.GameLauncherTag) ((GameLauncher) p.getSource()).getTag()).state;
|
||||||
if (state == 1)
|
if (state == 1)
|
||||||
LAUNCH_FINISHER.accept(p);
|
LAUNCH_FINISHER.accept(p);
|
||||||
else if (state == 2)
|
else if (state == 2)
|
||||||
LAUNCH_SCRIPT_FINISHER.accept(p);
|
LAUNCH_SCRIPT_FINISHER.accept(p);
|
||||||
});
|
});
|
||||||
HMCAPI.EVENT_BUS.channel(JavaProcessStoppedEvent.class).register(event -> checkExit((LauncherVisibility) ((JavaProcessMonitor) event.getSource()).getTag()));
|
HMCLApi.EVENT_BUS.channel(JavaProcessStoppedEvent.class).register(event -> checkExit((LauncherVisibility) ((ProcessMonitor) event.getSource()).getTag()));
|
||||||
HMCAPI.EVENT_BUS.channel(JavaProcessExitedAbnormallyEvent.class).register(event -> {
|
HMCLApi.EVENT_BUS.channel(JavaProcessExitedAbnormallyEvent.class).register(event -> {
|
||||||
int exitCode = event.getValue().getExitCode();
|
int exitCode = event.getValue().getExitCode();
|
||||||
HMCLog.err("The game exited abnormally, exit code: " + exitCode);
|
HMCLog.err("The game exited abnormally, exit code: " + exitCode);
|
||||||
String[] logs = event.getValue().getStdOutLines().toArray(new String[0]);
|
String[] logs = event.getValue().getStdOutLines().toArray(new String[0]);
|
||||||
@@ -96,16 +95,16 @@ public class LaunchingUIDaemon {
|
|||||||
f.setModal(true);
|
f.setModal(true);
|
||||||
f.setTitle(msg);
|
f.setTitle(msg);
|
||||||
f.setVisible(true);
|
f.setVisible(true);
|
||||||
checkExit((LauncherVisibility) ((JavaProcessMonitor) event.getSource()).getTag());
|
checkExit((LauncherVisibility) ((ProcessMonitor) event.getSource()).getTag());
|
||||||
});
|
});
|
||||||
HMCAPI.EVENT_BUS.channel(JVMLaunchFailedEvent.class).register(event -> {
|
HMCLApi.EVENT_BUS.channel(JVMLaunchFailedEvent.class).register(event -> {
|
||||||
int exitCode = event.getValue().getExitCode();
|
int exitCode = event.getValue().getExitCode();
|
||||||
HMCLog.err("Cannot create jvm, exit code: " + exitCode);
|
HMCLog.err("Cannot create jvm, exit code: " + exitCode);
|
||||||
WebFrame f = new WebFrame(event.getValue().getStdOutLines().toArray(new String[0]));
|
WebFrame f = new WebFrame(event.getValue().getStdOutLines().toArray(new String[0]));
|
||||||
f.setModal(true);
|
f.setModal(true);
|
||||||
f.setTitle(C.i18n("launch.cannot_create_jvm") + " exit code: " + exitCode);
|
f.setTitle(C.i18n("launch.cannot_create_jvm") + " exit code: " + exitCode);
|
||||||
f.setVisible(true);
|
f.setVisible(true);
|
||||||
checkExit((LauncherVisibility) ((JavaProcessMonitor) event.getSource()).getTag());
|
checkExit((LauncherVisibility) ((ProcessMonitor) event.getSource()).getTag());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
14
HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/ui/LogWindow.form → HMCL/src/main/java/org/jackhuang/hmcl/ui/LogWindow.form
Executable file → Normal file
@@ -4,7 +4,7 @@
|
|||||||
<Properties>
|
<Properties>
|
||||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="logwindow.title" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/I18N.properties" key="logwindow.title" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
<SyntheticProperties>
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnClear">
|
<Component class="javax.swing.JButton" name="btnClear">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.button.clear" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/I18N.properties" key="ui.button.clear" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnClose">
|
<Component class="javax.swing.JButton" name="btnClose">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.button.close" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/I18N.properties" key="ui.button.close" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnCopy">
|
<Component class="javax.swing.JButton" name="btnCopy">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.button.copy" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/I18N.properties" key="ui.button.copy" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblCrash">
|
<Component class="javax.swing.JLabel" name="lblCrash">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="ui.label.crashing" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/I18N.properties" key="ui.label.crashing" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnTieBa">
|
<Component class="javax.swing.JButton" name="btnTieBa">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="logwindow.tieba" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/I18N.properties" key="logwindow.tieba" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnTerminateGame">
|
<Component class="javax.swing.JButton" name="btnTerminateGame">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="logwindow.terminate_game" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/I18N.properties" key="logwindow.terminate_game" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
15
HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/ui/LogWindow.java → HMCL/src/main/java/org/jackhuang/hmcl/ui/LogWindow.java
Executable file → Normal file
@@ -15,19 +15,20 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.text.Document;
|
import javax.swing.text.Document;
|
||||||
import javax.swing.text.SimpleAttributeSet;
|
import javax.swing.text.SimpleAttributeSet;
|
||||||
import javax.swing.text.StyleConstants;
|
import javax.swing.text.StyleConstants;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.log.Level;
|
import org.jackhuang.hmcl.util.log.Level;
|
||||||
import org.jackhuang.hellominecraft.util.func.NonFunction;
|
import org.jackhuang.hmcl.api.func.NonFunction;
|
||||||
import org.jackhuang.hellominecraft.util.DoubleOutputStream;
|
import org.jackhuang.hmcl.util.DoubleOutputStream;
|
||||||
import org.jackhuang.hellominecraft.util.Utils;
|
import org.jackhuang.hmcl.util.Utils;
|
||||||
|
import org.jackhuang.hmcl.util.ui.SwingUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,13 +15,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import org.jackhuang.hellominecraft.util.code.Charsets;
|
import org.jackhuang.hmcl.util.code.Charsets;
|
||||||
import org.jackhuang.hellominecraft.util.log.Level;
|
import org.jackhuang.hmcl.util.log.Level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,11 +15,10 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.ui.Page;
|
import org.jackhuang.hmcl.util.ui.GaussionPanel;
|
||||||
import org.jackhuang.hellominecraft.util.ui.GaussionPanel;
|
import org.jackhuang.hmcl.util.ui.IRepaint;
|
||||||
import org.jackhuang.hellominecraft.util.ui.IRepaint;
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.CardLayout;
|
import java.awt.CardLayout;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
@@ -40,7 +39,6 @@ import java.awt.image.BufferedImage;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
import javax.swing.Box;
|
import javax.swing.Box;
|
||||||
@@ -51,22 +49,23 @@ import javax.swing.JComponent;
|
|||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.launcher.Main;
|
import org.jackhuang.hmcl.Main;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.PluginManager;
|
import org.jackhuang.hmcl.api.PluginManager;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.ThemeChangedEvent;
|
import org.jackhuang.hmcl.api.event.config.ThemeChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.lookandfeel.Theme;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.ui.BasicColors;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.util.ui.DropShadowBorder;
|
||||||
import org.jackhuang.hellominecraft.util.ui.BasicColors;
|
import org.jackhuang.hmcl.util.ui.GraphicsUtils;
|
||||||
import org.jackhuang.hellominecraft.util.ui.DropShadowBorder;
|
import org.jackhuang.hmcl.util.ui.SwingUtils;
|
||||||
import org.jackhuang.hellominecraft.util.ui.GraphicsUtils;
|
import org.jackhuang.hmcl.util.ui.TintablePanel;
|
||||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
import org.jackhuang.hmcl.api.auth.IAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.util.ui.TintablePanel;
|
import org.jackhuang.hmcl.api.ui.Theme;
|
||||||
|
import org.jackhuang.hmcl.api.ui.TopTabPage;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -159,7 +158,7 @@ public final class MainFrame extends DraggableFrame implements IRepaint {
|
|||||||
}
|
}
|
||||||
((JPanel) getContentPane()).setOpaque(true);
|
((JPanel) getContentPane()).setOpaque(true);
|
||||||
|
|
||||||
HMCAPI.EVENT_BUS.channel(ThemeChangedEvent.class).register(x -> reloadColor(x.getValue()));
|
HMCLApi.EVENT_BUS.channel(ThemeChangedEvent.class).register(x -> reloadColor(x.getValue()));
|
||||||
|
|
||||||
SwingUtilities.invokeLater(() -> selectTab("main"));
|
SwingUtilities.invokeLater(() -> selectTab("main"));
|
||||||
}
|
}
|
||||||
@@ -260,7 +259,7 @@ public final class MainFrame extends DraggableFrame implements IRepaint {
|
|||||||
|
|
||||||
private transient final ActionListener tabListener = e -> MainFrame.this.selectTab(e.getActionCommand());
|
private transient final ActionListener tabListener = e -> MainFrame.this.selectTab(e.getActionCommand());
|
||||||
|
|
||||||
private void initializeTab(Page inst, String cmd, String title) {
|
private void initializeTab(TopTabPage inst, String cmd, String title) {
|
||||||
HeaderTab tab = new HeaderTab(title);
|
HeaderTab tab = new HeaderTab(title);
|
||||||
tab.setActionCommand(cmd);
|
tab.setActionCommand(cmd);
|
||||||
tab.setForeground(BasicColors.COLOR_WHITE_TEXT);
|
tab.setForeground(BasicColors.COLOR_WHITE_TEXT);
|
||||||
@@ -274,11 +273,11 @@ public final class MainFrame extends DraggableFrame implements IRepaint {
|
|||||||
|
|
||||||
private final List<HeaderTab> tabHeader = new ArrayList<>();
|
private final List<HeaderTab> tabHeader = new ArrayList<>();
|
||||||
private JPanel tabWrapper[];
|
private JPanel tabWrapper[];
|
||||||
private final List<Page> tabContent = new ArrayList<>();
|
private final List<TopTabPage> tabContent = new ArrayList<>();
|
||||||
|
|
||||||
public void selectTab(String tabName) {
|
public void selectTab(String tabName) {
|
||||||
int chosen = -1;
|
int chosen = -1;
|
||||||
Page onCreate = null, onSelect = null;
|
TopTabPage onCreate = null, onSelect = null;
|
||||||
for (int i = 0; i < tabHeader.size(); i++)
|
for (int i = 0; i < tabHeader.size(); i++)
|
||||||
if (tabName.equalsIgnoreCase(tabHeader.get(i).getActionCommand())) {
|
if (tabName.equalsIgnoreCase(tabHeader.get(i).getActionCommand())) {
|
||||||
if (!tabContent.get(i).isCreated()) {
|
if (!tabContent.get(i).isCreated()) {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JPanel" name="pnlRoot">
|
<Container class="javax.swing.JPanel" name="pnlRoot">
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new org.jackhuang.hellominecraft.launcher.ui.GaussionPanel()"/>
|
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new org.jackhuang.hmcl.launcher.ui.GaussionPanel()"/>
|
||||||
</AuxValues>
|
</AuxValues>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<Property name="opaque" type="boolean" value="false"/>
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new org.jackhuang.hellominecraft.launcher.ui.RepaintPage()"/>
|
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new org.jackhuang.hmcl.launcher.ui.RepaintPage()"/>
|
||||||
<AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="MainPagePanel_pnlMore"/>
|
<AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="MainPagePanel_pnlMore"/>
|
||||||
</AuxValues>
|
</AuxValues>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblLogin">
|
<Component class="javax.swing.JLabel" name="lblLogin">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="login.type" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="login.type" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -147,14 +147,14 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblUserName">
|
<Component class="javax.swing.JLabel" name="lblUserName">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="login.username" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="login.username" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblProfile">
|
<Component class="javax.swing.JLabel" name="lblProfile">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.label.profile" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.label.profile" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -171,10 +171,10 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblVersion">
|
<Component class="javax.swing.JLabel" name="lblVersion">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.label.version" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.label.version" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.label.version" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.label.version" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -228,7 +228,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="lblPassword">
|
<Component class="javax.swing.JLabel" name="lblPassword">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.label.password" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.label.password" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -265,7 +265,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnLogout">
|
<Component class="javax.swing.JButton" name="btnLogout">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.logout" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.button.logout" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -279,7 +279,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnImportModpack">
|
<Component class="javax.swing.JButton" name="btnImportModpack">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.task.install" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="modpack.task.install" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -289,7 +289,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnExportModpack">
|
<Component class="javax.swing.JButton" name="btnExportModpack">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.task.save" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="modpack.task.save" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.ui.Page;
|
import org.jackhuang.hmcl.util.ui.Page;
|
||||||
import org.jackhuang.hellominecraft.util.ui.WideComboBox;
|
import org.jackhuang.hmcl.util.ui.WideComboBox;
|
||||||
import org.jackhuang.hellominecraft.util.ui.GaussionPanel;
|
import org.jackhuang.hmcl.util.ui.GaussionPanel;
|
||||||
import java.awt.CardLayout;
|
import java.awt.CardLayout;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
@@ -29,30 +29,31 @@ import javax.swing.DefaultComboBoxModel;
|
|||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.AuthenticatorChangedEvent;
|
import org.jackhuang.hmcl.api.event.config.AuthenticatorChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.ProfileChangedEvent;
|
import org.jackhuang.hmcl.api.event.config.ProfileChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.config.ProfileLoadingEvent;
|
import org.jackhuang.hmcl.api.event.config.ProfileLoadingEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.LaunchSucceededEvent;
|
import org.jackhuang.hmcl.api.event.launch.LaunchSucceededEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.LaunchingState;
|
import org.jackhuang.hmcl.api.event.launch.LaunchingState;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.LaunchingStateChangedEvent;
|
import org.jackhuang.hmcl.api.event.launch.LaunchingStateChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.version.RefreshedVersionsEvent;
|
import org.jackhuang.hmcl.api.event.version.RefreshedVersionsEvent;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
import org.jackhuang.hmcl.core.auth.AbstractAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hmcl.core.version.MinecraftVersion;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.mod.ModpackManager;
|
import org.jackhuang.hmcl.core.mod.ModpackManager;
|
||||||
import org.jackhuang.hellominecraft.launcher.ui.modpack.ModpackWizard;
|
import org.jackhuang.hmcl.ui.modpack.ModpackWizard;
|
||||||
import org.jackhuang.hellominecraft.lookandfeel.ConstomButton;
|
import org.jackhuang.hmcl.laf.ConstomButton;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hmcl.api.func.Consumer;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hmcl.util.sys.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.task.TaskWindow;
|
import org.jackhuang.hmcl.util.task.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.util.ui.GraphicsUtils;
|
import org.jackhuang.hmcl.util.ui.GraphicsUtils;
|
||||||
import org.jackhuang.hellominecraft.util.ui.JSystemFileChooser;
|
import org.jackhuang.hmcl.util.ui.JSystemFileChooser;
|
||||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
import org.jackhuang.hmcl.util.ui.SwingUtils;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.api.WizardDisplayer;
|
import org.jackhuang.hmcl.util.ui.wizard.api.WizardDisplayer;
|
||||||
|
import org.jackhuang.hmcl.api.auth.IAuthenticator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -97,12 +98,12 @@ public class MainPagePanel extends Page {
|
|||||||
|
|
||||||
((RepaintPage) pnlMore).setRepainter(pnlRoot);
|
((RepaintPage) pnlMore).setRepainter(pnlRoot);
|
||||||
|
|
||||||
HMCAPI.EVENT_BUS.channel(AuthenticatorChangedEvent.class).register(onAuthChanged);
|
HMCLApi.EVENT_BUS.channel(AuthenticatorChangedEvent.class).register(onAuthChanged);
|
||||||
HMCAPI.EVENT_BUS.channel(ProfileLoadingEvent.class).register(onLoadingProfiles);
|
HMCLApi.EVENT_BUS.channel(ProfileLoadingEvent.class).register(onLoadingProfiles);
|
||||||
HMCAPI.EVENT_BUS.channel(ProfileChangedEvent.class).register(onSelectedProfilesChanged);
|
HMCLApi.EVENT_BUS.channel(ProfileChangedEvent.class).register(onSelectedProfilesChanged);
|
||||||
HMCAPI.EVENT_BUS.channel(RefreshedVersionsEvent.class).register(onRefreshedVersions);
|
HMCLApi.EVENT_BUS.channel(RefreshedVersionsEvent.class).register(onRefreshedVersions);
|
||||||
HMCAPI.EVENT_BUS.channel(LaunchingStateChangedEvent.class).register(launchingStateChanged);
|
HMCLApi.EVENT_BUS.channel(LaunchingStateChangedEvent.class).register(launchingStateChanged);
|
||||||
HMCAPI.EVENT_BUS.channel(LaunchSucceededEvent.class).register(this::prepareAuths);
|
HMCLApi.EVENT_BUS.channel(LaunchSucceededEvent.class).register(this::prepareAuths);
|
||||||
|
|
||||||
prepareAuths();
|
prepareAuths();
|
||||||
}
|
}
|
||||||
@@ -117,7 +118,7 @@ public class MainPagePanel extends Page {
|
|||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
pnlRoot = new GaussionPanel();
|
pnlRoot = new GaussionPanel();
|
||||||
pnlMore = new org.jackhuang.hellominecraft.launcher.ui.RepaintPage();
|
pnlMore = new org.jackhuang.hmcl.ui.RepaintPage();
|
||||||
txtPlayerName = new javax.swing.JTextField();
|
txtPlayerName = new javax.swing.JTextField();
|
||||||
lblLogin = new javax.swing.JLabel();
|
lblLogin = new javax.swing.JLabel();
|
||||||
cboLoginMode = new javax.swing.JComboBox();
|
cboLoginMode = new javax.swing.JComboBox();
|
||||||
@@ -418,7 +419,7 @@ public class MainPagePanel extends Page {
|
|||||||
private void prepareAuths() {
|
private void prepareAuths() {
|
||||||
preparingAuth = true;
|
preparingAuth = true;
|
||||||
cboLoginMode.removeAllItems();
|
cboLoginMode.removeAllItems();
|
||||||
for (IAuthenticator str : IAuthenticator.LOGINS)
|
for (IAuthenticator str : AbstractAuthenticator.LOGINS)
|
||||||
cboLoginMode.addItem(str.getName());
|
cboLoginMode.addItem(str.getName());
|
||||||
preparingAuth = false;
|
preparingAuth = false;
|
||||||
int loginType = Settings.getInstance().getLoginType();
|
int loginType = Settings.getInstance().getLoginType();
|
||||||
@@ -495,7 +496,7 @@ public class MainPagePanel extends Page {
|
|||||||
};
|
};
|
||||||
|
|
||||||
final Consumer<RefreshedVersionsEvent> onRefreshedVersions = t -> {
|
final Consumer<RefreshedVersionsEvent> onRefreshedVersions = t -> {
|
||||||
if (Settings.getLastProfile().service() == t.getValue())
|
if (Settings.getLastProfile().service().version() == t.getSource())
|
||||||
loadVersions();
|
loadVersions();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<Properties>
|
<Properties>
|
||||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.newProfileWindow.title" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.newProfileWindow.title" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
<SyntheticProperties>
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.label.newProfileWindow.new_profile_name" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.label.newProfileWindow.new_profile_name" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.label.newProfileWindow.copy_from" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.label.newProfileWindow.copy_from" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnCancel">
|
<Component class="javax.swing.JButton" name="btnCancel">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="button.cancel" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="button.cancel" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
<Component class="javax.swing.JButton" name="btnOK">
|
<Component class="javax.swing.JButton" name="btnOK">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.ok" replaceFormat="C.i18n("{key}")"/>
|
<ResourceString bundle="org/jackhuang/hmcl/lang/I18N.properties" key="ui.button.ok" replaceFormat="C.i18n("{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
@@ -15,12 +15,12 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,12 +15,12 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.ui.Selectable;
|
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
import javax.swing.event.ChangeEvent;
|
import javax.swing.event.ChangeEvent;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
import org.jackhuang.hmcl.api.ui.TopTabPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -40,10 +40,10 @@ public class NewTabPane extends JTabbedPane implements ChangeListener {
|
|||||||
if (initializing)
|
if (initializing)
|
||||||
return;
|
return;
|
||||||
for (int i = 0; i < getComponentCount(); ++i)
|
for (int i = 0; i < getComponentCount(); ++i)
|
||||||
if (getSelectedIndex() != i && getComponent(i) instanceof Selectable)
|
if (getSelectedIndex() != i && getComponent(i) instanceof TopTabPage)
|
||||||
((Selectable) getComponent(i)).onLeave();
|
((TopTabPage) getComponent(i)).onLeave();
|
||||||
if (getSelectedComponent() instanceof Selectable)
|
if (getSelectedComponent() instanceof TopTabPage)
|
||||||
((Selectable) getSelectedComponent()).onSelect();
|
((TopTabPage) getSelectedComponent()).onSelect();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.ui.Page;
|
import org.jackhuang.hmcl.util.ui.Page;
|
||||||
import org.jackhuang.hellominecraft.util.ui.IRepaint;
|
import org.jackhuang.hmcl.util.ui.IRepaint;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -15,18 +15,18 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui.modpack;
|
package org.jackhuang.hmcl.ui.modpack;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.HeadlessException;
|
import java.awt.HeadlessException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.util.net.WebPage;
|
import org.jackhuang.hmcl.util.net.WebPage;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.WizardController;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.WizardController;
|
||||||
import org.markdown4j.Markdown4jProcessor;
|
import org.markdown4j.Markdown4jProcessor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui.modpack;
|
package org.jackhuang.hmcl.ui.modpack;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -23,14 +23,14 @@ import java.util.HashSet;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.swing.tree.DefaultTreeModel;
|
import javax.swing.tree.DefaultTreeModel;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.mod.ModAdviser;
|
import org.jackhuang.hmcl.core.mod.ModAdviser;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.Pair;
|
import org.jackhuang.hmcl.util.Pair;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hmcl.util.sys.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.ui.checktree.CheckBoxTreeCellRenderer;
|
import org.jackhuang.hmcl.util.ui.checktree.CheckBoxTreeCellRenderer;
|
||||||
import org.jackhuang.hellominecraft.util.ui.checktree.CheckBoxTreeNode;
|
import org.jackhuang.hmcl.util.ui.checktree.CheckBoxTreeNode;
|
||||||
import org.jackhuang.hellominecraft.util.ui.checktree.CheckBoxTreeNodeSelectionListener;
|
import org.jackhuang.hmcl.util.ui.checktree.CheckBoxTreeNodeSelectionListener;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.WizardController;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.WizardController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui.modpack;
|
package org.jackhuang.hmcl.ui.modpack;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.ui.JSystemFileChooser;
|
import org.jackhuang.hmcl.util.ui.JSystemFileChooser;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.WizardController;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.WizardController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.ui.modpack;
|
package org.jackhuang.hmcl.ui.modpack;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -28,29 +28,29 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.GameException;
|
import org.jackhuang.hmcl.core.GameException;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.mod.ModpackManager;
|
import org.jackhuang.hmcl.core.mod.ModpackManager;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hmcl.core.version.MinecraftVersion;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Config;
|
import org.jackhuang.hmcl.setting.Config;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.util.HMCLMinecraftService;
|
import org.jackhuang.hmcl.util.HMCLMinecraftService;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.Pair;
|
import org.jackhuang.hmcl.util.Pair;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.util.Utils;
|
import org.jackhuang.hmcl.util.Utils;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
import org.jackhuang.hmcl.util.sys.IOUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.ZipEngine;
|
import org.jackhuang.hmcl.util.sys.ZipEngine;
|
||||||
import org.jackhuang.hellominecraft.util.net.WebPage;
|
import org.jackhuang.hmcl.util.net.WebPage;
|
||||||
import org.jackhuang.hellominecraft.util.ui.checktree.CheckBoxTreeNode;
|
import org.jackhuang.hmcl.util.ui.checktree.CheckBoxTreeNode;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.DeferredWizardResult;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.DeferredWizardResult;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.ResultProgressHandle;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.ResultProgressHandle;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.Summary;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.Summary;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.WizardBranchController;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.WizardBranchController;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.WizardController;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.WizardController;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.WizardException;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.WizardException;
|
||||||
import org.jackhuang.hellominecraft.util.ui.wizard.spi.WizardPanelProvider;
|
import org.jackhuang.hmcl.util.ui.wizard.spi.WizardPanelProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,8 +15,11 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
|
import org.jackhuang.hmcl.util.C;
|
||||||
|
import org.jackhuang.hmcl.util.StrUtils;
|
||||||
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -25,15 +28,12 @@ import java.util.HashSet;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import static org.jackhuang.hmcl.Main.LAUNCHER_VERSION;
|
||||||
import static org.jackhuang.hellominecraft.launcher.Main.LAUNCHER_VERSION;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.util.net.NetUtils;
|
||||||
import org.jackhuang.hellominecraft.util.net.NetUtils;
|
import org.jackhuang.hmcl.util.sys.OS;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.ui.LogWindow;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
|
||||||
import org.jackhuang.hellominecraft.util.sys.OS;
|
|
||||||
import org.jackhuang.hellominecraft.util.ui.LogWindow;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,23 +15,22 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.AddTabCallback;
|
import org.jackhuang.hmcl.api.ui.AddTabCallback;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
import org.jackhuang.hmcl.api.IPlugin;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.IPlugin;
|
import org.jackhuang.hmcl.core.auth.OfflineAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
import org.jackhuang.hmcl.core.auth.YggdrasilAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.OfflineAuthenticator;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.YggdrasilAuthenticator;
|
import org.jackhuang.hmcl.ui.GameSettingsPanel;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
import org.jackhuang.hmcl.ui.LauncherSettingsPanel;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.ui.MainPagePanel;
|
||||||
import org.jackhuang.hellominecraft.launcher.ui.GameSettingsPanel;
|
import org.jackhuang.hmcl.api.auth.IAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.launcher.ui.LauncherSettingsPanel;
|
import org.jackhuang.hmcl.api.func.Consumer;
|
||||||
import org.jackhuang.hellominecraft.launcher.ui.MainPagePanel;
|
import org.jackhuang.hmcl.api.ui.Theme;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.laf.LAFTheme;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -39,6 +38,11 @@ import org.jackhuang.hellominecraft.util.func.Consumer;
|
|||||||
*/
|
*/
|
||||||
public class DefaultPlugin implements IPlugin {
|
public class DefaultPlugin implements IPlugin {
|
||||||
|
|
||||||
|
public DefaultPlugin() {
|
||||||
|
for (Theme t : LAFTheme.THEMES)
|
||||||
|
Theme.THEMES.put(t.getId(), t);
|
||||||
|
}
|
||||||
|
|
||||||
ArrayList<IAuthenticator> auths = new ArrayList<>();
|
ArrayList<IAuthenticator> auths = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hmcl.util.sys.FileUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,12 +15,12 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.asset.MinecraftAssetService;
|
import org.jackhuang.hmcl.core.asset.MinecraftAssetService;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
import org.jackhuang.hmcl.core.service.IMinecraftService;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,28 +15,28 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.GameException;
|
import org.jackhuang.hmcl.core.GameException;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.AuthenticationException;
|
import org.jackhuang.hmcl.api.auth.AuthenticationException;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
import org.jackhuang.hmcl.core.auth.AbstractAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.LoginInfo;
|
import org.jackhuang.hmcl.api.auth.LoginInfo;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.DefaultGameLauncher;
|
import org.jackhuang.hmcl.core.launch.DefaultGameLauncher;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher;
|
import org.jackhuang.hmcl.core.launch.GameLauncher;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.LaunchOptions;
|
import org.jackhuang.hmcl.api.game.LaunchOptions;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hmcl.api.event.launch.LaunchSucceededEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.LaunchSucceededEvent;
|
import org.jackhuang.hmcl.api.event.launch.LaunchingState;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.LaunchingState;
|
import org.jackhuang.hmcl.api.event.launch.LaunchingStateChangedEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.LaunchingStateChangedEvent;
|
import org.jackhuang.hmcl.api.event.launch.ProcessingLaunchOptionsEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.launch.ProcessingLaunchOptionsEvent;
|
import org.jackhuang.hmcl.core.RuntimeGameException;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.RuntimeGameException;
|
import org.jackhuang.hmcl.api.func.Consumer;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.util.sys.JavaProcess;
|
||||||
import org.jackhuang.hellominecraft.util.sys.JavaProcess;
|
import org.jackhuang.hmcl.api.auth.IAuthenticator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -50,12 +50,12 @@ public class HMCLGameLauncher {
|
|||||||
public HMCLGameLauncher(Profile p) {
|
public HMCLGameLauncher(Profile p) {
|
||||||
this.profile = p;
|
this.profile = p;
|
||||||
|
|
||||||
HMCAPI.EVENT_BUS.channel(LaunchSucceededEvent.class).register(() -> setLaunching(false));
|
HMCLApi.EVENT_BUS.channel(LaunchSucceededEvent.class).register(() -> setLaunching(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
void setLaunching(boolean isLaunching) {
|
void setLaunching(boolean isLaunching) {
|
||||||
if (isLaunching != this.isLaunching)
|
if (isLaunching != this.isLaunching)
|
||||||
HMCAPI.EVENT_BUS.fireChannel(new LaunchingStateChangedEvent(this, isLaunching ? LaunchingState.Starting : LaunchingState.Done));
|
HMCLApi.EVENT_BUS.fireChannel(new LaunchingStateChangedEvent(this, isLaunching ? LaunchingState.Starting : LaunchingState.Done));
|
||||||
this.isLaunching = isLaunching;
|
this.isLaunching = isLaunching;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ public class HMCLGameLauncher {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final IAuthenticator l = IAuthenticator.LOGINS.get(Settings.getInstance().getLoginType());
|
final IAuthenticator l = AbstractAuthenticator.LOGINS.get(Settings.getInstance().getLoginType());
|
||||||
final LoginInfo li = new LoginInfo(l.getUserName(), l.isLoggedIn() || !l.hasPassword() ? null : passwordIfNeeded);
|
final LoginInfo li = new LoginInfo(l.getUserName(), l.isLoggedIn() || !l.hasPassword() ? null : passwordIfNeeded);
|
||||||
Thread t = new Thread() {
|
Thread t = new Thread() {
|
||||||
@Override
|
@Override
|
||||||
@@ -85,7 +85,7 @@ public class HMCLGameLauncher {
|
|||||||
Thread.currentThread().setName("Game Launcher");
|
Thread.currentThread().setName("Game Launcher");
|
||||||
try {
|
try {
|
||||||
LaunchOptions options = profile.getSelectedVersionSetting().createLaunchOptions(profile.getCanonicalGameDirFile());
|
LaunchOptions options = profile.getSelectedVersionSetting().createLaunchOptions(profile.getCanonicalGameDirFile());
|
||||||
HMCAPI.EVENT_BUS.fireChannel(new ProcessingLaunchOptionsEvent(this, options));
|
HMCLApi.EVENT_BUS.fireChannel(new ProcessingLaunchOptionsEvent(this, options));
|
||||||
DefaultGameLauncher gl = new DefaultGameLauncher(options, profile.service(), li, l);
|
DefaultGameLauncher gl = new DefaultGameLauncher(options, profile.service(), li, l);
|
||||||
GameLauncherTag tag = new GameLauncherTag();
|
GameLauncherTag tag = new GameLauncherTag();
|
||||||
tag.launcherVisibility = profile.getSelectedVersionSetting().getLauncherVisibility();
|
tag.launcherVisibility = profile.getSelectedVersionSetting().getLauncherVisibility();
|
||||||
@@ -15,15 +15,15 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.version.MinecraftLibraryPathEvent;
|
import org.jackhuang.hmcl.api.event.version.MinecraftLibraryPathEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.GameDirType;
|
import org.jackhuang.hmcl.api.game.GameDirType;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersionManager;
|
import org.jackhuang.hmcl.core.version.MinecraftVersionManager;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.VersionSetting;
|
import org.jackhuang.hmcl.setting.VersionSetting;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -34,7 +34,7 @@ public class HMCLGameProvider extends MinecraftVersionManager {
|
|||||||
public HMCLGameProvider(HMCLMinecraftService p) {
|
public HMCLGameProvider(HMCLMinecraftService p) {
|
||||||
super(p);
|
super(p);
|
||||||
|
|
||||||
HMCAPI.EVENT_BUS.channel(MinecraftLibraryPathEvent.class).register(t -> {
|
HMCLApi.EVENT_BUS.channel(MinecraftLibraryPathEvent.class).register(t -> {
|
||||||
if (!t.getFile().getValue().exists())
|
if (!t.getFile().getValue().exists())
|
||||||
t.getFile().setValue(new File(Settings.getInstance().getCommonpath(), t.getLocation()));
|
t.getFile().setValue(new File(Settings.getInstance().getCommonpath(), t.getLocation()));
|
||||||
});
|
});
|
||||||
@@ -15,34 +15,40 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
|
import org.jackhuang.hmcl.core.service.IMinecraftService;
|
||||||
|
import org.jackhuang.hmcl.core.service.IMinecraftAssetService;
|
||||||
|
import org.jackhuang.hmcl.core.service.IMinecraftLoader;
|
||||||
|
import org.jackhuang.hmcl.core.service.IMinecraftDownloadService;
|
||||||
|
import org.jackhuang.hmcl.core.service.IMinecraftProvider;
|
||||||
|
import org.jackhuang.hmcl.util.C;
|
||||||
|
import org.jackhuang.hmcl.core.service.IMinecraftModService;
|
||||||
|
import org.jackhuang.hmcl.core.service.IMinecraftInstallerService;
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hmcl.api.HMCLApi;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.version.LoadedOneVersionEvent;
|
import org.jackhuang.hmcl.api.event.version.LoadedOneVersionEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.version.RefreshedVersionsEvent;
|
import org.jackhuang.hmcl.api.event.version.RefreshedVersionsEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.api.event.version.RefreshingVersionsEvent;
|
import org.jackhuang.hmcl.api.event.version.RefreshingVersionsEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.GameException;
|
import org.jackhuang.hmcl.core.GameException;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.install.MinecraftInstallerService;
|
import org.jackhuang.hmcl.core.install.MinecraftInstallerService;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.asset.MinecraftAssetService;
|
import org.jackhuang.hmcl.core.asset.MinecraftAssetService;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.UserProfileProvider;
|
import org.jackhuang.hmcl.api.auth.UserProfileProvider;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.MinecraftDownloadService;
|
import org.jackhuang.hmcl.core.download.MinecraftDownloadService;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.LaunchOptions;
|
import org.jackhuang.hmcl.api.game.LaunchOptions;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.MinecraftLoader;
|
import org.jackhuang.hmcl.core.launch.MinecraftLoader;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.*;
|
import org.jackhuang.hmcl.core.mod.MinecraftModService;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.mod.MinecraftModService;
|
import org.jackhuang.hmcl.core.mod.ModpackManager;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.mod.ModpackManager;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
import org.jackhuang.hmcl.setting.VersionSetting;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.VersionSetting;
|
import org.jackhuang.hmcl.ui.MainFrame;
|
||||||
import org.jackhuang.hellominecraft.launcher.ui.MainFrame;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.sys.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.util.task.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
|
||||||
import org.jackhuang.hellominecraft.util.task.TaskWindow;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -57,8 +63,8 @@ public class HMCLMinecraftService extends IMinecraftService {
|
|||||||
this.p = p;
|
this.p = p;
|
||||||
this.provider = new HMCLGameProvider(this);
|
this.provider = new HMCLGameProvider(this);
|
||||||
provider.initializeMiencraft();
|
provider.initializeMiencraft();
|
||||||
HMCAPI.EVENT_BUS.channel(RefreshingVersionsEvent.class).register(versionSettings::clear);
|
HMCLApi.EVENT_BUS.channel(RefreshingVersionsEvent.class).register(versionSettings::clear);
|
||||||
HMCAPI.EVENT_BUS.channel(RefreshedVersionsEvent.class).registerFirst(() -> {
|
HMCLApi.EVENT_BUS.channel(RefreshedVersionsEvent.class).registerFirst(() -> {
|
||||||
if (!checkingModpack) {
|
if (!checkingModpack) {
|
||||||
checkingModpack = true;
|
checkingModpack = true;
|
||||||
if (version().getVersionCount() == 0) {
|
if (version().getVersionCount() == 0) {
|
||||||
@@ -72,7 +78,7 @@ public class HMCLMinecraftService extends IMinecraftService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
HMCAPI.EVENT_BUS.channel(LoadedOneVersionEvent.class).register(e -> loadVersionSetting(e.getValue()));
|
HMCLApi.EVENT_BUS.channel(LoadedOneVersionEvent.class).register(e -> loadVersionSetting(e.getValue()));
|
||||||
this.mms = new MinecraftModService(this);
|
this.mms = new MinecraftModService(this);
|
||||||
this.mds = new MinecraftDownloadService(this);
|
this.mds = new MinecraftDownloadService(this);
|
||||||
this.mas = new HMCLAssetService(this);
|
this.mas = new HMCLAssetService(this);
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.lang.SupportedLocales;
|
import org.jackhuang.hmcl.util.lang.SupportedLocales;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Give the advice to solve the Minecraft crashing.
|
* Give the advice to solve the Minecraft crashing.
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util.upgrade;
|
package org.jackhuang.hmcl.util.upgrade;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -34,21 +34,21 @@ import java.util.jar.JarFile;
|
|||||||
import java.util.jar.JarOutputStream;
|
import java.util.jar.JarOutputStream;
|
||||||
import java.util.jar.Pack200;
|
import java.util.jar.Pack200;
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hmcl.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.MCUtils;
|
import org.jackhuang.hmcl.core.MCUtils;
|
||||||
import org.jackhuang.hellominecraft.util.task.Task;
|
import org.jackhuang.hmcl.util.task.Task;
|
||||||
import org.jackhuang.hellominecraft.util.task.TaskWindow;
|
import org.jackhuang.hmcl.util.task.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.util.net.FileDownloadTask;
|
import org.jackhuang.hmcl.util.net.FileDownloadTask;
|
||||||
import org.jackhuang.hellominecraft.util.ArrayUtils;
|
import org.jackhuang.hmcl.util.ArrayUtils;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hmcl.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.UpdateChecker;
|
import org.jackhuang.hmcl.util.UpdateChecker;
|
||||||
import org.jackhuang.hellominecraft.util.Utils;
|
import org.jackhuang.hmcl.util.Utils;
|
||||||
import org.jackhuang.hellominecraft.util.VersionNumber;
|
import org.jackhuang.hmcl.api.VersionNumber;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hmcl.util.sys.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
import org.jackhuang.hmcl.util.sys.IOUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.OS;
|
import org.jackhuang.hmcl.util.sys.OS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util.upgrade;
|
package org.jackhuang.hmcl.util.upgrade;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
import org.jackhuang.hellominecraft.util.VersionNumber;
|
import org.jackhuang.hmcl.api.VersionNumber;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hmcl.api.func.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,18 +15,18 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.util.upgrade;
|
package org.jackhuang.hmcl.util.upgrade;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
import org.jackhuang.hmcl.api.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.task.TaskWindow;
|
import org.jackhuang.hmcl.util.task.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.util.net.FileDownloadTask;
|
import org.jackhuang.hmcl.util.net.FileDownloadTask;
|
||||||
import org.jackhuang.hellominecraft.util.ArrayUtils;
|
import org.jackhuang.hmcl.util.ArrayUtils;
|
||||||
import org.jackhuang.hellominecraft.util.VersionNumber;
|
import org.jackhuang.hmcl.api.VersionNumber;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hmcl.util.sys.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.IOUtils;
|
import org.jackhuang.hmcl.util.sys.IOUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 382 B |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
15
HMCUtils/build.gradle → HMCLAPI/build.gradle
Executable file → Normal file
@@ -15,14 +15,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
apply plugin: 'me.tatarka.retrolambda'
|
|
||||||
|
|
||||||
if (!hasProperty('mainClass')) {
|
|
||||||
ext.mainClass = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
if (System.getenv("BUILD_NUMBER") != null)
|
|
||||||
version = System.getenv("BUILD_NUMBER")
|
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
@@ -34,6 +26,11 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply plugin: 'me.tatarka.retrolambda'
|
||||||
|
|
||||||
|
if (System.getenv("BUILD_NUMBER") != null)
|
||||||
|
version = System.getenv("BUILD_NUMBER")
|
||||||
|
|
||||||
retrolambda {
|
retrolambda {
|
||||||
javaVersion = JavaVersion.VERSION_1_6
|
javaVersion = JavaVersion.VERSION_1_7
|
||||||
}
|
}
|
||||||
@@ -15,16 +15,20 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api;
|
package org.jackhuang.hmcl.api;
|
||||||
|
|
||||||
|
import org.jackhuang.hmcl.api.event.EventBus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author huang
|
* @author huang
|
||||||
*/
|
*/
|
||||||
public class HMCAPI {
|
public class HMCLApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Events.
|
* Events.
|
||||||
*/
|
*/
|
||||||
public static final EventBus EVENT_BUS = new EventBus();
|
public static final EventBus EVENT_BUS = new EventBus();
|
||||||
|
|
||||||
|
public static VersionNumber HMCL_VERSION;
|
||||||
}
|
}
|
||||||
12
HMCUtils/src/main/java/org/jackhuang/hellominecraft/util/log/HMCLog.java → HMCLAPI/src/main/java/org/jackhuang/hmcl/api/HMCLog.java
Executable file → Normal file
@@ -15,9 +15,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.log;
|
package org.jackhuang.hmcl.api;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.log.logger.Logger;
|
import org.jackhuang.hmcl.api.ILogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -25,10 +25,10 @@ import org.jackhuang.hellominecraft.util.log.logger.Logger;
|
|||||||
*/
|
*/
|
||||||
public class HMCLog {
|
public class HMCLog {
|
||||||
|
|
||||||
private static final Logger LOGGER = new Logger("Hello Minecraft!");
|
public static ILogger LOGGER;
|
||||||
|
|
||||||
public static void log(String message) {
|
public static void log(String message) {
|
||||||
LOGGER.info(message);
|
LOGGER.log(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void warn(String message) {
|
public static void warn(String message) {
|
||||||
@@ -40,11 +40,11 @@ public class HMCLog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void err(String msg) {
|
public static void err(String msg) {
|
||||||
LOGGER.error(msg);
|
LOGGER.err(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void err(String msg, Throwable t) {
|
public static void err(String msg, Throwable t) {
|
||||||
LOGGER.error(msg, t);
|
LOGGER.err(msg, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,21 +15,21 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.ui;
|
package org.jackhuang.hmcl.api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public interface Selectable {
|
public interface ILogger {
|
||||||
|
|
||||||
void onCreate();
|
void log(String message);
|
||||||
|
|
||||||
boolean isCreated();
|
void warn(String message);
|
||||||
|
|
||||||
void onSelect();
|
void warn(String msg, Throwable t);
|
||||||
|
|
||||||
boolean isSelected();
|
void err(String msg);
|
||||||
|
|
||||||
void onLeave();
|
void err(String msg, Throwable t);
|
||||||
}
|
}
|
||||||
@@ -15,11 +15,12 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api;
|
package org.jackhuang.hmcl.api;
|
||||||
|
|
||||||
|
import org.jackhuang.hmcl.api.ui.AddTabCallback;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
import org.jackhuang.hmcl.api.auth.IAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hmcl.api.func.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Each plugin must implement this interface.
|
* Each plugin must implement this interface.
|
||||||
@@ -15,18 +15,29 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.svrmgr.api;
|
package org.jackhuang.hmcl.api;
|
||||||
|
|
||||||
import java.util.EventObject;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author huang
|
* @author huang
|
||||||
*/
|
*/
|
||||||
public class ServerStoppedEvent extends EventObject {
|
public interface IProcess {
|
||||||
|
|
||||||
public ServerStoppedEvent(Object source) {
|
int getExitCode();
|
||||||
super(source);
|
|
||||||
}
|
Process getRawProcess();
|
||||||
|
|
||||||
|
String getStartupCommand();
|
||||||
|
|
||||||
|
List<String> getStartupCommands();
|
||||||
|
|
||||||
|
ArrayList<String> getStdOutLines();
|
||||||
|
|
||||||
|
boolean isRunning();
|
||||||
|
|
||||||
|
void stop();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,12 +15,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api;
|
package org.jackhuang.hmcl.api;
|
||||||
|
|
||||||
|
import org.jackhuang.hmcl.api.ui.AddTabCallback;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
import org.jackhuang.hmcl.api.auth.IAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hmcl.api.func.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can be only called by HMCL.
|
* Can be only called by HMCL.
|
||||||
@@ -15,9 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util;
|
package org.jackhuang.hmcl.api;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.log.HMCLog;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util;
|
package org.jackhuang.hmcl.api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.core.auth;
|
package org.jackhuang.hmcl.api.auth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown if we are trying to log in but there's some problems like password wrong.
|
* Thrown if we are trying to log in but there's some problems like password wrong.
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* Hello Minecraft! Launcher.
|
||||||
|
* Copyright (C) 2013 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.api.auth;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author huang
|
||||||
|
*/
|
||||||
|
public interface IAuthenticator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the name of login method.
|
||||||
|
*/
|
||||||
|
String getName();
|
||||||
|
|
||||||
|
String getPassword();
|
||||||
|
|
||||||
|
String getUserName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Has password?
|
||||||
|
*
|
||||||
|
* @return has password?
|
||||||
|
*/
|
||||||
|
boolean hasPassword();
|
||||||
|
|
||||||
|
String id();
|
||||||
|
|
||||||
|
boolean isLoggedIn();
|
||||||
|
|
||||||
|
void logOut();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Login Method
|
||||||
|
*
|
||||||
|
* @param info username & password
|
||||||
|
*
|
||||||
|
* @return login result
|
||||||
|
*
|
||||||
|
* @throws
|
||||||
|
* org.jackhuang.hmcl.core.auth.AuthenticationException
|
||||||
|
*/
|
||||||
|
UserProfileProvider login(LoginInfo info) throws AuthenticationException;
|
||||||
|
|
||||||
|
UserProfileProvider loginBySettings() throws AuthenticationException;
|
||||||
|
|
||||||
|
void onLoadSettings(Map<?, ?> m);
|
||||||
|
|
||||||
|
Map<?, ?> onSaveSettings();
|
||||||
|
|
||||||
|
void setPassword(String password);
|
||||||
|
|
||||||
|
void setRememberMe(boolean is);
|
||||||
|
|
||||||
|
void setUserName(String s);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.core.auth;
|
package org.jackhuang.hmcl.api.auth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.core.auth;
|
package org.jackhuang.hmcl.api.auth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api;
|
package org.jackhuang.hmcl.api.event;
|
||||||
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api;
|
package org.jackhuang.hmcl.api.event;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hmcl.api.func.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,19 +15,18 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api.event;
|
package org.jackhuang.hmcl.api.event;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.ResultedSimpleEvent;
|
import org.jackhuang.hmcl.api.VersionNumber;
|
||||||
import org.jackhuang.hellominecraft.util.VersionNumber;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when we found that user's HMCL is out of date.
|
* This event gets fired when we found that user's HMCL is out of date.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link org.jackhuang.hellominecraft.api.ResultedEvent}
|
* This event is {@link org.jackhuang.hmcl.api.ResultedEvent}
|
||||||
* If this event is failed, HMCL will not ask user to upgrade the application.
|
* If this event is failed, HMCL will not ask user to upgrade the application.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.util.UpdateChecker}
|
* @param source {@link org.jackhuang.hmcl.util.UpdateChecker}
|
||||||
* @param VersionNumber newest version
|
* @param VersionNumber newest version
|
||||||
* @author huang
|
* @author huang
|
||||||
*/
|
*/
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api;
|
package org.jackhuang.hmcl.api.event;
|
||||||
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api;
|
package org.jackhuang.hmcl.api.event;
|
||||||
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api;
|
package org.jackhuang.hmcl.api.event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api;
|
package org.jackhuang.hmcl.api.event;
|
||||||
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
|
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.config;
|
package org.jackhuang.hmcl.api.event.config;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
import org.jackhuang.hmcl.api.auth.IAuthenticator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when the authenticator changed.
|
* This event gets fired when the authenticator changed.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.setting.Config}
|
* @param source {@link org.jackhuang.hmcl.setting.Config}
|
||||||
* @param IAuthenticator the new authenticator.
|
* @param IAuthenticator the new authenticator.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
@@ -15,22 +15,21 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.config;
|
package org.jackhuang.hmcl.api.event.config;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when the download type changed.
|
* This event gets fired when the download type changed.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.setting.Config}
|
* @param source {@link org.jackhuang.hmcl.setting.Config}
|
||||||
* @param DownloadType the new downlaod type
|
* @param String the new downlaod type name
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public class DownloadTypeChangedEvent extends SimpleEvent<DownloadType> {
|
public class DownloadTypeChangedEvent extends SimpleEvent<String> {
|
||||||
|
|
||||||
public DownloadTypeChangedEvent(Object source, DownloadType value) {
|
public DownloadTypeChangedEvent(Object source, String value) {
|
||||||
super(source, value);
|
super(source, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.config;
|
package org.jackhuang.hmcl.api.event.config;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
import org.jackhuang.hellominecraft.lookandfeel.Theme;
|
import org.jackhuang.hmcl.api.ui.Theme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when the application theme changed.
|
* This event gets fired when the application theme changed.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.setting.Config}
|
* @param source {@link org.jackhuang.hmcl.setting.Config}
|
||||||
* @param Theme the changed theme
|
* @param Theme the changed theme
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
@@ -15,18 +15,19 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.launch;
|
package org.jackhuang.hmcl.api.event.launch;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.ResultedSimpleEvent;
|
import org.jackhuang.hmcl.api.game.DecompressLibraryJob;
|
||||||
|
import org.jackhuang.hmcl.api.event.ResultedSimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when we are launching a game and going to decompress natives.
|
* This event gets fired when we are launching a game and going to decompress natives.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link org.jackhuang.hellominecraft.api.ResultedEvent}
|
* This event is {@link org.jackhuang.hmcl.api.event.ResultedEvent}
|
||||||
* If this event is failed, the launching process will be terminated.
|
* If this event is failed, the launching process will be terminated.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher}
|
* @param source {@link org.jackhuang.hmcl.core.launch.GameLauncher}
|
||||||
* @param DecompressLibraryJob libraries to be decompressed
|
* @param DecompressLibraryJob libraries to be decompressed
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
@@ -15,19 +15,19 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.launch;
|
package org.jackhuang.hmcl.api.event.launch;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.jackhuang.hellominecraft.api.ResultedSimpleEvent;
|
import org.jackhuang.hmcl.api.event.ResultedSimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when we are launching a game and there are some libraries to be downloaded.
|
* This event gets fired when we are launching a game and there are some libraries to be downloaded.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is {@link org.jackhuang.hellominecraft.api.ResultedEvent}
|
* This event is {@link org.jackhuang.hmcl.api.event.ResultedEvent}
|
||||||
* If this event is failed, the launching process will be terminated.
|
* If this event is failed, the launching process will be terminated.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher}
|
* @param source {@link org.jackhuang.hmcl.core.launch.GameLauncher}
|
||||||
* Passed value List<DownloadLibraryJob>: libraries to be downloaded.
|
* Passed value List<DownloadLibraryJob>: libraries to be downloaded.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.launch;
|
package org.jackhuang.hmcl.api.event.launch;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.IMinecraftLibrary;
|
import org.jackhuang.hmcl.api.game.IMinecraftLibrary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -37,7 +37,7 @@ public class DownloadLibraryJob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public DownloadLibraryJob parse() {
|
public DownloadLibraryJob parse() {
|
||||||
String name = lib.name;
|
String name = lib.getName();
|
||||||
if (name.startsWith("net.minecraftforge:forge:")) {
|
if (name.startsWith("net.minecraftforge:forge:")) {
|
||||||
String[] s = name.split(":");
|
String[] s = name.split(":");
|
||||||
if (s.length == 3)
|
if (s.length == 3)
|
||||||
@@ -15,22 +15,22 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.launch;
|
package org.jackhuang.hmcl.api.event.launch;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.IProcess;
|
||||||
import org.jackhuang.hellominecraft.util.sys.JavaProcess;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when we launched the game.
|
* This event gets fired when we launched the game.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher}
|
* @param source {@link org.jackhuang.hmcl.core.launch.GameLauncher}
|
||||||
* @param JavaProcess the game process
|
* @param IProcess the game process
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public class LaunchEvent extends SimpleEvent<JavaProcess> {
|
public class LaunchEvent extends SimpleEvent<IProcess> {
|
||||||
|
|
||||||
public LaunchEvent(Object source, JavaProcess value) {
|
public LaunchEvent(Object source, IProcess value) {
|
||||||
super(source, value);
|
super(source, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.launch;
|
package org.jackhuang.hmcl.api.event.launch;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when we make the launching command successfully(not launched the game process).
|
* This event gets fired when we make the launching command successfully(not launched the game process).
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher}
|
* @param source {@link org.jackhuang.hmcl.core.launch.GameLauncher}
|
||||||
* @param List<String> Our launching command.
|
* @param List<String> Our launching command.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.launch;
|
package org.jackhuang.hmcl.api.event.launch;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,15 +15,15 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.launch;
|
package org.jackhuang.hmcl.api.event.launch;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when we are launching a game and mark what things we are doing.
|
* This event gets fired when we are launching a game and mark what things we are doing.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher}
|
* @param source {@link org.jackhuang.hmcl.core.launch.GameLauncher}
|
||||||
* @param LaunchingState the launching state.
|
* @param LaunchingState the launching state.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
@@ -15,19 +15,19 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.launch;
|
package org.jackhuang.hmcl.api.event.launch;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.LaunchOptions;
|
import org.jackhuang.hmcl.api.game.LaunchOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired before generating launch command.
|
* This event gets fired before generating launch command.
|
||||||
* <br>
|
* <br>
|
||||||
* Pay attension: If you need to terminate the launching process, you must throw
|
* Pay attension: If you need to terminate the launching process, you must throw
|
||||||
* {@link org.jackhuang.hellominecraft.launcher.core.RuntimeGameException anyway.
|
* {@link org.jackhuang.hmcl.core.RuntimeGameException anyway.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher}
|
* @param source {@link org.jackhuang.hmcl.core.launch.GameLauncher}
|
||||||
* @param LaunchOptions you can modify the value of this event to control the launching process.
|
* @param LaunchOptions you can modify the value of this event to control the launching process.
|
||||||
* @author huang
|
* @author huang
|
||||||
*/
|
*/
|
||||||
@@ -15,19 +15,19 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.launch;
|
package org.jackhuang.hmcl.api.event.launch;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.auth.UserProfileProvider;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.UserProfileProvider;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when we successfully logged in.
|
* This event gets fired when we successfully logged in.
|
||||||
* <br>
|
* <br>
|
||||||
* Pay attension: If you need to terminate the launching process, you must throw
|
* Pay attension: If you need to terminate the launching process, you must throw
|
||||||
* {@link org.jackhuang.hellominecraft.launcher.core.RuntimeGameException anyway.
|
* {@link org.jackhuang.hmcl.core.RuntimeGameException anyway.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher}
|
* @param source {@link org.jackhuang.hmcl.core.launch.GameLauncher}
|
||||||
* @param UserProfileProvider you can modify the value of this event to control the user profile.
|
* @param UserProfileProvider you can modify the value of this event to control the user profile.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
@@ -15,22 +15,22 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api.event.process;
|
package org.jackhuang.hmcl.api.event.process;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.IProcess;
|
||||||
import org.jackhuang.hellominecraft.util.sys.JavaProcess;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when we launch the JVM and it got crashed.
|
* This event gets fired when we launch the JVM and it got crashed.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.util.sys.JavaProcessMonitor}
|
* @param source {@link org.jackhuang.hmcl.util.sys.JavaProcessMonitor}
|
||||||
* @param JavaProcess the crashed process.
|
* @param JavaProcess the crashed process.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public class JVMLaunchFailedEvent extends SimpleEvent<JavaProcess> {
|
public class JVMLaunchFailedEvent extends SimpleEvent<IProcess> {
|
||||||
|
|
||||||
public JVMLaunchFailedEvent(Object source, JavaProcess value) {
|
public JVMLaunchFailedEvent(Object source, IProcess value) {
|
||||||
super(source, value);
|
super(source, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,22 +15,22 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api.event.process;
|
package org.jackhuang.hmcl.api.event.process;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.IProcess;
|
||||||
import org.jackhuang.hellominecraft.util.sys.JavaProcess;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when a JavaProcess exited abnormally and the exit code is not zero.
|
* This event gets fired when a JavaProcess exited abnormally and the exit code is not zero.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.util.sys.JavaProcessMonitor}
|
* @param source {@link org.jackhuang.hmcl.util.sys.JavaProcessMonitor}
|
||||||
* @param JavaProcess The process that exited abnormally.
|
* @param JavaProcess The process that exited abnormally.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public class JavaProcessExitedAbnormallyEvent extends SimpleEvent<JavaProcess> {
|
public class JavaProcessExitedAbnormallyEvent extends SimpleEvent<IProcess> {
|
||||||
|
|
||||||
public JavaProcessExitedAbnormallyEvent(Object source, JavaProcess value) {
|
public JavaProcessExitedAbnormallyEvent(Object source, IProcess value) {
|
||||||
super(source, value);
|
super(source, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,22 +15,22 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api.event.process;
|
package org.jackhuang.hmcl.api.event.process;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.IProcess;
|
||||||
import org.jackhuang.hellominecraft.util.sys.JavaProcess;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when a JavaProcess is starting.
|
* This event gets fired when a JavaProcess is starting.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.util.sys.JavaProcessMonitor}
|
* @param source {@link org.jackhuang.hmcl.util.sys.JavaProcessMonitor}
|
||||||
* @param JavaProcess the starting JavaProcess.
|
* @param JavaProcess the starting JavaProcess.
|
||||||
* @author huang
|
* @author huang
|
||||||
*/
|
*/
|
||||||
public class JavaProcessStartingEvent extends SimpleEvent<JavaProcess> {
|
public class JavaProcessStartingEvent extends SimpleEvent<IProcess> {
|
||||||
|
|
||||||
public JavaProcessStartingEvent(Object source, JavaProcess value) {
|
public JavaProcessStartingEvent(Object source, IProcess value) {
|
||||||
super(source, value);
|
super(source, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,22 +15,22 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.api.event.process;
|
package org.jackhuang.hmcl.api.event.process;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.IProcess;
|
||||||
import org.jackhuang.hellominecraft.util.sys.JavaProcess;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when minecraft process exited successfully and the exit code is 0.
|
* This event gets fired when minecraft process exited successfully and the exit code is 0.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.util.sys.JavaProcessMonitor}
|
* @param source {@link org.jackhuang.hmcl.util.sys.JavaProcessMonitor}
|
||||||
* @param JavaProcess minecraft process
|
* @param JavaProcess minecraft process
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public class JavaProcessStoppedEvent extends SimpleEvent<JavaProcess> {
|
public class JavaProcessStoppedEvent extends SimpleEvent<IProcess> {
|
||||||
|
|
||||||
public JavaProcessStoppedEvent(Object source, JavaProcess value) {
|
public JavaProcessStoppedEvent(Object source, IProcess value) {
|
||||||
super(source, value);
|
super(source, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,15 +15,15 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.version;
|
package org.jackhuang.hmcl.api.event.version;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import org.jackhuang.hmcl.api.event.SimpleEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when a minecraft version has been loaded.
|
* This event gets fired when a minecraft version has been loaded.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersionManager}
|
* @param source {@link org.jackhuang.hmcl.core.version.MinecraftVersionManager}
|
||||||
* @param String the version id.
|
* @param String the version id.
|
||||||
* @author huang
|
* @author huang
|
||||||
*/
|
*/
|
||||||
@@ -15,17 +15,17 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.version;
|
package org.jackhuang.hmcl.api.event.version;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import org.jackhuang.hellominecraft.util.Wrapper;
|
import org.jackhuang.hmcl.api.Wrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when we getting minecraft library path.
|
* This event gets fired when we getting minecraft library path.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.version.MinecraftLibrary}
|
* @param source {@link org.jackhuang.hmcl.core.version.MinecraftLibrary}
|
||||||
* @param {@code Wrapper<File>} modify this thing to change to your wanted mc lib.
|
* @param {@code Wrapper<File>} modify this thing to change to your wanted mc lib.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
@@ -15,23 +15,22 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.version;
|
package org.jackhuang.hmcl.api.event.version;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import java.util.EventObject;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when all the versions in .minecraft folder are loaded.
|
* This event gets fired when all the versions in .minecraft folder are loaded.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersionManager}
|
* @param source {@link org.jackhuang.hmcl.core.version.MinecraftVersionManager}
|
||||||
* @param IMinecraftService the .minecraft folder.
|
* @param IMinecraftService the .minecraft folder.
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public class RefreshedVersionsEvent extends SimpleEvent<IMinecraftService> {
|
public class RefreshedVersionsEvent extends EventObject {
|
||||||
|
|
||||||
public RefreshedVersionsEvent(Object source, IMinecraftService value) {
|
public RefreshedVersionsEvent(Object source) {
|
||||||
super(source, value);
|
super(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,23 +15,22 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.api.event.version;
|
package org.jackhuang.hmcl.api.event.version;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.api.SimpleEvent;
|
import java.util.EventObject;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event gets fired when loading versions in a .minecraft folder.
|
* This event gets fired when loading versions in a .minecraft folder.
|
||||||
* <br>
|
* <br>
|
||||||
* This event is fired on the {@link org.jackhuang.hellominecraft.api.HMCAPI#EVENT_BUS}
|
* This event is fired on the {@link org.jackhuang.hmcl.api.HMCLApi#EVENT_BUS}
|
||||||
* @param source {@link org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersionManager}
|
* @param source {@link org.jackhuang.hmcl.core.version.MinecraftVersionManager}
|
||||||
* @param IMinecraftService .minecraft folder.
|
* @param IMinecraftService .minecraft folder.
|
||||||
* @author huang
|
* @author huang
|
||||||
*/
|
*/
|
||||||
public class RefreshingVersionsEvent extends SimpleEvent<IMinecraftService> {
|
public class RefreshingVersionsEvent extends EventObject {
|
||||||
|
|
||||||
public RefreshingVersionsEvent(Object source, IMinecraftService value) {
|
public RefreshingVersionsEvent(Object source) {
|
||||||
super(source, value);
|
super(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.func;
|
package org.jackhuang.hmcl.api.func;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.func;
|
package org.jackhuang.hmcl.api.func;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.func;
|
package org.jackhuang.hmcl.api.func;
|
||||||
|
|
||||||
import java.util.EventListener;
|
import java.util.EventListener;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.func;
|
package org.jackhuang.hmcl.api.func;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.func;
|
package org.jackhuang.hmcl.api.func;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||