owl-bt
Version:
owl-bt is editor for Behavior trees. It has been inspired by Unreal engine behavior trees in a way, that it supports special node items like decorators and services. This makes trees smaller and much more readable.
40 lines (33 loc) • 832 B
JavaScript
;
(function () {
class RedoCommand {
constructor(UndoRedoManager, RedoAction) {
this._UndoRedoManager = UndoRedoManager;
this._RedoAction = RedoAction;
}
canExec() {
return this._UndoRedoManager.hasRedo();
}
exec() {
if (this.canExec()) {
this._RedoAction.exec();
}
}
}
angular.module('editorApp')
.service('RedoCommand', RedoCommand)
.config(function (CommandPaletteCfgProvider, CommandTopMenuCfgProvider) {
CommandPaletteCfgProvider.addCommand({
service: 'RedoCommand',
name: 'core:Redo',
icon: 'repeat',
hotkey: 'mod+y'
});
CommandTopMenuCfgProvider.addMenuItem({
title: 'Redo',
section: 'Edit',
command: 'core:Redo',
order: 210
});
});
})();