Fixed various rounding errors in database

This commit is contained in:
Anuken
2021-01-18 18:04:16 -05:00
parent 83a4f56679
commit 82f8e78ec8
5 changed files with 7 additions and 7 deletions

View File

@@ -23,10 +23,10 @@ public class LiquidDisplay extends Table{
if(amount != 0){
Table t = new Table().left().bottom();
t.add(Strings.autoFixed(amount, 1)).style(Styles.outlineLabel);
t.add(Strings.autoFixed(amount, 2)).style(Styles.outlineLabel);
add(t);
}
}}).size(8 * 4).padRight(3 + (amount != 0 && Strings.autoFixed(amount, 1).length() > 2 ? 8 : 0));
}}).size(8 * 4).padRight(3 + (amount != 0 && Strings.autoFixed(amount, 2).length() > 2 ? 8 : 0));
if(perSecond){
add(StatUnit.perSecond.localized()).padLeft(2).padRight(5).color(Color.lightGray).style(Styles.outlineLabel);

View File

@@ -59,11 +59,11 @@ public class AmmoListValue<T extends UnlockableContent> implements StatValue{
}
if(!Mathf.equal(type.reloadMultiplier, 1f)){
sep(bt, Core.bundle.format("bullet.reload", Strings.fixed(type.reloadMultiplier, 1)));
sep(bt, Core.bundle.format("bullet.reload", Strings.autoFixed(type.reloadMultiplier, 2)));
}
if(type.knockback > 0){
sep(bt, Core.bundle.format("bullet.knockback", Strings.fixed(type.knockback, 1)));
sep(bt, Core.bundle.format("bullet.knockback", Strings.autoFixed(type.knockback, 2)));
}
if(type.healPercent > 0f){

View File

@@ -40,7 +40,7 @@ public class BoosterListValue implements StatValue{
float reloadRate = (baseReload ? 1f : 0f) + maxUsed * multiplier * liquid.heatCapacity;
float standardReload = baseReload ? reload : reload / (maxUsed * multiplier * 0.4f);
float result = standardReload / (reload / reloadRate);
bt.add(Core.bundle.format("bullet.reload", Strings.fixed(result, 1)));
bt.add(Core.bundle.format("bullet.reload", Strings.autoFixed(result, 2)));
}).left().padTop(-9);
c.row();
}

View File

@@ -39,7 +39,7 @@ public class WeaponListValue implements StatValue{
if(weapon.inaccuracy > 0){
sep(w, "[lightgray]" + Stat.inaccuracy.localized() + ": [white]" + (int)weapon.inaccuracy + " " + StatUnit.degrees.localized());
}
sep(w, "[lightgray]" + Stat.reload.localized() + ": " + (weapon.mirror ? "2x " : "") + "[white]" + Strings.autoFixed(60f / weapon.reload * weapon.shots, 1));
sep(w, "[lightgray]" + Stat.reload.localized() + ": " + (weapon.mirror ? "2x " : "") + "[white]" + Strings.autoFixed(60f / weapon.reload * weapon.shots, 2));
var bullet = new AmmoListValue<UnitType>(OrderedMap.of(unit, weapon.bullet));
bullet.display(w);