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.
32 lines (28 loc) • 871 B
JavaScript
;
(function () {
function ItemBasePropertyEditorCtrl(TreeSelection, SetTreeNodeItemBasePropertyValueAction) {
function propertyAccessor(property, isSet, value) {
let item = TreeSelection.selItem();
if (item) {
if (isSet) {
SetTreeNodeItemBasePropertyValueAction.exec({
node: TreeSelection.selNode(),
nodeItem: item,
property: property,
value: value,
});
} else {
return item[property];
}
}
}
this.comment = function (value) {
return propertyAccessor('comment', arguments.length, value);
};
this.label = function (value) {
return propertyAccessor('label', arguments.length, value);
};
}
angular.module('editorApp')
.controller('ItemBasePropertyEditorCtrl', ItemBasePropertyEditorCtrl)
})();