- Reimplements autosave logic to handle levels, subscenes and terrains in a more consistent, reliable way.

- Adds entry to RMB menu in Asset Browser to restore an asset to a backup copy taken from autosaves
- Adds reparent out-of-bounds objects button to SceneGroup inspector
- Adds ability to have SubScene have a different loading bounds from the actual subscene bounds, allowing load triggering to happen ahead of the bounds of the subscene itself
- Fixes asset importer handling of animFPS field to be the correct type
- Adds onInspect handling to GameBase allowing better handling for any game class type with editor integration
- Add getAssetLooseFileCount and getAssetLooseFile to AssetManager to be able to iterate over all loose files associated to an asset
- Add standard/default preload function def to forestItem
- Fixes handling of text placement on GuiIconButtonCtrl when text is set to the right
- Adds setGlobalCenter utility function
- Adds ability to set guiInputCtrl active state
- Matched util functions for tracking if left and right mouse buttons are down to EditTSCtrl alongside the existing middle mouse
- Add empty element sanity check to appMesh loader
- Add callback for GameBase when game is created
- Add default graphics options config for steamdeck
- Fix typo in assetImportConfig default
- Filters SceneGroup utility buttons in inspector to only show for relevent class types
This commit is contained in:
JeffR 2025-05-25 07:40:10 -05:00
parent 70502d1b0f
commit bb7ee38bf4
33 changed files with 978 additions and 237 deletions

View file

@ -2435,6 +2435,69 @@ AssetManager::typeAssetDependsOnHash* AssetManager::getDependedOnAssets()
// Find any asset dependencies.
return &mAssetDependsOn;
}
//-----------------------------------------------------------------------------
S32 AssetManager::getAssetLooseFileCount(const char* pAssetId)
{
// Debug Profiling.
PROFILE_SCOPE(AssetManager_getAssetLooseFileCount);
// Sanity!
AssertFatal(pAssetId != NULL, "Cannot get loose files for NULL asset Id.");
// Find asset.
AssetDefinition* pAssetDefinition = findAsset(pAssetId);
// Did we find the asset?
if (pAssetDefinition == NULL)
{
// No, so warn.
Con::warnf("Asset Manager: Failed to get loose files for asset Id '%s' as it does not exist.", pAssetId);
return false;
}
S32 looseFileCount = pAssetDefinition->mAssetLooseFiles.size();
// Cleanup our reference
pAssetDefinition = NULL;
return looseFileCount;
}
//-----------------------------------------------------------------------------
const char* AssetManager::getAssetLooseFile(const char* pAssetId, const S32& index)
{
// Debug Profiling.
PROFILE_SCOPE(AssetManager_getAssetLooseFile);
// Sanity!
AssertFatal(pAssetId != NULL, "Cannot get loose file for NULL asset Id.");
// Find asset.
AssetDefinition* pAssetDefinition = findAsset(pAssetId);
// Did we find the asset?
if (pAssetDefinition == NULL)
{
// No, so warn.
Con::warnf("Asset Manager: Failed to get loose file for asset Id '%s' as it does not exist.", pAssetId);
return false;
}
if(index < 0 || index >= pAssetDefinition->mAssetLooseFiles.size())
{
Con::warnf("Asset Manager : Failed to get loose file for asset Id '%s' as the index was out of range.", pAssetId);
}
StringTableEntry looseFile = pAssetDefinition->mAssetLooseFiles[index];
// Cleanup our reference
pAssetDefinition = NULL;
return looseFile;
}
//-----------------------------------------------------------------------------
bool AssetManager::scanDeclaredAssets( const char* pPath, const char* pExtension, const bool recurse, ModuleDefinition* pModuleDefinition )

View file

@ -376,6 +376,9 @@ public:
typeAssetDependsOnHash* getDependedOnAssets();
S32 getAssetLooseFileCount(const char* pAssetId);
const char* getAssetLooseFile(const char* pAssetId, const S32& index);
/// Declare Console Object.
DECLARE_CONOBJECT( AssetManager );

View file

@ -763,6 +763,36 @@ DefineEngineMethod(AssetManager, findAssetLooseFile, S32, (const char* assetQuer
//-----------------------------------------------------------------------------
DefineEngineMethod(AssetManager, getAssetLooseFileCount, S32, (const char* assetId), (""),
"Gets the number of loose files associated with the given assetId.\n"
"@param assetId The assetId to check.\n"
"@return The number of loose files associated with the assetId.\n")
{
// Fetch asset loose file.
const char* pAssetId = assetId;
// Perform query.
return object->getAssetLooseFileCount(pAssetId);
}
//-----------------------------------------------------------------------------
DefineEngineMethod(AssetManager, getAssetLooseFile, const char*, (const char* assetId, S32 index), ("", 0),
"Gets the loose file associated to the given assetId at the provided index.\n"
"@param assetId The assetId to check.\n"
"@param index The index of the loose file to get.\n"
"@return The file name of the associated loose file.\n")
{
// Fetch asset loose file.
const char* pAssetId = assetId;
// Perform query.
return object->getAssetLooseFile(pAssetId, index);
}
//-----------------------------------------------------------------------------
DefineEngineMethod(AssetManager, getDeclaredAssetCount, bool, (),,
"Gets the number of declared assets.\n"
"@return Returns the number of declared assets.\n")