File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -56,14 +56,15 @@ export default class Dialog {
56
56
form . build ( 'ASK-NAME-CREATE-DIALOG' ) ;
57
57
58
58
// Events
59
+ popin . onClose = ( ) => form . element . destroy ( ) ;
60
+
59
61
popin . onButtonClick = id => {
60
62
if ( ! form . isValid ( ) )
61
63
return ;
62
64
63
65
resolve ( form . element . record [ 'Name' ] ) ;
64
66
65
- // Destroy
66
- form . element . destroy ( ) ;
67
+ // Close
67
68
popin . close ( ) ;
68
69
} ;
69
70
} ) ;
Original file line number Diff line number Diff line change @@ -270,9 +270,13 @@ export default class BehaviorGraphEditor extends EditorPlugin {
270
270
this . toolbar . element . right = `Attached to "${ node instanceof Scene ? 'Scene' : node . name } "` ;
271
271
this . toolbar . element . render ( ) ;
272
272
273
- // Unlock
273
+ // Unlock / lock
274
274
this . layout . unlockPanel ( 'left' ) ;
275
- this . layout . unlockPanel ( 'main' ) ;
275
+
276
+ if ( this . datas . metadatas . length === 0 )
277
+ this . layout . lockPanel ( 'main' , 'Please add a graph' ) ;
278
+ else
279
+ this . layout . unlockPanel ( 'main' ) ;
276
280
}
277
281
278
282
/**
@@ -320,6 +324,9 @@ export default class BehaviorGraphEditor extends EditorPlugin {
320
324
// Select latest script
321
325
this . grid . select ( [ this . datas . metadatas . length - 1 ] ) ;
322
326
this . selectGraph ( this . datas . metadatas . length - 1 ) ;
327
+
328
+ // Unlock
329
+ this . layout . unlockPanel ( 'main' ) ;
323
330
}
324
331
325
332
/**
@@ -334,6 +341,9 @@ export default class BehaviorGraphEditor extends EditorPlugin {
334
341
this . datas . metadatas . splice ( id - offset , 1 ) ;
335
342
offset ++ ;
336
343
} ) ;
344
+
345
+ // Update
346
+ this . objectSelected ( this . node ) ;
337
347
}
338
348
339
349
/**
You can’t perform that action at this time.
0 commit comments