This commit is contained in:
Anuken
2019-03-31 18:20:38 -04:00
parent de0235ad94
commit 6b70418861
32 changed files with 227 additions and 253 deletions

View File

@@ -192,7 +192,7 @@ public class PlacementFragment extends Fragment{
topTable.table(header -> {
header.left();
header.add(new Image(lastDisplay.icon(Icon.medium))).size(8 * 4);
header.labelWrap(() -> !unlocked(lastDisplay) ? Core.bundle.get("blocks.unknown") : lastDisplay.localizedName)
header.labelWrap(() -> !unlocked(lastDisplay) ? Core.bundle.get("block.unknown") : lastDisplay.localizedName)
.left().width(190f).padLeft(5);
header.add().growX();
if(unlocked(lastDisplay)){

View File

@@ -413,19 +413,19 @@ public class Block extends BlockStorage{
}else{
current = entity -> entity.liquids.current();
}
bars.add("liquid", entity -> new Bar(() -> entity.liquids.get(current.get(entity)) <= 0.001f ? Core.bundle.get("blocks.liquid") : current.get(entity).localizedName(), () -> current.get(entity).color, () -> entity.liquids.get(current.get(entity)) / liquidCapacity));
bars.add("liquid", entity -> new Bar(() -> entity.liquids.get(current.get(entity)) <= 0.001f ? Core.bundle.get("bar.liquid") : current.get(entity).localizedName(), () -> current.get(entity).color, () -> entity.liquids.get(current.get(entity)) / liquidCapacity));
}
if(hasPower && consumes.hasPower()){
boolean buffered = consumes.getPower().isBuffered;
float capacity = consumes.getPower().powerCapacity;
bars.add("power", entity -> new Bar(() -> buffered ? Core.bundle.format("blocks.powerbalance", Float.isNaN(entity.power.satisfaction * capacity) ? "<ERROR>" : (int)(entity.power.satisfaction * capacity)) :
Core.bundle.get("blocks.power"), () -> Pal.powerBar, () -> entity.power.satisfaction));
bars.add("power", entity -> new Bar(() -> buffered ? Core.bundle.format("bar.powerbalance", Float.isNaN(entity.power.satisfaction * capacity) ? "<ERROR>" : (int)(entity.power.satisfaction * capacity)) :
Core.bundle.get("bar.power"), () -> Pal.powerBar, () -> entity.power.satisfaction));
}
if(hasItems && configurable){
bars.add("items", entity -> new Bar(() -> Core.bundle.format("blocks.items", entity.items.total()), () -> Pal.items, () -> (float)entity.items.total() / itemCapacity));
bars.add("items", entity -> new Bar(() -> Core.bundle.format("bar.items", entity.items.total()), () -> Pal.items, () -> (float)entity.items.total() / itemCapacity));
}
}

View File

@@ -52,7 +52,7 @@ public class ImpactReactor extends PowerGenerator{
super.setBars();
bars.add("poweroutput", entity -> new Bar(() ->
Core.bundle.format("blocks.poweroutput",
Core.bundle.format("bar.poweroutput",
Strings.fixed(Math.max(entity.tile.block().getPowerProduction(entity.tile) - consumes.getPower().powerPerTick, 0)*60 * entity.delta(), 1)),
() -> Pal.powerBar,
() -> ((GeneratorEntity)entity).productionEfficiency));

View File

@@ -73,7 +73,7 @@ public class NuclearReactor extends PowerGenerator{
@Override
public void setBars(){
super.setBars();
bars.add("heat", entity -> new Bar("blocks.heat", Pal.lightOrange, () -> ((NuclearReactorEntity)entity).heat));
bars.add("heat", entity -> new Bar("bar.heat", Pal.lightOrange, () -> ((NuclearReactorEntity)entity).heat));
}
@Override

View File

@@ -39,7 +39,7 @@ public class PowerGenerator extends PowerDistributor{
if(hasPower && outputsPower && !consumes.hasPower()){
bars.add("power", entity -> new Bar(() ->
Core.bundle.format("blocks.poweroutput",
Core.bundle.format("bar.poweroutput",
Strings.fixed(entity.tile.block().getPowerProduction(entity.tile)*60 * entity.timeScale, 1)),
() -> Pal.powerBar,
() -> ((GeneratorEntity)entity).productionEfficiency));

View File

@@ -92,7 +92,7 @@ public class PowerNode extends PowerBlock{
public void setBars(){
super.setBars();
bars.add("power", entity -> new Bar(() ->
Core.bundle.format("blocks.powerbalance",
Core.bundle.format("bar.powerbalance",
((entity.power.graph.getPowerBalance() >= 0 ? "+" : "") + Strings.fixed(entity.power.graph.getPowerBalance()*60, 1))),
() -> Pal.powerBar,
() -> Mathf.clamp(entity.power.graph.getPowerProduced() / entity.power.graph.getPowerNeeded())));

View File

@@ -28,7 +28,7 @@ public class ThermalGenerator extends PowerGenerator{
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
drawPlaceText(Core.bundle.formatFloat("blocks.efficiency", sumAttribute(Attribute.heat, x, y)*100, 1), x, y, valid);
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", sumAttribute(Attribute.heat, x, y)*100, 1), x, y, valid);
}
@Override

View File

@@ -53,7 +53,7 @@ public class Cultivator extends GenericCrafter{
public void setBars(){
super.setBars();
bars.add("multiplier", entity -> new Bar(() ->
Core.bundle.formatFloat("blocks.efficiency",
Core.bundle.formatFloat("bar.efficiency",
((((CultivatorEntity)entity).boost + 1f) * ((CultivatorEntity)entity).warmup)*100f,1),
() -> Pal.ammo,
() -> ((CultivatorEntity)entity).warmup));
@@ -61,7 +61,7 @@ public class Cultivator extends GenericCrafter{
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
drawPlaceText(Core.bundle.formatFloat("blocks.efficiency", (1+sumAttribute(Attribute.spores, x, y))*100, 1), x, y, valid);
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", (1+sumAttribute(Attribute.spores, x, y))*100, 1), x, y, valid);
}
@Override

View File

@@ -79,7 +79,7 @@ public class Drill extends Block{
bars.add("drillspeed", e -> {
DrillEntity entity = (DrillEntity)e;
return new Bar(() -> Core.bundle.format("blocks.outputspeed", Strings.fixed(entity.lastDrillSpeed * 60 * entity.timeScale, 2)), () -> Pal.ammo, () -> entity.warmup);
return new Bar(() -> Core.bundle.format("bar.drillspeed", Strings.fixed(entity.lastDrillSpeed * 60 * entity.timeScale, 2)), () -> Pal.ammo, () -> entity.warmup);
});
}

View File

@@ -42,7 +42,7 @@ public class SolidPump extends Pump{
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
if(attribute != null){
drawPlaceText(Core.bundle.formatFloat("blocks.efficiency", (sumAttribute(attribute, x, y) + 1f)*100, 1), x, y, valid);
drawPlaceText(Core.bundle.formatFloat("bar.efficiency", (sumAttribute(attribute, x, y) + 1f)*100, 1), x, y, valid);
}
}
@@ -50,7 +50,7 @@ public class SolidPump extends Pump{
public void setBars(){
super.setBars();
bars.add("efficiency", entity -> new Bar(() ->
Core.bundle.formatFloat("blocks.efficiency",
Core.bundle.formatFloat("bar.efficiency",
((((SolidPumpEntity)entity).boost + 1f) * ((SolidPumpEntity)entity).warmup) * 100, 1),
() -> Pal.ammo,
() -> ((SolidPumpEntity)entity).warmup));

View File

@@ -101,8 +101,8 @@ public class UnitFactory extends Block{
@Override
public void setBars(){
super.setBars();
bars.add("progress", entity -> new Bar("blocks.progress", Pal.ammo, () -> ((UnitFactoryEntity)entity).buildTime / produceTime));
bars.add("spawned", entity -> new Bar(() -> Core.bundle.format("blocks.spawned", ((UnitFactoryEntity)entity).spawned, maxSpawn), () -> Pal.command, () -> (float)((UnitFactoryEntity)entity).spawned / maxSpawn));
bars.add("progress", entity -> new Bar("bar.progress", Pal.ammo, () -> ((UnitFactoryEntity)entity).buildTime / produceTime));
bars.add("spawned", entity -> new Bar(() -> Core.bundle.format("bar.spawned", ((UnitFactoryEntity)entity).spawned, maxSpawn), () -> Pal.command, () -> (float)((UnitFactoryEntity)entity).spawned / maxSpawn));
}
@Override

View File

@@ -21,7 +21,6 @@ public enum BlockStat{
powerRange(StatCategory.power),
basePowerGeneration(StatCategory.power),
liquidUse(StatCategory.crafting),
input(StatCategory.crafting),
output(StatCategory.crafting),
productionTime(StatCategory.crafting),

View File

@@ -18,7 +18,6 @@ public enum StatUnit{
seconds,
perSecond,
timesSpeed(false),
timesRadius(false),
percent(false),
none,
items;