File tree Expand file tree Collapse file tree 6 files changed +25
-10
lines changed
Expand file tree Collapse file tree 6 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ namespace phasereditor2d.ide {
9797
9898 for ( const ext of exts ) {
9999
100- await ext . preload ( monitor ) ;
100+ await ext . compile ( monitor ) ;
101101 }
102102
103103 dlg . close ( ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,6 @@ namespace phasereditor2d.ide.core {
1212
1313 abstract getTotal ( ) : number ;
1414
15- abstract preload ( monitor : controls . IProgressMonitor ) ;
15+ abstract compile ( monitor : controls . IProgressMonitor ) : Promise < void > ;
1616 }
1717}
Original file line number Diff line number Diff line change @@ -2,6 +2,21 @@ namespace phasereditor2d.ide.core.code {
22
33 import io = colibri . core . io ;
44
5+ export function isLibraryFile ( file : io . FilePath ) {
6+
7+ if ( file . isRoot ( ) ) {
8+
9+ return false ;
10+ }
11+
12+ if ( file . getSibling ( "library.txt" ) ) {
13+
14+ return true ;
15+ }
16+
17+ return isLibraryFile ( file . getParent ( ) ) ;
18+ }
19+
520 export function isNodeModuleFile ( file : io . FilePath ) {
621
722 if ( file . isFolder ( ) && file . getName ( ) === "node_modules" ) {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ namespace phasereditor2d.scene.core.code {
3232 scene . destroyGame ( ) ;
3333 }
3434
35- async preload ( monitor : colibri . ui . controls . IProgressMonitor ) {
35+ async compile ( monitor : colibri . ui . controls . IProgressMonitor ) {
3636
3737 const files = this . getFiles ( ) ;
3838
Original file line number Diff line number Diff line change @@ -312,12 +312,12 @@ namespace phasereditor2d.scene.core.json {
312312 return this . _compFilename_Data_Map . get ( file . getFullName ( ) ) ;
313313 }
314314
315- getUserComponentsModels ( includeNodeModules = true ) {
315+ getUserComponentsModels ( includeLibraryFiles = true ) {
316316
317- if ( ! includeNodeModules ) {
317+ if ( ! includeLibraryFiles ) {
318318
319319 return this . _compModelsInfo
320- . filter ( info => ! ide . core . code . isNodeModuleFile ( info . file ) )
320+ . filter ( info => ! ide . core . code . isNodeModuleFile ( info . file ) && ! ide . core . code . isLibraryFile ( info . file ) )
321321 }
322322
323323 return this . _compModelsInfo ;
@@ -358,12 +358,12 @@ namespace phasereditor2d.scene.core.json {
358358 return null ;
359359 }
360360
361- getSceneFiles ( includeNodeModules = true ) {
361+ getSceneFiles ( includeLibraryFiles = true ) {
362362
363- if ( ! includeNodeModules ) {
363+ if ( ! includeLibraryFiles ) {
364364
365365 return this . _sceneFiles
366- . filter ( f => ! ide . core . code . isNodeModuleFile ( f ) )
366+ . filter ( f => ! ide . core . code . isNodeModuleFile ( f ) && ! ide . core . code . isLibraryFile ( f ) )
367367 }
368368
369369 return this . _sceneFiles ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ namespace phasereditor2d.scene.ui.editor.usercomponent {
99 return finder . getUserComponentsModels ( ) . length ;
1010 }
1111
12- async preload ( monitor : colibri . ui . controls . IProgressMonitor ) {
12+ async compile ( monitor : colibri . ui . controls . IProgressMonitor ) {
1313
1414 const finder = ScenePlugin . getInstance ( ) . getSceneFinder ( ) ;
1515
You can’t perform that action at this time.
0 commit comments