From d1c2d87d55c47fdb9f16c447d94e9cf7fba4025a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 21 Aug 2024 11:10:13 -0400 Subject: [PATCH] v2.5.0: fixed some visual errors in new catalogs --- .../shatteredpixeldungeon/items/potions/Potion.java | 4 ++++ .../shatteredpixeldungeon/items/rings/Ring.java | 4 ++++ .../shatteredpixeldungeon/items/scrolls/Scroll.java | 4 ++++ .../shatteredpixeldungeon/scenes/JournalScene.java | 7 +++++++ .../shatteredpixeldungeon/windows/WndJournal.java | 2 +- 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java index baa59e7d4..2c8ade946 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java @@ -149,6 +149,10 @@ public class Potion extends Item { public static void initColors() { handler = new ItemStatusHandler<>( (Class[])Generator.Category.POTION.classes, colors ); } + + public static void clearColors() { + handler = null; + } public static void save( Bundle bundle ) { handler.save( bundle ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java index 5f7442fb8..7535e832c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java @@ -76,6 +76,10 @@ public class Ring extends KindofMisc { public static void initGems() { handler = new ItemStatusHandler<>( (Class[])Generator.Category.RING.classes, gems ); } + + public static void clearGems(){ + handler = null; + } public static void save( Bundle bundle ) { handler.save( bundle ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java index 4e9ac899d..d8b31cf99 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java @@ -104,6 +104,10 @@ public abstract class Scroll extends Item { public static void initLabels() { handler = new ItemStatusHandler<>( (Class[])Generator.Category.SCROLL.classes, runes ); } + + public static void clearLabels(){ + handler = null; + } public static void save( Bundle bundle ) { handler.save( bundle ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/JournalScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/JournalScene.java index 0f5cd1ac9..21d16ff0f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/JournalScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/JournalScene.java @@ -26,6 +26,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Chrome; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.journal.Journal; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; @@ -57,6 +60,10 @@ public class JournalScene extends PixelScene { Badges.loadGlobal(); Journal.loadGlobal(); + Potion.clearColors(); + Scroll.clearLabels(); + Ring.clearGems(); + Music.INSTANCE.playTracks( new String[]{Assets.Music.THEME_1, Assets.Music.THEME_2}, new float[]{1, 1}, diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java index 07ebd28e3..bb4e94954 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java @@ -926,7 +926,7 @@ public class WndJournal extends WndTabbed { } else { icon.lightness(0f); title = "???"; - desc = Messages.get(CatalogTab.class, "not_seen_trap"); + desc = Messages.get(CatalogTab.class, "not_seen_plant"); } }