This commit is contained in:
Anuken
2020-08-18 13:09:12 -04:00
parent fffdd1ca86
commit 4d83221c76
7 changed files with 31 additions and 12 deletions

View File

@@ -84,7 +84,7 @@ public class Door extends Wall{
if(type == LAccess.enabled){
boolean shouldOpen = !Mathf.zero(p1);
if(open == shouldOpen || (Units.anyEntities(tile) && !shouldOpen) || !timer(timerToggle, 60f)){
if(open == shouldOpen || (Units.anyEntities(tile) && !shouldOpen) || !origin().timer(timerToggle, 60f)){
return;
}
@@ -92,6 +92,10 @@ public class Door extends Wall{
}
}
public DoorBuild origin(){
return chained.isEmpty() ? this : chained.first();
}
public void effect(){
(open ? closefx : openfx).at(this);
}
@@ -130,7 +134,7 @@ public class Door extends Wall{
@Override
public void tapped(Player player){
if((Units.anyEntities(tile) && open) || !timer(timerToggle, 40f)){
if((Units.anyEntities(tile) && open) || !origin().timer(timerToggle, 50f)){
return;
}

View File

@@ -43,12 +43,14 @@ public class LogicDisplay extends Block{
public void draw(){
super.draw();
if(buffer == null){
buffer = new FrameBuffer(displaySize, displaySize);
//clear the buffer - some OSs leave garbage in it
buffer.begin(Pal.darkerMetal);
buffer.end();
}
Draw.draw(Draw.z(), () -> {
if(buffer == null){
buffer = new FrameBuffer(displaySize, displaySize);
//clear the buffer - some OSs leave garbage in it
buffer.begin(Pal.darkerMetal);
buffer.end();
}
});
if(!commands.isEmpty()){
Draw.draw(Draw.z(), () -> {
@@ -86,7 +88,11 @@ public class LogicDisplay extends Block{
});
}
Draw.rect(Draw.wrap(buffer.getTexture()), x, y, buffer.getWidth() * Draw.scl, -buffer.getHeight() * Draw.scl);
Draw.draw(Draw.z(), () -> {
if(buffer != null){
Draw.rect(Draw.wrap(buffer.getTexture()), x, y, buffer.getWidth() * Draw.scl, -buffer.getHeight() * Draw.scl);
}
});
}
}

View File

@@ -39,5 +39,10 @@ public abstract class StorageBlock extends Block{
linkedCore.drawSelect();
}
}
@Override
public boolean canPickup(){
return linkedCore != null;
}
}
}