v0.3.4: moved some functionality from Utils in prep for removing it.
This commit is contained in:
@@ -34,8 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Artifact extends KindofMisc {
|
||||
|
||||
private static final float TIME_TO_EQUIP = 1f;
|
||||
@@ -204,15 +202,15 @@ public class Artifact extends KindofMisc {
|
||||
|
||||
if (levelKnown && level()/levelCap != 0) {
|
||||
if (chargeCap > 0) {
|
||||
return Utils.format( TXT_TO_STRING_LVL_CHARGE, name(), visiblyUpgraded(), charge, chargeCap );
|
||||
return Messages.format( TXT_TO_STRING_LVL_CHARGE, name(), visiblyUpgraded(), charge, chargeCap );
|
||||
} else {
|
||||
return Utils.format( TXT_TO_STRING_LVL, name(), visiblyUpgraded() );
|
||||
return Messages.format( TXT_TO_STRING_LVL, name(), visiblyUpgraded() );
|
||||
}
|
||||
} else {
|
||||
if (chargeCap > 0) {
|
||||
return Utils.format( TXT_TO_STRING_CHARGE, name(), charge, chargeCap );
|
||||
return Messages.format( TXT_TO_STRING_CHARGE, name(), charge, chargeCap );
|
||||
} else {
|
||||
return Utils.format( TXT_TO_STRING, name() );
|
||||
return Messages.format( TXT_TO_STRING, name() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,20 +220,20 @@ public class Artifact extends KindofMisc {
|
||||
|
||||
//display the current cooldown
|
||||
if (cooldown != 0)
|
||||
return Utils.format( "%d", cooldown );
|
||||
return Messages.format( "%d", cooldown );
|
||||
|
||||
//display as percent
|
||||
if (chargeCap == 100)
|
||||
return Utils.format( "%d%%", charge );
|
||||
return Messages.format( "%d%%", charge );
|
||||
|
||||
//display as #/#
|
||||
if (chargeCap > 0)
|
||||
return Utils.format( "%d/%d", charge, chargeCap );
|
||||
return Messages.format( "%d/%d", charge, chargeCap );
|
||||
|
||||
//if there's no cap -
|
||||
//- but there is charge anyway, display that charge
|
||||
if (charge != 0)
|
||||
return Utils.format( "%d", charge );
|
||||
return Messages.format( "%d", charge );
|
||||
|
||||
//otherwise, if there's no charge, return null.
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user