From 5830f5db397602dc69f7b90c62bf25cf52fe7eca Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 14 Mar 2024 13:19:40 -0400 Subject: [PATCH] v2.4.0: improved how the game handles loading hero splash arts --- .../shatteredpixeldungeon/scenes/HeroSelectScene.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java index a0c4c4fb3..129fe3095 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java @@ -91,7 +91,7 @@ public class HeroSelectScene extends PixelScene { Badges.loadGlobal(); Journal.loadGlobal(); - background = new Image(HeroClass.WARRIOR.splashArt()){ + background = new Image(TextureCache.createSolid(0xFF2d2f31), 0, 0, 800, 450){ @Override public void update() { if (GamesInProgress.selectedClass != null) { @@ -105,7 +105,6 @@ public class HeroSelectScene extends PixelScene { } }; background.scale.set(Camera.main.height/background.height); - background.tint(0x2d2f31, 1f); background.x = (Camera.main.width - background.width())/2f; background.y = (Camera.main.height - background.height())/2f; @@ -376,7 +375,13 @@ public class HeroSelectScene extends PixelScene { private void setSelectedHero(HeroClass cl){ GamesInProgress.selectedClass = cl; - background.texture( cl.splashArt() ); + try { + //loading these big jpgs fails sometimes, so we have a catch for it + background.texture(cl.splashArt()); + } catch (Exception e){ + background.texture(TextureCache.createSolid(0xFF2d2f31)); + background.frame(0, 0, 800, 450); + } background.visible = true; background.hardlight(1.5f,1.5f,1.5f);