Skip to content

Commit

Permalink
Merge branch 'release/4.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gravit0 committed Apr 21, 2024
2 parents 63c76e8 + e439902 commit f490252
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 23 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ repositories {
}

dependencies {
implementation "pro.gravit.launcher:launcher-core:5.6.0"
implementation "pro.gravit.launcher:launcher-ws-api:5.6.0"
implementation "pro.gravit.launcher:launcher-client-api:5.6.0"
implementation "pro.gravit.launcher:launcher-client-start-api:5.6.0"
implementation "pro.gravit.launcher:launcher-client-starter-api:5.6.0"
implementation "pro.gravit.launcher:launcher-core:5.6.1"
implementation "pro.gravit.launcher:launcher-ws-api:5.6.1"
implementation "pro.gravit.launcher:launcher-client-api:5.6.1"
implementation "pro.gravit.launcher:launcher-client-start-api:5.6.1"
implementation "pro.gravit.launcher:launcher-client-starter-api:5.6.1"
implementation "pro.gravit.utils.enfs:enfs:2.0.1-SNAPSHOT"
implementation 'io.netty:netty-codec-http:4.1.67.Final'
implementation 'com.github.oshi:oshi-core:5.8.1'
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion runtime/components/buttons/customization.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#customization {
-fx-background-color: rgba(0,0,0,0.7);
-fx-background-color: -fx-colors-text;
-fx-background-radius: 4px;
-fx-opacity: 0;
-fx-effect: none;
Expand Down
2 changes: 1 addition & 1 deletion runtime/components/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-fx-font-size: 14px;
}
#notificationText {
-fx-fill: -fx-colors-text;
-fx-text-fill: -fx-colors-text;
-fx-font-size: 10px;
}
/*-- Блок сервера --*/
Expand Down
1 change: 1 addition & 0 deletions runtime/dialogs/dialogs.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#textDialog {
-fx-background-color: -fx-bg2;
-fx-background-radius: 10px;
-fx-text-fill: -fx-colors-text;
-fx-font-size: 12px;
-fx-padding: 10px 15px 10px 15px;
}
Expand Down
4 changes: 4 additions & 0 deletions runtime/scenes/update/update.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#speed-text {
-fx-font-size: 14px;
-fx-font-weight: bold;
-fx-text-fill: -fx-colors-text;
}
#volume {
-fx-text-fill: -fx-colors-text;
}
.speedError {
-fx-text-fill: -fx-red;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/pro/gravit/launcher/gui/JavaFXApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ public PrimaryStage getMainStage() {

@Override
public void init() throws Exception {
if(JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE) {
System.setProperty("prism.lcdtext", "false");
}
guiModuleConfig = new GuiModuleConfig();
settingsManager = new StdSettingsManager();
UserSettings.providers.register(JavaRuntimeModule.RUNTIME_NAME, RuntimeSettings.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class JavaRuntimeModule extends LauncherModule {

public JavaRuntimeModule() {
super(new LauncherModuleInfo("StdJavaRuntime",
new Version(4, 0, 0, 1, Version.Type.STABLE),
new Version(4, 0, 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 @@ -19,6 +19,7 @@

public class ServerButton extends AbstractVisualComponent {
private static final String SERVER_BUTTON_FXML = "components/serverButton.fxml";
private static final String SERVER_BUTTON_CUSTOM_FXML = "components/serverButton/%s.fxml";
private static final String SERVER_BUTTON_DEFAULT_IMAGE = "images/servers/example.png";
private static final String SERVER_BUTTON_CUSTOM_IMAGE = "images/servers/%s.png";
public ClientProfile profile;
Expand All @@ -27,14 +28,23 @@ public class ServerButton extends AbstractVisualComponent {
private Region serverLogo;

protected ServerButton(JavaFXApplication application, ClientProfile profile) {
super(SERVER_BUTTON_FXML, application);
super(getServerButtonFxml(application, profile), application);
this.profile = profile;
}

public static ServerButton createServerButton(JavaFXApplication application, ClientProfile profile) {
return new ServerButton(application, profile);
}

private static String getServerButtonFxml(JavaFXApplication application, ClientProfile profile) {
String customFxml = String.format(SERVER_BUTTON_CUSTOM_FXML, profile.getUUID().toString());
URL fxml = application.tryResource(customFxml);
if(fxml != null) {
return customFxml;
}
return SERVER_BUTTON_FXML;
}

@Override
public String getName() {
return "serverButton";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ public CompletableFuture<Void> show(AuthWebViewDetails details) {
public CompletableFuture<AuthFlow.LoginAndPasswordResult> auth(AuthWebViewDetails details) {
overlay.future = new CompletableFuture<>();
overlay.follow(details.url, details.redirectUrl, (r) -> {
String code = r;
LogHelper.debug("Code: %s", code);
if (code.startsWith("?code=")) {
code = r.substring("?code=".length(), r.indexOf("&"));
}
LogHelper.debug("Code: %s", code);
overlay.future.complete(new AuthFlow.LoginAndPasswordResult(null, new AuthCodePassword(code)));
LogHelper.dev("Redirect uri: %s", r);
overlay.future.complete(new AuthFlow.LoginAndPasswordResult(null, new AuthCodePassword(r)));
});
return overlay.future;
}
Expand Down Expand Up @@ -119,16 +114,16 @@ protected void doInit() {
}

public void follow(String url, String redirectUrl, Consumer<String> redirectCallback) {
LogHelper.debug("Load url %s", url);
LogHelper.dev("Load url %s", url);
webView.getEngine().setJavaScriptEnabled(true);
webView.getEngine().load(url);
if (redirectCallback != null) {
webView.getEngine().locationProperty().addListener((obs, oldLocation, newLocation) -> {
if (newLocation != null) {
LogHelper.debug("Location: %s", newLocation);
LogHelper.dev("Location: %s", newLocation);
if (redirectUrl != null) {
if (newLocation.startsWith(redirectUrl)) {
redirectCallback.accept(newLocation.substring(redirectUrl.length()));
redirectCallback.accept(newLocation);
}
} else {
redirectCallback.accept(newLocation);
Expand Down

0 comments on commit f490252

Please sign in to comment.