Block loader/unloader progress bar changes (#4138)

* Change block loader/unloader progess bar color & bundle

ammo -> items

* Make block unloader bar go down
This commit is contained in:
Patrick 'Quezler' Mounier 2020-12-28 16:44:59 +01:00 committed by GitHub
parent e714d44a0e
commit d84a36b8ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -1,5 +1,6 @@
package mindustry.world.blocks.experimental;
import arc.*;
import arc.graphics.g2d.*;
import arc.util.*;
import mindustry.entities.units.*;
@ -46,7 +47,7 @@ public class BlockLoader extends PayloadAcceptor{
public void setBars(){
super.setBars();
bars.add("progress", entity -> new Bar("bar.progress", Pal.ammo, ((BlockLoaderBuild)entity)::fraction));
bars.add("progress", (BlockLoaderBuild entity) -> new Bar(() -> Core.bundle.format("bar.items", entity.payload == null ? 0 : entity.payload.build.items.total()), () -> Pal.items, entity::fraction));
}
@Override

View file

@ -54,11 +54,6 @@ public class BlockUnloader extends BlockLoader{
return items.total() >= itemCapacity;
}
@Override
public float fraction(){
return payload == null ? 0f : 1f - payload.build.items.total() / (float)payload.build.block.itemCapacity;
}
@Override
public boolean shouldExport(){
return payload != null && (payload.block().hasItems && payload.build.items.empty());