File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ definition([
1919 many(art()),
2020])
2121
22- // copy to project
2322// art ffset save message / input size
2423// autozoom based on sprite size for sprites tab
2524
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ import { workspace } from '#store/workspace';
55import { Button } from '#ui' ;
66import { selectTab } from '#components/layout/model' ;
77
8- // TODO: set focused obejct
9-
108export const File = observer ( ( ) => {
119 return (
1210 < >
Original file line number Diff line number Diff line change 11import { remote } from 'electron' ;
22import { toJS } from 'mobx' ;
33import { uuid } from '#util/uuid' ;
4+ import { selectTab } from '#components/layout/model' ;
5+ import { workspace } from '#store/workspace' ;
46const { getCurrentWindow, Menu, MenuItem } = remote ;
57
68export default function ( node ) {
@@ -10,16 +12,26 @@ export default function(node) {
1012 label : node . name ,
1113 enabled : false ,
1214 } ) ) ;
15+ const type = node . isDirectory ? 'folder' : 'object' ;
16+ if ( ! node . isDirectory ) {
17+ menu . append ( new MenuItem ( {
18+ label : 'copy to file menu' ,
19+ click : ( ) => {
20+ Object . assign ( workspace . file , toJS ( node . ref ) ) ;
21+ selectTab ( 'File' ) ;
22+ } ,
23+ } ) ) ;
24+ }
1325 menu . append ( new MenuItem ( {
14- label : 'copy' ,
26+ label : 'copy ' + type ,
1527 click : ( ) => {
1628 const clone = toJS ( node . parent [ index ] ) ;
1729 clone . uuid = uuid ( ) ;
1830 node . parent . splice ( index , 0 , clone ) ;
1931 } ,
2032 } ) ) ;
2133 menu . append ( new MenuItem ( {
22- label : 'delete' ,
34+ label : 'delete ' + type ,
2335 submenu : [
2436 new MenuItem ( {
2537 label : 'confirm' ,
You can’t perform that action at this time.
0 commit comments