Merge pull request #2680 from Card-Forge/newmaster2

Fix old theme Splashscreen and Logo
This commit is contained in:
Anthony Calosa
2023-03-14 19:06:22 +08:00
committed by GitHub
2 changed files with 7 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ public class FSkin {
public static Texture getLogo() { public static Texture getLogo() {
if (Forge.isMobileAdventureMode) if (Forge.isMobileAdventureMode)
return Forge.getAssets().getTexture(getDefaultSkinFile("adv_logo.png")); return Forge.getAssets().getTexture(getDefaultSkinFile("adv_logo.png"));
return Forge.getAssets().getTexture(getSkinFile("hd_logo.png")); return Forge.getAssets().getTexture(getSkinFile("hd_logo.png"), false);
} }
public static void changeSkin(final String skinName) { public static void changeSkin(final String skinName) {
@@ -150,7 +150,7 @@ public class FSkin {
Forge.getAssets().loadTexture(f2); Forge.getAssets().loadTexture(f2);
splashScreen.setSplashTexture(new TextureRegion(Forge.getAssets().getTexture(f2))); splashScreen.setSplashTexture(new TextureRegion(Forge.getAssets().getTexture(f2)));
} else { } else {
splashScreen.setSplashTexture(new TextureRegion(Forge.getAssets().getTexture(f2), 0, 0, w, h - 100)); splashScreen.setSplashTexture(new TextureRegion(Forge.getAssets().getTexture(f), 0, 0, w, h - 100));
} }
} }
Pixmap pxSplash = new Pixmap(f); Pixmap pxSplash = new Pixmap(f);

View File

@@ -202,8 +202,9 @@ public enum FSkinTexture implements FImage {
FileHandle preferredFile = isPlanechaseBG ? FSkin.getCachePlanechaseFile(filename) : FSkin.getSkinFile(filename); FileHandle preferredFile = isPlanechaseBG ? FSkin.getCachePlanechaseFile(filename) : FSkin.getSkinFile(filename);
if (preferredFile.exists()) { if (preferredFile.exists()) {
try { try {
texture = Forge.getAssets().getTexture(preferredFile); texture = Forge.getAssets().getTexture(preferredFile, false);
isloaded = true; if (texture != null)
isloaded = true;
} }
catch (final Exception e) { catch (final Exception e) {
System.err.println("Failed to load skin file: " + preferredFile); System.err.println("Failed to load skin file: " + preferredFile);
@@ -242,7 +243,8 @@ public enum FSkinTexture implements FImage {
} }
} }
if (repeat) { if (repeat) {
texture.setWrap(TextureWrap.Repeat, TextureWrap.Repeat); if (texture != null)
texture.setWrap(TextureWrap.Repeat, TextureWrap.Repeat);
} }
} }