fix server reload

This commit is contained in:
zhandouxiaojiji committed 2021-03-16 17:42:19 +08:00
1 parent dbc3b2099a
commit faf1116038
4 files changed
+17 -5

No files matched your search

+3 -2
View File
@@ -1,6 +1,6 @@
{
"name": "behavior3editor",
"version": "0.1.4",
"version": "0.1.9",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -1274,7 +1274,8 @@
"version": "3.0.1",
"resolved": "https://registry.npm.taobao.org/boolean/download/boolean-3.0.1.tgz",
"integrity": "sha1-NezytKLuGRsLRJhvFOtfBSpcu08=",
"dev": true
"dev": true,
"optional": true
},
"boxen": {
"version": "4.2.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "behavior3editor",
"version": "0.1.9",
"version": "0.1.10",
"description": "行为树编辑器",
"main": "./dist/main.js",
"scripts": {
+11 -1
View File
@@ -365,8 +365,18 @@ export default class Editor extends React.Component<EditorProps, EditorState> {
this.graph.layout();
this.graph.fitCenter();
this.graph.set("animate", true);
}
return treeModel;
getTreeModel() {
const { filepath } = this.props;
const data = this.graph.findDataById("1") as GraphNodeModel;
this.autoId = Utils.refreshNodeId(data);
const root = Utils.createFileData(data);
return {
name: path.basename(filepath).slice(0, -5),
root,
desc: this.treeModel.desc,
} as BehaviorTreeModel;
}
copyNode() {
+2 -1
View File
@@ -92,7 +92,8 @@ export default class TreeTabs extends Component<TreeTabsProps, TreeTabsState> {
for (let k in this.editors) {
let editor = this.editors[k];
if (editor) {
trees.push(editor.save());
editor.save();
trees.push(editor.getTreeModel());
}
}
return trees;