Color custom blocks that are performing an operation.

This commit is contained in:
Sergio Martínez Portela 2020-05-28 18:04:48 +02:00
parent ceee0db011
commit f456b75030

View File

@ -411,6 +411,9 @@ public class ProgramakerCustomBlockPart implements Part {
if (pulseOutput != null) { if (pulseOutput != null) {
pulseOutput.send(new Signal()); pulseOutput.send(new Signal());
} }
// Notify screen that there's updates
this._partGrid.update();
} }
private void freeBlock(String token) { private void freeBlock(String token) {
@ -511,11 +514,18 @@ public class ProgramakerCustomBlockPart implements Part {
return; // Logic block, don't show on user-mode return; // Logic block, don't show on user-mode
} }
boolean operationInProgress = this.token != null;
drawConnectors(canvas); drawConnectors(canvas);
drawWires(canvas, devMode); drawWires(canvas, devMode);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
if (operationInProgress) {
paint.setColor(Color.YELLOW);
}
else {
paint.setColor(Color.WHITE); paint.setColor(Color.WHITE);
}
canvas.drawRect( canvas.drawRect(
new Rect(get_left(), get_top(), new Rect(get_left(), get_top(),
get_right(), get_bottom()), get_right(), get_bottom()),