Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -2055,6 +2055,7 @@ public class Blocks implements ContentList{
|
||||
|
||||
//TODO remove
|
||||
launchPadLarge = new LaunchPad("launch-pad-large"){{
|
||||
requirements(Category.effect, BuildVisibility.debugOnly, ItemStack.with(Items.titanium, 200, Items.silicon, 150, Items.lead, 250, Items.plastanium, 75));
|
||||
size = 4;
|
||||
itemCapacity = 300;
|
||||
launchTime = 60f * 35;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mindustry.world.blocks.experimental;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.util.*;
|
||||
import mindustry.entities.units.*;
|
||||
@@ -46,12 +47,13 @@ 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
|
||||
public void drawRequestRegion(BuildPlan req, Eachable<BuildPlan> list){
|
||||
Draw.rect(region, req.drawx(), req.drawy());
|
||||
Draw.rect(inRegion, req.drawx(), req.drawy(), req.rotation * 90);
|
||||
Draw.rect(outRegion, req.drawx(), req.drawy(), req.rotation * 90);
|
||||
Draw.rect(topRegion, req.drawx(), req.drawy());
|
||||
}
|
||||
@@ -76,11 +78,14 @@ public class BlockLoader extends PayloadAcceptor{
|
||||
Draw.rect(region, x, y);
|
||||
|
||||
//draw input
|
||||
boolean fallback = true;
|
||||
for(int i = 0; i < 4; i++){
|
||||
if(blends(i) && i != rotation){
|
||||
Draw.rect(inRegion, x, y, (i * 90) - 180);
|
||||
fallback = false;
|
||||
}
|
||||
}
|
||||
if(fallback) Draw.rect(inRegion, x, y, rotation * 90);
|
||||
|
||||
Draw.rect(outRegion, x, y, rotdeg());
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -33,6 +33,7 @@ public class Reconstructor extends UnitBlock{
|
||||
@Override
|
||||
public void drawRequestRegion(BuildPlan req, Eachable<BuildPlan> list){
|
||||
Draw.rect(region, req.drawx(), req.drawy());
|
||||
Draw.rect(inRegion, req.drawx(), req.drawy(), req.rotation * 90);
|
||||
Draw.rect(outRegion, req.drawx(), req.drawy(), req.rotation * 90);
|
||||
Draw.rect(topRegion, req.drawx(), req.drawy());
|
||||
}
|
||||
@@ -127,11 +128,14 @@ public class Reconstructor extends UnitBlock{
|
||||
Draw.rect(region, x, y);
|
||||
|
||||
//draw input
|
||||
boolean fallback = true;
|
||||
for(int i = 0; i < 4; i++){
|
||||
if(blends(i) && i != rotation){
|
||||
Draw.rect(inRegion, x, y, (i * 90) - 180);
|
||||
fallback = false;
|
||||
}
|
||||
}
|
||||
if(fallback) Draw.rect(inRegion, x, y, rotation * 90);
|
||||
|
||||
Draw.rect(outRegion, x, y, rotdeg());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user