Updated move folder behavior to better update the module and asset databases of changes

added dynamic reload on editor profiles when the theme is changed via editor
Adjusted direct filename fields to just be hidden, not disabled(avoids breaking legacy content)
Added ability to update asset references in a given folder path
Added WIP ability to scan for and update module dependencies
This commit is contained in:
Areloch 2019-12-08 15:54:37 -06:00
parent 2f16446031
commit c0d6cc36f5
8 changed files with 130 additions and 16 deletions

View file

@ -134,11 +134,60 @@ function AssetBrowser::deleteModule(%this)
}
function AssetBrowser::RefreshModuleDependencies(%this)
function AssetBrowser::RefreshModuleDependencies(%this, %moduleDef)
{
//Iterate through all our modules
//then, iterate through the module's assets
//if an asset has a module that isn't us, queue that into the dependencies list
//AssetBrowser.RefreshModuleDependencies(16823);
%modulePath = filePath(%moduleDef.ModuleFilePath);
%filePattern = "*.cs" TAB "*.taml" TAB "*.mis";
//First, wipe out any files inside the folder first
%file = makeFullPath(findFirstFileMultiExpr( %filePattern, true));
%fileObj = new FileObject();
%modulesList = ModuleDatabase.findModules(false);
new ArrayObject(moduleDepList);
while( %file !$= "" )
{
if(startsWith(%file, %modulePath))
{
if(%fileObj.openForRead(%file))
{
while( !%fileObj.isEOF() )
{
%line = %fileObj.readLine();
if(%line $= "")
continue;
for(%i=0; %i < getWordCount(%modulesList); %i++)
{
%moduleName = getWord(%modulesList, %i).moduleID;
//if(%moduleName $= %moduleDef.moduleID)
// continue;
%hasMatch = strIsMatchExpr( "*"@%moduleName@":*", %line );
if(%hasMatch)
{
moduleDepList.add(%moduleName);
}
}
}
}
}
%file = makeFullPath(findNextFileMultiExpr( %filePattern ));
}
%fileObj.delete();
}