mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Merge branch 'MiscQOLFixes20210828' of https://github.com/Areloch/Torque3D into Preview4_0
This commit is contained in:
commit
25a32cba2a
26 changed files with 330 additions and 204 deletions
|
|
@ -438,15 +438,15 @@ ImageAsset::ImageTypes ImageAsset::getImageTypeFromName(const char* name)
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineEngineMethod(ImageAsset, getImagePath, const char*, (), ,
|
DefineEngineMethod(ImageAsset, getImagePath, const char*, (), ,
|
||||||
"Creates an instance of the given GameObject given the asset definition.\n"
|
"Gets the image filepath of this asset.\n"
|
||||||
"@return The GameObject entity created from the asset.")
|
"@return File path of the image file.")
|
||||||
{
|
{
|
||||||
return object->getImagePath();
|
return object->getImagePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineEngineMethod(ImageAsset, getImageInfo, const char*, (), ,
|
DefineEngineMethod(ImageAsset, getImageInfo, const char*, (), ,
|
||||||
"Creates an instance of the given GameObject given the asset definition.\n"
|
"Gets the info and properties of the image.\n"
|
||||||
"@return The GameObject entity created from the asset.")
|
"@return The info/properties of the image.")
|
||||||
{
|
{
|
||||||
return object->getImageInfo();
|
return object->getImageInfo();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -429,6 +429,13 @@ void TerrainAsset::copyTo(SimObject* object)
|
||||||
Parent::copyTo(object);
|
Parent::copyTo(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(TerrainAsset, getTerrainFilePath, const char*, (), ,
|
||||||
|
"Gets the terrain filepath of this asset.\n"
|
||||||
|
"@return File path of the terrain file.")
|
||||||
|
{
|
||||||
|
return object->getTerrainFilePath();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// GuiInspectorTypeAssetId
|
// GuiInspectorTypeAssetId
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ void GuiVariableInspector::addField(const char* name, const char* label, const c
|
||||||
{
|
{
|
||||||
VariableField newField;
|
VariableField newField;
|
||||||
newField.mFieldName = StringTable->insert(name);
|
newField.mFieldName = StringTable->insert(name);
|
||||||
newField.mFieldLabel = StringTable->insert(label);
|
newField.mFieldLabel = StringTable->insert(label, true);
|
||||||
newField.mFieldTypeName = StringTable->insert(typeName);
|
newField.mFieldTypeName = StringTable->insert(typeName);
|
||||||
newField.mFieldDescription = StringTable->insert(description);
|
newField.mFieldDescription = StringTable->insert(description);
|
||||||
newField.mDefaultValue = StringTable->insert(defaultValue);
|
newField.mDefaultValue = StringTable->insert(defaultValue);
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@
|
||||||
tooltip = "Create a new asset in the current directory";
|
tooltip = "Create a new asset in the current directory";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
internalName = "CreateAssetButton";
|
class="CreateAssetButton";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
anchorBottom = "0";
|
anchorBottom = "0";
|
||||||
anchorLeft = "1";
|
anchorLeft = "1";
|
||||||
anchorRight = "0";
|
anchorRight = "0";
|
||||||
position = "328 140";
|
position = "328 159";
|
||||||
extent = "368 450";
|
extent = "368 450";
|
||||||
minExtent = "48 92";
|
minExtent = "48 92";
|
||||||
horizSizing = "center";
|
horizSizing = "center";
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
anchorBottom = "0";
|
anchorBottom = "0";
|
||||||
anchorLeft = "1";
|
anchorLeft = "1";
|
||||||
anchorRight = "0";
|
anchorRight = "0";
|
||||||
position = "12 54";
|
position = "12 29";
|
||||||
extent = "116 17";
|
extent = "116 17";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "right";
|
horizSizing = "right";
|
||||||
|
|
@ -68,6 +68,35 @@
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
|
new GuiPopUpMenuCtrlEx(NewAssetTargetModule) {
|
||||||
|
maxPopupHeight = "200";
|
||||||
|
sbUsesNAColor = "0";
|
||||||
|
reverseTextList = "0";
|
||||||
|
bitmapBounds = "16 16";
|
||||||
|
hotTrackCallback = "0";
|
||||||
|
maxLength = "1024";
|
||||||
|
margin = "0 0 0 0";
|
||||||
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
|
position = "135 28";
|
||||||
|
extent = "202 18";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "ToolsGuiPopUpMenuProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
internalName = "ModuleList";
|
||||||
|
class = "AssetBrowserModuleList";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
new GuiTextCtrl() {
|
new GuiTextCtrl() {
|
||||||
text = "Target Path:";
|
text = "Target Path:";
|
||||||
maxLength = "1024";
|
maxLength = "1024";
|
||||||
|
|
@ -77,7 +106,7 @@
|
||||||
anchorBottom = "0";
|
anchorBottom = "0";
|
||||||
anchorLeft = "1";
|
anchorLeft = "1";
|
||||||
anchorRight = "0";
|
anchorRight = "0";
|
||||||
position = "12 30";
|
position = "12 54";
|
||||||
extent = "116 17";
|
extent = "116 17";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "right";
|
horizSizing = "right";
|
||||||
|
|
@ -104,7 +133,7 @@
|
||||||
anchorBottom = "0";
|
anchorBottom = "0";
|
||||||
anchorLeft = "1";
|
anchorLeft = "1";
|
||||||
anchorRight = "0";
|
anchorRight = "0";
|
||||||
position = "135 30";
|
position = "135 54";
|
||||||
extent = "201 18";
|
extent = "201 18";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "width";
|
horizSizing = "width";
|
||||||
|
|
@ -128,7 +157,7 @@
|
||||||
groupNum = "-1";
|
groupNum = "-1";
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
useMouseEvents = "0";
|
useMouseEvents = "0";
|
||||||
position = "343 27";
|
position = "340 51";
|
||||||
extent = "22 22";
|
extent = "22 22";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "left";
|
horizSizing = "left";
|
||||||
|
|
@ -144,33 +173,6 @@
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
new GuiTextEditCtrl(NewAssetTargetModule) {
|
|
||||||
historySize = "0";
|
|
||||||
tabComplete = "0";
|
|
||||||
sinkAllKeyEvents = "0";
|
|
||||||
password = "0";
|
|
||||||
passwordMask = "*";
|
|
||||||
maxLength = "1024";
|
|
||||||
margin = "0 0 0 0";
|
|
||||||
padding = "0 0 0 0";
|
|
||||||
anchorTop = "1";
|
|
||||||
anchorBottom = "0";
|
|
||||||
anchorLeft = "1";
|
|
||||||
anchorRight = "0";
|
|
||||||
position = "135 53";
|
|
||||||
extent = "202 18";
|
|
||||||
minExtent = "8 2";
|
|
||||||
horizSizing = "width";
|
|
||||||
vertSizing = "bottom";
|
|
||||||
profile = "ToolsGuiTextEditProfile";
|
|
||||||
visible = "1";
|
|
||||||
active = "0";
|
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
|
||||||
isContainer = "1";
|
|
||||||
canSave = "1";
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
};
|
|
||||||
new GuiScrollCtrl() {
|
new GuiScrollCtrl() {
|
||||||
willFirstRespond = "1";
|
willFirstRespond = "1";
|
||||||
hScrollBar = "alwaysOn";
|
hScrollBar = "alwaysOn";
|
||||||
|
|
@ -213,7 +215,7 @@
|
||||||
changeChildSizeToFit = "1";
|
changeChildSizeToFit = "1";
|
||||||
changeChildPosition = "1";
|
changeChildPosition = "1";
|
||||||
position = "1 1";
|
position = "1 1";
|
||||||
extent = "337 338";
|
extent = "337 56";
|
||||||
minExtent = "16 16";
|
minExtent = "16 16";
|
||||||
horizSizing = "width";
|
horizSizing = "width";
|
||||||
vertSizing = "height";
|
vertSizing = "height";
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@
|
||||||
isContainer = "1";
|
isContainer = "1";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
closeCommand="Canvas.popDialog(AssetBrowser_SelectModule);";
|
||||||
|
|
||||||
new GuiPopUpMenuCtrlEx() {
|
new GuiPopUpMenuCtrlEx() {
|
||||||
maxPopupHeight = "200";
|
maxPopupHeight = "200";
|
||||||
|
|
@ -95,7 +96,7 @@
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
class = "SelectPackage_NewAssetModuleBtn";
|
class = "AssetBrowserSelModuleAddBtn";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
|
|
@ -132,7 +133,7 @@
|
||||||
profile = "ToolsGuiButtonProfile";
|
profile = "ToolsGuiButtonProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "1";
|
active = "1";
|
||||||
command = "Canvas.popDialog(AssetBrowser_addModule);";
|
command = "Canvas.popDialog(AssetBrowser_SelectModule);";
|
||||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ function AssetBrowser_addModuleWindow::onGainFirstResponder(%this)
|
||||||
function AssetBrowser_addModuleWindow::close()
|
function AssetBrowser_addModuleWindow::close()
|
||||||
{
|
{
|
||||||
Canvas.popDialog(AssetBrowser_addModule);
|
Canvas.popDialog(AssetBrowser_addModule);
|
||||||
eval(AssetBrowser_addModuleWindow.callbackFunction);
|
//eval(AssetBrowser_addModuleWindow.callbackFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser_addModuleWindow::CreateNewModule(%this)
|
function AssetBrowser_addModuleWindow::CreateNewModule(%this)
|
||||||
|
|
@ -127,4 +127,9 @@ function AssetBrowserModuleList::refresh(%this)
|
||||||
%moduleName = getWord(%moduleList, %i);
|
%moduleName = getWord(%moduleList, %i);
|
||||||
%this.add(%moduleName.ModuleId, %i);
|
%this.add(%moduleName.ModuleId, %i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function AssetBrowserSelModuleAddBtn::onClick(%this)
|
||||||
|
{
|
||||||
|
AssetBrowser.CreateNewModule("AssetBrowser_selectModule.newModuleAdded();");
|
||||||
}
|
}
|
||||||
|
|
@ -36,7 +36,10 @@ function AssetBrowser::initialize(%this)
|
||||||
new ArrayObject(AssetPreviewArray);
|
new ArrayObject(AssetPreviewArray);
|
||||||
|
|
||||||
if(!isObject(%this.dirHandler))
|
if(!isObject(%this.dirHandler))
|
||||||
|
{
|
||||||
%this.dirHandler = makedirectoryHandler(AssetBrowser-->filterTree, "cache,shaderCache", "");
|
%this.dirHandler = makedirectoryHandler(AssetBrowser-->filterTree, "cache,shaderCache", "");
|
||||||
|
%this.dirHandler.currentAddress = "data/";
|
||||||
|
}
|
||||||
|
|
||||||
AssetBrowser-->filterTree.buildIconTable( ":tools/classIcons/Prefab:tools/classIcons/Prefab" @
|
AssetBrowser-->filterTree.buildIconTable( ":tools/classIcons/Prefab:tools/classIcons/Prefab" @
|
||||||
":tools/classIcons/SimSet:tools/classIcons/SimSet");
|
":tools/classIcons/SimSet:tools/classIcons/SimSet");
|
||||||
|
|
@ -2090,7 +2093,14 @@ function AssetBrowser::navigateTo(%this, %address, %historyNav)
|
||||||
|
|
||||||
if(%this.hasLooseFilesInDir())
|
if(%this.hasLooseFilesInDir())
|
||||||
{
|
{
|
||||||
|
if(EditorSettings.value("Assets/AutoImportLooseFiles", false) && EditorSettings.value("Assets/AutoImport", false))
|
||||||
|
{
|
||||||
|
AssetBrowser.autoImportSimpleLooseFiles();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
%this-->AutoImportAssetButton.visible = true;
|
%this-->AutoImportAssetButton.visible = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,8 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData)
|
||||||
|
|
||||||
%success = saveScaledImage(%assetDef.getImagePath(), %previewFilePath);
|
%success = saveScaledImage(%assetDef.getImagePath(), %previewFilePath);
|
||||||
|
|
||||||
|
if(%success)
|
||||||
|
{
|
||||||
%previewAsset = new ImageAsset()
|
%previewAsset = new ImageAsset()
|
||||||
{
|
{
|
||||||
assetName = %previewAssetName;
|
assetName = %previewAssetName;
|
||||||
|
|
@ -203,15 +205,26 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData)
|
||||||
imageFile = fileName(%previewFilePath);
|
imageFile = fileName(%previewFilePath);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
%previewAssetName = "ToolsModule:" @ %previewAssetName;
|
||||||
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
%previewImgAssetPath = %previewPath @ %previewAsset.assetName @ ".asset.taml";
|
||||||
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
%assetImportSuccessful = TAMLWrite(%previewAsset, %previewImgAssetPath);
|
||||||
|
|
||||||
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
%toolsModuleDef = ModuleDatabase.findModule("ToolsModule",1);
|
||||||
|
|
||||||
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
%success = AssetDatabase.addDeclaredAsset(%toolsModuleDef, %previewImgAssetPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%previewFilePath = %assetDef.getImagePath();
|
||||||
|
%previewAssetName = %module.moduleId @ ":" @ %assetDef.assetName;
|
||||||
|
}
|
||||||
|
|
||||||
hideEditorLoadingGui();
|
hideEditorLoadingGui();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%previewAssetName = "ToolsModule:" @ %previewAssetName;
|
||||||
|
}
|
||||||
|
|
||||||
//Revalidate. If it didn't work, just use the default placeholder one
|
//Revalidate. If it didn't work, just use the default placeholder one
|
||||||
if(!isFile(%previewFilePath))
|
if(!isFile(%previewFilePath))
|
||||||
|
|
@ -220,7 +233,7 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData)
|
||||||
%previewData.assetName = %assetDef.assetName;
|
%previewData.assetName = %assetDef.assetName;
|
||||||
%previewData.assetPath = %assetDef.scriptFile;
|
%previewData.assetPath = %assetDef.scriptFile;
|
||||||
|
|
||||||
%previewData.previewImage = "ToolsModule:" @ %previewAssetName;//%assetDef.fileName;
|
%previewData.previewImage = %previewAssetName;
|
||||||
|
|
||||||
%previewData.assetFriendlyName = %assetDef.assetName;
|
%previewData.assetFriendlyName = %assetDef.assetName;
|
||||||
%previewData.assetDesc = %assetDef.description;
|
%previewData.assetDesc = %assetDef.description;
|
||||||
|
|
|
||||||
|
|
@ -318,30 +318,20 @@ function AssetBrowser::buildShapeAssetPreview(%this, %assetDef, %previewData)
|
||||||
"Shape File path: " @ %assetDef.getShapeFile();
|
"Shape File path: " @ %assetDef.getShapeFile();
|
||||||
|
|
||||||
if(%this.selectMode)
|
if(%this.selectMode)
|
||||||
|
{
|
||||||
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if(EditorSettings.value("Assets/Browser/doubleClickAction", "Edit Asset") $= "Edit Asset")
|
||||||
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
%previewData.doubleClickCommand = "AssetBrowser.editAsset( "@%assetDef@" );";
|
||||||
|
else
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.onShapeAssetEditorDropped( "@%assetDef@" );";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position)
|
function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position)
|
||||||
{
|
{
|
||||||
//echo("DROPPED A SHAPE ON THE EDITOR WINDOW!");
|
|
||||||
|
|
||||||
%targetPosition = EWorldEditor.unproject(%position SPC 1000);
|
|
||||||
%camPos = LocalClientConnection.camera.getPosition();
|
|
||||||
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
|
|
||||||
|
|
||||||
%pos = EWCreatorWindow.getCreateObjectPosition();
|
|
||||||
|
|
||||||
if(%rayResult != 0)
|
|
||||||
{
|
|
||||||
%pos = getWords(%rayResult, 1, 3);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
%pos = "0 0 0";
|
|
||||||
}
|
|
||||||
|
|
||||||
%assetId = %assetDef.getAssetId();
|
%assetId = %assetDef.getAssetId();
|
||||||
|
|
||||||
%newStatic = new TSStatic()
|
%newStatic = new TSStatic()
|
||||||
|
|
@ -354,6 +344,8 @@ function AssetBrowser::onShapeAssetEditorDropped(%this, %assetDef, %position)
|
||||||
|
|
||||||
EWorldEditor.clearSelection();
|
EWorldEditor.clearSelection();
|
||||||
EWorldEditor.selectObject(%newStatic);
|
EWorldEditor.selectObject(%newStatic);
|
||||||
|
|
||||||
|
EWorldEditor.dropSelection();
|
||||||
|
|
||||||
EWorldEditor.isDirty = true;
|
EWorldEditor.isDirty = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,11 @@ function AssetBrowser::dragAndDropTerrainAsset(%this, %assetDef, %dropTarget)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function AssetBrowser::onTerrainAssetEditorDropped(%this, %assetDef, %position)
|
||||||
|
{
|
||||||
|
createTerrainBlock(%assetDef.getAssetId());
|
||||||
|
}
|
||||||
|
|
||||||
function AssetBrowser::renameTerrainAsset(%this, %assetDef, %newAssetId, %originalName, %newName)
|
function AssetBrowser::renameTerrainAsset(%this, %assetDef, %newAssetId, %originalName, %newName)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -160,7 +165,6 @@ function AssetBrowser::buildTerrainAssetPreview(%this, %assetDef, %previewData)
|
||||||
{
|
{
|
||||||
%previewData.assetName = %assetDef.assetName;
|
%previewData.assetName = %assetDef.assetName;
|
||||||
%previewData.assetPath = "";
|
%previewData.assetPath = "";
|
||||||
%previewData.doubleClickCommand = "";
|
|
||||||
|
|
||||||
%previewData.previewImage = "ToolsModule:gameObjectIcon_image";
|
%previewData.previewImage = "ToolsModule:gameObjectIcon_image";
|
||||||
|
|
||||||
|
|
@ -170,6 +174,18 @@ function AssetBrowser::buildTerrainAssetPreview(%this, %assetDef, %previewData)
|
||||||
"\nAsset Type: Terrain Asset" @
|
"\nAsset Type: Terrain Asset" @
|
||||||
"\nAsset Definition ID: " @ %assetDef @
|
"\nAsset Definition ID: " @ %assetDef @
|
||||||
"\nDefinition Path: " @ %assetDef.getTerrainFilePath();
|
"\nDefinition Path: " @ %assetDef.getTerrainFilePath();
|
||||||
|
|
||||||
|
if(%this.selectMode)
|
||||||
|
{
|
||||||
|
%previewData.doubleClickCommand = "AssetBrowser.selectAsset( AssetBrowser.selectedAsset );";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(EditorSettings.value("Assets/Browser/doubleClickAction", "Edit Asset") $= "Edit Asset")
|
||||||
|
%previewData.doubleClickCommand = "";
|
||||||
|
else
|
||||||
|
%previewData.doubleClickCommand = "createTerrainBlock(\""@%assetDef.getAssetId()@"\");";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function GuiInspectorTypeTerrainAssetPtr::onClick( %this, %fieldName )
|
function GuiInspectorTypeTerrainAssetPtr::onClick( %this, %fieldName )
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,13 @@ function AssetBrowser::ConvertFolderIntoModule(%this, %folderName)
|
||||||
AssetBrowser_addModuleWindow.CreateNewModule();
|
AssetBrowser_addModuleWindow.CreateNewModule();
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::CreateNewModule(%this)
|
function AssetBrowser::CreateNewModule(%this, %callback)
|
||||||
{
|
{
|
||||||
Canvas.pushDialog(AssetBrowser_AddModule);
|
Canvas.pushDialog(AssetBrowser_AddModule);
|
||||||
AssetBrowser_addModuleWindow.selectWindow();
|
AssetBrowser_addModuleWindow.selectWindow();
|
||||||
|
|
||||||
AssetBrowser_addModuleWindow.callbackFunction = "AssetBrowser.promptNewModuleFolders();";
|
AssetBrowser_addModuleWindow.callbackFunction = "AssetBrowser.promptNewModuleFolders();";
|
||||||
|
AssetBrowser_addModuleWindow.callbackFallthrough = %callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::promptNewModuleFolders(%this)
|
function AssetBrowser::promptNewModuleFolders(%this)
|
||||||
|
|
@ -24,6 +25,9 @@ function AssetBrowser::promptNewModuleFolders(%this)
|
||||||
"Do you want to create some common folders for organization of your new Module?",
|
"Do you want to create some common folders for organization of your new Module?",
|
||||||
"AssetBrowser.makeModuleFolders();", //if yes, make the foldesr
|
"AssetBrowser.makeModuleFolders();", //if yes, make the foldesr
|
||||||
"AssetBrowser.loadDirectories();"); //if no, just refresh
|
"AssetBrowser.loadDirectories();"); //if no, just refresh
|
||||||
|
|
||||||
|
if(AssetBrowser_addModuleWindow.callbackFallthrough !$= "")
|
||||||
|
eval(AssetBrowser_addModuleWindow.callbackFallthrough);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::makeModuleFolders(%this)
|
function AssetBrowser::makeModuleFolders(%this)
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,22 @@ function CreateAssetButton::onClick(%this)
|
||||||
|
|
||||||
function AssetBrowser_newAsset::onWake(%this)
|
function AssetBrowser_newAsset::onWake(%this)
|
||||||
{
|
{
|
||||||
NewAssetTargetAddress.text = AssetBrowser.dirHandler.currentAddress;
|
%targetModule = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
|
||||||
NewAssetTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
|
|
||||||
|
|
||||||
|
if(%targetModule $= "")
|
||||||
|
%targetModule = EditorSettings.value("Assets/New/defaultModule", "");
|
||||||
|
|
||||||
|
NewAssetTargetModule.setText(%targetModule);
|
||||||
|
|
||||||
|
%moduleDef = ModuleDatabase.findModule(%targetModule);
|
||||||
|
|
||||||
|
%targetPath = AssetBrowser.dirHandler.currentAddress;
|
||||||
|
if(!startsWith(%targetPath, %moduleDef.ModulePath))
|
||||||
|
{
|
||||||
|
%targetPath = %moduleDef.ModulePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
NewAssetTargetAddress.text = %targetPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser_newAssetWindow::onClose(%this)
|
function AssetBrowser_newAssetWindow::onClose(%this)
|
||||||
|
|
@ -107,34 +120,6 @@ function AssetBrowser::setupCreateNewAsset(%this, %assetType, %moduleName, %call
|
||||||
%command = %this @ ".setupCreateNew"@%assetType @"();";
|
%command = %this @ ".setupCreateNew"@%assetType @"();";
|
||||||
eval(%command);
|
eval(%command);
|
||||||
}
|
}
|
||||||
/*if(%assetType $= "ComponentAsset")
|
|
||||||
{
|
|
||||||
NewAssetPropertiesInspector.startGroup("Components");
|
|
||||||
NewAssetPropertiesInspector.addField("parentClass", "New Asset Parent Class", "String", "Name of the new asset's parent class", "Component", "", %this.newAssetSettings);
|
|
||||||
NewAssetPropertiesInspector.addField("componentGroup", "Component Group", "String", "Name of the group of components this component asset belongs to", "", "", %this.newAssetSettings);
|
|
||||||
//NewAssetPropertiesInspector.addField("componentName", "Component Name", "String", "Name of the new component", "", "", %this.newAssetSettings);
|
|
||||||
NewAssetPropertiesInspector.endGroup();
|
|
||||||
}*/
|
|
||||||
//Special case, we only do this via internal means like baking
|
|
||||||
/*else if(%assetType $= "ShapeAsset")
|
|
||||||
{
|
|
||||||
NewAssetPropertiesInspector.startGroup("Shape");
|
|
||||||
NewAssetPropertiesInspector.addField("isServerScript", "Is Server Script", "bool", "Is this script used on the server?", "1", "", %this.newAssetSettings);
|
|
||||||
NewAssetPropertiesInspector.endGroup();
|
|
||||||
}*/
|
|
||||||
/*else if(%assetType $= "ShapeAnimationAsset")
|
|
||||||
{
|
|
||||||
NewAssetPropertiesInspector.startGroup("Animation");
|
|
||||||
NewAssetPropertiesInspector.addField("sourceFile", "Source File", "filename", "Source file this animation will pull from", "", "", %this.newAssetSettings);
|
|
||||||
NewAssetPropertiesInspector.addField("animationName", "Animation Name", "string", "Name of the animation clip when used in a shape", "", "", %this.newAssetSettings);
|
|
||||||
|
|
||||||
NewAssetPropertiesInspector.addField("startFrame", "Starting Frame", "int", "Source file this animation will pull from", "", "", %this.newAssetSettings);
|
|
||||||
NewAssetPropertiesInspector.addField("endFrame", "Ending Frame", "int", "Source file this animation will pull from", "", "", %this.newAssetSettings);
|
|
||||||
|
|
||||||
NewAssetPropertiesInspector.addField("padRotation", "Pad Rotations", "bool", "Source file this animation will pull from", "0", "", %this.newAssetSettings);
|
|
||||||
NewAssetPropertiesInspector.addField("padTransforms", "Pad Transforms", "bool", "Source file this animation will pull from", "0", "", %this.newAssetSettings);
|
|
||||||
NewAssetPropertiesInspector.endGroup();
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function NewAssetPropertiesInspector::updateNewAssetField(%this)
|
function NewAssetPropertiesInspector::updateNewAssetField(%this)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,14 @@ function AssetBrowser_SelectModule::showDialog(%this, %callback)
|
||||||
function AssetBrowser_SelectModule::onWake(%this)
|
function AssetBrowser_SelectModule::onWake(%this)
|
||||||
{
|
{
|
||||||
AssetBrowser_SelectModuleWindow-->ModuleList.refresh();
|
AssetBrowser_SelectModuleWindow-->ModuleList.refresh();
|
||||||
|
|
||||||
|
%defaultModule = EditorSettings.value("Assets/New/defaultModule", "");
|
||||||
|
if(%defaultModule !$= "" &&
|
||||||
|
EditorSettings.value("Assets/New/alwaysPromptModuleTarget", false) == false)
|
||||||
|
{
|
||||||
|
Canvas.popDialog(AssetBrowser_SelectModule);
|
||||||
|
eval(%this.callback @ "(" @ %defaultModule @ ");");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser_SelectModule::moduleSelected(%this)
|
function AssetBrowser_SelectModule::moduleSelected(%this)
|
||||||
|
|
@ -24,10 +32,7 @@ function AssetBrowser_SelectModule::moduleSelected(%this)
|
||||||
|
|
||||||
function SelectModule_NewAssetModuleBtn::onClick(%this)
|
function SelectModule_NewAssetModuleBtn::onClick(%this)
|
||||||
{
|
{
|
||||||
Canvas.pushDialog(AssetBrowser_AddModule);
|
AssetBrowser.CreateNewModule("AssetBrowser_selectModule.newModuleAdded();");
|
||||||
AssetBrowser_addModuleWindow.selectWindow();
|
|
||||||
|
|
||||||
AssetBrowser_AddModule.callback = "AssetBrowser_selectModule.newModuleAdded();";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser_selectModule::newModuleAdded(%this)
|
function AssetBrowser_selectModule::newModuleAdded(%this)
|
||||||
|
|
|
||||||
|
|
@ -686,6 +686,12 @@ function DatablockEditorPlugin::pickedNewDBTargetModule(%this, %module)
|
||||||
%moduleDef = ModuleDatabase.findModule(%module);
|
%moduleDef = ModuleDatabase.findModule(%module);
|
||||||
|
|
||||||
$DATABLOCK_EDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedDatablocks." @ $TorqueScriptFileExtension;
|
$DATABLOCK_EDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedDatablocks." @ $TorqueScriptFileExtension;
|
||||||
|
|
||||||
|
if(!isDirectory(filePath($DATABLOCK_EDITOR_DEFAULT_FILENAME)))
|
||||||
|
{
|
||||||
|
AssetBrowser.dirHandler.createFolder(filePath($DATABLOCK_EDITOR_DEFAULT_FILENAME));
|
||||||
|
}
|
||||||
|
|
||||||
DatablockEditorPlugin.createDatablock();
|
DatablockEditorPlugin.createDatablock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,11 @@ function DecalEditorGui::pickedNewDecalTargetModule(%this, %module)
|
||||||
%moduleDef = ModuleDatabase.findModule(%module);
|
%moduleDef = ModuleDatabase.findModule(%module);
|
||||||
$decalDataFile = %moduleDef.ModulePath @ "/scripts/managedData/managedDecalData." @ $TorqueScriptFileExtension;
|
$decalDataFile = %moduleDef.ModulePath @ "/scripts/managedData/managedDecalData." @ $TorqueScriptFileExtension;
|
||||||
|
|
||||||
|
if(!isDirectory(filePath($decalDataFile)))
|
||||||
|
{
|
||||||
|
AssetBrowser.dirHandler.createFolder(filePath($decalDataFile));
|
||||||
|
}
|
||||||
|
|
||||||
%name = getUniqueName( "NewDecalData" );
|
%name = getUniqueName( "NewDecalData" );
|
||||||
|
|
||||||
%str = "datablock DecalData( " @ %name @ " ) { Material = \"WarningMaterial\"; };";
|
%str = "datablock DecalData( " @ %name @ " ) { Material = \"WarningMaterial\"; };";
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,12 @@ function ForestEditorGui::pickedNewMeshTargetModule(%this, %module)
|
||||||
%moduleDef = ModuleDatabase.findModule(%module);
|
%moduleDef = ModuleDatabase.findModule(%module);
|
||||||
|
|
||||||
ForestEditorGui.forestItemDataPath = %moduleDef.ModulePath @ "/scripts/managedData/managedForestItemData." @ $TorqueScriptFileExtension;
|
ForestEditorGui.forestItemDataPath = %moduleDef.ModulePath @ "/scripts/managedData/managedForestItemData." @ $TorqueScriptFileExtension;
|
||||||
|
|
||||||
|
if(!isDirectory(filePath(ForestEditorGui.forestItemDataPath)))
|
||||||
|
{
|
||||||
|
AssetBrowser.dirHandler.createFolder(filePath(ForestEditorGui.forestItemDataPath));
|
||||||
|
}
|
||||||
|
|
||||||
AssetBrowser.showDialog("ShapeAsset", "selectNewForestMesh", "", "", "");
|
AssetBrowser.showDialog("ShapeAsset", "selectNewForestMesh", "", "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -493,6 +493,28 @@ function ESettingsWindow::getAssetEditingSettings(%this)
|
||||||
{
|
{
|
||||||
ImportAssetWindow::reloadImportOptionConfigs();
|
ImportAssetWindow::reloadImportOptionConfigs();
|
||||||
|
|
||||||
|
//First, get our list of modules
|
||||||
|
%moduleList = ModuleDatabase.findModules();
|
||||||
|
%formattedModuleList = "";
|
||||||
|
|
||||||
|
%count = getWordCount(%moduleList);
|
||||||
|
for(%i=0; %i < %count; %i++)
|
||||||
|
{
|
||||||
|
%module = getWord(%moduleList, %i);
|
||||||
|
if(%module.group !$= "Tools" && %module.group !$= "Core")
|
||||||
|
{
|
||||||
|
if(%formattedModuleList $= "")
|
||||||
|
%formattedModuleList = %module.moduleId;
|
||||||
|
else
|
||||||
|
%formattedModuleList = %formattedModuleList @ "," @ %module.moduleId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsInspector.startGroup("Asset Creation");
|
||||||
|
SettingsInspector.addSettingsField("Assets/New/defaultModule", "Default Module", "list", "Default Module for new assets to be created into", %formattedModuleList);
|
||||||
|
SettingsInspector.addSettingsField("Assets/New/alwaysPromptModuleTarget", "Always Prompt Target Module", "bool", "If off, use the default module");
|
||||||
|
SettingsInspector.endGroup();
|
||||||
|
|
||||||
for(%i=0; %i < ImportAssetWindow.importConfigsList.Count(); %i++)
|
for(%i=0; %i < ImportAssetWindow.importConfigsList.Count(); %i++)
|
||||||
{
|
{
|
||||||
%configName = ImportAssetWindow.importConfigsList.getKey(%i);
|
%configName = ImportAssetWindow.importConfigsList.getKey(%i);
|
||||||
|
|
@ -506,6 +528,7 @@ function ESettingsWindow::getAssetEditingSettings(%this)
|
||||||
"will attempt to automatically import any inbound assets"@
|
"will attempt to automatically import any inbound assets"@
|
||||||
"using the default config, without prompting the import window."@
|
"using the default config, without prompting the import window."@
|
||||||
"The window will still display if any issues are detected", "");
|
"The window will still display if any issues are detected", "");
|
||||||
|
SettingsInspector.addSettingsField("Assets/AutoImportLooseFiles", "Automatically Import Loose Files", "bool", "If on, will automatically import unassociated loose files in assets when navigating the Asset Browser.", "");
|
||||||
SettingsInspector.endGroup();
|
SettingsInspector.endGroup();
|
||||||
|
|
||||||
SettingsInspector.startGroup("Asset Browser");
|
SettingsInspector.startGroup("Asset Browser");
|
||||||
|
|
@ -516,7 +539,7 @@ function ESettingsWindow::getAssetEditingSettings(%this)
|
||||||
SettingsInspector.addSettingsField("Assets/Browser/showEmptyFolders", "Show Empty Folders in Tiles view in Asset Browser", "bool", "");
|
SettingsInspector.addSettingsField("Assets/Browser/showEmptyFolders", "Show Empty Folders in Tiles view in Asset Browser", "bool", "");
|
||||||
SettingsInspector.addSettingsField("Assets/Browser/showLooseFiles", "Show Loose Files when viewing in Asset Browser", "bool", "");
|
SettingsInspector.addSettingsField("Assets/Browser/showLooseFiles", "Show Loose Files when viewing in Asset Browser", "bool", "");
|
||||||
SettingsInspector.addSettingsField("AssetManagement/Assets/promptOnRename", "Prompt on Rename", "bool", "");
|
SettingsInspector.addSettingsField("AssetManagement/Assets/promptOnRename", "Prompt on Rename", "bool", "");
|
||||||
|
SettingsInspector.addSettingsField("Assets/Browser/doubleClickAction", "Double Click Action", "list", "Dictates what sort of action double clicking on an asset in the Browser will invoke", "Edit Asset,Spawn Asset");
|
||||||
SettingsInspector.addSettingsField("AssetManagement/Assets/closeBrowserOnDragAction", "Close Browser on Drag Action", "bool", "If on, the Asset Browser will automatically close after dragging an asset from it to the editor interface.");
|
SettingsInspector.addSettingsField("AssetManagement/Assets/closeBrowserOnDragAction", "Close Browser on Drag Action", "bool", "If on, the Asset Browser will automatically close after dragging an asset from it to the editor interface.");
|
||||||
SettingsInspector.endGroup();
|
SettingsInspector.endGroup();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -353,13 +353,18 @@ new GuiControlProfile( ToolsGuiButtonProfile )
|
||||||
{
|
{
|
||||||
opaque = true;
|
opaque = true;
|
||||||
border = true;
|
border = true;
|
||||||
|
fillColor = EditorSettings.value("Theme/tabsColor");
|
||||||
|
fillColorHL = EditorSettings.value("Theme/tabsGLColor");
|
||||||
|
fillColorSEL = EditorSettings.value("Theme/tabsSELColor");
|
||||||
|
fillColorNA = EditorSettings.value("Theme/tabsSELColor");
|
||||||
|
|
||||||
fontColor = EditorSettings.value("Theme/fieldTextColor");
|
fontColor = EditorSettings.value("Theme/fieldTextColor");
|
||||||
fontColorHL = EditorSettings.value("Theme/fieldTextHLColor");
|
fontColorHL = EditorSettings.value("Theme/fieldTextHLColor");
|
||||||
fontColorNA = EditorSettings.value("Theme/fieldTextSELColor");
|
fontColorNA = EditorSettings.value("Theme/fieldTextSELColor");
|
||||||
fixedExtent = false;
|
fixedExtent = false;
|
||||||
justify = "center";
|
justify = "center";
|
||||||
canKeyFocus = false;
|
canKeyFocus = false;
|
||||||
bitmapAsset = "ToolsModule:button_image";
|
//bitmapAsset = "ToolsModule:button_image";
|
||||||
hasBitmapArray = false;
|
hasBitmapArray = false;
|
||||||
category = "Tools";
|
category = "Tools";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,76 +1,80 @@
|
||||||
//--- OBJECT WRITE BEGIN ---
|
//--- OBJECT WRITE BEGIN ---
|
||||||
%guiContent = new GuiControl(ScriptEditorDlg,EditorGuiGroup) {
|
%guiContent = new GuiControl(ScriptEditorDlg,EditorGuiGroup) {
|
||||||
isContainer = "1";
|
|
||||||
Profile = "ToolsGuiDefaultNonModalProfile";
|
|
||||||
HorizSizing = "width";
|
|
||||||
VertSizing = "height";
|
|
||||||
position = "0 0";
|
position = "0 0";
|
||||||
Extent = "1024 768";
|
extent = "1024 768";
|
||||||
MinExtent = "8 2";
|
minExtent = "8 2";
|
||||||
canSave = "1";
|
horizSizing = "width";
|
||||||
Visible = "1";
|
vertSizing = "height";
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
profile = "ToolsGuiDefaultNonModalProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
canSaveDynamicFields = "0";
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "1";
|
||||||
|
|
||||||
new GuiWindowCtrl() {
|
new GuiWindowCtrl() {
|
||||||
|
text = "Text Pad";
|
||||||
resizeWidth = "0";
|
resizeWidth = "0";
|
||||||
resizeHeight = "0";
|
resizeHeight = "0";
|
||||||
canMove = "1";
|
canMove = "1";
|
||||||
canClose = "1";
|
canClose = "1";
|
||||||
canMinimize = "1";
|
canMinimize = "1";
|
||||||
canMaximize = "1";
|
canMaximize = "1";
|
||||||
minSize = "50 50";
|
canCollapse = "0";
|
||||||
closeCommand = "ScriptEditorDlg.close();";
|
closeCommand = "ScriptEditorDlg.close();";
|
||||||
EdgeSnap = "1";
|
edgeSnap = "1";
|
||||||
text = "Text Pad";
|
margin = "0 0 0 0";
|
||||||
Margin = "0 0 0 0";
|
padding = "0 0 0 0";
|
||||||
Padding = "0 0 0 0";
|
anchorTop = "1";
|
||||||
AnchorTop = "1";
|
anchorBottom = "0";
|
||||||
AnchorBottom = "0";
|
anchorLeft = "1";
|
||||||
AnchorLeft = "1";
|
anchorRight = "0";
|
||||||
AnchorRight = "0";
|
position = "219 162";
|
||||||
isContainer = "1";
|
extent = "524 373";
|
||||||
Profile = "ToolsGuiWindowProfile";
|
minExtent = "8 8";
|
||||||
HorizSizing = "center";
|
horizSizing = "center";
|
||||||
VertSizing = "center";
|
vertSizing = "center";
|
||||||
position = "176 120";
|
profile = "ToolsGuiWindowProfile";
|
||||||
Extent = "656 464";
|
visible = "1";
|
||||||
MinExtent = "8 8";
|
active = "1";
|
||||||
canSave = "1";
|
command = "ScriptEditorDlg.close();";
|
||||||
Visible = "1";
|
accelerator = "escape";
|
||||||
Command = "ScriptEditorDlg.close();";
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
Accelerator = "escape";
|
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
new GuiControl() {
|
new GuiControl() {
|
||||||
isContainer = "1";
|
|
||||||
Profile = "ToolsGuiDefaultProfile";
|
|
||||||
HorizSizing = "width";
|
|
||||||
VertSizing = "height";
|
|
||||||
position = "8 24";
|
position = "8 24";
|
||||||
Extent = "640 392";
|
extent = "508 291";
|
||||||
MinExtent = "8 2";
|
minExtent = "8 2";
|
||||||
canSave = "1";
|
horizSizing = "width";
|
||||||
Visible = "1";
|
vertSizing = "height";
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
profile = "ToolsGuiDefaultProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
new GuiControl() {
|
new GuiControl() {
|
||||||
isContainer = "1";
|
position = "1 7";
|
||||||
Profile = "ToolsGuiDefaultProfile";
|
extent = "507 286";
|
||||||
HorizSizing = "width";
|
minExtent = "8 2";
|
||||||
VertSizing = "height";
|
horizSizing = "width";
|
||||||
position = "8 7";
|
vertSizing = "height";
|
||||||
Extent = "627 380";
|
profile = "ToolsGuiDefaultProfile";
|
||||||
MinExtent = "8 2";
|
visible = "1";
|
||||||
canSave = "1";
|
active = "1";
|
||||||
Visible = "1";
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
new GuiScrollCtrl() {
|
new GuiScrollCtrl() {
|
||||||
|
|
@ -82,23 +86,24 @@
|
||||||
constantThumbHeight = "0";
|
constantThumbHeight = "0";
|
||||||
childMargin = "1 1";
|
childMargin = "1 1";
|
||||||
mouseWheelScrollSpeed = "-1";
|
mouseWheelScrollSpeed = "-1";
|
||||||
Margin = "0 0 0 0";
|
margin = "0 0 0 0";
|
||||||
Padding = "0 0 0 0";
|
padding = "0 0 0 0";
|
||||||
AnchorTop = "1";
|
anchorTop = "1";
|
||||||
AnchorBottom = "0";
|
anchorBottom = "0";
|
||||||
AnchorLeft = "1";
|
anchorLeft = "1";
|
||||||
AnchorRight = "0";
|
anchorRight = "0";
|
||||||
isContainer = "1";
|
|
||||||
Profile = "ToolsGuiScrollProfile";
|
|
||||||
HorizSizing = "width";
|
|
||||||
VertSizing = "height";
|
|
||||||
position = "0 0";
|
position = "0 0";
|
||||||
Extent = "627 380";
|
extent = "507 286";
|
||||||
MinExtent = "8 2";
|
minExtent = "8 2";
|
||||||
canSave = "1";
|
horizSizing = "width";
|
||||||
Visible = "1";
|
vertSizing = "height";
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
profile = "ToolsGuiScrollProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
new GuiMLTextEditCtrl() {
|
new GuiMLTextEditCtrl() {
|
||||||
|
|
@ -106,18 +111,19 @@
|
||||||
allowColorChars = "0";
|
allowColorChars = "0";
|
||||||
maxChars = "-1";
|
maxChars = "-1";
|
||||||
useURLMouseCursor = "0";
|
useURLMouseCursor = "0";
|
||||||
isContainer = "0";
|
|
||||||
Profile = "ToolsGuiTextPadProfile";
|
|
||||||
HorizSizing = "width";
|
|
||||||
VertSizing = "height";
|
|
||||||
position = "2 2";
|
position = "2 2";
|
||||||
Extent = "623 380";
|
extent = "505 286";
|
||||||
MinExtent = "8 2";
|
minExtent = "8 2";
|
||||||
canSave = "1";
|
horizSizing = "width";
|
||||||
Visible = "1";
|
vertSizing = "height";
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
profile = "ToolsGuiTextPadProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
internalName = "TextPad";
|
internalName = "TextPad";
|
||||||
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -125,7 +131,7 @@
|
||||||
};
|
};
|
||||||
new GuiIconButtonCtrl() {
|
new GuiIconButtonCtrl() {
|
||||||
buttonMargin = "4 4";
|
buttonMargin = "4 4";
|
||||||
bitmapAsset = "ToolsModule:iconCancel_image";
|
BitmapAsset = "ToolsModule:iconCancel_image";
|
||||||
iconLocation = "Left";
|
iconLocation = "Left";
|
||||||
sizeIconToButton = "0";
|
sizeIconToButton = "0";
|
||||||
makeIconSquare = "0";
|
makeIconSquare = "0";
|
||||||
|
|
@ -136,23 +142,24 @@
|
||||||
groupNum = "-1";
|
groupNum = "-1";
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
useMouseEvents = "0";
|
useMouseEvents = "0";
|
||||||
isContainer = "0";
|
position = "335 334";
|
||||||
Profile = "ToolsGuiButtonProfile";
|
extent = "80 25";
|
||||||
HorizSizing = "left";
|
minExtent = "8 2";
|
||||||
VertSizing = "top";
|
horizSizing = "left";
|
||||||
position = "460 424";
|
vertSizing = "top";
|
||||||
Extent = "80 25";
|
profile = "ToolsGuiButtonProfile";
|
||||||
MinExtent = "8 2";
|
visible = "1";
|
||||||
canSave = "1";
|
active = "1";
|
||||||
Visible = "1";
|
command = "ScriptEditorDlg.close();";
|
||||||
Command = "ScriptEditorDlg.close();";
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
new GuiIconButtonCtrl() {
|
new GuiIconButtonCtrl() {
|
||||||
buttonMargin = "4 4";
|
buttonMargin = "4 4";
|
||||||
bitmapAsset = "ToolsModule:iconAccept_image";
|
BitmapAsset = "ToolsModule:iconAccept_image";
|
||||||
iconLocation = "Left";
|
iconLocation = "Left";
|
||||||
sizeIconToButton = "0";
|
sizeIconToButton = "0";
|
||||||
makeIconSquare = "0";
|
makeIconSquare = "0";
|
||||||
|
|
@ -163,18 +170,19 @@
|
||||||
groupNum = "-1";
|
groupNum = "-1";
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
useMouseEvents = "0";
|
useMouseEvents = "0";
|
||||||
isContainer = "0";
|
position = "436 334";
|
||||||
Profile = "ToolsGuiButtonProfile";
|
extent = "80 25";
|
||||||
HorizSizing = "left";
|
minExtent = "8 2";
|
||||||
VertSizing = "top";
|
horizSizing = "left";
|
||||||
position = "560 424";
|
vertSizing = "top";
|
||||||
Extent = "80 25";
|
profile = "ToolsGuiButtonProfile";
|
||||||
MinExtent = "8 2";
|
visible = "1";
|
||||||
canSave = "1";
|
active = "1";
|
||||||
Visible = "1";
|
command = "_TextPadOnOk();";
|
||||||
Command = "_TextPadOnOk();";
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
tooltipprofile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2039,13 +2039,17 @@ function MaterialEditorGui::pickedNewMaterialTargetModule( %this, %module )
|
||||||
PE_EmitterEditor.targetModule = %module;
|
PE_EmitterEditor.targetModule = %module;
|
||||||
MaterialEditorGui.defaultMaterialFile = %moduleDef.ModulePath @ "/scripts/managedData/materials." @ $TorqueScriptFileExtension;
|
MaterialEditorGui.defaultMaterialFile = %moduleDef.ModulePath @ "/scripts/managedData/materials." @ $TorqueScriptFileExtension;
|
||||||
|
|
||||||
|
if(!isDirectory(filePath(MaterialEditorGui.defaultMaterialFile)))
|
||||||
|
{
|
||||||
|
AssetBrowser.dirHandler.createFolder(filePath(MaterialEditorGui.defaultMaterialFile));
|
||||||
|
}
|
||||||
|
|
||||||
%action = %this.createUndo(ActionCreateNewMaterial, "Create New Material");
|
%action = %this.createUndo(ActionCreateNewMaterial, "Create New Material");
|
||||||
%action.object = "";
|
%action.object = "";
|
||||||
|
|
||||||
%material = getUniqueName( "newMaterial" );
|
%material = getUniqueName( "newMaterial" );
|
||||||
new Material(%material)
|
new Material(%material)
|
||||||
{
|
{
|
||||||
diffuseMap[0] = "core/rendering/images/warnmat";
|
|
||||||
mapTo = "unmapped_mat";
|
mapTo = "unmapped_mat";
|
||||||
parentGroup = RootGroup;
|
parentGroup = RootGroup;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -563,6 +563,11 @@ function PE_EmitterEditor::pickedNewEmitterTargetModule( %this, %module )
|
||||||
PE_EmitterEditor.targetModule = %module;
|
PE_EmitterEditor.targetModule = %module;
|
||||||
$PE_EMITTEREDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension;
|
$PE_EMITTEREDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension;
|
||||||
|
|
||||||
|
if(!isDirectory(filePath($PE_EMITTEREDITOR_DEFAULT_FILENAME)))
|
||||||
|
{
|
||||||
|
AssetBrowser.dirHandler.createFolder(filePath($PE_EMITTEREDITOR_DEFAULT_FILENAME));
|
||||||
|
}
|
||||||
|
|
||||||
// Create a new emitter.
|
// Create a new emitter.
|
||||||
%emitter = getUniqueName( "newEmitter" );
|
%emitter = getUniqueName( "newEmitter" );
|
||||||
datablock ParticleEmitterData( %emitter : DefaultEmitter )
|
datablock ParticleEmitterData( %emitter : DefaultEmitter )
|
||||||
|
|
|
||||||
|
|
@ -498,6 +498,11 @@ function PE_ParticleEditor::pickedNewParticleTargetModule(%this, %module)
|
||||||
%moduleDef = ModuleDatabase.findModule(%module);
|
%moduleDef = ModuleDatabase.findModule(%module);
|
||||||
$PE_PARTICLEEDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension;
|
$PE_PARTICLEEDITOR_DEFAULT_FILENAME = %moduleDef.ModulePath @ "/scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension;
|
||||||
|
|
||||||
|
if(!isDirectory(filePath($PE_PARTICLEEDITOR_DEFAULT_FILENAME)))
|
||||||
|
{
|
||||||
|
AssetBrowser.dirHandler.createFolder(filePath($PE_PARTICLEEDITOR_DEFAULT_FILENAME));
|
||||||
|
}
|
||||||
|
|
||||||
// Create the particle datablock and add to the emitter.
|
// Create the particle datablock and add to the emitter.
|
||||||
|
|
||||||
%newParticle = getUniqueName( "newParticle" );
|
%newParticle = getUniqueName( "newParticle" );
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ function EPainter::updateLayers( %this, %matIndex )
|
||||||
%ctrl = new GuiIconButtonCtrl()
|
%ctrl = new GuiIconButtonCtrl()
|
||||||
{
|
{
|
||||||
profile = "GuiCreatorIconButtonProfile";
|
profile = "GuiCreatorIconButtonProfile";
|
||||||
iconBitmap = "~/worldEditor/images/terrainpainter/new_layer_icon";
|
iconBitmapAsset = "ToolsModule:new_layer_icon_image";
|
||||||
iconLocation = "Left";
|
iconLocation = "Left";
|
||||||
textLocation = "Right";
|
textLocation = "Right";
|
||||||
extent = %listWidth SPC "46";
|
extent = %listWidth SPC "46";
|
||||||
|
|
|
||||||
|
|
@ -246,14 +246,22 @@ function TerrainMaterialDlg::clearTextureMap(%this, %mapName)
|
||||||
%targetMap.setBitmap($TerrainMaterialEditor::emptyMaterialImage);
|
%targetMap.setBitmap($TerrainMaterialEditor::emptyMaterialImage);
|
||||||
%targetMap.asset = "";
|
%targetMap.asset = "";
|
||||||
|
|
||||||
|
%targetMapName = %this.findObjectByInternalName(%mapName @ "AssetId", true);
|
||||||
|
%targetMapName.setText("None");
|
||||||
|
|
||||||
TerrainMaterialDlg.matDirty = true;
|
TerrainMaterialDlg.matDirty = true;
|
||||||
|
|
||||||
if(%mapName $= "DetailMap")
|
if(%mapName $= "DetailMap")
|
||||||
{
|
{
|
||||||
//hide the supplemental maps
|
//hide the supplemental maps
|
||||||
NormalMapContainer.callOnChildren("setActive", false);
|
NormalMapContainer.callOnChildren("setActive", false);
|
||||||
|
%this.clearTextureMap("NormalMap");
|
||||||
|
|
||||||
ORMMapContainer.callOnChildren("setActive", false);
|
ORMMapContainer.callOnChildren("setActive", false);
|
||||||
|
%this.clearTextureMap("ORMMap");
|
||||||
|
|
||||||
MacroMapContainer.callOnChildren("setActive", false);
|
MacroMapContainer.callOnChildren("setActive", false);
|
||||||
|
%this.clearTextureMap("MacroMap");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -290,6 +298,9 @@ function TerrainMaterialDlg::changeTerrainMatMapAsset(%this)
|
||||||
|
|
||||||
%targetMap.setBitmap( %image );
|
%targetMap.setBitmap( %image );
|
||||||
|
|
||||||
|
%targetMapName = %mapName @ "AssetId";
|
||||||
|
%targetMapName.setText(%imgAsset);
|
||||||
|
|
||||||
TerrainMaterialDlg.matDirty = true;
|
TerrainMaterialDlg.matDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -546,29 +557,32 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat )
|
||||||
|
|
||||||
%newName = %this-->matNameCtrl.getText();
|
%newName = %this-->matNameCtrl.getText();
|
||||||
|
|
||||||
|
%blankBitmap = AssetDatabase.acquireAsset($TerrainMaterialEditor::emptyMaterialImage).getImagePath();
|
||||||
|
|
||||||
|
|
||||||
//---
|
//---
|
||||||
%newDiffuse = %this-->texBaseMap.getBitmap();
|
%newDiffuse = %this-->texBaseMap.getBitmap();
|
||||||
if(%newDiffuse $= $TerrainMaterialEditor::emptyMaterialImage)
|
if(%newDiffuse $= $TerrainMaterialEditor::emptyMaterialImage || %newDiffuse $= %blankBitmap)
|
||||||
%newDiffuse = "";
|
%newDiffuse = "";
|
||||||
|
|
||||||
//---
|
//---
|
||||||
%newNormal = %this-->texNormalMap.getBitmap();
|
%newNormal = %this-->texNormalMap.getBitmap();
|
||||||
if(%newNormal $= $TerrainMaterialEditor::emptyMaterialImage)
|
if(%newNormal $= $TerrainMaterialEditor::emptyMaterialImage || %newNormal $= %blankBitmap)
|
||||||
%newNormal = "";
|
%newNormal = "";
|
||||||
|
|
||||||
//---
|
//---
|
||||||
%newormConfig = %this-->texORMConfigMap.getBitmap();
|
%newormConfig = %this-->texORMConfigMap.getBitmap();
|
||||||
if(%newormConfig $= $TerrainMaterialEditor::emptyMaterialImage)
|
if(%newormConfig $= $TerrainMaterialEditor::emptyMaterialImage || %newormConfig $= %blankBitmap)
|
||||||
%newormConfig = "";
|
%newormConfig = "";
|
||||||
|
|
||||||
//---
|
//---
|
||||||
%newDetail = %this-->texDetailMap.getBitmap();
|
%newDetail = %this-->texDetailMap.getBitmap();
|
||||||
if(%newDetail $= $TerrainMaterialEditor::emptyMaterialImage)
|
if(%newDetail $= $TerrainMaterialEditor::emptyMaterialImage || %newDetail $= %blankBitmap)
|
||||||
%newDetail = "";
|
%newDetail = "";
|
||||||
|
|
||||||
//---
|
//---
|
||||||
%newMacro = %this-->texMacroMap.getBitmap();
|
%newMacro = %this-->texMacroMap.getBitmap();
|
||||||
if(%newMacro $= $TerrainMaterialEditor::emptyMaterialImage)
|
if(%newMacro $= $TerrainMaterialEditor::emptyMaterialImage || %newMacro $= %blankBitmap)
|
||||||
%newMacro = "";
|
%newMacro = "";
|
||||||
|
|
||||||
%detailSize = %this-->detSizeCtrl.getText();
|
%detailSize = %this-->detSizeCtrl.getText();
|
||||||
|
|
|
||||||
|
|
@ -1059,7 +1059,12 @@ function EditorDropTypeMenu::onSelectItem(%this, %id, %text)
|
||||||
// a drop type is selected in the menu.
|
// a drop type is selected in the menu.
|
||||||
EWorldEditor.dropType = getField(%this.item[%id], 2);
|
EWorldEditor.dropType = getField(%this.item[%id], 2);
|
||||||
|
|
||||||
%this.checkRadioItem(0, (%this.getItemCount() - 1), %id);
|
for(%i=0; %i < %this.getItemCount() + 1; %i++)
|
||||||
|
{
|
||||||
|
%this.checkItem(%i, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
%this.checkItem(%id, true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue