Welcome page
This commit is contained in:
@@ -99,6 +99,9 @@ public final class Config implements Cloneable {
|
|||||||
@SerializedName("logLines")
|
@SerializedName("logLines")
|
||||||
public final IntegerProperty logLines = new SimpleIntegerProperty(100);
|
public final IntegerProperty logLines = new SimpleIntegerProperty(100);
|
||||||
|
|
||||||
|
@SerializedName("firstLaunch")
|
||||||
|
public final BooleanProperty firstLaunch = new SimpleBooleanProperty(true);
|
||||||
|
|
||||||
public final ObservableList<AuthlibInjectorServer> authlibInjectorServers = FXCollections.observableArrayList();
|
public final ObservableList<AuthlibInjectorServer> authlibInjectorServers = FXCollections.observableArrayList();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ public class Settings {
|
|||||||
|
|
||||||
private final Map<String, Account> accounts = new ConcurrentHashMap<>();
|
private final Map<String, Account> accounts = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
private final boolean firstLaunch;
|
||||||
|
|
||||||
private Settings() {
|
private Settings() {
|
||||||
|
firstLaunch = SETTINGS.firstLaunch.get();
|
||||||
|
|
||||||
loadProxy();
|
loadProxy();
|
||||||
|
|
||||||
for (Iterator<Map<Object, Object>> iterator = SETTINGS.accounts.iterator(); iterator.hasNext();) {
|
for (Iterator<Map<Object, Object>> iterator = SETTINGS.accounts.iterator(); iterator.hasNext();) {
|
||||||
@@ -140,6 +144,7 @@ public class Settings {
|
|||||||
public void save() {
|
public void save() {
|
||||||
try {
|
try {
|
||||||
SETTINGS.accounts.clear();
|
SETTINGS.accounts.clear();
|
||||||
|
SETTINGS.firstLaunch.set(false);
|
||||||
for (Account account : accounts.values()) {
|
for (Account account : accounts.values()) {
|
||||||
Map<Object, Object> storage = account.toStorage();
|
Map<Object, Object> storage = account.toStorage();
|
||||||
storage.put("type", Accounts.getAccountType(account));
|
storage.put("type", Accounts.getAccountType(account));
|
||||||
@@ -152,6 +157,10 @@ public class Settings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFirstLaunch() {
|
||||||
|
return firstLaunch;
|
||||||
|
}
|
||||||
|
|
||||||
private final StringProperty commonPath = new ImmediateStringProperty(this, "commonPath", SETTINGS.commonDirectory.get()) {
|
private final StringProperty commonPath = new ImmediateStringProperty(this, "commonPath", SETTINGS.commonDirectory.get()) {
|
||||||
@Override
|
@Override
|
||||||
public void invalidated() {
|
public void invalidated() {
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ import com.jfoenix.controls.JFXDialog;
|
|||||||
import com.jfoenix.controls.JFXDrawer;
|
import com.jfoenix.controls.JFXDrawer;
|
||||||
import com.jfoenix.controls.JFXHamburger;
|
import com.jfoenix.controls.JFXHamburger;
|
||||||
import com.jfoenix.svg.SVGGlyph;
|
import com.jfoenix.svg.SVGGlyph;
|
||||||
|
import javafx.animation.Interpolator;
|
||||||
|
import javafx.animation.KeyFrame;
|
||||||
|
import javafx.animation.KeyValue;
|
||||||
|
import javafx.animation.Timeline;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
@@ -38,6 +42,7 @@ import javafx.scene.Node;
|
|||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.Tooltip;
|
import javafx.scene.control.Tooltip;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
import javafx.scene.input.MouseEvent;
|
import javafx.scene.input.MouseEvent;
|
||||||
import javafx.scene.layout.*;
|
import javafx.scene.layout.*;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
@@ -45,6 +50,7 @@ import javafx.scene.shape.Rectangle;
|
|||||||
import javafx.stage.Screen;
|
import javafx.stage.Screen;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import javafx.stage.StageStyle;
|
import javafx.stage.StageStyle;
|
||||||
|
import javafx.util.Duration;
|
||||||
import org.jackhuang.hmcl.Launcher;
|
import org.jackhuang.hmcl.Launcher;
|
||||||
import org.jackhuang.hmcl.setting.EnumBackgroundImage;
|
import org.jackhuang.hmcl.setting.EnumBackgroundImage;
|
||||||
import org.jackhuang.hmcl.setting.Settings;
|
import org.jackhuang.hmcl.setting.Settings;
|
||||||
@@ -129,6 +135,8 @@ public final class Decorator extends StackPane implements TaskExecutorDialogWiza
|
|||||||
private JFXButton btnClose;
|
private JFXButton btnClose;
|
||||||
@FXML
|
@FXML
|
||||||
private HBox navLeft;
|
private HBox navLeft;
|
||||||
|
@FXML
|
||||||
|
private ImageView welcomeView;
|
||||||
|
|
||||||
public Decorator(Stage primaryStage, Node mainPage, String title) {
|
public Decorator(Stage primaryStage, Node mainPage, String title) {
|
||||||
this(primaryStage, mainPage, title, true, true);
|
this(primaryStage, mainPage, title, true, true);
|
||||||
@@ -172,6 +180,19 @@ public final class Decorator extends StackPane implements TaskExecutorDialogWiza
|
|||||||
dialog.setDialogContainer(drawerWrapper);
|
dialog.setDialogContainer(drawerWrapper);
|
||||||
dialog.setContent(dialogPane);
|
dialog.setContent(dialogPane);
|
||||||
|
|
||||||
|
welcomeView.setCursor(Cursor.HAND);
|
||||||
|
welcomeView.setOnMouseClicked(e -> {
|
||||||
|
Timeline nowAnimation = new Timeline();
|
||||||
|
nowAnimation.getKeyFrames().addAll(
|
||||||
|
new KeyFrame(Duration.ZERO, new KeyValue(welcomeView.opacityProperty(), 1.0D, Interpolator.EASE_BOTH)),
|
||||||
|
new KeyFrame(new Duration(300), new KeyValue(welcomeView.opacityProperty(), 0.0D, Interpolator.EASE_BOTH)),
|
||||||
|
new KeyFrame(new Duration(300), e2 -> drawerWrapper.getChildren().remove(welcomeView))
|
||||||
|
);
|
||||||
|
nowAnimation.play();
|
||||||
|
});
|
||||||
|
if (!Settings.INSTANCE.isFirstLaunch())
|
||||||
|
drawerWrapper.getChildren().remove(welcomeView);
|
||||||
|
|
||||||
if (!min) buttonsContainer.getChildren().remove(btnMin);
|
if (!min) buttonsContainer.getChildren().remove(btnMin);
|
||||||
if (!max) buttonsContainer.getChildren().remove(btnMax);
|
if (!max) buttonsContainer.getChildren().remove(btnMax);
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
<?import org.jackhuang.hmcl.ui.construct.AdvancedListBox?>
|
<?import org.jackhuang.hmcl.ui.construct.AdvancedListBox?>
|
||||||
<?import org.jackhuang.hmcl.ui.FXUtils?>
|
<?import org.jackhuang.hmcl.ui.FXUtils?>
|
||||||
<?import java.lang.String?>
|
<?import java.lang.String?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
<fx:root xmlns="http://javafx.com/javafx"
|
<fx:root xmlns="http://javafx.com/javafx"
|
||||||
type="StackPane"
|
type="StackPane"
|
||||||
xmlns:fx="http://javafx.com/fxml">
|
xmlns:fx="http://javafx.com/fxml">
|
||||||
@@ -44,6 +46,9 @@
|
|||||||
</StackPane>
|
</StackPane>
|
||||||
</center>
|
</center>
|
||||||
</BorderPane>
|
</BorderPane>
|
||||||
|
<ImageView fx:id="welcomeView">
|
||||||
|
<Image url="/assets/img/HMCL.png" />
|
||||||
|
</ImageView>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
</center>
|
</center>
|
||||||
<top>
|
<top>
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ message.unknown=Unknown
|
|||||||
|
|
||||||
|
|
||||||
modpack=Mod pack
|
modpack=Mod pack
|
||||||
modpack.choose=Choose a modpack zip file which you want to import. If you want to update the modpack, please enter the version you want to update.
|
modpack.choose=Choose a modpack zip file which you want to install.
|
||||||
modpack.desc=Describe your modpack, including precautions, changlog, supporting Markdown(also supporting online pictures).
|
modpack.desc=Describe your modpack, including precautions, changlog, supporting Markdown(also supporting online pictures).
|
||||||
modpack.enter_name=Enter your desired name for this game.
|
modpack.enter_name=Enter your desired name for this game.
|
||||||
modpack.export=Export Modpack
|
modpack.export=Export Modpack
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ message.unknown=未知
|
|||||||
|
|
||||||
|
|
||||||
modpack=整合包
|
modpack=整合包
|
||||||
modpack.choose=选择要导入的游戏整合包文件,如果您希望更新整合包,请输入要更新的版本名
|
modpack.choose=选择要安装的游戏整合包文件
|
||||||
modpack.desc=描述你要制作的整合包,比如整合包注意事项和更新记录,支持 Markdown(图片请用网络图)。
|
modpack.desc=描述你要制作的整合包,比如整合包注意事项和更新记录,支持 Markdown(图片请用网络图)。
|
||||||
modpack.enter_name=给游戏起个你喜欢的名字
|
modpack.enter_name=给游戏起个你喜欢的名字
|
||||||
modpack.export=导出整合包
|
modpack.export=导出整合包
|
||||||
|
|||||||
Reference in New Issue
Block a user