|
|
|
@ -9,17 +9,17 @@ export class AutoCuttingReactor
|
|
|
|
|
{
|
|
|
|
|
this.Enable = userConfig.openAutoCuttingReactor;
|
|
|
|
|
|
|
|
|
|
const cuttingCommands = ["draw", "DD", "左右侧板", "立板", "层板", "背板", "DOOR", "购买模块并插入", "插入模块", "DRAWER"];
|
|
|
|
|
const cuttingCommands = new Set(["draw", "DD", "左右侧板", "立板", "层板", "背板", "DOOR", "购买模块并插入", "插入模块", "DRAWER"]);
|
|
|
|
|
|
|
|
|
|
app.CommandReactor.OnCommandEnd((cmdName, changeObjects, createObjects) =>
|
|
|
|
|
{
|
|
|
|
|
if (!this.Enable) return;
|
|
|
|
|
|
|
|
|
|
if (!cuttingCommands.includes(cmdName)) return;
|
|
|
|
|
if (!cuttingCommands.has(cmdName)) return;
|
|
|
|
|
|
|
|
|
|
let brs = createObjects.filter(o => !o.IsErase && o instanceof Board) as Board[];
|
|
|
|
|
|
|
|
|
|
if (cmdName !== "插入模块" && cmdName !== "购买模块并插入")
|
|
|
|
|
if (cmdName !== "插入模块" && cmdName !== "购买模块并插入" && cmdName !== "DRAWER")
|
|
|
|
|
if (brs.length > 10)
|
|
|
|
|
{
|
|
|
|
|
app.Editor.Prompt("复制的板件超过10个,取消触发切割反应器!");
|
|
|
|
|