mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
Changes behavior with suffix appending of asset importer so it doesn't contaminate the original "clean" name, which is used for setting the mapTo value of material definitions
Also adds a sanity check when applying the type suffix to see if it's already there to avoid needless doubleups Fixes offsetting/positioning behavior on icon buttons to actually respect the icon position variable Adds sanity checks to ensure we're not trying to utilize a in-process-of-deleting decoy dummy Fixes handling of sliders in option menus to properly store and test unapplied values Fixes handling of display device setting to properly store and test unapplied values Adds additional logic to creation of shape and material asset previews to attempt to force-load dependencies to improve likelihood that they'll actually be loaded when we go to generate the preview. Temp disables creating cubemap 'assets' via the RMB context menu in the AB
This commit is contained in:
parent
96fd520eb7
commit
5c8d8fab00
8 changed files with 108 additions and 31 deletions
|
|
@ -200,7 +200,7 @@ function OptionsMenu::apply(%this)
|
|||
//for updates
|
||||
if ( %targetVar $= "$pref::Video::displayDevice" )
|
||||
{
|
||||
MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." );
|
||||
schedule(32, 0, "MessageBoxOK", "Change requires restart", "Please restart the game for a display device change to take effect.");
|
||||
}
|
||||
else if(startsWith(%targetVar, "$pref::PostFX::"))
|
||||
{
|
||||
|
|
@ -349,11 +349,6 @@ function populateDisplaySettingsList()
|
|||
OptionName.setText("");
|
||||
OptionDescription.setText("");
|
||||
|
||||
//First, lets double-check the active device is accurate. Sometimes the default value in our prefs doesn't match the active one
|
||||
%displayDevice = getDisplayDeviceType();
|
||||
if($changingDisplayDevice !$= "")
|
||||
%displayDevice = $changingDisplayDevice;
|
||||
|
||||
%apiList = "";
|
||||
%apiCount = GFXInit::getAdapterCount();
|
||||
%apiIdx = 0;
|
||||
|
|
@ -374,7 +369,11 @@ function populateDisplaySettingsList()
|
|||
|
||||
trim(%apiList);
|
||||
|
||||
OptionsMenuSettingsList.addOptionRow("Display API", "$pref::Video::DisplayAPI", %apiList, false, "", true, "The display API used for rendering.", %displayDevice);
|
||||
%displayDevice = OptionsMenu.getOptionVariableValue("$pref::Video::displayDevice");
|
||||
if(%displayDevice $= "")
|
||||
%displayDevice = getDisplayDeviceType();
|
||||
|
||||
OptionsMenuSettingsList.addOptionRow("Display API", "$pref::Video::displayDevice", %apiList, false, "", true, "The display API used for rendering.", %displayDevice);
|
||||
|
||||
%numDevices = Canvas.getMonitorCount();
|
||||
%devicesList = "";
|
||||
|
|
@ -977,6 +976,8 @@ function MenuOptionsButton::onChange(%this)
|
|||
OptionName.setText(%optionName);
|
||||
OptionDescription.setText(%tooltipText);
|
||||
|
||||
if(%optionMode == 0)
|
||||
{
|
||||
%currentValue = %this.getCurrentOption();
|
||||
if(%currentValue !$= "")
|
||||
{
|
||||
|
|
@ -995,6 +996,20 @@ function MenuOptionsButton::onChange(%this)
|
|||
}
|
||||
else
|
||||
OptionsMenu.unappliedChanges.setValue("\"" @ %saveReadyValue @ "\"", %prefIndex);
|
||||
}
|
||||
}
|
||||
else if(%optionMode == 1)
|
||||
{
|
||||
%currentValue = %this.getValue();
|
||||
|
||||
%prefIndex = OptionsMenu.unappliedChanges.getIndexFromKey(%targetVar);
|
||||
if(%prefIndex == -1)
|
||||
{
|
||||
echo("Setting UnappliedChanges via add: key:" @ %targetVar @", value: " @ %currentValue);
|
||||
OptionsMenu.unappliedChanges.add(%targetVar, "\"" @ %currentValue @ "\"" );
|
||||
}
|
||||
else
|
||||
OptionsMenu.unappliedChanges.setValue("\"" @ %currentValue @ "\"", %prefIndex);
|
||||
}
|
||||
|
||||
//Update the UI in case there's responsive logic
|
||||
|
|
|
|||
|
|
@ -462,10 +462,17 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData,
|
|||
|
||||
if(isObject(%assetDef.materialDefinitionName))
|
||||
{
|
||||
//real fast, we'll be 100% sure that the image resource we need is loaded
|
||||
%diffuseMapAssetId = %assetDef.materialDefinitionName.getDiffuseMapAsset(0);
|
||||
if(AssetDatabase.isDeclaredAsset(%diffuseMapAssetId))
|
||||
{
|
||||
%diffuseMapAsset = AssetDatabase.acquireAsset(%diffuseMapAssetId);
|
||||
AssetDatabase.releaseAsset(%diffuseMapAssetId);
|
||||
}
|
||||
%previewShapeDef = AssetDatabase.acquireAsset("ToolsModule:previewSphereShape");
|
||||
%generatedFilePath = %previewShapeDef.generateCachedPreviewImage(256, %assetDef.materialDefinitionName);
|
||||
|
||||
pathCopy(%generatedFilePath, %previewFilePath);
|
||||
pathCopy(%generatedFilePath, %previewFilePath, false);
|
||||
fileDelete(%generatedFilePath);
|
||||
|
||||
if(!AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||
|
|
|
|||
|
|
@ -290,12 +290,21 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData, %f
|
|||
{
|
||||
displayEditorLoadingGui("Generating Shape Asset Preview...");
|
||||
|
||||
//real fast, we'll be 100% sure that the image resource we need is loaded
|
||||
|
||||
%matSlot0AssetId = %assetDef.materialSlot0;
|
||||
if(AssetDatabase.isDeclaredAsset(%matSlot0AssetId))
|
||||
{
|
||||
%matAsset = AssetDatabase.acquireAsset(%matSlot0AssetId);
|
||||
AssetDatabase.releaseAsset(%matSlot0AssetId);
|
||||
}
|
||||
|
||||
//This is slightly hacky, but we're going to utilize the imposter/last detail system
|
||||
//to generate our previews for us and then clean up the unneeded bits
|
||||
|
||||
%filePath = %assetDef.generateCachedPreviewImage();
|
||||
|
||||
pathCopy(%filePath, %previewFilePath);
|
||||
pathCopy(%filePath, %previewFilePath, false);
|
||||
fileDelete(%filePath); //cleanup
|
||||
|
||||
if(!AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||
|
|
|
|||
|
|
@ -237,6 +237,7 @@ function AssetBrowser::buildPopupMenus(%this)
|
|||
AddNewArtAssetPopup.enableItem(7, false); //shape animation
|
||||
AddNewArtAssetPopup.enableItem(13, false); //sound asset
|
||||
AddNewArtAssetPopup.enableItem(15, false); //particle effect
|
||||
AddNewArtAssetPopup.enableItem(17, false); //cubemap
|
||||
|
||||
if( !isObject( EditFolderPopup ) )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue