Skip to content

Commit

Permalink
Merge branch 'release/3.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
gravit0 committed Nov 20, 2023
2 parents bd876c7 + d7e5848 commit 41ec88a
Show file tree
Hide file tree
Showing 26 changed files with 154 additions and 105 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ javafx {
sourceCompatibility = '17'
targetCompatibility = '17'
group 'pro.gravit.launcher'
version '3.0.1'
version '3.0.2'
def mainClassName = "pro.gravit.launcher.client.JavaRuntimeModule"

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

dependencies {
implementation "pro.gravit.launcher:launcher-core:5.5.1"
implementation "pro.gravit.launcher:launcher-modern-core:5.5.1"
implementation "pro.gravit.launcher:launcher-ws-api:5.5.1"
implementation "pro.gravit.launcher:launcher-client-api:5.5.1"
implementation "pro.gravit.launcher:launcher-client-start-api:5.5.1"
implementation "pro.gravit.launcher:launcher-client-starter-api:5.5.1"
implementation "pro.gravit.launcher:launcher-core:5.5.2"
implementation "pro.gravit.launcher:launcher-modern-core:5.5.2"
implementation "pro.gravit.launcher:launcher-ws-api:5.5.2"
implementation "pro.gravit.launcher:launcher-client-api:5.5.2"
implementation "pro.gravit.launcher:launcher-client-start-api:5.5.2"
implementation "pro.gravit.launcher:launcher-client-starter-api:5.5.2"
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
13 changes: 8 additions & 5 deletions runtime/scenes/debug/debug.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.shape.SVGPath?>

<!-- DrLeonardo refactor -->
Expand All @@ -28,7 +28,7 @@
</Label>

<!-- Заголовок сцены -->
<Label id="headingDialog" layoutX="62.0" layoutY="39.0" prefHeight="25.0" prefWidth="417.0" text="%runtime.scenes.debug.headingDebug" AnchorPane.topAnchor="39.0" />
<Label layoutX="62.0" layoutY="39.0" prefHeight="25.0" prefWidth="417.0" styleClass="scene-header" text="%runtime.scenes.debug.headingDebug" AnchorPane.topAnchor="39.0" />


<!-- Кнопка назад -->
Expand Down Expand Up @@ -87,9 +87,12 @@
</HBox>
</AnchorPane>

<Pane id="output-detail" layoutX="20.0" layoutY="98.0" prefHeight="381.0" prefWidth="860.0">
<TextArea id="output" editable="false" layoutX="7.0" layoutY="6.0" prefHeight="390.0" prefWidth="844.0" wrapText="true" />
</Pane>
<StackPane id="output-detail" layoutX="20.0" layoutY="98.0" prefHeight="381.0" prefWidth="860.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="50.0" AnchorPane.rightAnchor="50.0" AnchorPane.topAnchor="110.0">
<TextArea id="output" editable="false" layoutX="7.0" layoutY="6.0" wrapText="true">
<padding>
<Insets bottom="15.0" left="20.0" right="20.0" top="15.0" />
</padding></TextArea>
</StackPane>

<!-- Подключение стилей-->
<stylesheets>
Expand Down
5 changes: 5 additions & 0 deletions runtime/scenes/options/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.optional-container {
-fx-background-color: transparent;
-fx-padding: 15 0 0 15px;
-fx-cursor: hand;
}
.optional-checkbox {
-fx-fill: -fx-black2C;
Expand Down Expand Up @@ -55,4 +56,8 @@
-fx-font-weight: 800;
-fx-text-fill: -fx-white;
}

#tabPane:focused .tab {
-fx-focus-color: transparent;
}
/*-- DrLeonardo styles refactor --*/
10 changes: 0 additions & 10 deletions runtime/scenes/options/options.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@
<!-- Заголовок сцены -->
<HBox id="controls" spacing="10.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="30.0">

<!-- Кнопка консоли -->
<Button id="console" layoutX="676.0" layoutY="-2.0" mnemonicParsing="false" styleClass="icon-button">
<graphic>
<SVGPath content="M3.35715 0C1.78599 0 0.5 1.28599 0.5 2.85714V21.1428C0.5 22.714 1.78599 24 3.35715 24H21.6429C23.214 24 24.5 22.714 24.5 21.1428V2.85714C24.5 1.28599 23.214 0 21.6429 0H3.35715ZM3.35715 1.14286H21.6429C22.5963 1.14286 23.3571 1.90372 23.3571 2.85714V21.1428C23.3571 22.0963 22.5963 22.8571 21.6429 22.8571H3.35715C2.40373 22.8571 1.64285 22.0963 1.64285 21.1428V2.85714C1.64285 1.90372 2.40373 1.14286 3.35715 1.14286Z M5.5 6V18H19.5V6H5.5ZM6.66667 7.09091H18.3333V8.18182H6.66667V7.09091ZM6.66667 9.27273H18.3333V16.9091H6.66667V9.27273ZM9.71094 10.7898L8.8724 11.5739L10.4948 13.0909L8.8724 14.608L9.71094 15.392L11.7526 13.483L12.1536 13.0909L11.7526 12.6989L9.71094 10.7898ZM12.5 14.1818V15.2727H16V14.1818H12.5Z" styleClass="icon-button-color" />
</graphic>
<tooltip>
<Tooltip id="consoleTooltip" text="%runtime.scenes.settings.consoleTooltip" />
</tooltip>
</Button>

<!-- Кнопка языка -->
<Button id="lang" layoutX="718.0" mnemonicParsing="false" styleClass="icon-button">
<graphic>
Expand Down
2 changes: 1 addition & 1 deletion runtime/scenes/serverinfo/serverinfo.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-fx-font-style: normal;
-fx-font-weight: normal;
-fx-font-size: 14px;
-fx-text-color: -fx-black2C;
-fx-text-fill: -fx-black2C;
}
/*-- Фон сервера --*/
#serverImage {
Expand Down
4 changes: 2 additions & 2 deletions runtime/scenes/serverinfo/serverinfo.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@


