v0.4.0: refactor to artifact level display
This commit is contained in:
parent
e2cc778129
commit
eab9c65911
|
@ -345,8 +345,8 @@ public class Item implements Bundlable {
|
|||
|
||||
String name = name();
|
||||
|
||||
if (levelKnown && level != 0)
|
||||
name = Messages.format( TXT_TO_STRING_LVL, name, level );
|
||||
if (visiblyUpgraded() != 0)
|
||||
name = Messages.format( TXT_TO_STRING_LVL, name, visiblyUpgraded() );
|
||||
|
||||
if (quantity > 1)
|
||||
name = Messages.format( TXT_TO_STRING_X, name, quantity );
|
||||
|
|
|
@ -113,7 +113,7 @@ public class Artifact extends KindofMisc {
|
|||
|
||||
@Override
|
||||
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
|
||||
|
@ -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
|
||||
public String status() {
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user