Skip to content

Commit

Permalink
Merge branch 'release/1.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gravit0 committed Dec 25, 2020
2 parents f9ab8e9 + e6c0529 commit 775bf53
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 23 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ javafx {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
group 'pro.gravit.launcher'
version '1.5.0'
version '1.5.1'
def mainClassName = "pro.gravit.launcher.client.JavaRuntimeModule"

task sourcesJar(type: Jar) {
Expand Down Expand Up @@ -46,9 +46,9 @@ repositories {
}

dependencies {
implementation "pro.gravit.launcher:launcher-core:5.1.8-SNAPSHOT"
implementation "pro.gravit.launcher:launcher-ws-api:5.1.8-SNAPSHOT"
implementation "pro.gravit.launcher:launcher-client-api:5.1.8-SNAPSHOT"
implementation "pro.gravit.launcher:launcher-core:5.1.9"
implementation "pro.gravit.launcher:launcher-ws-api:5.1.9"
implementation "pro.gravit.launcher:launcher-client-api:5.1.9"
implementation 'com.github.oshi:oshi-core:4.5.2'
implementation 'com.google.code.gson:gson:2.8.6'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class JavaRuntimeModule extends LauncherModule {
private RuntimeProvider provider;

public JavaRuntimeModule() {
super(new LauncherModuleInfo("StdJavaRuntime", new Version(1, 5, 0, 1, Version.Type.STABLE),
super(new LauncherModuleInfo("StdJavaRuntime", new Version(1, 5, 1, 1, Version.Type.STABLE),
0, new String[]{}, new String[]{"runtime"}));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public abstract class AbstractScene implements AllowDisable {
private Node currentOverlayNode;
private AbstractOverlay currentOverlay;
private boolean enabled = true;
private boolean hideTransformStarted = false;

protected AbstractScene(String fxmlPath, JavaFXApplication application) {
this.fxmlPath = fxmlPath;
Expand Down Expand Up @@ -103,6 +104,12 @@ public void hideOverlay(double delay, EventHandler<ActionEvent> onFinished) {
return;
if (currentOverlay == null)
return;
if(hideTransformStarted) {
if(onFinished != null) {
contextHelper.runInFxThread(() -> onFinished.handle(null));
}
}
hideTransformStarted = true;
enable();
Pane root = (Pane) scene.getRoot();
fade(currentOverlayNode, delay, 1.0, 0.0, (e) -> {
Expand All @@ -116,6 +123,7 @@ public void hideOverlay(double delay, EventHandler<ActionEvent> onFinished) {
if (onFinished != null) {
onFinished.handle(e);
}
hideTransformStarted = false;
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package pro.gravit.launcher.client.gui.raw;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Rectangle2D;
import javafx.scene.Scene;
import javafx.scene.control.Button;
Expand Down Expand Up @@ -150,10 +152,13 @@ public void showTextDialog(String header, Consumer<String> onApplyCallback, Runn
onCloseCallback.run();
});
TextField a = LookupHelper.<TextField>lookup(pane, "#dialogInput");
LookupHelper.<Button>lookup(pane, "#apply").setOnAction((e) -> {
EventHandler<ActionEvent> eventHandler = (e) -> {
onClose.run();
onApplyCallback.accept(a.getText());
});
};
LookupHelper.<Button>lookup(pane, "#apply").setOnAction(eventHandler);
a.setOnAction(eventHandler);
a.requestFocus();
}, isLauncher);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ private void login(String login, byte[] password, GetAvailabilityAuthRequestEven
String message = exception.getMessage();
if(message.equals(AuthRequestEvent.TWO_FACTOR_NEED_ERROR_MESSAGE))
{
this.hideOverlay(0, null); //Force hide overlay
application.messageManager.showTextDialog(application.getTranslation("runtime.scenes.login.dialog2fa.header"), (result) -> {
login(login, password, authId, result, savePassword);
}, null, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,6 @@ public void reset() {
Pane serverList = (Pane) LookupHelper.<ScrollPane>lookup(layout, "#serverlist").getContent();
serverList.getChildren().clear();
application.runtimeStateMachine.clearServerPingCallbacks();
try {
Request.service.request(new PingServerRequest()).thenAccept((event) -> {
if(event.serverMap != null)
{
event.serverMap.forEach((name, value) -> {
application.runtimeStateMachine.setServerPingReport(event.serverMap);
});
}
}).exceptionally((ex) -> {
LogHelper.error(ex.getCause());
return null;
});
} catch (IOException e) {
e.printStackTrace();
}
serverButtonCacheMap.forEach((profile, serverButtonCache) -> {
try {
Pane pane = serverButtonCache.pane.get();
Expand Down Expand Up @@ -276,7 +261,6 @@ else if(profile.getServers() != null)
{
for(ClientProfile.ServerProfile serverProfile : profile.getServers())
{
if(serverProfile.serverAddress == null) continue;
if(serverProfile.isDefault)
{
application.runtimeStateMachine.addServerPingCallback(serverProfile.name, (report) -> {
Expand All @@ -295,6 +279,21 @@ else if(profile.getServers() != null)
LogHelper.error(e);
}
});
try {
Request.service.request(new PingServerRequest()).thenAccept((event) -> {
if(event.serverMap != null)
{
event.serverMap.forEach((name, value) -> {
application.runtimeStateMachine.setServerPingReport(event.serverMap);
});
}
}).exceptionally((ex) -> {
LogHelper.error(ex.getCause());
return null;
});
} catch (IOException e) {
e.printStackTrace();
}
CommonHelper.newThread("SkinHead Downloader Thread", true, () -> {
try {
updateSkinHead();
Expand Down

0 comments on commit 775bf53

Please sign in to comment.