From 54345572703d0821bd5a844c58328e655f98d23d Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 12 Sep 2024 16:17:10 -0400 Subject: [PATCH] v2.5.1: fixed split alch guide not updating in various cases --- .../shatteredpixeldungeon/scenes/AlchemyScene.java | 14 +++++++++++++- .../shatteredpixeldungeon/windows/WndJournal.java | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java index c88ed93d2..e5429bf95 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/AlchemyScene.java @@ -107,6 +107,7 @@ public class AlchemyScene extends PixelScene { private boolean energyAddBlinking = false; private static boolean splitAlchGuide = false; + private WndJournal.AlchemyTab alchGuide = null; private static int centerW; private static final int BTN_SIZE = 28; @@ -190,7 +191,7 @@ public class AlchemyScene extends PixelScene { guideBG.x = Camera.main.width - left - guideBG.width(); add(guideBG); - WndJournal.AlchemyTab alchGuide = new WndJournal.AlchemyTab(); + alchGuide = new WndJournal.AlchemyTab(); add(alchGuide); alchGuide.setRect(guideBG.x + guideBG.marginLeft(), guideBG.y + guideBG.marginTop(), @@ -648,6 +649,10 @@ public class AlchemyScene extends PixelScene { energyAddBlinking = promptToAddEnergy; + if (alchGuide != null){ + alchGuide.updateList(); + } + } private void combine( int slot ){ @@ -721,6 +726,10 @@ public class AlchemyScene extends PixelScene { } } } + + if (alchGuide != null){ + alchGuide.updateList(); + } } public void craftItem( ArrayList ingredients, Item result ){ @@ -819,6 +828,9 @@ public class AlchemyScene extends PixelScene { } cancel.enable(false); repeat.enable(lastRecipe != null); + if (alchGuide != null){ + alchGuide.updateList(); + } } public void createEnergy(){ 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 4bcea1cd7..096e025e2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java @@ -363,7 +363,7 @@ public class WndJournal extends WndTabbed { updateList(); } - private void updateList() { + public void updateList() { if (currentPageIdx != -1 && !Document.ALCHEMY_GUIDE.isPageFound(currentPageIdx)){ currentPageIdx = -1;