|
|
|
@ -11,6 +11,8 @@ export interface Command
|
|
|
|
|
* 这些命令没有历史记录,但如果不增加约束,可能会破坏历史
|
|
|
|
|
*/
|
|
|
|
|
NoHistory?: boolean;
|
|
|
|
|
//透明命令,透明命令没有历史记录,也不占用命令状态,也无视命令状态.
|
|
|
|
|
Transparency?: boolean;
|
|
|
|
|
exec: Function;//函数可以返回true,实现放弃命令的任何操作.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -31,6 +33,13 @@ class CommandMachine
|
|
|
|
|
app.Editor.CommandStore.historyCmdList.push(cmdName);
|
|
|
|
|
|
|
|
|
|
let cmd = this.CommandMap.get(cmdName);
|
|
|
|
|
if (cmd.Transparency)
|
|
|
|
|
{
|
|
|
|
|
await cmd.exec();
|
|
|
|
|
app.Editor.UpdateScreen();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.CommandStart(cmdName, cmd.NoHistory);
|
|
|
|
|
app.Editor.SelectCtrl.RestState();
|
|
|
|
|
let abort: boolean = true;
|
|
|
|
|