Merge pull request #1287 from kevlahnota/master

fix black texture on card list view
This commit is contained in:
Anthony Calosa
2022-08-07 22:20:53 +08:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@@ -328,6 +328,9 @@ public class Forge implements ApplicationListener {
altZoneTabs = true;
//pixl cursor for adventure
setCursor(null, "0");
loadAdventureResources(true);
}
private static void loadAdventureResources(boolean startScene) {
try {
if(!adventureLoaded)
{
@@ -336,7 +339,8 @@ public class Forge implements ApplicationListener {
}
adventureLoaded=true;
}
switchScene(SceneType.StartScene.instance);
if (startScene)
switchScene(SceneType.StartScene.instance);
} catch (Exception e) {
e.printStackTrace();
}
@@ -362,6 +366,10 @@ public class Forge implements ApplicationListener {
//load Drafts
preloadBoosterDrafts();
FThreads.invokeInEdtLater(() -> {
if (selector.equals("Adventure")) {
//preload adventure resources to speedup startup if selector is adventure. Needs in edt when setting up worldstage
loadAdventureResources(false);
}
//selection transition
setTransitionScreen(new TransitionScreen(() -> {
if (selector.equals("Classic")) {
@@ -944,10 +952,10 @@ public class Forge implements ApplicationListener {
@Override
public void dispose() {
if (currentScreen != null) {
FOverlay.hideAll();
currentScreen.onClose(null);
currentScreen = null;
}
FOverlay.hideAll();
assets.dispose();
Dscreens.clear();
graphics.dispose();

View File

@@ -327,6 +327,7 @@ public class ImageCache {
syncQ.clear();
cardsLoaded.clear();
counter = 0;
CardRenderer.clearcardArtCache();
} catch (Exception e) {
//e.printStackTrace();
} finally {