<!-- Аватар игрока -->
<ImageView id="avatar" fitHeight="32.0" fitWidth="32.0" layoutX="53.0" layoutY="31.0" smooth="false" AnchorPane.leftAnchor="73.0" AnchorPane.topAnchor="34.0">
<ImageView id="avatar" fitHeight="32.0" fitWidth="32.0" layoutX="53.0" layoutY="31.0" smooth="false" AnchorPane.leftAnchor="73.0" AnchorPane.topAnchor="31.0">
<Image url="@../../images/icons/default.png" />
</ImageView>

Expand All @@ -92,7 +92,7 @@

<!-- Блок сервера-->
<Pane id="serverButton" layoutX="34.0" layoutY="119.0" prefHeight="350.0" prefWidth="175.0" AnchorPane.leftAnchor="62.0" AnchorPane.topAnchor="148.0" />
<ScrollPane fitToWidth="true" hbarPolicy="NEVER" layoutX="320.0" layoutY="100.0" pannable="true" AnchorPane.bottomAnchor="20.0" AnchorPane.leftAnchor="320.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="100.0">
<ScrollPane id="serverDescriptionPane" fitToWidth="true" hbarPolicy="NEVER" layoutX="320.0" layoutY="100.0" pannable="true" AnchorPane.bottomAnchor="20.0" AnchorPane.leftAnchor="320.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="100.0">
<content>
<Label id="serverDescription" alignment="TOP_LEFT" maxWidth="1.7976931348623157E308" prefWidth="149.0" text="Server description" wrapText="true" />
</content>
Expand Down
2 changes: 1 addition & 1 deletion runtime/scenes/settings/settings.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<Label styleClass="settings-header" text="%runtime.scenes.settings.header.java" />
<HBox spacing="10.0">
<children>
<ComboBox id="javaCombo" prefWidth="240.0" styleClass="combo-box" />
<ComboBox id="javaCombo" prefWidth="240.0" />
<Text styleClass="javaDesc" text="%runtime.scenes.settings.javaDesc" textOrigin="CENTER" wrappingWidth="323.0" />
</children>
</HBox>
Expand Down
2 changes: 1 addition & 1 deletion runtime/scenes/update/update.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- Навбар -->
<AnchorPane id="header" layoutX="523.2000122070312" layoutY="30.0" prefHeight="100.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<!-- Заголовок сцены -->
<Text id="headingDialog" layoutX="26.0" layoutY="51.0" text="%runtime.scenes.update.headingDialog" />
<Label layoutX="26.0" styleClass="scene-header" layoutY="51.0" text="%runtime.scenes.update.headingDialog" />
<!-- Кнопки управления -->
<HBox id="controls" spacing="10.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="30.0">

