Pixel-Composer/scripts/project_function/project_function.gml

26 lines
609 B
Plaintext
Raw Normal View History

2023-07-10 20:14:10 +02:00
/// @desc Function Description
/// @param {Struct.Project} project Description
2023-07-06 19:49:16 +02:00
function closeProject(project) {
2023-07-23 21:15:45 +02:00
//print($"Close {PROJECT.path}");
PROJECT.active = false;
2023-07-06 19:49:16 +02:00
array_remove(PROJECTS, project);
if(array_length(PROJECTS) == 0)
PROJECT = new Project();
var panels = findPanels("Panel_Graph");
for( var i = array_length(panels) - 1; i >= 0; i-- ) {
var panel = panels[i];
2023-07-23 21:15:45 +02:00
//print($" Check {panel.project.path}");
2023-07-06 19:49:16 +02:00
if(panel.project == project) {
panel.panel.remove(panel);
array_remove(panels, panel)
}
}
if(array_length(panels) == 0)
setPanel();
2023-07-10 20:14:10 +02:00
project.cleanup();
2023-07-06 19:49:16 +02:00
}