mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Merge pull request #769 from Areloch/MiscFixes20220423
Misc Fixes 2022/04/23
This commit is contained in:
commit
b37d15d183
19 changed files with 370 additions and 518 deletions
|
|
@ -836,11 +836,11 @@ function OptionsMenuSettingsList::addOptionBoolRow(%this, %label, %targetPrefVar
|
||||||
|
|
||||||
if(%qualityLevelList $= $yesNoList && isInt(%defaultValue))
|
if(%qualityLevelList $= $yesNoList && isInt(%defaultValue))
|
||||||
{
|
{
|
||||||
%defaultValue = convertBoolToYesNo(!%defaultValue);
|
%defaultValue = convertBoolToYesNo(%defaultValue);
|
||||||
}
|
}
|
||||||
else if(%qualityLevelList $= $onOffList && isInt(%defaultValue))
|
else if(%qualityLevelList $= $onOffList && isInt(%defaultValue))
|
||||||
{
|
{
|
||||||
%defaultValue = convertBoolToOnOff(!%defaultValue);
|
%defaultValue = convertBoolToOnOff(%defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
return %this.addOptionRow(%label, %targetPrefVar, %qualityLevelList,
|
return %this.addOptionRow(%label, %targetPrefVar, %qualityLevelList,
|
||||||
|
|
@ -995,9 +995,11 @@ function MenuOptionsButton::onChange(%this)
|
||||||
OptionsMenu.unappliedChanges.add(%targetVar, "\"" @ %saveReadyValue @ "\"" );
|
OptionsMenu.unappliedChanges.add(%targetVar, "\"" @ %saveReadyValue @ "\"" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
OptionsMenu.unappliedChanges.setValue("\"" @ %saveReadyValue @ "\"", %prefIndex);
|
OptionsMenu.unappliedChanges.setValue("\"" @ %saveReadyValue @ "\"", %prefIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if(%optionMode == 1)
|
else if(%optionMode == 1)
|
||||||
{
|
{
|
||||||
%currentValue = %this.getValue();
|
%currentValue = %this.getValue();
|
||||||
|
|
@ -1009,7 +1011,9 @@ function MenuOptionsButton::onChange(%this)
|
||||||
OptionsMenu.unappliedChanges.add(%targetVar, "\"" @ %currentValue @ "\"" );
|
OptionsMenu.unappliedChanges.add(%targetVar, "\"" @ %currentValue @ "\"" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
OptionsMenu.unappliedChanges.setValue("\"" @ %currentValue @ "\"", %prefIndex);
|
OptionsMenu.unappliedChanges.setValue("\"" @ %currentValue @ "\"", %prefIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update the UI in case there's responsive logic
|
//Update the UI in case there's responsive logic
|
||||||
|
|
|
||||||
|
|
@ -157,8 +157,8 @@ $guiContent = new GuiControl(AssetBrowser) {
|
||||||
position = "204 80";
|
position = "204 80";
|
||||||
extent = "615 608";
|
extent = "615 608";
|
||||||
minExtent = "383 274";
|
minExtent = "383 274";
|
||||||
horizSizing = "center";
|
horizSizing = "windowRelative";
|
||||||
vertSizing = "center";
|
vertSizing = "windowRelative";
|
||||||
profile = "ToolsGuiWindowProfile";
|
profile = "ToolsGuiWindowProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "1";
|
active = "1";
|
||||||
|
|
@ -276,6 +276,7 @@ $guiContent = new GuiControl(AssetBrowser) {
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
internalName = "ImportAssetButton";
|
internalName = "ImportAssetButton";
|
||||||
|
command="AssetBrowser.importNewFile();";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
|
|
@ -770,7 +771,7 @@ $guiContent = new GuiControl(AssetBrowser) {
|
||||||
position = "0 0";
|
position = "0 0";
|
||||||
extent = "23 23";
|
extent = "23 23";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "left";
|
horizSizing = "right";
|
||||||
vertSizing = "bottom";
|
vertSizing = "bottom";
|
||||||
profile = "ToolsGuiSolidDefaultProfile";
|
profile = "ToolsGuiSolidDefaultProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,15 @@ function AssetBrowserPlugin::onWorldEditorStartup( %this )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function AssetBrowserPlugin::onWorldEditorShutdown( %this )
|
||||||
|
{
|
||||||
|
//force close us real fast to save off current settings/configs
|
||||||
|
if(AssetBrowser.isAwake())
|
||||||
|
{
|
||||||
|
AssetBrowser.hideDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function AssetBrowserPlugin::initSettings( %this )
|
function AssetBrowserPlugin::initSettings( %this )
|
||||||
{
|
{
|
||||||
EditorSettings.beginGroup( "Assets", true );
|
EditorSettings.beginGroup( "Assets", true );
|
||||||
|
|
|
||||||
|
|
@ -368,8 +368,6 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
|
||||||
%this.previewData.doubleClickCommand = "";
|
%this.previewData.doubleClickCommand = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetPreviewArray.empty();
|
|
||||||
|
|
||||||
%previewImage = "core/art/warnmat";
|
%previewImage = "core/art/warnmat";
|
||||||
|
|
||||||
if(/*%moduleName !$= "" && */ModuleDatabase.findModule(%moduleName, 1) !$= "")
|
if(/*%moduleName !$= "" && */ModuleDatabase.findModule(%moduleName, 1) !$= "")
|
||||||
|
|
@ -512,6 +510,7 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
|
||||||
textLocation = "Bottom";
|
textLocation = "Bottom";
|
||||||
extent = %previewSize.x SPC %previewSize.y + %textBottomPad;
|
extent = %previewSize.x SPC %previewSize.y + %textBottomPad;
|
||||||
buttonType = "RadioButton";
|
buttonType = "RadioButton";
|
||||||
|
buttonMargin = "0 -10";
|
||||||
profile = ToolsGuiDefaultProfile;
|
profile = ToolsGuiDefaultProfile;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -528,11 +527,16 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
|
||||||
%previewButton.iconLocation = "Left";
|
%previewButton.iconLocation = "Left";
|
||||||
%previewButton.textLocation = "Right";
|
%previewButton.textLocation = "Right";
|
||||||
%previewButton.setextent(120,20);
|
%previewButton.setextent(120,20);
|
||||||
|
%previewButton.buttonMargin = "0 0";
|
||||||
|
|
||||||
|
AssetBrowser.previewListMode = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%size = %previewSize.x * %previewScaleSize;
|
%size = %previewSize.x * %previewScaleSize;
|
||||||
%previewButton.setextent(%size,%size + %textBottomPad);
|
%previewButton.setextent(%size,%size + %textBottomPad);
|
||||||
|
|
||||||
|
AssetBrowser.previewListMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%previewButton.extent = %previewSize.x + %previewBounds SPC %previewSize.y + %previewBounds + 24;
|
//%previewButton.extent = %previewSize.x + %previewBounds SPC %previewSize.y + %previewBounds + 24;
|
||||||
|
|
@ -549,6 +553,8 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
|
||||||
%doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
|
%doubleClickCommand = "AssetBrowser.editAsset( "@%assetDesc@" );";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%this.previewData.previewLoaded = true;
|
||||||
|
|
||||||
//Build out the preview
|
//Build out the preview
|
||||||
%buildCommand = %this @ ".build" @ %assetType @ "Preview(\"" @ %assetDesc @ "\"," @ %this.previewData @ ");";
|
%buildCommand = %this @ ".build" @ %assetType @ "Preview(\"" @ %assetDesc @ "\"," @ %this.previewData @ ");";
|
||||||
eval(%buildCommand);
|
eval(%buildCommand);
|
||||||
|
|
@ -579,7 +585,8 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
|
||||||
AssetBrowser-->assetList.add(%previewButton);
|
AssetBrowser-->assetList.add(%previewButton);
|
||||||
|
|
||||||
// add to the array object for reference later
|
// add to the array object for reference later
|
||||||
AssetPreviewArray.add( %previewButton, %this.previewData.previewImage );
|
if(%this.previewData.previewLoaded == false)
|
||||||
|
AssetPreviewArray.add( %previewButton );
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::refresh(%this)
|
function AssetBrowser::refresh(%this)
|
||||||
|
|
@ -607,6 +614,25 @@ function AssetBrowser::doRefresh(%this)
|
||||||
%this.dirty = false;
|
%this.dirty = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function AssetBrowser::populatePreviewImages(%this)
|
||||||
|
{
|
||||||
|
echo("AssetBrowser::populatePreviewImages() - Previews to generate: " @ AssetPreviewArray.count());
|
||||||
|
for(%i=0; %i < AssetPreviewArray.count(); %i++)
|
||||||
|
{
|
||||||
|
%previewButton = AssetPreviewArray.getKey(%i);
|
||||||
|
%type = %previewButton.assetType;
|
||||||
|
|
||||||
|
echo(" - Generating preview for asset: " @ %previewButton.moduleName @ ":" @ %previewButton.assetName);
|
||||||
|
|
||||||
|
AssetBrowser.call("generate" @ %previewButton.assetType @ "PreviewImage", %previewButton);
|
||||||
|
AssetPreviewArray.erase(%i);
|
||||||
|
|
||||||
|
echo(" - done, scheduling another pass");
|
||||||
|
AssetBrowser.schedule(32, "populatePreviewImages");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
/*function AssetPreviewButton::onClick(%this)
|
/*function AssetPreviewButton::onClick(%this)
|
||||||
|
|
@ -716,7 +742,6 @@ function AssetBrowser::loadDirectories( %this )
|
||||||
//}
|
//}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
AssetPreviewArray.empty();
|
|
||||||
|
|
||||||
AssetBrowser-->filterTree.buildVisibleTree(true);
|
AssetBrowser-->filterTree.buildVisibleTree(true);
|
||||||
|
|
||||||
|
|
@ -1495,7 +1520,11 @@ function AssetBrowser::doRebuildAssetArray(%this)
|
||||||
{
|
{
|
||||||
if(AssetBrowser.assetTypeFilter !$= "")
|
if(AssetBrowser.assetTypeFilter !$= "")
|
||||||
{
|
{
|
||||||
if(AssetBrowser.assetTypeFilter $= %assetType)
|
%filtersCount = getWordCount(AssetBrowser.assetTypeFilter);
|
||||||
|
for(%fltrIdx = 0; %fltrIdx < %filtersCount; %fltrIdx++)
|
||||||
|
{
|
||||||
|
%fltr = getWord(AssetBrowser.assetTypeFilter, %fltrIdx);
|
||||||
|
if(%fltr $= %assetType)
|
||||||
{
|
{
|
||||||
$AssetBrowser::AssetArray.add( %moduleName, %assetId );
|
$AssetBrowser::AssetArray.add( %moduleName, %assetId );
|
||||||
|
|
||||||
|
|
@ -1503,6 +1532,7 @@ function AssetBrowser::doRebuildAssetArray(%this)
|
||||||
%finalAssetCount++;
|
%finalAssetCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//got it.
|
//got it.
|
||||||
|
|
@ -1550,7 +1580,22 @@ function AssetBrowser::doRebuildAssetArray(%this)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Add Non-Asset Scripted Objects. Datablock, etc based
|
//Add Non-Asset Scripted Objects. Datablock, etc based
|
||||||
if(AssetBrowser.assetTypeFilter $= "" && %breadcrumbPath !$= "" && isDirectory(%breadcrumbPath))
|
%hasDBFilter = true;
|
||||||
|
if(AssetBrowser.assetTypeFilter !$= "")
|
||||||
|
{
|
||||||
|
%hasDBFilter = false;
|
||||||
|
%filterCount = getWordCount(AssetBrowser.assetTypeFilter);
|
||||||
|
for(%fltrIdx = 0; %fltrIdx < %filterCount; %fltrIdx++)
|
||||||
|
{
|
||||||
|
%fltr = getWord(AssetBrowser.assetTypeFilter, %fltrIdx);
|
||||||
|
if(%fltr $= "Datablock" || %fltr $= "Datablocks")
|
||||||
|
{
|
||||||
|
%hasDBFilter = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(%hasDBFilter && %breadcrumbPath !$= "" && isDirectory(%breadcrumbPath))
|
||||||
{
|
{
|
||||||
%category = getWord( %breadcrumbPath, 1 );
|
%category = getWord( %breadcrumbPath, 1 );
|
||||||
%dataGroup = "DataBlockGroup";
|
%dataGroup = "DataBlockGroup";
|
||||||
|
|
@ -1768,6 +1813,10 @@ function AssetBrowser::doRebuildAssetArray(%this)
|
||||||
%name = %creatorObj.val[1];
|
%name = %creatorObj.val[1];
|
||||||
%func = %creatorObj.val[2];
|
%func = %creatorObj.val[2];
|
||||||
|
|
||||||
|
%searchActive = AssetSearchTerms.count() != 0;
|
||||||
|
if(%searchActive && !matchesSearch(%name, "Creator"))
|
||||||
|
continue;
|
||||||
|
|
||||||
$AssetBrowser::AssetArray.add( %name, "Creator" TAB %creatorObj );
|
$AssetBrowser::AssetArray.add( %name, "Creator" TAB %creatorObj );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1776,6 +1825,8 @@ function AssetBrowser::doRebuildAssetArray(%this)
|
||||||
|
|
||||||
for(%i=0; %i < $AssetBrowser::AssetArray.count(); %i++)
|
for(%i=0; %i < $AssetBrowser::AssetArray.count(); %i++)
|
||||||
AssetBrowser.buildAssetPreview( $AssetBrowser::AssetArray.getValue(%i), $AssetBrowser::AssetArray.getKey(%i) );
|
AssetBrowser.buildAssetPreview( $AssetBrowser::AssetArray.getValue(%i), $AssetBrowser::AssetArray.getKey(%i) );
|
||||||
|
//Queue population of any non-Type Card preview images
|
||||||
|
AssetBrowser.schedule(32, "populatePreviewImages");
|
||||||
|
|
||||||
AssetBrowser_FooterText.text = %finalAssetCount @ " Assets";
|
AssetBrowser_FooterText.text = %finalAssetCount @ " Assets";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,20 +175,48 @@ function AssetBrowser::importImageAsset(%this, %assetItem)
|
||||||
AssetDatabase.refreshAsset(%assetId);
|
AssetDatabase.refreshAsset(%assetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData)
|
||||||
{
|
{
|
||||||
if(%forcePreviewRegenerate $= "")
|
//%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(%assetDef.getImagePath())));
|
||||||
%forcePreviewRegenerate = false;
|
|
||||||
|
|
||||||
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(%assetDef.getImagePath())));
|
%previewData.previewImage = "ToolsModule:genericAssetIcon_image";
|
||||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
%previewData.previewLoaded = false; //this marks it for loading progressively later
|
||||||
|
|
||||||
|
%previewData.assetName = %assetDef.assetName;
|
||||||
|
%previewData.assetPath = %assetDef.scriptFile;
|
||||||
|
|
||||||
|
%previewData.assetFriendlyName = %assetDef.assetName;
|
||||||
|
%previewData.assetDesc = %assetDef.description;
|
||||||
|
|
||||||
|
//image info
|
||||||
|
//%info = %assetDef.getImageInfo();
|
||||||
|
|
||||||
|
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @ "\n" @
|
||||||
|
"Asset Type: Image Asset\n" @
|
||||||
|
"Asset Definition ID: " @ %assetDef @ "\n" @
|
||||||
|
"Image Type: " @ %assetDef.imageType @ "\n" @
|
||||||
|
/* "Format: " @ getWord(%info, 0) @ "\n" @
|
||||||
|
"Height: " @ getWord(%info, 1) @ "\n" @
|
||||||
|
"Width: " @ getWord(%info, 2) @ "\n" @
|
||||||
|
"Depth: " @ getWord(%info, 3) @ "\n" @ */
|
||||||
|
"Image File path: " @ %assetDef.getImagePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
function AssetBrowser::generateImageAssetPreviewImage(%this, %previewButton, %forceRegenerate)
|
||||||
|
{
|
||||||
|
if(%forceRegenerate $= "")
|
||||||
|
%forceRegenerate = false;
|
||||||
|
|
||||||
|
%previewPath = "tools/resources/previewCache/" @ %previewButton.moduleName @ "/";
|
||||||
|
|
||||||
if(!IsDirectory(%previewPath))
|
if(!IsDirectory(%previewPath))
|
||||||
{
|
{
|
||||||
%this.dirHandler.createFolder(%previewPath);
|
%this.dirHandler.createFolder(%previewPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
%generatePreview = false;
|
%assetId = %previewButton.moduleName @ ":" @ %previewButton.assetName;
|
||||||
|
|
||||||
|
%assetDef = AssetDatabase.acquireAsset(%assetId);
|
||||||
|
|
||||||
%previewFilePath = %previewPath @ %assetDef.assetName @ "_Preview.png";
|
%previewFilePath = %previewPath @ %assetDef.assetName @ "_Preview.png";
|
||||||
if(!isFile(%previewFilePath) || (compareFileTimes(%assetDef.getImagePath(), %previewFilePath) == 1))
|
if(!isFile(%previewFilePath) || (compareFileTimes(%assetDef.getImagePath(), %previewFilePath) == 1))
|
||||||
|
|
@ -196,12 +224,10 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData, %f
|
||||||
%generatePreview = true;
|
%generatePreview = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
%previewAssetName = %previewButton.moduleName @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
||||||
|
|
||||||
if(%generatePreview || %forcePreviewRegenerate)
|
if(%generatePreview || %forceRegenerate)
|
||||||
{
|
{
|
||||||
displayEditorLoadingGui("Generating Image Asset Preview...");
|
|
||||||
|
|
||||||
%success = saveScaledImage(%assetDef.getImagePath(), %previewFilePath, EditorSettings.value("Assets/Browser/PreviewImageSize"));
|
%success = saveScaledImage(%assetDef.getImagePath(), %previewFilePath, EditorSettings.value("Assets/Browser/PreviewImageSize"));
|
||||||
|
|
||||||
if(%success)
|
if(%success)
|
||||||
|
|
@ -222,49 +248,28 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData, %f
|
||||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||||
|
|
||||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||||
|
|
||||||
|
if(!%success)
|
||||||
|
{
|
||||||
|
return false; //failed to register the preview image for some reason?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
%previewButton.bitmapAsset = %previewAssetName;
|
||||||
%previewFilePath = %assetDef.getImagePath();
|
return true;
|
||||||
%previewAssetName = %module.moduleId @ ":" @ %assetDef.assetName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hideEditorLoadingGui();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%previewAssetName = "ToolsModule:" @ %previewAssetName;
|
//just map the existing one then
|
||||||
}
|
if(AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||||
|
|
||||||
//Revalidate. If it didn't work, just use the default placeholder one
|
|
||||||
if(!isFile(%previewFilePath))
|
|
||||||
{
|
{
|
||||||
%previewData.previewImage = "ToolsModule:genericAssetIcon_image";
|
%previewButton.bitmapAsset = "ToolsModule:" @ %previewAssetName;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
%previewData.previewImage = %previewAssetName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%previewData.assetName = %assetDef.assetName;
|
return false;
|
||||||
%previewData.assetPath = %assetDef.scriptFile;
|
|
||||||
|
|
||||||
%previewData.assetFriendlyName = %assetDef.assetName;
|
|
||||||
%previewData.assetDesc = %assetDef.description;
|
|
||||||
|
|
||||||
//image info
|
|
||||||
%info = %assetDef.getImageInfo();
|
|
||||||
|
|
||||||
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @ "\n" @
|
|
||||||
"Asset Type: Image Asset\n" @
|
|
||||||
"Asset Definition ID: " @ %assetDef @ "\n" @
|
|
||||||
"Image Type: " @ %assetDef.imageType @ "\n" @
|
|
||||||
"Format: " @ getWord(%info, 0) @ "\n" @
|
|
||||||
"Height: " @ getWord(%info, 1) @ "\n" @
|
|
||||||
"Width: " @ getWord(%info, 2) @ "\n" @
|
|
||||||
"Depth: " @ getWord(%info, 3) @ "\n" @
|
|
||||||
"Image File path: " @ %assetDef.getImagePath();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Renames the asset
|
//Renames the asset
|
||||||
|
|
|
||||||
|
|
@ -426,8 +426,43 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
||||||
{
|
{
|
||||||
if(%forcePreviewRegenerate $= "")
|
%previewData.previewImage = "ToolsModule:genericAssetIcon_image";
|
||||||
%forcePreviewRegenerate = false;
|
%previewData.previewLoaded = false; //this marks it for loading progressively later
|
||||||
|
|
||||||
|
%previewData.assetName = %assetDef.assetName;
|
||||||
|
%previewData.assetPath = %assetDef.scriptFile;
|
||||||
|
|
||||||
|
%previewData.assetFriendlyName = %assetDef.assetName;
|
||||||
|
%previewData.assetDesc = %assetDef.description;
|
||||||
|
|
||||||
|
if(%this.selectMode)
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
||||||
|
else
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
||||||
|
|
||||||
|
%definitionPath = %assetDef.getScriptPath();
|
||||||
|
if(%definitionPath $= "")
|
||||||
|
%definitionPath = %assetDef.getFilename();
|
||||||
|
|
||||||
|
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @
|
||||||
|
"\nAsset Type: Material Asset" @
|
||||||
|
"\nAsset Definition ID: " @ %assetDef @
|
||||||
|
"\nDefinition Path: " @ %definitionPath;
|
||||||
|
|
||||||
|
if(!%this.selectMode)
|
||||||
|
{
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function AssetBrowser::generateMaterialAssetPreviewImage(%this, %previewButton, %forceRegenerate)
|
||||||
|
{
|
||||||
|
if(%forceRegenerate $= "")
|
||||||
|
%forceRegenerate = false;
|
||||||
|
|
||||||
|
%assetId = %previewButton.moduleName @ ":" @ %previewButton.assetName;
|
||||||
|
|
||||||
|
%assetDef = AssetDatabase.acquireAsset(%assetId);
|
||||||
|
|
||||||
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId()))));
|
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId()))));
|
||||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
||||||
|
|
@ -456,10 +491,8 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData,
|
||||||
|
|
||||||
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
||||||
|
|
||||||
if(%generatePreview || %forcePreviewRegenerate)
|
if(%generatePreview || %forceRegenerate)
|
||||||
{
|
{
|
||||||
displayEditorLoadingGui("Generating Material Asset Preview...");
|
|
||||||
|
|
||||||
if(isObject(%assetDef.materialDefinitionName))
|
if(isObject(%assetDef.materialDefinitionName))
|
||||||
{
|
{
|
||||||
//real fast, we'll be 100% sure that the image resource we need is loaded
|
//real fast, we'll be 100% sure that the image resource we need is loaded
|
||||||
|
|
@ -490,50 +523,28 @@ function AssetBrowser::buildMaterialAssetPreview(%this, %assetDef, %previewData,
|
||||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||||
|
|
||||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||||
|
|
||||||
|
if(!%success)
|
||||||
|
{
|
||||||
|
return false; //failed to register the preview image for some reason?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
%previewButton.bitmapAsset = %previewAssetName;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//just map the existing one then
|
||||||
|
if(AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||||
{
|
{
|
||||||
error("Failed to generate preview for material: " @ %assetDef.materialDefinitionName);
|
%previewButton.bitmapAsset = "ToolsModule:" @ %previewAssetName;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
hideEditorLoadingGui();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Revalidate. If it didn't work, just use the default placeholder one
|
return false;
|
||||||
if(!isFile(%previewFilePath))
|
|
||||||
{
|
|
||||||
%previewData.previewImage = "ToolsModule:materialIcon_image";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
%previewData.previewImage = "ToolsModule:" @ %previewAssetName;
|
|
||||||
}
|
|
||||||
|
|
||||||
%previewData.assetName = %assetDef.assetName;
|
|
||||||
%previewData.assetPath = %assetDef.scriptFile;
|
|
||||||
|
|
||||||
%previewData.assetFriendlyName = %assetDef.assetName;
|
|
||||||
%previewData.assetDesc = %assetDef.description;
|
|
||||||
|
|
||||||
if(%this.selectMode)
|
|
||||||
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
|
||||||
else
|
|
||||||
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
|
||||||
|
|
||||||
%definitionPath = %assetDef.getScriptPath();
|
|
||||||
if(%definitionPath $= "")
|
|
||||||
%definitionPath = %assetDef.getFilename();
|
|
||||||
|
|
||||||
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @
|
|
||||||
"\nAsset Type: Material Asset" @
|
|
||||||
"\nAsset Definition ID: " @ %assetDef @
|
|
||||||
"\nDefinition Path: " @ %definitionPath;
|
|
||||||
|
|
||||||
if(!%this.selectMode)
|
|
||||||
{
|
|
||||||
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::onMaterialAssetEditorDropped(%this, %assetDef, %position)
|
function AssetBrowser::onMaterialAssetEditorDropped(%this, %assetDef, %position)
|
||||||
|
|
|
||||||
|
|
@ -265,8 +265,44 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
|
||||||
|
|
||||||
function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
||||||
{
|
{
|
||||||
if(%forcePreviewRegenerate $= "")
|
%previewData.previewImage = "ToolsModule:genericAssetIcon_image";
|
||||||
%forcePreviewRegenerate = false;
|
%previewData.previewLoaded = false; //this marks it for loading progressively later
|
||||||
|
|
||||||
|
%previewData.assetName = %assetDef.assetName;
|
||||||
|
%previewData.assetPath = %assetDef.fileName;
|
||||||
|
|
||||||
|
%previewData.assetFriendlyName = %assetDef.assetName;
|
||||||
|
%previewData.assetDesc = %assetDef.description;
|
||||||
|
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @ "\n" @
|
||||||
|
"Asset Type: Shape Asset\n" @
|
||||||
|
"Asset Definition ID: " @ %assetDef @ "\n" @
|
||||||
|
"Shape File path: " @ %assetDef.getShapePath();
|
||||||
|
|
||||||
|
if(%this.selectMode)
|
||||||
|
{
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(EditorSettings.value("Assets/Browser/doubleClickAction", "Edit Asset") $= "Edit Asset")
|
||||||
|
{
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.onShapeAssetEditorDropped( "@%assetDef@" );";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function AssetBrowser::generateShapeAssetPreviewImage(%this, %previewButton, %forceRegenerate)
|
||||||
|
{
|
||||||
|
if(%forceRegenerate $= "")
|
||||||
|
%forceRegenerate = false;
|
||||||
|
|
||||||
|
%assetId = %previewButton.moduleName @ ":" @ %previewButton.assetName;
|
||||||
|
|
||||||
|
%assetDef = AssetDatabase.acquireAsset(%assetId);
|
||||||
|
|
||||||
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(%assetDef.getShapePath())));
|
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(%assetDef.getShapePath())));
|
||||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
||||||
|
|
@ -286,10 +322,8 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData, %f
|
||||||
|
|
||||||
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
||||||
|
|
||||||
if(%generatePreview || %forcePreviewRegenerate)
|
if(%generatePreview || %forceRegenerate)
|
||||||
{
|
{
|
||||||
displayEditorLoadingGui("Generating Shape Asset Preview...");
|
|
||||||
|
|
||||||
//real fast, we'll be 100% sure that the image resource we need is loaded
|
//real fast, we'll be 100% sure that the image resource we need is loaded
|
||||||
|
|
||||||
%matSlot0AssetId = %assetDef.materialSlot0;
|
%matSlot0AssetId = %assetDef.materialSlot0;
|
||||||
|
|
@ -322,46 +356,31 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData, %f
|
||||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||||
|
|
||||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||||
}
|
|
||||||
|
|
||||||
hideEditorLoadingGui();
|
if(!%success)
|
||||||
|
{
|
||||||
|
return false; //failed to register the preview image for some reason?
|
||||||
}
|
}
|
||||||
|
|
||||||
//Revalidate. If it didn't work, just use the default placeholder one
|
|
||||||
if(!isFile(%previewFilePath))
|
|
||||||
{
|
|
||||||
%previewData.previewImage = "ToolsModule:genericAssetIcon_image";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%previewData.previewImage = "ToolsModule:" @ %previewAssetName;
|
%previewAssetName = "ToolsModule:" @ %previewAssetName;
|
||||||
}
|
}
|
||||||
|
|
||||||
%previewData.assetName = %assetDef.assetName;
|
%previewButton.bitmapAsset = %previewAssetName;
|
||||||
%previewData.assetPath = %assetDef.fileName;
|
return true;
|
||||||
|
|
||||||
%previewData.assetFriendlyName = %assetDef.assetName;
|
|
||||||
%previewData.assetDesc = %assetDef.description;
|
|
||||||
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @ "\n" @
|
|
||||||
"Asset Type: Shape Asset\n" @
|
|
||||||
"Asset Definition ID: " @ %assetDef @ "\n" @
|
|
||||||
"Shape File path: " @ %assetDef.getShapePath();
|
|
||||||
|
|
||||||
if(%this.selectMode)
|
|
||||||
{
|
|
||||||
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(EditorSettings.value("Assets/Browser/doubleClickAction", "Edit Asset") $= "Edit Asset")
|
//just map the existing one then
|
||||||
|
if(AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||||
{
|
{
|
||||||
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
%previewButton.bitmapAsset = "ToolsModule:" @ %previewAssetName;
|
||||||
}
|
return true;
|
||||||
else
|
|
||||||
{
|
|
||||||
%previewData.doubleClickCommand = "AssetBrowser.onShapeAssetEditorDropped( "@%assetDef@" );";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position)
|
function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position)
|
||||||
|
|
|
||||||
|
|
@ -111,8 +111,35 @@ function AssetBrowser::moveTerrainMaterialAsset(%this, %assetDef, %destination)
|
||||||
|
|
||||||
function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previewData, %forcePreviewRegenerate)
|
||||||
{
|
{
|
||||||
if(%forcePreviewRegenerate $= "")
|
%previewData.previewImage = "ToolsModule:genericAssetIcon_image";
|
||||||
%forcePreviewRegenerate = false;
|
%previewData.previewLoaded = false; //this marks it for loading progressively later
|
||||||
|
|
||||||
|
%previewData.assetName = %assetDef.assetName;
|
||||||
|
%previewData.assetPath = "";
|
||||||
|
%previewData.doubleClickCommand = "";
|
||||||
|
|
||||||
|
%previewData.assetFriendlyName = %assetDef.gameObjectName;
|
||||||
|
%previewData.assetDesc = %assetDef.description;
|
||||||
|
%previewData.tooltip = %assetDef.gameObjectName;
|
||||||
|
|
||||||
|
%definitionPath = %assetDef.getScriptPath();
|
||||||
|
if(%definitionPath $= "")
|
||||||
|
%definitionPath = %assetDef.getFilename();
|
||||||
|
|
||||||
|
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @
|
||||||
|
"\nAsset Type: Terrain Material Asset" @
|
||||||
|
"\nAsset Definition ID: " @ %assetDef @
|
||||||
|
"\nDefinition Path: " @ %definitionPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
function AssetBrowser::generateTerrainMaterialAssetPreviewImage(%this, %previewButton, %forceRegenerate)
|
||||||
|
{
|
||||||
|
if(%forceRegenerate $= "")
|
||||||
|
%forceRegenerate = false;
|
||||||
|
|
||||||
|
%assetId = %previewButton.moduleName @ ":" @ %previewButton.assetName;
|
||||||
|
|
||||||
|
%assetDef = AssetDatabase.acquireAsset(%assetId);
|
||||||
|
|
||||||
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId()))));
|
%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(AssetDatabase.getAssetFilePath(%assetDef.getAssetId()))));
|
||||||
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
%previewPath = "tools/resources/previewCache/" @ %module.moduleId @ "/";
|
||||||
|
|
@ -141,10 +168,8 @@ function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previ
|
||||||
|
|
||||||
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
%previewAssetName = %module.moduleId @ "_" @ %assetDef.assetName @ "_PreviewImage";
|
||||||
|
|
||||||
if(%generatePreview || %forcePreviewRegenerate)
|
if(%generatePreview || %forceRegenerate)
|
||||||
{
|
{
|
||||||
displayEditorLoadingGui("Generating Material Asset Preview...");
|
|
||||||
|
|
||||||
if(isObject(%assetDef.materialDefinitionName))
|
if(isObject(%assetDef.materialDefinitionName))
|
||||||
{
|
{
|
||||||
%previewShapeDef = AssetDatabase.acquireAsset("ToolsModule:previewSphereShape");
|
%previewShapeDef = AssetDatabase.acquireAsset("ToolsModule:previewSphereShape");
|
||||||
|
|
@ -169,38 +194,28 @@ function AssetBrowser::buildTerrainMaterialAssetPreview(%this, %assetDef, %previ
|
||||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||||
|
|
||||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||||
|
|
||||||
|
if(!%success)
|
||||||
|
{
|
||||||
|
return false; //failed to register the preview image for some reason?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hideEditorLoadingGui();
|
%previewButton.bitmapAsset = %previewAssetName;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Revalidate. If it didn't work, just use the default placeholder one
|
|
||||||
if(!isFile(%previewFilePath))
|
|
||||||
{
|
|
||||||
%previewData.previewImage = "ToolsModule:terrainMaterialIcon_image";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
%previewData.previewImage = "ToolsModule:" @ %previewAssetName;
|
//just map the existing one then
|
||||||
|
if(AssetDatabase.isDeclaredAsset("ToolsModule:" @ %previewAssetName))
|
||||||
|
{
|
||||||
|
%previewButton.bitmapAsset = "ToolsModule:" @ %previewAssetName;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%previewData.assetName = %assetDef.assetName;
|
return false;
|
||||||
%previewData.assetPath = "";
|
|
||||||
%previewData.doubleClickCommand = "";
|
|
||||||
|
|
||||||
%previewData.assetFriendlyName = %assetDef.gameObjectName;
|
|
||||||
%previewData.assetDesc = %assetDef.description;
|
|
||||||
%previewData.tooltip = %assetDef.gameObjectName;
|
|
||||||
|
|
||||||
%definitionPath = %assetDef.getScriptPath();
|
|
||||||
if(%definitionPath $= "")
|
|
||||||
%definitionPath = %assetDef.getFilename();
|
|
||||||
|
|
||||||
%previewData.tooltip = "Asset Name: " @ %assetDef.assetName @
|
|
||||||
"\nAsset Type: Terrain Material Asset" @
|
|
||||||
"\nAsset Definition ID: " @ %assetDef @
|
|
||||||
"\nDefinition Path: " @ %definitionPath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function GuiInspectorTypeTerrainMaterialAssetPtr::onClick( %this, %fieldName )
|
function GuiInspectorTypeTerrainMaterialAssetPtr::onClick( %this, %fieldName )
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,33 @@ function newAssetUpdatePath(%newPath)
|
||||||
NewAssetTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
|
NewAssetTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
function AssetBrowser::importNewFile(%this)
|
||||||
|
{
|
||||||
|
%importingPath = "";
|
||||||
|
|
||||||
|
%dlg = new OpenFileDialog()
|
||||||
|
{
|
||||||
|
Filters = "(All Files (*.*)|*.*|";
|
||||||
|
DefaultFile = "";
|
||||||
|
ChangePath = false;
|
||||||
|
MustExist = true;
|
||||||
|
MultipleFiles = false;
|
||||||
|
forceRelativePath = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
if ( %dlg.Execute() )
|
||||||
|
{
|
||||||
|
%importingPath = makeFullPath(%dlg.FileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
%dlg.delete();
|
||||||
|
|
||||||
|
AssetBrowser.onBeginDropFiles();
|
||||||
|
AssetBrowser.onDropFile(%importingPath);
|
||||||
|
AssetBrowser.onEndDropFiles();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
function NewAssetTargetModule::onSelect(%this, %idx, %idy)
|
function NewAssetTargetModule::onSelect(%this, %idx, %idy)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewImageAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewImageAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
//fillColorNA = "230 126 0 255"; //fill color default
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "230 126 0 255";
|
borderColor = "230 126 0 255";
|
||||||
|
|
@ -10,7 +10,8 @@ singleton GuiControlProfile(AssetBrowserPreviewImageAsset : ToolsGuiDefaultProfi
|
||||||
|
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewMaterialAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewMaterialAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "0 100 0 255";
|
borderColor = "0 100 0 255";
|
||||||
|
|
@ -19,7 +20,8 @@ singleton GuiControlProfile(AssetBrowserPreviewMaterialAsset : ToolsGuiDefaultPr
|
||||||
|
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewShapeAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewShapeAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "0 0 200 255";
|
borderColor = "0 0 200 255";
|
||||||
|
|
@ -28,7 +30,8 @@ singleton GuiControlProfile(AssetBrowserPreviewShapeAsset : ToolsGuiDefaultProfi
|
||||||
|
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewShapeAnimationAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewShapeAnimationAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "0 0 200 255";
|
borderColor = "0 0 200 255";
|
||||||
|
|
@ -37,7 +40,8 @@ singleton GuiControlProfile(AssetBrowserPreviewShapeAnimationAsset : ToolsGuiDef
|
||||||
|
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewSoundAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewSoundAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "75 101 135 255";
|
borderColor = "75 101 135 255";
|
||||||
|
|
@ -46,7 +50,8 @@ singleton GuiControlProfile(AssetBrowserPreviewSoundAsset : ToolsGuiDefaultProfi
|
||||||
|
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewTerrainAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewTerrainAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "200 198 198 255";
|
borderColor = "200 198 198 255";
|
||||||
|
|
@ -55,7 +60,8 @@ singleton GuiControlProfile(AssetBrowserPreviewTerrainAsset : ToolsGuiDefaultPro
|
||||||
|
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewTerrainMaterialAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewTerrainMaterialAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "200 198 198 255";
|
borderColor = "200 198 198 255";
|
||||||
|
|
@ -64,7 +70,8 @@ singleton GuiControlProfile(AssetBrowserPreviewTerrainMaterialAsset : ToolsGuiDe
|
||||||
|
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewStateMachineAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewStateMachineAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "0 76 135 255";
|
borderColor = "0 76 135 255";
|
||||||
|
|
@ -73,7 +80,8 @@ singleton GuiControlProfile(AssetBrowserPreviewStateMachineAsset : ToolsGuiDefau
|
||||||
|
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewGUIAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewGUIAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "17 5 44 255";
|
borderColor = "17 5 44 255";
|
||||||
|
|
@ -82,7 +90,8 @@ singleton GuiControlProfile(AssetBrowserPreviewGUIAsset : ToolsGuiDefaultProfile
|
||||||
|
|
||||||
singleton GuiControlProfile(AssetBrowserPreviewLevelAsset : ToolsGuiDefaultProfile)
|
singleton GuiControlProfile(AssetBrowserPreviewLevelAsset : ToolsGuiDefaultProfile)
|
||||||
{
|
{
|
||||||
fillColor = "128 128 128 255"; //hovered/selected
|
fillcolor = EditorSettings.value("Theme/windowBackgroundColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
|
||||||
border = true;
|
border = true;
|
||||||
borderColor = "0 208 186 255";
|
borderColor = "0 208 186 255";
|
||||||
|
|
|
||||||
|
|
@ -285,6 +285,12 @@ new GuiControlProfile( ToolsGuiTextArrayProfile : ToolsGuiTextProfile )
|
||||||
if( !isObject( ToolsGuiTextListProfile ) )
|
if( !isObject( ToolsGuiTextListProfile ) )
|
||||||
new GuiControlProfile( ToolsGuiTextListProfile : ToolsGuiTextProfile )
|
new GuiControlProfile( ToolsGuiTextListProfile : ToolsGuiTextProfile )
|
||||||
{
|
{
|
||||||
|
fontColor = EditorSettings.value("Theme/fieldTextColor");
|
||||||
|
fontColorHL = EditorSettings.value("Theme/fieldTextHLColor");
|
||||||
|
fontColorSEL = EditorSettings.value("Theme/fieldTextSELColor");
|
||||||
|
fillColor = EditorSettings.value("Theme/fieldBGColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/fieldBGHLColor");
|
||||||
|
fillColorSEL = EditorSettings.value("Theme/fieldBGSELColor");
|
||||||
tab = true;
|
tab = true;
|
||||||
canKeyFocus = true;
|
canKeyFocus = true;
|
||||||
category = "Tools";
|
category = "Tools";
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ $guiContent = new GuiControl() {
|
||||||
EdgeSnap = "1";
|
EdgeSnap = "1";
|
||||||
text = "Shapes";
|
text = "Shapes";
|
||||||
|
|
||||||
new GuiTabBookCtrl() {
|
new GuiTabBookCtrl(ShapeEditorTabbook) {
|
||||||
internalName = "tabBook";
|
internalName = "tabBook";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
isContainer = "1";
|
isContainer = "1";
|
||||||
|
|
@ -175,126 +175,8 @@ $guiContent = new GuiControl() {
|
||||||
AnchorBottom = "0";
|
AnchorBottom = "0";
|
||||||
AnchorLeft = "1";
|
AnchorLeft = "1";
|
||||||
AnchorRight = "0";
|
AnchorRight = "0";
|
||||||
text = "Library";
|
text = "Assets";
|
||||||
maxLength = "1024";
|
maxLength = "1024";
|
||||||
|
|
||||||
new GuiContainer() {
|
|
||||||
isContainer = "1";
|
|
||||||
HorizSizing = "width";
|
|
||||||
VertSizing = "height";
|
|
||||||
position = "0 0";
|
|
||||||
Extent = "202 146";
|
|
||||||
MinExtent = "0 -500";
|
|
||||||
Profile = "GuiInspectorProfile";
|
|
||||||
};
|
|
||||||
new GuiBitmapBorderCtrl() {
|
|
||||||
isContainer = "1";
|
|
||||||
HorizSizing = "width";
|
|
||||||
VertSizing = "height";
|
|
||||||
position = "0 0";
|
|
||||||
Extent = "202 146";
|
|
||||||
MinExtent = "0 -500";
|
|
||||||
Profile = "ToolsGuiTabBorderProfile";
|
|
||||||
};
|
|
||||||
new GuiBitmapButtonCtrl() {
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
isContainer = "0";
|
|
||||||
Profile = "ToolsGuiButtonProfile";
|
|
||||||
HorizSizing = "right";
|
|
||||||
VertSizing = "bottom";
|
|
||||||
position = "3 4";
|
|
||||||
Extent = "20 19";
|
|
||||||
MinExtent = "8 2";
|
|
||||||
canSave = "1";
|
|
||||||
Visible = "1";
|
|
||||||
Command = "ShapeEdSelectWindow.navigateUp();";
|
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
|
||||||
groupNum = "0";
|
|
||||||
buttonType = "PushButton";
|
|
||||||
useMouseEvents = "0";
|
|
||||||
bitmapAsset = "ToolsModule:folderUp_image";
|
|
||||||
};
|
|
||||||
new GuiPopUpMenuCtrl(ShapeEdSelectMenu) {
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
isContainer = "0";
|
|
||||||
Profile = "ToolsGuiPopUpMenuProfile";
|
|
||||||
HorizSizing = "width";
|
|
||||||
VertSizing = "bottom";
|
|
||||||
position = "26 4";
|
|
||||||
Extent = "172 18";
|
|
||||||
MinExtent = "8 2";
|
|
||||||
canSave = "1";
|
|
||||||
Visible = "1";
|
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
|
||||||
Margin = "0 0 0 0";
|
|
||||||
Padding = "0 0 0 0";
|
|
||||||
AnchorTop = "1";
|
|
||||||
AnchorBottom = "0";
|
|
||||||
AnchorLeft = "1";
|
|
||||||
AnchorRight = "0";
|
|
||||||
text = "art";
|
|
||||||
maxLength = "1024";
|
|
||||||
maxPopupHeight = "200";
|
|
||||||
sbUsesNAColor = "0";
|
|
||||||
reverseTextList = "0";
|
|
||||||
bitmapBounds = "16 16";
|
|
||||||
};
|
|
||||||
new GuiScrollCtrl() {
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
isContainer = "1";
|
|
||||||
Profile = "ToolsGuiScrollProfile";
|
|
||||||
HorizSizing = "width";
|
|
||||||
VertSizing = "height";
|
|
||||||
position = "0 24";
|
|
||||||
Extent = "202 122";
|
|
||||||
MinExtent = "8 -500";
|
|
||||||
canSave = "1";
|
|
||||||
Visible = "1";
|
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
|
||||||
Margin = "0 0 0 0";
|
|
||||||
Padding = "0 0 0 0";
|
|
||||||
AnchorTop = "1";
|
|
||||||
AnchorBottom = "0";
|
|
||||||
AnchorLeft = "1";
|
|
||||||
AnchorRight = "0";
|
|
||||||
willFirstRespond = "1";
|
|
||||||
hScrollBar = "dynamic";
|
|
||||||
vScrollBar = "dynamic";
|
|
||||||
lockHorizScroll = false;
|
|
||||||
lockVertScroll = "false";
|
|
||||||
constantThumbHeight = "0";
|
|
||||||
childMargin = "0 0";
|
|
||||||
mouseWheelScrollSpeed = "-1";
|
|
||||||
|
|
||||||
new GuiDynamicCtrlArrayControl() {
|
|
||||||
internalName = "shapeLibrary";
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
isContainer = "1";
|
|
||||||
Profile = "ToolsGuiTransparentProfile";
|
|
||||||
HorizSizing = "right";
|
|
||||||
VertSizing = "bottom";
|
|
||||||
position = "1 1";
|
|
||||||
Extent = "189 42";
|
|
||||||
MinExtent = "8 11";
|
|
||||||
canSave = "1";
|
|
||||||
Visible = "1";
|
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
|
||||||
colCount = "1";
|
|
||||||
colSize = "64";
|
|
||||||
rowCount = "0";
|
|
||||||
RowSize = "64";
|
|
||||||
rowSpacing = "4";
|
|
||||||
colSpacing = "4";
|
|
||||||
frozen = "0";
|
|
||||||
autoCellSize = "1";
|
|
||||||
fillRowFirst = "1";
|
|
||||||
dynamicSize = "1";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,6 @@ function ShapeEditorPlugin::onWorldEditorStartup(%this)
|
||||||
ShapeEdSeqNodeTabBook.selectPage(0);
|
ShapeEdSeqNodeTabBook.selectPage(0);
|
||||||
ShapeEdAdvancedWindow-->tabBook.selectPage(0);
|
ShapeEdAdvancedWindow-->tabBook.selectPage(0);
|
||||||
ShapeEdSelectWindow-->tabBook.selectPage(0);
|
ShapeEdSelectWindow-->tabBook.selectPage(0);
|
||||||
ShapeEdSelectWindow.navigate("");
|
|
||||||
|
|
||||||
SetToggleButtonValue( ShapeEditorToolbar-->orbitNodeBtn, 0 );
|
SetToggleButtonValue( ShapeEditorToolbar-->orbitNodeBtn, 0 );
|
||||||
SetToggleButtonValue( ShapeEditorToolbar-->ghostMode, 0 );
|
SetToggleButtonValue( ShapeEditorToolbar-->ghostMode, 0 );
|
||||||
|
|
|
||||||
|
|
@ -366,230 +366,6 @@ function ShapeEdShapeTreeView::onSelect( %this, %obj )
|
||||||
ShapeEdHintMenu.setSelected( %hintId );
|
ShapeEdHintMenu.setSelected( %hintId );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find all DTS or COLLADA models. Note: most of this section was shamelessly
|
|
||||||
// stolen from creater.ed.tscript => great work whoever did the original!
|
|
||||||
function ShapeEdSelectWindow::navigate( %this, %address )
|
|
||||||
{
|
|
||||||
// Freeze the icon array so it doesn't update until we've added all of the
|
|
||||||
// icons
|
|
||||||
%this-->shapeLibrary.frozen = true;
|
|
||||||
%this-->shapeLibrary.clear();
|
|
||||||
ShapeEdSelectMenu.clear();
|
|
||||||
|
|
||||||
%filePatterns = getFormatExtensions();
|
|
||||||
%fullPath = findFirstFileMultiExpr( %filePatterns );
|
|
||||||
|
|
||||||
while ( %fullPath !$= "" )
|
|
||||||
{
|
|
||||||
// Ignore cached DTS files
|
|
||||||
if ( endswith( %fullPath, "cached.dts" ) )
|
|
||||||
{
|
|
||||||
%fullPath = findNextFileMultiExpr( %filePatterns );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ignore assets in the tools folder
|
|
||||||
%fullPath = makeRelativePath( %fullPath, getMainDotCSDir() );
|
|
||||||
%splitPath = strreplace( %fullPath, " ", "_" );
|
|
||||||
%splitPath = strreplace( %splitPath, "/", " " );
|
|
||||||
if ( getWord( %splitPath, 0 ) $= "tools" )
|
|
||||||
{
|
|
||||||
%fullPath = findNextFileMultiExpr( %filePatterns );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
%dirCount = getWordCount( %splitPath ) - 1;
|
|
||||||
%pathFolders = getWords( %splitPath, 0, %dirCount - 1 );
|
|
||||||
|
|
||||||
// Add this file's path ( parent folders ) to the
|
|
||||||
// popup menu if it isn't there yet.
|
|
||||||
%temp = strreplace( %pathFolders, " ", "/" );
|
|
||||||
%temp = strreplace( %temp, "_", " " );
|
|
||||||
%r = ShapeEdSelectMenu.findText( %temp );
|
|
||||||
if ( %r == -1 )
|
|
||||||
ShapeEdSelectMenu.add( %temp );
|
|
||||||
|
|
||||||
// Is this file in the current folder?
|
|
||||||
if ( stricmp( %pathFolders, %address ) == 0 )
|
|
||||||
{
|
|
||||||
%this.addShapeIcon( %fullPath );
|
|
||||||
}
|
|
||||||
// Then is this file in a subfolder we need to add
|
|
||||||
// a folder icon for?
|
|
||||||
else
|
|
||||||
{
|
|
||||||
%wordIdx = 0;
|
|
||||||
%add = false;
|
|
||||||
|
|
||||||
if ( %address $= "" )
|
|
||||||
{
|
|
||||||
%add = true;
|
|
||||||
%wordIdx = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for ( ; %wordIdx < %dirCount; %wordIdx++ )
|
|
||||||
{
|
|
||||||
%temp = getWords( %splitPath, 0, %wordIdx );
|
|
||||||
if ( stricmp( %temp, %address ) == 0 )
|
|
||||||
{
|
|
||||||
%add = true;
|
|
||||||
%wordIdx++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( %add == true )
|
|
||||||
{
|
|
||||||
%folder = getWord( %splitPath, %wordIdx );
|
|
||||||
|
|
||||||
// Add folder icon if not already present
|
|
||||||
%ctrl = %this.findIconCtrl( %folder );
|
|
||||||
if ( %ctrl == -1 )
|
|
||||||
%this.addFolderIcon( %folder );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
%fullPath = findNextFileMultiExpr( %filePatterns );
|
|
||||||
}
|
|
||||||
|
|
||||||
%this-->shapeLibrary.sort( "alphaIconCompare" );
|
|
||||||
for ( %i = 0; %i < %this-->shapeLibrary.getCount(); %i++ )
|
|
||||||
%this-->shapeLibrary.getObject( %i ).autoSize = false;
|
|
||||||
|
|
||||||
%this-->shapeLibrary.frozen = false;
|
|
||||||
%this-->shapeLibrary.refresh();
|
|
||||||
%this.address = %address;
|
|
||||||
|
|
||||||
ShapeEdSelectMenu.sort();
|
|
||||||
|
|
||||||
%str = strreplace( %address, " ", "/" );
|
|
||||||
%r = ShapeEdSelectMenu.findText( %str );
|
|
||||||
if ( %r != -1 )
|
|
||||||
ShapeEdSelectMenu.setSelected( %r, false );
|
|
||||||
else
|
|
||||||
ShapeEdSelectMenu.setText( %str );
|
|
||||||
}
|
|
||||||
|
|
||||||
function ShapeEdSelectWindow::navigateDown( %this, %folder )
|
|
||||||
{
|
|
||||||
if ( %this.address $= "" )
|
|
||||||
%address = %folder;
|
|
||||||
else
|
|
||||||
%address = %this.address SPC %folder;
|
|
||||||
|
|
||||||
// Because this is called from an IconButton::onClick command
|
|
||||||
// we have to wait a tick before actually calling navigate, else
|
|
||||||
// we would delete the button out from under itself.
|
|
||||||
%this.schedule( 1, "navigate", %address );
|
|
||||||
}
|
|
||||||
|
|
||||||
function ShapeEdSelectWindow::navigateUp( %this )
|
|
||||||
{
|
|
||||||
%count = getWordCount( %this.address );
|
|
||||||
|
|
||||||
if ( %count == 0 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( %count == 1 )
|
|
||||||
%address = "";
|
|
||||||
else
|
|
||||||
%address = getWords( %this.address, 0, %count - 2 );
|
|
||||||
|
|
||||||
%this.navigate( %address );
|
|
||||||
}
|
|
||||||
|
|
||||||
function ShapeEdSelectWindow::findIconCtrl( %this, %name )
|
|
||||||
{
|
|
||||||
for ( %i = 0; %i < %this-->shapeLibrary.getCount(); %i++ )
|
|
||||||
{
|
|
||||||
%ctrl = %this-->shapeLibrary.getObject( %i );
|
|
||||||
if ( %ctrl.text $= %name )
|
|
||||||
return %ctrl;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function ShapeEdSelectWindow::createIcon( %this )
|
|
||||||
{
|
|
||||||
%ctrl = new GuiIconButtonCtrl()
|
|
||||||
{
|
|
||||||
profile = "GuiCreatorIconButtonProfile";
|
|
||||||
iconLocation = "Left";
|
|
||||||
textLocation = "Right";
|
|
||||||
extent = "348 19";
|
|
||||||
textMargin = 8;
|
|
||||||
buttonMargin = "2 2";
|
|
||||||
autoSize = false;
|
|
||||||
sizeIconToButton = true;
|
|
||||||
makeIconSquare = true;
|
|
||||||
buttonType = "radioButton";
|
|
||||||
groupNum = "-1";
|
|
||||||
};
|
|
||||||
|
|
||||||
return %ctrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
function ShapeEdSelectWindow::addFolderIcon( %this, %text )
|
|
||||||
{
|
|
||||||
%ctrl = %this.createIcon();
|
|
||||||
|
|
||||||
%ctrl.altCommand = "ShapeEdSelectWindow.navigateDown( \"" @ %text @ "\" );";
|
|
||||||
%ctrl.iconBitmap = "tools/gui/images/folder.png";
|
|
||||||
%ctrl.text = %text;
|
|
||||||
%ctrl.tooltip = %text;
|
|
||||||
%ctrl.class = "CreatorFolderIconBtn";
|
|
||||||
|
|
||||||
%ctrl.buttonType = "radioButton";
|
|
||||||
%ctrl.groupNum = "-1";
|
|
||||||
|
|
||||||
%this-->shapeLibrary.addGuiControl( %ctrl );
|
|
||||||
}
|
|
||||||
|
|
||||||
function ShapeEdSelectWindow::addShapeIcon( %this, %fullPath )
|
|
||||||
{
|
|
||||||
%ctrl = %this.createIcon();
|
|
||||||
|
|
||||||
%ext = fileExt( %fullPath );
|
|
||||||
%file = fileBase( %fullPath );
|
|
||||||
%fileLong = %file @ %ext;
|
|
||||||
%tip = %fileLong NL
|
|
||||||
"Size: " @ fileSize( %fullPath ) / 1000.0 SPC "KB" NL
|
|
||||||
"Date Created: " @ fileCreatedTime( %fullPath ) NL
|
|
||||||
"Last Modified: " @ fileModifiedTime( %fullPath );
|
|
||||||
|
|
||||||
%ctrl.altCommand = "ShapeEdSelectWindow.onSelect( \"" @ %fullPath @ "\" );";
|
|
||||||
%ctrl.iconBitmap = ( ( %ext $= ".dts" ) ? EditorIconRegistry::findIconByClassName( "TSStatic" ) : "tools/gui/images/iconCollada" );
|
|
||||||
%ctrl.text = %file;
|
|
||||||
%ctrl.class = "CreatorStaticIconBtn";
|
|
||||||
%ctrl.tooltip = %tip;
|
|
||||||
|
|
||||||
%ctrl.buttonType = "radioButton";
|
|
||||||
%ctrl.groupNum = "-1";
|
|
||||||
|
|
||||||
// Check if a shape specific icon is available
|
|
||||||
%formats = ".png .jpg .dds .bmp .gif .jng .tga";
|
|
||||||
%count = getWordCount( %formats );
|
|
||||||
for ( %i = 0; %i < %count; %i++ )
|
|
||||||
{
|
|
||||||
%ext = getWord( %formats, %i );
|
|
||||||
if ( isFile( %fullPath @ %ext ) )
|
|
||||||
{
|
|
||||||
%ctrl.iconBitmap = %fullPath @ %ext;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
%this-->shapeLibrary.addGuiControl( %ctrl );
|
|
||||||
}
|
|
||||||
|
|
||||||
function ShapeEdSelectMenu::onSelect( %this, %id, %text )
|
|
||||||
{
|
|
||||||
%split = strreplace( %text, "/", " " );
|
|
||||||
ShapeEdSelectWindow.navigate( %split );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the GUI in response to the shape selection changing
|
// Update the GUI in response to the shape selection changing
|
||||||
function ShapeEdPropWindow::update_onShapeSelectionChanged( %this )
|
function ShapeEdPropWindow::update_onShapeSelectionChanged( %this )
|
||||||
{
|
{
|
||||||
|
|
@ -3444,3 +3220,18 @@ function showShapeEditorPreview()
|
||||||
%visible = ShapeEditorToolbar-->showPreview.getValue();
|
%visible = ShapeEditorToolbar-->showPreview.getValue();
|
||||||
ShapeEdPreviewGui.setVisible( %visible );
|
ShapeEdPreviewGui.setVisible( %visible );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
function ShapeEditorTabbook::onTabSelected( %this )
|
||||||
|
{
|
||||||
|
if( ShapeEditorTabbook.getSelectedPage() == 1)
|
||||||
|
{
|
||||||
|
AssetBrowser.showDialog("ShapeAsset", "openShapeInShapeEditor");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openShapeInShapeEditor(%shapeAssetId)
|
||||||
|
{
|
||||||
|
%assetDef = AssetDatabase.acquireAsset(%shapeAssetId);
|
||||||
|
AssetBrowser.editShapeAsset(%assetDef);
|
||||||
|
}
|
||||||
|
|
@ -176,6 +176,29 @@ $guiContent = new GuiControl() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
new GuiTabPageCtrl() {
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
Enabled = "1";
|
||||||
|
isContainer = "1";
|
||||||
|
Profile = "ToolsGuiEditorTabPage";
|
||||||
|
HorizSizing = "width";
|
||||||
|
VertSizing = "height";
|
||||||
|
position = "0 19";
|
||||||
|
Extent = "197 271";
|
||||||
|
MinExtent = "8 2";
|
||||||
|
canSave = "1";
|
||||||
|
Visible = "1";
|
||||||
|
hovertime = "1000";
|
||||||
|
Margin = "0 0 0 0";
|
||||||
|
Padding = "0 0 0 0";
|
||||||
|
AnchorTop = "1";
|
||||||
|
AnchorBottom = "0";
|
||||||
|
AnchorLeft = "1";
|
||||||
|
AnchorRight = "0";
|
||||||
|
text = "Assets";
|
||||||
|
maxLength = "1024";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
new GuiBitmapButtonCtrl() {
|
new GuiBitmapButtonCtrl() {
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
|
|
||||||
|
|
@ -586,7 +586,7 @@ function TerrainImportGuiAddOpacityMap( %name )
|
||||||
// once per channel in the file
|
// once per channel in the file
|
||||||
// currently it works with just grayscale.
|
// currently it works with just grayscale.
|
||||||
%channelsTxt = "R" TAB "G" TAB "B" TAB "A";
|
%channelsTxt = "R" TAB "G" TAB "B" TAB "A";
|
||||||
%bitmapInfo = getBitmapinfo( %name );
|
%bitmapInfo = getBitmapinfo( makeFullPath(%name) );
|
||||||
|
|
||||||
%channelCount = getWord( %bitmapInfo, 2 );
|
%channelCount = getWord( %bitmapInfo, 2 );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1932,9 +1932,8 @@ function EditorTreeTabBook::onTabSelected( %this )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EWTreeWindow-->DeleteSelection.visible = false;
|
AssetBrowser.showDialog("ShapeAsset Datablock");
|
||||||
EWTreeWindow-->LockSelection.visible = false;
|
EditorTreeTabBook.selectPage(0);
|
||||||
EWTreeWindow-->AddSimGroup.visible = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,7 @@ package EditorDisconnectOverride
|
||||||
{
|
{
|
||||||
if ( isObject( Editor ) && Editor.isEditorEnabled() )
|
if ( isObject( Editor ) && Editor.isEditorEnabled() )
|
||||||
{
|
{
|
||||||
|
EditorGui.saveAs = false; //whatever edits we were doing are irrelevent now
|
||||||
%mainMenuGUI = ProjectSettings.value("UI/mainMenuName");
|
%mainMenuGUI = ProjectSettings.value("UI/mainMenuName");
|
||||||
if (isObject( %mainMenuGUI ))
|
if (isObject( %mainMenuGUI ))
|
||||||
Editor.close( %mainMenuGUI );
|
Editor.close( %mainMenuGUI );
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ function EditorGui::buildMenus(%this)
|
||||||
//%fileMenu.appendItem("Create Blank Terrain" TAB "" TAB "Canvas.pushDialog( CreateNewTerrainGui );");
|
//%fileMenu.appendItem("Create Blank Terrain" TAB "" TAB "Canvas.pushDialog( CreateNewTerrainGui );");
|
||||||
%fileMenu.appendItem("Create Blank Terrain" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule, createTerrainBlock);");
|
%fileMenu.appendItem("Create Blank Terrain" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule, createTerrainBlock);");
|
||||||
|
|
||||||
%fileMenu.appendItem("Import Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainImportGui );");
|
%fileMenu.appendItem("Import Terrain Heightmap" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule, createTerrainBlock); Canvas.pushDialog( TerrainImportGui );");
|
||||||
|
|
||||||
%fileMenu.appendItem("Export Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainExportGui );");
|
%fileMenu.appendItem("Export Terrain Heightmap" TAB "" TAB "Canvas.pushDialog( TerrainExportGui );");
|
||||||
%fileMenu.appendItem("-");
|
%fileMenu.appendItem("-");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue