mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-27 23:11:12 -08:00
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:
parent
e714d44a0e
commit
d84a36b8ee
2 changed files with 2 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue