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:
committed by
GitHub
parent
e714d44a0e
commit
d84a36b8ee
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.world.blocks.experimental;
|
package mindustry.world.blocks.experimental;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
@@ -46,7 +47,7 @@ public class BlockLoader extends PayloadAcceptor{
|
|||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.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
|
@Override
|
||||||
|
|||||||
@@ -54,11 +54,6 @@ public class BlockUnloader extends BlockLoader{
|
|||||||
return items.total() >= itemCapacity;
|
return items.total() >= itemCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public float fraction(){
|
|
||||||
return payload == null ? 0f : 1f - payload.build.items.total() / (float)payload.build.block.itemCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldExport(){
|
public boolean shouldExport(){
|
||||||
return payload != null && (payload.block().hasItems && payload.build.items.empty());
|
return payload != null && (payload.block().hasItems && payload.build.items.empty());
|
||||||
|
|||||||
Reference in New Issue
Block a user