Adds ability to delete a module

This commit is contained in:
Areloch 2020-12-03 00:15:24 -06:00
parent 80eb4ab2ba
commit 941cfb6d40

View file

@ -194,7 +194,31 @@ function AssetBrowser::reloadModule(%this)
function AssetBrowser::deleteModule(%this)
{
%moduleDef = ModuleDatabase.findModule(AssetBrowser.selectedModule, 1);
toolsMessageBoxYesNo("Delete Module?",
"This will permanently delete the module " @ %moduleDef.moduleId @ " and all it's contents. <br><br> Do you wish to continue?",
"AssetBrowser.doDeleteModule();",
"");
}
function AssetBrowser::doDeleteModule(%this)
{
//First, get the module path
%moduleDef = ModuleDatabase.findModule(AssetBrowser.selectedModule, 1);
%modulePath = %moduleDef.ModulePath;
//Next, unregister the module
ModuleDatabase.unregisterModule(AssetBrowser.SelectedModule, 1);
//Then, delete it
%this.deleteFolder(%modulePath);
//Remove the module def
%moduleDef.delete();
//And refresh the browser
%this.loadDirectories();
}
function AssetBrowser::RefreshModuleDependencies(%this, %moduleDef)