Added D3D error code interpreter

Added sanity check for findMatch
Finished most of asset importer logic to utilize settings system
Cleaned up code for finding associated files
Added General importer settings category and integrated logic for those settings fields
Updated logic in variableGroup to support callbacks in custom fields
Updated logic in variableInspector to better handle callbacks, as well as being able to manually update when manipulating fields
Updated scripts to utilize project settings values for playGUI and mainMenuGUI names
Improved module-oriented loading of materials
Added util function for populating custom fonts
This commit is contained in:
Areloch 2019-08-12 01:04:17 -05:00
parent 02262b014a
commit ab9fc302fc
19 changed files with 620 additions and 598 deletions

View file

@ -54,6 +54,11 @@ function initServer()
$Server::MissionFileSpec = "data/levels/*.mis";
callOnModules("initServer");
//Maybe this should be a pref for better per-project control
//But many physically based/gameplay things utilize materials being detected
//So we'll load on the server as well
loadModuleMaterials();
}
//-----------------------------------------------------------------------------

View file

@ -33,27 +33,8 @@ function isScriptFile(%path)
function loadMaterials()
{
// Load any materials files for which we only have DSOs.
for( %file = findFirstFile( "*/materials.cs.dso" );
%file !$= "";
%file = findNextFile( "*/materials.cs.dso" ))
{
// Only execute, if we don't have the source file.
%csFileName = getSubStr( %file, 0, strlen( %file ) - 4 );
if( !isFile( %csFileName ) )
exec( %csFileName );
}
// Load all source material files.
for( %file = findFirstFile( "*/materials.cs" );
%file !$= "";
%file = findNextFile( "*/materials.cs" ))
{
exec( %file );
}
loadModuleMaterials();
// Load all materials created by the material editor if
// the folder exists
if( IsDirectory( "materialEditor" ) )
@ -251,7 +232,7 @@ function validateDatablockName(%name)
%name = strreplace( %name, " ", "_" );
// remove any other invalid characters
%invalidCharacters = "-+*/%$&§=()[].?\"#,;!~<>|°^{}";
%invalidCharacters = "-+*/%$&<EFBFBD>=()[].?\"#,;!~<>|<7C>^{}";
%name = stripChars( %name, %invalidCharacters );
if( %name $= "" )
@ -621,4 +602,13 @@ function switchControlObject(%client, %newControlEntity)
return error("SwitchControlObject: Target controller has no conrol object behavior!");
%control.setConnectionControlObject(%client);
}
function populateAllFonts(%font)
{
populateFontCacheRange(%font,14,0,65535);
populateFontCacheRange(%font,18,0,65535);
populateFontCacheRange(%font,24,0,65535);
populateFontCacheRange(%font,32,0,65535);
populateFontCacheRange(%font,36,0,65535);
}

View file

@ -17,4 +17,43 @@ function callOnModules(%functionName, %moduleGroup)
eval(%module.scopeSet @ "." @ %functionName @ "();");
}
}
}
function loadModuleMaterials(%moduleGroup)
{
//Get our modules so we can exec any specific client-side loading/handling
%modulesList = ModuleDatabase.findModules(false);
for(%i=0; %i < getWordCount(%modulesList); %i++)
{
%module = getWord(%modulesList, %i);
if(%moduleGroup !$= "")
{
if(%module.group !$= %moduleGroup)
continue;
}
%modulePath = %module.ModulePath;
// Load any materials files for which we only have DSOs.
for( %file = findFirstFile( %modulePath @ "/*/materials.cs.dso" );
%file !$= "";
%file = findNextFile( %modulePath @ "/*/materials.cs.dso" ))
{
// Only execute, if we don't have the source file.
%csFileName = getSubStr( %file, 0, strlen( %file ) - 4 );
if( !isFile( %csFileName ) )
exec( %csFileName );
}
// Load all source material files.
for( %file = findFirstFile( %modulePath @ "/*/materials.cs" );
%file !$= "";
%file = findNextFile( %modulePath @ "/*/materials.cs" ))
{
exec( %file );
}
}
}