From 7fbb1ff83a5af2937acb87044ad90522d2e039b8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 30 Sep 2020 19:37:38 -0400 Subject: [PATCH] v0.9.0: fixed hero select talents showing as levelled up in some cases --- .../shatteredpixeldungeon/ui/TalentButton.java | 4 ++-- .../shatteredpixeldungeon/windows/WndInfoTalent.java | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TalentButton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TalentButton.java index 4d166694f..4d6bfd2ae 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TalentButton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/TalentButton.java @@ -108,14 +108,14 @@ public class TalentButton extends Button { && Dungeon.hero != null && Dungeon.hero.talentPointsAvailable() > 0 && Dungeon.hero.pointsInTalent(talent) < talent.maxPoints()){ - ShatteredPixelDungeon.scene().addToFront(new WndInfoTalent(talent, new Callback() { + ShatteredPixelDungeon.scene().addToFront(new WndInfoTalent(talent, pointsInTalent, new Callback() { @Override public void call() { upgradeTalent(); } })); } else { - ShatteredPixelDungeon.scene().addToFront(new WndInfoTalent(talent, null)); + ShatteredPixelDungeon.scene().addToFront(new WndInfoTalent(talent, pointsInTalent, null)); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoTalent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoTalent.java index 6a8f720a1..807c70aab 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoTalent.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoTalent.java @@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.windows; import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; @@ -44,7 +43,7 @@ public class WndInfoTalent extends Window { private SmartTexture icons; private TextureFilm film; - public WndInfoTalent(Talent talent, Callback onUpgradeButton){ + public WndInfoTalent(Talent talent, int points, Callback onUpgradeButton){ super(); IconTitle titlebar = new IconTitle(); @@ -57,8 +56,8 @@ public class WndInfoTalent extends Window { titlebar.icon( buffIcon ); String title = Messages.titleCase(talent.title()); - if (Dungeon.hero != null && Dungeon.hero.pointsInTalent(talent) > 0){ - title += " +" + Dungeon.hero.pointsInTalent(talent); + if (points > 0){ + title += " +" + points; } titlebar.label( title, Window.TITLE_COLOR ); titlebar.setRect( 0, 0, WIDTH, 0 );