mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 14:36:13 +01:00
29 lines
No EOL
631 B
Text
29 lines
No EOL
631 B
Text
function closeProject(project) {
|
|
//print($"Close {PROJECT.path}");
|
|
|
|
project.active = false;
|
|
array_remove(PROJECTS, project);
|
|
if(array_length(PROJECTS) == 0) {
|
|
PROJECT = new Project();
|
|
PROJECTS = [ PROJECT ];
|
|
}
|
|
|
|
var panels = findPanels("Panel_Graph");
|
|
|
|
for( var i = array_length(panels) - 1; i >= 0; i-- ) {
|
|
var panel = panels[i];
|
|
//print($" Check {panel.project.path}");
|
|
if(panel.project != project)
|
|
continue;
|
|
|
|
if(array_length(panels) == 1) {
|
|
panel.setProject(PROJECT);
|
|
panel.onFocusBegin();
|
|
} else {
|
|
panel.panel.remove(panel);
|
|
array_remove(panels, panel);
|
|
}
|
|
}
|
|
|
|
project.cleanup();
|
|
} |