Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -370,10 +370,10 @@ public class PlacementFragment{
|
||||
line.add(stack.item.localizedName).maxWidth(140f).fillX().color(Color.lightGray).padLeft(2).left().get().setEllipsis(true);
|
||||
line.labelWrap(() -> {
|
||||
Building core = player.core();
|
||||
if(core == null || state.rules.infiniteResources) return "*/*";
|
||||
int stackamount = Math.round(stack.amount * state.rules.buildCostMultiplier);
|
||||
if(core == null || state.rules.infiniteResources) return "*/" + stackamount;
|
||||
|
||||
int amount = core.items.get(stack.item);
|
||||
int stackamount = Math.round(stack.amount * state.rules.buildCostMultiplier);
|
||||
String color = (amount < stackamount / 2f ? "[scarlet]" : amount < stackamount ? "[accent]" : "[white]");
|
||||
|
||||
return color + UI.formatAmount(amount) + "[white]/" + stackamount;
|
||||
|
||||
@@ -35,8 +35,7 @@ public class StatValues{
|
||||
}
|
||||
|
||||
public static String fixValue(float value){
|
||||
int precision = Math.abs((int)value - value) <= 0.001f ? 0 : Math.abs((int)(value * 10) - value * 10) <= 0.001f ? 1 : 2;
|
||||
return Strings.fixed(value, precision);
|
||||
return Strings.autoFixed(value, 2);
|
||||
}
|
||||
|
||||
public static StatValue squared(float value, StatUnit unit){
|
||||
|
||||
Reference in New Issue
Block a user