Expand Down
12 changes: 6 additions & 6 deletions runtime/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ RadioButton {
}
.scene-header {
-fx-font-weight: bold;
-fx-font-size: 24px;
-fx-text-color: -fx-black2C;
-fx-font-size: 20px;
-fx-text-fill: -fx-black2C;
}
/*-- Вид блоков --*/
.blocks {
Expand Down Expand Up @@ -112,7 +112,7 @@ RadioButton {
-fx-font-size: 14px;
-fx-text-fill: -fx-black2C;
}
#money {
#role {
-fx-font-weight: normal;
-fx-font-size: 12px;
-fx-text-fill: -fx-black2C;
Expand All @@ -133,16 +133,16 @@ RadioButton {
}
/*-- Блок вывода --*/
#output-detail {
-fx-background-color: -fx-glass;
-fx-background-radius: 20px;
-fx-background-color: -fx-scene-card;
-fx-background-radius: 15px 15px 0px 0px;
}
/* Вывод лога */
#output-detail>#output {
-fx-background-color: transparent;
-fx-background-radius: 0;
-fx-padding: 10px;
-fx-font-size: 12px;
-fx-text-color: -fx-black2C;
-fx-text-fill: -fx-black2C;
}
#output-detail>#output .content,
#output-detail>#output .content {
Expand Down
1 change: 1 addition & 0 deletions runtime/styles/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
-fx-violetTr: rgba(107, 54, 255, 0.18);
-fx-header: #A4B3BA;
-fx-header-hover: #D0D6D9;
-fx-scene-card: rgba(250, 250, 255, 0.50);
-fx-violetGR: linear-gradient(#8D4CE0 10.39%, #5D35B9 68.07%, #FAFAFF 68.07%);
-fx-ramGR: linear-gradient(from 50% 50% to 100% 100%, -fx-green, -fx-violet);
-fx-updateGR: linear-gradient(from 20% 20% to 100% 100%, -fx-violet, #5D35B9);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class JavaRuntimeModule extends LauncherModule {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void init() throws Exception {
service.registerEventHandler(new GuiEventHandler(this));
authService = new AuthService(this);
launchService = new LaunchService(this);
profilesService = new ProfilesService();
profilesService = new ProfilesService(this);
messageManager = new MessageManager(this);
securityService = new RuntimeSecurityService(this);
skinManager = new SkinManager(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

public class DesignConstants {
public static final double AVATAR_IMAGE_RADIUS = 8.0;
public static final double SCENE_CLIP_RADIUS = 10.0;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package pro.gravit.launcher.client.gui.dialogs;

import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.text.Text;
import pro.gravit.launcher.client.gui.JavaFXApplication;
import pro.gravit.launcher.client.gui.helper.LookupHelper;
Expand All @@ -12,8 +13,8 @@ public class InfoDialog extends AbstractDialog {
private final Runnable onAccept;
private final Runnable onClose;

private Text textHeader;
private Text textDescription;
private Label textHeader;
private Label textDescription;

public InfoDialog(JavaFXApplication application, String header, String text, Runnable onAccept, Runnable onClose) {
super("dialogs/info/dialog.fxml", application);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
import pro.gravit.launcher.client.gui.JavaFXApplication;
import pro.gravit.launcher.client.gui.config.DesignConstants;
import pro.gravit.utils.helper.LogHelper;

import java.io.IOException;
Expand All @@ -37,6 +39,17 @@ protected AbstractStage(Stage stage) {
} catch (IOException e) {
LogHelper.error(e);
}
{
}
}

protected void setClipRadius(double width, double height) {
Rectangle rect = new Rectangle(stackPane.getPrefWidth(), stackPane.getPrefHeight());
rect.heightProperty().bind(stackPane.heightProperty());
rect.widthProperty().bind(stackPane.widthProperty());
rect.setArcHeight(height);
rect.setArcWidth(width);
stackPane.setClip(rect);
}

public void hide() {
Expand Down Expand Up @@ -81,8 +94,9 @@ public void setScene(AbstractVisualComponent visualComponent) throws Exception {
stackPane.getChildren().add(visualComponent.getFxmlRoot());
} else {
var old = stackPane.getChildren().get(0);
if(old.getEffect() instanceof GaussianBlur) { // TODO: MAY BE BLUR NEW SCENE (?)
if(old.getEffect() instanceof GaussianBlur blur) {
old.setEffect(null);
visualComponent.getFxmlRootPrivate().setEffect(blur);
}
stackPane.getChildren().set(0, visualComponent.getFxmlRoot());
}
Expand Down Expand Up @@ -150,9 +164,11 @@ public void show() {
}

public void disable() {
if (disableCounter.incrementAndGet() != 1) return;
var value = disableCounter.incrementAndGet();
LogHelper.dev("Disable scene: stack_num: %s | blur: %s | counter: %s",stackPane.getChildren().size(), disablePane == null ? "null" : "not null", value);
if (value != 1) return;
Pane layout = (Pane) stackPane.getChildren().get(0);
layout.setEffect(new GaussianBlur(20));
layout.setEffect(new GaussianBlur(150));
if (disablePane == null) {
disablePane = new Pane();
disablePane.setPrefHeight(layout.getPrefHeight());
Expand All @@ -163,7 +179,9 @@ public void disable() {
}

public void enable() {
if (disableCounter.decrementAndGet() != 0) return;
var value = disableCounter.decrementAndGet();
LogHelper.dev("Enable scene: stack_num: %s | blur: %s | counter: %s",stackPane.getChildren().size(), disablePane == null ? "null" : "not null", value);
if (value != 0) return;
Pane layout = (Pane) stackPane.getChildren().get(0);
layout.setEffect(null);
disablePane.setVisible(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import javafx.scene.control.CheckBox;
import javafx.stage.FileChooser;
import pro.gravit.launcher.Launcher;
import pro.gravit.launcher.LauncherNetworkAPI;
import pro.gravit.launcher.client.gui.JavaFXApplication;
import pro.gravit.launcher.client.gui.helper.LookupHelper;
import pro.gravit.launcher.events.request.AssetUploadInfoRequestEvent;
Expand Down Expand Up @@ -155,6 +156,7 @@ public void uploadAsset(String name, AssetOptions options) {
}

public static final class AssetOptions {
@LauncherNetworkAPI
private final boolean modelSlim;

public AssetOptions(boolean modelSlim) {
Expand All @@ -167,11 +169,11 @@ public boolean modelSlim() {

}

public record UploadError(String error) {
public record UploadError(@LauncherNetworkAPI String error) {

}

public record UserTexture(String url, String digest, Map<String, String> metadata) {
public record UserTexture(@LauncherNetworkAPI String url,@LauncherNetworkAPI String digest,@LauncherNetworkAPI Map<String, String> metadata) {

Texture toLauncherTexture() {
return new Texture(url, SecurityHelper.fromHex(digest), metadata);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import pro.gravit.utils.helper.LogHelper;

public class WelcomeOverlay extends AbstractOverlay {
private Image originalImage;
public WelcomeOverlay(JavaFXApplication application) {
super("overlay/welcome/welcome.fxml", application);
}
Expand All @@ -33,7 +34,14 @@ public void reset() {
JavaFxUtils.setStaticRadius(h, DesignConstants.AVATAR_IMAGE_RADIUS);
Image image = application.skinManager.getScaledFxSkinHead(
application.authService.getUsername(), (int) h.getFitWidth(), (int) h.getFitHeight());
if (image != null) h.setImage(image);
if (image != null) {
if(originalImage == null) {
originalImage = h.getImage();
}
h.setImage(image);
} else if(originalImage != null) {
h.setImage(originalImage);
}
} catch (Throwable e) {
LogHelper.warning("Skin head error");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ protected AbstractStage getCurrentStage() {

public void init() throws Exception {
layout = (Pane) LookupHelper.lookupIfPossible(getFxmlRoot(), "#layout").orElse(getFxmlRoot());
Rectangle rect = new Rectangle(layout.getPrefWidth(), layout.getPrefHeight());
rect.heightProperty().bind(layout.heightProperty());
rect.widthProperty().bind(layout.widthProperty());
rect.setArcHeight(15);
rect.setArcWidth(15);
layout.setClip(rect);
header = (Pane) LookupHelper.lookupIfPossible(layout, "#header").orElse(null);
sceneBaseInit();
super.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ public <T extends WebSocketEvent> void processing(Request<T> request, String tex
public void errorHandle(Throwable e) {
super.errorHandle(e);
contextHelper.runInFxThread(() -> {
enable();
authButton.setState(LoginAuthButtonComponent.AuthButtonState.ERROR);
});
}
Expand Down Expand Up @@ -344,10 +343,6 @@ public void onGetProfiles() {
(profiles) -> {
application.profilesService.setProfilesResult(profiles);
application.runtimeSettings.profiles = profiles.profiles;
for (ClientProfile profile : profiles.profiles) {
application.triggerManager
.process(profile, application.profilesService.getOptionalView(profile));
}
contextHelper.runInFxThread(() -> {
application.securityService.startRequest();
if (application.gui.optionsScene != null) {
Expand Down
Loading

0 comments on commit 41ec88a

Please sign in to comment.