From c5e6f056ce5863eefed8ecdc245f4189fa89c5dd Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 6 Apr 2022 18:24:37 -0400 Subject: [PATCH] v1.2.2: fixed hero info stats tab not updating with talent changes --- .../shatteredpixeldungeon/windows/WndHero.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndHero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndHero.java index 0bcde4e20..25f72e18c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndHero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndHero.java @@ -43,6 +43,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.TalentsPane; import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.watabou.gltextures.SmartTexture; import com.watabou.gltextures.TextureCache; +import com.watabou.noosa.Gizmo; import com.watabou.noosa.Group; import com.watabou.noosa.Image; import com.watabou.noosa.TextureFilm; @@ -83,7 +84,12 @@ public class WndHero extends WndTabbed { add( new IconTab( Icons.get(Icons.RANKINGS) ) { protected void select( boolean value ) { super.select( value ); - if (selected) lastIdx = 0; + if (selected) { + lastIdx = 0; + if (!stats.visible) { + stats.initialize(); + } + } stats.visible = stats.active = selected; } } ); @@ -126,6 +132,15 @@ public class WndHero extends WndTabbed { private float pos; public StatsTab() { + initialize(); + } + + public void initialize(){ + + for (Gizmo g : members){ + if (g != null) g.destroy(); + } + clear(); Hero hero = Dungeon.hero;