From c513d00c50beb89509971784fe890a55ddf54286 Mon Sep 17 00:00:00 2001 From: Glavo Date: Tue, 25 Feb 2025 18:20:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=AF=E5=8A=A8=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=20(#3442)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update * update * update --- .../org/jackhuang/hmcl/ui/Controllers.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java index 44e208ac5..8f0c2f275 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java @@ -19,6 +19,10 @@ package org.jackhuang.hmcl.ui; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXDialogLayout; +import javafx.animation.Interpolator; +import javafx.animation.KeyFrame; +import javafx.animation.KeyValue; +import javafx.animation.Timeline; import javafx.beans.InvalidationListener; import javafx.beans.WeakInvalidationListener; import javafx.beans.property.DoubleProperty; @@ -34,6 +38,7 @@ import javafx.scene.paint.Color; import javafx.stage.Screen; import javafx.stage.Stage; import javafx.stage.StageStyle; +import javafx.util.Duration; import org.jackhuang.hmcl.Launcher; import org.jackhuang.hmcl.Metadata; import org.jackhuang.hmcl.game.ModpackHelper; @@ -42,8 +47,10 @@ import org.jackhuang.hmcl.setting.*; import org.jackhuang.hmcl.task.Task; import org.jackhuang.hmcl.task.TaskExecutor; import org.jackhuang.hmcl.ui.account.AccountListPage; +import org.jackhuang.hmcl.ui.animation.AnimationUtils; import org.jackhuang.hmcl.ui.construct.*; import org.jackhuang.hmcl.ui.construct.MessageDialogPane.MessageType; +import org.jackhuang.hmcl.ui.decorator.Decorator; import org.jackhuang.hmcl.ui.decorator.DecoratorController; import org.jackhuang.hmcl.ui.download.DownloadPage; import org.jackhuang.hmcl.ui.download.ModpackInstallWizardProvider; @@ -267,6 +274,24 @@ public final class Controllers { stage.initStyle(StageStyle.TRANSPARENT); stage.setScene(scene); + if (AnimationUtils.isAnimationEnabled() && !OperatingSystem.CURRENT_OS.isLinuxOrBSD()) { + Decorator node = decorator.getDecorator(); + Interpolator ease = Interpolator.SPLINE(0.25, 0.1, 0.25, 1); + Timeline timeline = new Timeline( + new KeyFrame(Duration.millis(0), + new KeyValue(node.opacityProperty(), 0, ease), + new KeyValue(node.scaleXProperty(), 0.3, ease), + new KeyValue(node.scaleYProperty(), 0.3, ease) + ), + new KeyFrame(Duration.millis(800), + new KeyValue(node.opacityProperty(), 1, ease), + new KeyValue(node.scaleXProperty(), 1, ease), + new KeyValue(node.scaleYProperty(), 1, ease) + ) + ); + timeline.play(); + } + if (!Architecture.SYSTEM_ARCH.isX86() && globalConfig().getPlatformPromptVersion() < 1) { Runnable continueAction = () -> globalConfig().setPlatformPromptVersion(1);