v0.4.0: refactor to artifact level display

This commit is contained in:
Evan Debenham 2016-06-11 17:57:53 -04:00 committed by Evan Debenham
parent e2cc778129
commit eab9c65911
2 changed files with 3 additions and 13 deletions

View File

@ -345,8 +345,8 @@ public class Item implements Bundlable {
String name = name(); String name = name();
if (levelKnown && level != 0) if (visiblyUpgraded() != 0)
name = Messages.format( TXT_TO_STRING_LVL, name, level ); name = Messages.format( TXT_TO_STRING_LVL, name, visiblyUpgraded() );
if (quantity > 1) if (quantity > 1)
name = Messages.format( TXT_TO_STRING_X, name, quantity ); name = Messages.format( TXT_TO_STRING_X, name, quantity );

View File

@ -113,7 +113,7 @@ public class Artifact extends KindofMisc {
@Override @Override
public int visiblyUpgraded() { public int visiblyUpgraded() {
return ((level()*10)/levelCap); return levelKnown ? Math.round((level()*10)/(float)levelCap): 0;
} }
//transfers upgrades from another artifact, transfer level will equal the displayed level //transfers upgrades from another artifact, transfer level will equal the displayed level
@ -134,16 +134,6 @@ public class Artifact extends KindofMisc {
} }
} }
@Override
public String toString() {
if (levelKnown && level()/levelCap != 0) {
return Messages.format( TXT_TO_STRING_LVL, name(), visiblyUpgraded() );
} else {
return name();
}
}
@Override @Override
public String status() { public String status() {