Skip to content

Commit fe809ad

Browse files
authored
Fix #4860: 播放动画时将 ListPageBase 缓存为位图 (#4862)
1 parent 78a78f4 commit fe809ad

5 files changed

Lines changed: 6 additions & 9 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/ui/ListPageBase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
import javafx.event.Event;
2424
import javafx.event.EventHandler;
2525
import javafx.scene.control.Control;
26+
import org.jackhuang.hmcl.ui.animation.TransitionPane;
2627

2728
import static org.jackhuang.hmcl.ui.construct.SpinnerPane.FAILED_ACTION;
2829

29-
public class ListPageBase<T> extends Control {
30+
public class ListPageBase<T> extends Control implements TransitionPane.Cacheable {
3031
private final ListProperty<T> items = new SimpleListProperty<>(this, "items", FXCollections.observableArrayList());
3132
private final BooleanProperty loading = new SimpleBooleanProperty(this, "loading", false);
3233
private final StringProperty failedReason = new SimpleStringProperty(this, "failed");

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/InstallerListPage.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.jackhuang.hmcl.task.TaskExecutor;
3030
import org.jackhuang.hmcl.task.TaskListener;
3131
import org.jackhuang.hmcl.ui.*;
32-
import org.jackhuang.hmcl.ui.animation.TransitionPane;
3332
import org.jackhuang.hmcl.ui.download.UpdateInstallerWizardProvider;
3433
import org.jackhuang.hmcl.util.TaskCancellationAction;
3534
import org.jackhuang.hmcl.util.io.FileUtils;
@@ -43,7 +42,7 @@
4342
import static org.jackhuang.hmcl.ui.FXUtils.runInFX;
4443
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
4544

46-
public class InstallerListPage extends ListPageBase<InstallerItem> implements VersionPage.VersionLoadable, TransitionPane.Cacheable {
45+
public class InstallerListPage extends ListPageBase<InstallerItem> implements VersionPage.VersionLoadable {
4746
private Profile profile;
4847
private String versionId;
4948
private Version version;

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.jackhuang.hmcl.ui.Controllers;
3535
import org.jackhuang.hmcl.ui.FXUtils;
3636
import org.jackhuang.hmcl.ui.ListPageBase;
37-
import org.jackhuang.hmcl.ui.animation.TransitionPane;
3837
import org.jackhuang.hmcl.ui.construct.MessageDialogPane;
3938
import org.jackhuang.hmcl.ui.construct.PageAware;
4039
import org.jackhuang.hmcl.util.TaskCancellationAction;
@@ -50,7 +49,7 @@
5049
import static org.jackhuang.hmcl.util.logging.Logger.LOG;
5150
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
5251

53-
public final class ModListPage extends ListPageBase<ModListPageSkin.ModInfoObject> implements VersionPage.VersionLoadable, PageAware, TransitionPane.Cacheable {
52+
public final class ModListPage extends ListPageBase<ModListPageSkin.ModInfoObject> implements VersionPage.VersionLoadable, PageAware {
5453
private final BooleanProperty modded = new SimpleBooleanProperty(this, "modded", false);
5554

5655
private final ReentrantLock lock = new ReentrantLock();

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.jackhuang.hmcl.task.Schedulers;
3838
import org.jackhuang.hmcl.task.Task;
3939
import org.jackhuang.hmcl.ui.*;
40-
import org.jackhuang.hmcl.ui.animation.TransitionPane;
4140
import org.jackhuang.hmcl.ui.construct.*;
4241
import org.jackhuang.hmcl.util.Lang;
4342
import org.jackhuang.hmcl.util.StringUtils;
@@ -61,7 +60,7 @@
6160
/**
6261
* @author Glavo
6362
*/
64-
public final class SchematicsPage extends ListPageBase<SchematicsPage.Item> implements VersionPage.VersionLoadable, TransitionPane.Cacheable {
63+
public final class SchematicsPage extends ListPageBase<SchematicsPage.Item> implements VersionPage.VersionLoadable {
6564

6665
private static String translateAuthorName(String author) {
6766
if (I18n.isUseChinese() && "hsds".equals(author)) {

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListPage.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.jackhuang.hmcl.task.Schedulers;
2828
import org.jackhuang.hmcl.task.Task;
2929
import org.jackhuang.hmcl.ui.*;
30-
import org.jackhuang.hmcl.ui.animation.TransitionPane;
3130
import org.jackhuang.hmcl.util.io.FileUtils;
3231

3332
import java.io.IOException;
@@ -42,7 +41,7 @@
4241
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
4342
import static org.jackhuang.hmcl.util.logging.Logger.LOG;
4443

45-
public final class WorldListPage extends ListPageBase<WorldListItem> implements VersionPage.VersionLoadable, TransitionPane.Cacheable {
44+
public final class WorldListPage extends ListPageBase<WorldListItem> implements VersionPage.VersionLoadable {
4645
private final BooleanProperty showAll = new SimpleBooleanProperty(this, "showAll", false);
4746

4847
private Path savesDir;

0 commit comments

Comments
 (0)