mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-02-12 10:59:23 +00:00
added special logic for cutters so they remove overlays of empty outputs, and added clearing overlays on clear items
This commit is contained in:
parent
6ba12f094f
commit
07c703f7d6
@ -52,6 +52,7 @@ export class ItemEjectorComponent extends Component {
|
|||||||
clear() {
|
clear() {
|
||||||
for (const slot of this.slots) {
|
for (const slot of this.slots) {
|
||||||
slot.item = null;
|
slot.item = null;
|
||||||
|
slot.lastItem = null;
|
||||||
slot.progress = 0;
|
slot.progress = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -334,16 +334,21 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
|||||||
|
|
||||||
const cutDefinitions = this.root.shapeDefinitionMgr.shapeActionCutHalf(inputDefinition);
|
const cutDefinitions = this.root.shapeDefinitionMgr.shapeActionCutHalf(inputDefinition);
|
||||||
|
|
||||||
|
const ejectorComp = payload.entity.components.ItemEjector;
|
||||||
for (let i = 0; i < cutDefinitions.length; ++i) {
|
for (let i = 0; i < cutDefinitions.length; ++i) {
|
||||||
const definition = cutDefinitions[i];
|
const definition = cutDefinitions[i];
|
||||||
if (!definition.isEntirelyEmpty()) {
|
|
||||||
|
if (definition.isEntirelyEmpty()) {
|
||||||
|
ejectorComp.slots[i].lastItem = null;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
payload.outItems.push({
|
payload.outItems.push({
|
||||||
item: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(definition),
|
item: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(definition),
|
||||||
requiredSlot: i,
|
requiredSlot: i,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ProcessorImplementationPayload} payload
|
* @param {ProcessorImplementationPayload} payload
|
||||||
@ -355,16 +360,21 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
|||||||
|
|
||||||
const cutDefinitions = this.root.shapeDefinitionMgr.shapeActionCutQuad(inputDefinition);
|
const cutDefinitions = this.root.shapeDefinitionMgr.shapeActionCutQuad(inputDefinition);
|
||||||
|
|
||||||
|
const ejectorComp = payload.entity.components.ItemEjector;
|
||||||
for (let i = 0; i < cutDefinitions.length; ++i) {
|
for (let i = 0; i < cutDefinitions.length; ++i) {
|
||||||
const definition = cutDefinitions[i];
|
const definition = cutDefinitions[i];
|
||||||
if (!definition.isEntirelyEmpty()) {
|
|
||||||
|
if (definition.isEntirelyEmpty()) {
|
||||||
|
ejectorComp.slots[i].lastItem = null;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
payload.outItems.push({
|
payload.outItems.push({
|
||||||
item: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(definition),
|
item: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(definition),
|
||||||
requiredSlot: i,
|
requiredSlot: i,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ProcessorImplementationPayload} payload
|
* @param {ProcessorImplementationPayload} payload
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user