mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 23:06:07 -04:00
load welcome.png only when necessary
This saves ~200ms startup time.
This commit is contained in:
parent
c329f1cafb
commit
0d2e287f67
@ -72,7 +72,6 @@ public class DecoratorController {
|
|||||||
private static final String PROPERTY_DIALOG_CLOSE_HANDLER = DecoratorController.class.getName() + ".dialog.closeListener";
|
private static final String PROPERTY_DIALOG_CLOSE_HANDLER = DecoratorController.class.getName() + ".dialog.closeListener";
|
||||||
|
|
||||||
private final Decorator decorator;
|
private final Decorator decorator;
|
||||||
private final ImageView welcomeView;
|
|
||||||
private final Navigator navigator;
|
private final Navigator navigator;
|
||||||
|
|
||||||
private JFXDialog dialog;
|
private JFXDialog dialog;
|
||||||
@ -91,7 +90,10 @@ public class DecoratorController {
|
|||||||
decorator.onBackNavButtonActionProperty().set(e -> back());
|
decorator.onBackNavButtonActionProperty().set(e -> back());
|
||||||
decorator.onRefreshNavButtonActionProperty().set(e -> refresh());
|
decorator.onRefreshNavButtonActionProperty().set(e -> refresh());
|
||||||
|
|
||||||
welcomeView = new ImageView();
|
if (switchedToNewUI()) {
|
||||||
|
if (config().getLocalization().getLocale() == Locale.CHINA) {
|
||||||
|
// currently, user guide is only available in Chinese
|
||||||
|
ImageView welcomeView = new ImageView();
|
||||||
welcomeView.setImage(newImage("/assets/img/welcome.png"));
|
welcomeView.setImage(newImage("/assets/img/welcome.png"));
|
||||||
welcomeView.setCursor(Cursor.HAND);
|
welcomeView.setCursor(Cursor.HAND);
|
||||||
FXUtils.limitSize(welcomeView, 796, 517);
|
FXUtils.limitSize(welcomeView, 796, 517);
|
||||||
@ -104,10 +106,6 @@ public class DecoratorController {
|
|||||||
);
|
);
|
||||||
nowAnimation.play();
|
nowAnimation.play();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (switchedToNewUI()) {
|
|
||||||
if (config().getLocalization().getLocale() == Locale.CHINA) {
|
|
||||||
// currently, user guide is only available in Chinese
|
|
||||||
decorator.getContainer().setAll(welcomeView);
|
decorator.getContainer().setAll(welcomeView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user