Should fix 'Never get to here'
This commit is contained in:
@@ -109,7 +109,13 @@ public final class LauncherHelper {
|
|||||||
.then(Task.of(Schedulers.javafx(), () -> emitStatus(LoadingState.LAUNCHING)))
|
.then(Task.of(Schedulers.javafx(), () -> emitStatus(LoadingState.LAUNCHING)))
|
||||||
.then(Task.of(variables -> {
|
.then(Task.of(variables -> {
|
||||||
variables.set("launcher", new HMCLGameLauncher(
|
variables.set("launcher", new HMCLGameLauncher(
|
||||||
repository, selectedVersion, variables.get("account"), setting.toLaunchOptions(profile.getGameDir()), new HMCLProcessListener(variables.get("account"), setting, gameVersion.isPresent())
|
repository,
|
||||||
|
selectedVersion,
|
||||||
|
variables.get("account"),
|
||||||
|
setting.toLaunchOptions(profile.getGameDir()),
|
||||||
|
setting.getLauncherVisibility() == LauncherVisibility.CLOSE
|
||||||
|
? null // Unnecessary to start listening to game process output when close launcher immediately after game launched.
|
||||||
|
: new HMCLProcessListener(variables.get("account"), setting, gameVersion.isPresent())
|
||||||
));
|
));
|
||||||
}))
|
}))
|
||||||
.then(variables -> {
|
.then(variables -> {
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ public final class Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void dialog(Region content) {
|
public static void dialog(Region content) {
|
||||||
decorator.showDialog(content);
|
if (decorator != null)
|
||||||
|
decorator.showDialog(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void dialog(String text) {
|
public static void dialog(String text) {
|
||||||
|
|||||||
@@ -273,9 +273,7 @@ public class DefaultLauncher extends Launcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ManagedProcess p = new ManagedProcess(process, rawCommandLine);
|
ManagedProcess p = new ManagedProcess(process, rawCommandLine);
|
||||||
if (listener == null)
|
if (listener != null)
|
||||||
startMonitors(p);
|
|
||||||
else
|
|
||||||
startMonitors(p, listener, daemon);
|
startMonitors(p, listener, daemon);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@@ -313,11 +311,6 @@ public class DefaultLauncher extends Launcher {
|
|||||||
throw new PermissionException();
|
throw new PermissionException();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startMonitors(ManagedProcess managedProcess) {
|
|
||||||
managedProcess.addRelatedThread(Lang.thread(new StreamPump(managedProcess.getProcess().getInputStream()), "stdout-pump", true));
|
|
||||||
managedProcess.addRelatedThread(Lang.thread(new StreamPump(managedProcess.getProcess().getErrorStream()), "stderr-pump", true));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startMonitors(ManagedProcess managedProcess, ProcessListener processListener) {
|
private void startMonitors(ManagedProcess managedProcess, ProcessListener processListener) {
|
||||||
startMonitors(managedProcess, processListener, true);
|
startMonitors(managedProcess, processListener, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user