mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-02-12 02:49:20 +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() {
|
||||
for (const slot of this.slots) {
|
||||
slot.item = null;
|
||||
slot.lastItem = null;
|
||||
slot.progress = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -334,14 +334,19 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
||||
|
||||
const cutDefinitions = this.root.shapeDefinitionMgr.shapeActionCutHalf(inputDefinition);
|
||||
|
||||
const ejectorComp = payload.entity.components.ItemEjector;
|
||||
for (let i = 0; i < cutDefinitions.length; ++i) {
|
||||
const definition = cutDefinitions[i];
|
||||
if (!definition.isEntirelyEmpty()) {
|
||||
payload.outItems.push({
|
||||
item: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(definition),
|
||||
requiredSlot: i,
|
||||
});
|
||||
|
||||
if (definition.isEntirelyEmpty()) {
|
||||
ejectorComp.slots[i].lastItem = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
payload.outItems.push({
|
||||
item: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(definition),
|
||||
requiredSlot: i,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -355,14 +360,19 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
||||
|
||||
const cutDefinitions = this.root.shapeDefinitionMgr.shapeActionCutQuad(inputDefinition);
|
||||
|
||||
const ejectorComp = payload.entity.components.ItemEjector;
|
||||
for (let i = 0; i < cutDefinitions.length; ++i) {
|
||||
const definition = cutDefinitions[i];
|
||||
if (!definition.isEntirelyEmpty()) {
|
||||
payload.outItems.push({
|
||||
item: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(definition),
|
||||
requiredSlot: i,
|
||||
});
|
||||
|
||||
if (definition.isEntirelyEmpty()) {
|
||||
ejectorComp.slots[i].lastItem = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
payload.outItems.push({
|
||||
item: this.root.shapeDefinitionMgr.getShapeItemFromDefinition(definition),
|
||||
requiredSlot: i,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user