v0.9.0: fixed hero select talents showing as levelled up in some cases

This commit is contained in:
Evan Debenham
2020-09-30 19:37:38 -04:00
parent 0e79bc2592
commit 7fbb1ff83a
2 changed files with 5 additions and 6 deletions
@@ -108,14 +108,14 @@ public class TalentButton extends Button {
&& Dungeon.hero != null && Dungeon.hero != null
&& Dungeon.hero.talentPointsAvailable() > 0 && Dungeon.hero.talentPointsAvailable() > 0
&& Dungeon.hero.pointsInTalent(talent) < talent.maxPoints()){ && Dungeon.hero.pointsInTalent(talent) < talent.maxPoints()){
ShatteredPixelDungeon.scene().addToFront(new WndInfoTalent(talent, new Callback() { ShatteredPixelDungeon.scene().addToFront(new WndInfoTalent(talent, pointsInTalent, new Callback() {
@Override @Override
public void call() { public void call() {
upgradeTalent(); upgradeTalent();
} }
})); }));
} else { } else {
ShatteredPixelDungeon.scene().addToFront(new WndInfoTalent(talent, null)); ShatteredPixelDungeon.scene().addToFront(new WndInfoTalent(talent, pointsInTalent, null));
} }
} }
@@ -22,7 +22,6 @@
package com.shatteredpixel.shatteredpixeldungeon.windows; package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
@@ -44,7 +43,7 @@ public class WndInfoTalent extends Window {
private SmartTexture icons; private SmartTexture icons;
private TextureFilm film; private TextureFilm film;
public WndInfoTalent(Talent talent, Callback onUpgradeButton){ public WndInfoTalent(Talent talent, int points, Callback onUpgradeButton){
super(); super();
IconTitle titlebar = new IconTitle(); IconTitle titlebar = new IconTitle();
@@ -57,8 +56,8 @@ public class WndInfoTalent extends Window {
titlebar.icon( buffIcon ); titlebar.icon( buffIcon );
String title = Messages.titleCase(talent.title()); String title = Messages.titleCase(talent.title());
if (Dungeon.hero != null && Dungeon.hero.pointsInTalent(talent) > 0){ if (points > 0){
title += " +" + Dungeon.hero.pointsInTalent(talent); title += " +" + points;
} }
titlebar.label( title, Window.TITLE_COLOR ); titlebar.label( title, Window.TITLE_COLOR );
titlebar.setRect( 0, 0, WIDTH, 0 ); titlebar.setRect( 0, 0, WIDTH, 0 );