Merge pull request #687 from Areloch/MiscQOL_20211116
Misc QOL and Bugfixes for 2021/11/26
|
|
@ -199,7 +199,7 @@ GuiControl* GuiInspectorTypeCubemapAssetPtr::constructEditControl()
|
||||||
// Change filespec
|
// Change filespec
|
||||||
char szBuffer[512];
|
char szBuffer[512];
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"CubemapAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"CubemapAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
||||||
mInspector->getInspectObject(), mCaption);
|
mInspector->getIdString(), mCaption);
|
||||||
mBrowseButton->setField("Command", szBuffer);
|
mBrowseButton->setField("Command", szBuffer);
|
||||||
|
|
||||||
setDataField(StringTable->insert("object"), NULL, String::ToString(mInspector->getInspectObject()).c_str());
|
setDataField(StringTable->insert("object"), NULL, String::ToString(mInspector->getInspectObject()).c_str());
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ GuiControl* GuiInspectorTypeGUIAssetPtr::constructEditControl()
|
||||||
// Change filespec
|
// Change filespec
|
||||||
char szBuffer[512];
|
char szBuffer[512];
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"GUIAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"GUIAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
||||||
mInspector->getComponentGroupTargetId(), mCaption);
|
mInspector->getIdString(), mCaption);
|
||||||
mBrowseButton->setField("Command", szBuffer);
|
mBrowseButton->setField("Command", szBuffer);
|
||||||
|
|
||||||
// Create "Open in ShapeEditor" button
|
// Create "Open in ShapeEditor" button
|
||||||
|
|
|
||||||
|
|
@ -480,7 +480,7 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
|
||||||
// Change filespec
|
// Change filespec
|
||||||
char szBuffer[512];
|
char szBuffer[512];
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
|
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
|
||||||
mInspector->getInspectObject()->getIdString(), mCaption);
|
mInspector->getIdString(), mCaption);
|
||||||
mBrowseButton->setField("Command", szBuffer);
|
mBrowseButton->setField("Command", szBuffer);
|
||||||
|
|
||||||
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
||||||
|
|
@ -488,11 +488,9 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
|
||||||
// Create "Open in ShapeEditor" button
|
// Create "Open in ShapeEditor" button
|
||||||
mImageEdButton = new GuiBitmapButtonCtrl();
|
mImageEdButton = new GuiBitmapButtonCtrl();
|
||||||
|
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.openShapeAssetId(%d.getText());", retCtrl->getId());
|
|
||||||
mImageEdButton->setField("Command", szBuffer);
|
|
||||||
|
|
||||||
char bitmapName[512] = "ToolsModule:GameTSCtrl_image";
|
char bitmapName[512] = "ToolsModule:GameTSCtrl_image";
|
||||||
mImageEdButton->setBitmap(StringTable->insert(bitmapName));
|
mImageEdButton->setBitmap(StringTable->insert(bitmapName));
|
||||||
|
mImageEdButton->setHidden(true);
|
||||||
|
|
||||||
mImageEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
|
mImageEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
|
||||||
mImageEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
|
mImageEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
|
||||||
|
|
|
||||||
|
|
@ -432,8 +432,8 @@ GuiControl* GuiInspectorTypeMaterialAssetPtr::constructEditControl()
|
||||||
|
|
||||||
// Change filespec
|
// Change filespec
|
||||||
char szBuffer[512];
|
char szBuffer[512];
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, \"\");",
|
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
|
||||||
getIdString());
|
mInspector->getIdString(), mCaption);
|
||||||
mBrowseButton->setField("Command", szBuffer);
|
mBrowseButton->setField("Command", szBuffer);
|
||||||
|
|
||||||
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ GuiControl* GuiInspectorTypeParticleAssetPtr::constructEditControl()
|
||||||
// Change filespec
|
// Change filespec
|
||||||
char szBuffer[512];
|
char szBuffer[512];
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ParticleAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ParticleAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
||||||
mInspector->getComponentGroupTargetId(), mCaption);
|
mInspector->getIdString(), mCaption);
|
||||||
mBrowseButton->setField("Command", szBuffer);
|
mBrowseButton->setField("Command", szBuffer);
|
||||||
|
|
||||||
// Create "Open in ShapeEditor" button
|
// Create "Open in ShapeEditor" button
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@
|
||||||
#ifdef TORQUE_TOOLS
|
#ifdef TORQUE_TOOLS
|
||||||
#include "ts/tsLastDetail.h"
|
#include "ts/tsLastDetail.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "util/imposterCapture.h"
|
||||||
|
|
||||||
StringTableEntry ShapeAsset::smNoShapeAssetFallback = NULL;
|
StringTableEntry ShapeAsset::smNoShapeAssetFallback = NULL;
|
||||||
|
|
||||||
|
|
@ -600,7 +601,7 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl()
|
||||||
// Change filespec
|
// Change filespec
|
||||||
char szBuffer[512];
|
char szBuffer[512];
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
|
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
|
||||||
mInspector->getInspectObject()->getIdString(), mCaption);
|
mInspector->getIdString(), mCaption);
|
||||||
mBrowseButton->setField("Command", szBuffer);
|
mBrowseButton->setField("Command", szBuffer);
|
||||||
|
|
||||||
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
||||||
|
|
|
||||||
|
|
@ -465,7 +465,7 @@ GuiControl* GuiInspectorTypeTerrainAssetPtr::constructEditControl()
|
||||||
// Change filespec
|
// Change filespec
|
||||||
char szBuffer[512];
|
char szBuffer[512];
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
|
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
|
||||||
mInspector->getInspectObject()->getIdString(), mCaption);
|
mInspector->getIdString(), mCaption);
|
||||||
mBrowseButton->setField("Command", szBuffer);
|
mBrowseButton->setField("Command", szBuffer);
|
||||||
|
|
||||||
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,7 @@ GuiControl* GuiInspectorTypeTerrainMaterialAssetPtr::constructEditControl()
|
||||||
// Change filespec
|
// Change filespec
|
||||||
char szBuffer[512];
|
char szBuffer[512];
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainMaterialAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainMaterialAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
||||||
mInspector->getComponentGroupTargetId(), mCaption);
|
mInspector->getIdString(), mCaption);
|
||||||
mMatPreviewButton->setField("Command", szBuffer);
|
mMatPreviewButton->setField("Command", szBuffer);
|
||||||
|
|
||||||
mMatPreviewButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
|
mMatPreviewButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
|
||||||
|
|
|
||||||
|
|
@ -1820,6 +1820,32 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//Check to see if our target module has a matching assetId for this slot already
|
||||||
|
String testAssetId = targetModuleId + ":" + assetItem->cleanAssetName + StringUnit::getUnit(suffixList.c_str(), i, ",;\t");
|
||||||
|
bool localAssetFound = false;
|
||||||
|
|
||||||
|
if (AssetDatabase.isDeclaredAsset(testAssetId.c_str()))
|
||||||
|
localAssetFound = true;
|
||||||
|
|
||||||
|
if (localAssetFound == false)
|
||||||
|
//Didn't work, try checking the common default type suffix
|
||||||
|
testAssetId = targetModuleId + ":" + assetItem->cleanAssetName + StringUnit::getUnit(suffixList.c_str(), i, ",;\t") + activeImportConfig->AddedImageSuffix;
|
||||||
|
|
||||||
|
if (localAssetFound)
|
||||||
|
{
|
||||||
|
//got a match!
|
||||||
|
ImageAsset* foundImageAsset = AssetDatabase.acquireAsset<ImageAsset>(testAssetId.c_str());
|
||||||
|
imagePath = foundImageAsset->getImagePath();
|
||||||
|
|
||||||
|
AssetImportObject* newImageAssetObj = addImportingAsset("ImageAsset", imagePath, assetItem, "");
|
||||||
|
|
||||||
|
newImageAssetObj->imageSuffixType = ImageAsset::getImageTypeNameFromType((ImageAsset::ImageTypes)t);
|
||||||
|
newImageAssetObj->importStatus = AssetImportObject::UseForDependencies; //we aren't going to actually IMPORT an already imported asset,
|
||||||
|
//so mark it as dependency use only
|
||||||
|
matchedImageTypes[t] = newImageAssetObj;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (materialImageNoSuffix.isNotEmpty())
|
if (materialImageNoSuffix.isNotEmpty())
|
||||||
{
|
{
|
||||||
testPath = assetItem->filePath.getRootAndPath();
|
testPath = assetItem->filePath.getRootAndPath();
|
||||||
|
|
@ -1837,6 +1863,32 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
|
||||||
matchedImageTypes[t] = newImageAssetObj;
|
matchedImageTypes[t] = newImageAssetObj;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Check to see if our target module has a matching assetId for this slot already based on our trimmed mat name
|
||||||
|
testAssetId = targetModuleId + ":" + materialImageNoSuffix + StringUnit::getUnit(suffixList.c_str(), i, ",;\t");
|
||||||
|
bool localAssetFound = false;
|
||||||
|
|
||||||
|
if (AssetDatabase.isDeclaredAsset(testAssetId.c_str()))
|
||||||
|
localAssetFound = true;
|
||||||
|
|
||||||
|
if (localAssetFound == false)
|
||||||
|
//Didn't work, try checking the common default type suffix
|
||||||
|
testAssetId = targetModuleId + ":" + materialImageNoSuffix + StringUnit::getUnit(suffixList.c_str(), i, ",;\t") + activeImportConfig->AddedImageSuffix;
|
||||||
|
|
||||||
|
if (localAssetFound)
|
||||||
|
{
|
||||||
|
//got a match!
|
||||||
|
ImageAsset* foundImageAsset = AssetDatabase.acquireAsset<ImageAsset>(testAssetId.c_str());
|
||||||
|
imagePath = foundImageAsset->getImagePath();
|
||||||
|
|
||||||
|
AssetImportObject* newImageAssetObj = addImportingAsset("ImageAsset", imagePath, assetItem, "");
|
||||||
|
|
||||||
|
newImageAssetObj->imageSuffixType = ImageAsset::getImageTypeNameFromType((ImageAsset::ImageTypes)t);
|
||||||
|
newImageAssetObj->importStatus = AssetImportObject::UseForDependencies; //we aren't going to actually IMPORT an already imported asset,
|
||||||
|
//so mark it as dependency use only
|
||||||
|
matchedImageTypes[t] = newImageAssetObj;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2538,6 +2590,9 @@ void AssetImporter::importAssets(AssetImportObject* assetItem)
|
||||||
{
|
{
|
||||||
bool registerSuccess = AssetDatabase.addDeclaredAsset(moduleDef, assetPath.getFullPath().c_str());
|
bool registerSuccess = AssetDatabase.addDeclaredAsset(moduleDef, assetPath.getFullPath().c_str());
|
||||||
|
|
||||||
|
String assetIdStr = item->moduleName + ":" + item->assetName;
|
||||||
|
StringTableEntry assetId = StringTable->insert(assetIdStr.c_str());
|
||||||
|
|
||||||
if (!registerSuccess)
|
if (!registerSuccess)
|
||||||
{
|
{
|
||||||
dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to successfully register new asset at path %s to moduleId %s", assetPath.getFullPath().c_str(), targetModuleId.c_str());
|
dSprintf(importLogBuffer, sizeof(importLogBuffer), "AssetImporter::importAssets - Failed to successfully register new asset at path %s to moduleId %s", assetPath.getFullPath().c_str(), targetModuleId.c_str());
|
||||||
|
|
@ -2548,9 +2603,6 @@ void AssetImporter::importAssets(AssetImportObject* assetItem)
|
||||||
//Any special-case post-reg stuff here
|
//Any special-case post-reg stuff here
|
||||||
if (item->assetType == String("ShapeAsset"))
|
if (item->assetType == String("ShapeAsset"))
|
||||||
{
|
{
|
||||||
String assetIdStr = item->moduleName + ":" + item->assetName;
|
|
||||||
StringTableEntry assetId = StringTable->insert(assetIdStr.c_str());
|
|
||||||
|
|
||||||
//forcefully update it's shape constructor
|
//forcefully update it's shape constructor
|
||||||
TSShapeConstructor* tss = TSShapeConstructor::findShapeConstructorByAssetId(assetId);
|
TSShapeConstructor* tss = TSShapeConstructor::findShapeConstructorByAssetId(assetId);
|
||||||
|
|
||||||
|
|
@ -2558,6 +2610,10 @@ void AssetImporter::importAssets(AssetImportObject* assetItem)
|
||||||
tss->setShapeAssetId(assetId);
|
tss->setShapeAssetId(assetId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Go ahead and force the asset to load now just to kick it for immediate use
|
||||||
|
AssetBase* assetDef = AssetDatabase.acquireAsset<AssetBase>(assetId);
|
||||||
|
AssetDatabase.releaseAsset(assetId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ GuiControl* GuiInspectorTypeStateMachineAssetPtr::constructEditControl()
|
||||||
// Change filespec
|
// Change filespec
|
||||||
char szBuffer[512];
|
char szBuffer[512];
|
||||||
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"StateMachineAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"StateMachineAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
|
||||||
mInspector->getComponentGroupTargetId(), mCaption);
|
mInspector->getIdString(), mCaption);
|
||||||
mBrowseButton->setField("Command", szBuffer);
|
mBrowseButton->setField("Command", szBuffer);
|
||||||
|
|
||||||
// Create "Open in ShapeEditor" button
|
// Create "Open in ShapeEditor" button
|
||||||
|
|
|
||||||
|
|
@ -1086,15 +1086,16 @@ void TSStatic::unpackUpdate(NetConnection* con, BitStream* stream)
|
||||||
|
|
||||||
stream->read(&mForceDetail);
|
stream->read(&mForceDetail);
|
||||||
|
|
||||||
if (stream->readFlag())
|
if (stream->readFlag())
|
||||||
mAnimOffset = stream->readFloat(7);
|
mAnimOffset = stream->readFloat(7);
|
||||||
|
|
||||||
if (stream->readFlag())
|
if (stream->readFlag())
|
||||||
mAnimSpeed = stream->readSignedFloat(7) * AnimSpeedMax;
|
mAnimSpeed = stream->readSignedFloat(7) * AnimSpeedMax;
|
||||||
|
|
||||||
mPlayAmbient = stream->readFlag();
|
mPlayAmbient = stream->readFlag();
|
||||||
|
|
||||||
|
//update our shape, figuring that it likely changed
|
||||||
|
_createShape();
|
||||||
}
|
}
|
||||||
|
|
||||||
mUseAlphaFade = stream->readFlag();
|
mUseAlphaFade = stream->readFlag();
|
||||||
|
|
|
||||||
|
|
@ -232,32 +232,7 @@ void GuiBitmapButtonCtrl::inspectPostApply()
|
||||||
{
|
{
|
||||||
Parent::inspectPostApply();
|
Parent::inspectPostApply();
|
||||||
|
|
||||||
Torque::Path path( mBitmapName );
|
setBitmap(getBitmap());
|
||||||
const String& fileName = path.getFileName();
|
|
||||||
|
|
||||||
if( mUseStates )
|
|
||||||
{
|
|
||||||
// If the filename points to a single state, automatically
|
|
||||||
// cut off the state part. Makes it easy to select files in
|
|
||||||
// the editor without having to go in and manually cut off the
|
|
||||||
// state parts all the time.
|
|
||||||
|
|
||||||
static String s_n = "_n";
|
|
||||||
static String s_d = "_d";
|
|
||||||
static String s_h = "_h";
|
|
||||||
static String s_i = "_i";
|
|
||||||
|
|
||||||
if( fileName.endsWith( s_n )
|
|
||||||
|| fileName.endsWith( s_d )
|
|
||||||
|| fileName.endsWith( s_h )
|
|
||||||
|| fileName.endsWith( s_i ) )
|
|
||||||
{
|
|
||||||
path.setFileName( fileName.substr( 0, fileName.length() - 2 ) );
|
|
||||||
path.setExtension( String::EmptyString );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setBitmap( StringTable->insert(path.getFullPath().c_str()) );
|
|
||||||
|
|
||||||
// if the extent is set to (0,0) in the gui editor and appy hit, this control will
|
// if the extent is set to (0,0) in the gui editor and appy hit, this control will
|
||||||
// set it's extent to be exactly the size of the normal bitmap (if present)
|
// set it's extent to be exactly the size of the normal bitmap (if present)
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,10 @@ class GuiBitmapButtonCtrl : public GuiButtonCtrl
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
void onBitmapChange() {}
|
void onBitmapChange()
|
||||||
|
{
|
||||||
|
setBitmap(getBitmap());
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ $guiContent = new GuiControl(ConsoleDlg) {
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
new GuiBitmapCtrl() {
|
new GuiBitmapCtrl() {
|
||||||
bitmap = "data/ui/art/hudfill.png";
|
bitmapAsset = "Core_GUI:hudFill";
|
||||||
color = "255 255 255 255";
|
color = "255 255 255 255";
|
||||||
wrap = "0";
|
wrap = "0";
|
||||||
position = "0 0";
|
position = "0 0";
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,13 @@ new GuiControlProfile(GuiConsoleTextProfile)
|
||||||
category = "Core";
|
category = "Core";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$ConsoleDefaultFillColor = "0 0 0 175";
|
||||||
|
|
||||||
if(!isObject(ConsoleScrollProfile))
|
if(!isObject(ConsoleScrollProfile))
|
||||||
new GuiControlProfile(ConsoleScrollProfile : GuiScrollProfile)
|
new GuiControlProfile(ConsoleScrollProfile : GuiScrollProfile)
|
||||||
{
|
{
|
||||||
opaque = true;
|
opaque = true;
|
||||||
fillColor = "0 0 0 175";
|
fillColor = $ConsoleDefaultFillColor;
|
||||||
border = 1;
|
border = 1;
|
||||||
//borderThickness = 0;
|
//borderThickness = 0;
|
||||||
borderColor = "0 0 0";
|
borderColor = "0 0 0";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1 @@
|
||||||
<ShapeAsset
|
|
||||||
canSave="true"
|
|
||||||
canSaveDynamicFields="true"
|
|
||||||
AssetName="Camera"
|
|
||||||
fileName="@assetFile=camera.dts"
|
|
||||||
constuctorFileName="@assetFile=camera.tscript" />
|
constuctorFileName="@assetFile=camera.tscript" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<MaterialAsset
|
||||||
|
canSave="true"
|
||||||
|
canSaveDynamicFields="true"
|
||||||
|
AssetName="Green"
|
||||||
|
scriptFile="@assetFile=green"
|
||||||
|
materialDefinitionName="Green"
|
||||||
|
originalFilePath="D:/Gamedev/Projects/Catographer/GameBuild/Templates/BaseGame/game/core/gameObjects/shapes/green" />
|
||||||
|
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
singleton TSShapeConstructor(cameradts)
|
singleton TSShapeConstructor(cameradts2)
|
||||||
{
|
{
|
||||||
baseShapeAsset = "Core_GameObjects:Camera";
|
baseShapeAsset = "Core_GameObjects:Camera";
|
||||||
singleDetailSize = "0";
|
singleDetailSize = "0";
|
||||||
|
|
|
||||||
196
Templates/BaseGame/game/core/gameObjects/shapes/green.tscript
Normal file
|
|
@ -0,0 +1,196 @@
|
||||||
|
//--- OBJECT WRITE BEGIN ---
|
||||||
|
new Material(OctahedronMat) {
|
||||||
|
mapTo = "green";
|
||||||
|
diffuseColor[0] = "0 1 0 1";
|
||||||
|
diffuseColor[1] = "1 1 1 1";
|
||||||
|
diffuseColor[2] = "1 1 1 1";
|
||||||
|
diffuseColor[3] = "1 1 1 1";
|
||||||
|
DiffuseMap[0] = "core/gameObjects/images/camera";
|
||||||
|
diffuseMapSRGB[0] = "1";
|
||||||
|
diffuseMapSRGB[1] = "1";
|
||||||
|
diffuseMapSRGB[2] = "1";
|
||||||
|
diffuseMapSRGB[3] = "1";
|
||||||
|
detailScale[0] = "2 2";
|
||||||
|
detailScale[1] = "2 2";
|
||||||
|
detailScale[2] = "2 2";
|
||||||
|
detailScale[3] = "2 2";
|
||||||
|
detailNormalMapStrength[0] = "1";
|
||||||
|
detailNormalMapStrength[1] = "1";
|
||||||
|
detailNormalMapStrength[2] = "1";
|
||||||
|
detailNormalMapStrength[3] = "1";
|
||||||
|
roughness[0] = "1";
|
||||||
|
roughness[1] = "1";
|
||||||
|
roughness[2] = "1";
|
||||||
|
roughness[3] = "1";
|
||||||
|
metalness[0] = "0";
|
||||||
|
metalness[1] = "0";
|
||||||
|
metalness[2] = "0";
|
||||||
|
metalness[3] = "0";
|
||||||
|
glowMul[0] = "0";
|
||||||
|
glowMul[1] = "0";
|
||||||
|
glowMul[2] = "0";
|
||||||
|
glowMul[3] = "0";
|
||||||
|
accuEnabled[0] = "0";
|
||||||
|
accuEnabled[1] = "0";
|
||||||
|
accuEnabled[2] = "0";
|
||||||
|
accuEnabled[3] = "0";
|
||||||
|
accuScale[0] = "1";
|
||||||
|
accuScale[1] = "1";
|
||||||
|
accuScale[2] = "1";
|
||||||
|
accuScale[3] = "1";
|
||||||
|
accuDirection[0] = "1";
|
||||||
|
accuDirection[1] = "1";
|
||||||
|
accuDirection[2] = "1";
|
||||||
|
accuDirection[3] = "1";
|
||||||
|
accuStrength[0] = "0.6";
|
||||||
|
accuStrength[1] = "0.6";
|
||||||
|
accuStrength[2] = "0.6";
|
||||||
|
accuStrength[3] = "0.6";
|
||||||
|
accuCoverage[0] = "0.9";
|
||||||
|
accuCoverage[1] = "0.9";
|
||||||
|
accuCoverage[2] = "0.9";
|
||||||
|
accuCoverage[3] = "0.9";
|
||||||
|
accuSpecular[0] = "16";
|
||||||
|
accuSpecular[1] = "16";
|
||||||
|
accuSpecular[2] = "16";
|
||||||
|
accuSpecular[3] = "16";
|
||||||
|
isSRGB[0] = "0";
|
||||||
|
isSRGB[1] = "0";
|
||||||
|
isSRGB[2] = "0";
|
||||||
|
isSRGB[3] = "0";
|
||||||
|
invertRoughness[0] = "0";
|
||||||
|
invertRoughness[1] = "0";
|
||||||
|
invertRoughness[2] = "0";
|
||||||
|
invertRoughness[3] = "0";
|
||||||
|
roughnessChan[0] = "0";
|
||||||
|
roughnessChan[1] = "0";
|
||||||
|
roughnessChan[2] = "0";
|
||||||
|
roughnessChan[3] = "0";
|
||||||
|
AOChan[0] = "1";
|
||||||
|
AOChan[1] = "1";
|
||||||
|
AOChan[2] = "1";
|
||||||
|
AOChan[3] = "1";
|
||||||
|
metalChan[0] = "2";
|
||||||
|
metalChan[1] = "2";
|
||||||
|
metalChan[2] = "2";
|
||||||
|
metalChan[3] = "2";
|
||||||
|
glow[0] = "0";
|
||||||
|
glow[1] = "0";
|
||||||
|
glow[2] = "0";
|
||||||
|
glow[3] = "0";
|
||||||
|
parallaxScale[0] = "0";
|
||||||
|
parallaxScale[1] = "0";
|
||||||
|
parallaxScale[2] = "0";
|
||||||
|
parallaxScale[3] = "0";
|
||||||
|
useAnisotropic[0] = "1";
|
||||||
|
useAnisotropic[1] = "1";
|
||||||
|
useAnisotropic[2] = "1";
|
||||||
|
useAnisotropic[3] = "1";
|
||||||
|
vertLit[0] = "0";
|
||||||
|
vertLit[1] = "0";
|
||||||
|
vertLit[2] = "0";
|
||||||
|
vertLit[3] = "0";
|
||||||
|
vertColor[0] = "0";
|
||||||
|
vertColor[1] = "0";
|
||||||
|
vertColor[2] = "0";
|
||||||
|
vertColor[3] = "0";
|
||||||
|
minnaertConstant[0] = "-1";
|
||||||
|
minnaertConstant[1] = "-1";
|
||||||
|
minnaertConstant[2] = "-1";
|
||||||
|
minnaertConstant[3] = "-1";
|
||||||
|
subSurface[0] = "0";
|
||||||
|
subSurface[1] = "0";
|
||||||
|
subSurface[2] = "0";
|
||||||
|
subSurface[3] = "0";
|
||||||
|
subSurfaceColor[0] = "1 0.2 0.2 1";
|
||||||
|
subSurfaceColor[1] = "1 0.2 0.2 1";
|
||||||
|
subSurfaceColor[2] = "1 0.2 0.2 1";
|
||||||
|
subSurfaceColor[3] = "1 0.2 0.2 1";
|
||||||
|
subSurfaceRolloff[0] = "0.2";
|
||||||
|
subSurfaceRolloff[1] = "0.2";
|
||||||
|
subSurfaceRolloff[2] = "0.2";
|
||||||
|
subSurfaceRolloff[3] = "0.2";
|
||||||
|
emissive[0] = "0";
|
||||||
|
emissive[1] = "0";
|
||||||
|
emissive[2] = "0";
|
||||||
|
emissive[3] = "0";
|
||||||
|
foreground[0] = "0";
|
||||||
|
foreground[1] = "0";
|
||||||
|
foreground[2] = "0";
|
||||||
|
foreground[3] = "0";
|
||||||
|
doubleSided = "0";
|
||||||
|
animFlags[0] = "0x00000000";
|
||||||
|
animFlags[1] = "0x00000000";
|
||||||
|
animFlags[2] = "0x00000000";
|
||||||
|
animFlags[3] = "0x00000000";
|
||||||
|
scrollDir[0] = "0 0";
|
||||||
|
scrollDir[1] = "0 0";
|
||||||
|
scrollDir[2] = "0 0";
|
||||||
|
scrollDir[3] = "0 0";
|
||||||
|
scrollSpeed[0] = "0";
|
||||||
|
scrollSpeed[1] = "0";
|
||||||
|
scrollSpeed[2] = "0";
|
||||||
|
scrollSpeed[3] = "0";
|
||||||
|
rotSpeed[0] = "0";
|
||||||
|
rotSpeed[1] = "0";
|
||||||
|
rotSpeed[2] = "0";
|
||||||
|
rotSpeed[3] = "0";
|
||||||
|
rotPivotOffset[0] = "0 0";
|
||||||
|
rotPivotOffset[1] = "0 0";
|
||||||
|
rotPivotOffset[2] = "0 0";
|
||||||
|
rotPivotOffset[3] = "0 0";
|
||||||
|
waveType[0] = "Sin";
|
||||||
|
waveType[1] = "Sin";
|
||||||
|
waveType[2] = "Sin";
|
||||||
|
waveType[3] = "Sin";
|
||||||
|
waveFreq[0] = "0";
|
||||||
|
waveFreq[1] = "0";
|
||||||
|
waveFreq[2] = "0";
|
||||||
|
waveFreq[3] = "0";
|
||||||
|
waveAmp[0] = "0";
|
||||||
|
waveAmp[1] = "0";
|
||||||
|
waveAmp[2] = "0";
|
||||||
|
waveAmp[3] = "0";
|
||||||
|
sequenceFramePerSec[0] = "0";
|
||||||
|
sequenceFramePerSec[1] = "0";
|
||||||
|
sequenceFramePerSec[2] = "0";
|
||||||
|
sequenceFramePerSec[3] = "0";
|
||||||
|
sequenceSegmentSize[0] = "0";
|
||||||
|
sequenceSegmentSize[1] = "0";
|
||||||
|
sequenceSegmentSize[2] = "0";
|
||||||
|
sequenceSegmentSize[3] = "0";
|
||||||
|
cellIndex[0] = "0 0";
|
||||||
|
cellIndex[1] = "0 0";
|
||||||
|
cellIndex[2] = "0 0";
|
||||||
|
cellIndex[3] = "0 0";
|
||||||
|
cellLayout[0] = "0 0";
|
||||||
|
cellLayout[1] = "0 0";
|
||||||
|
cellLayout[2] = "0 0";
|
||||||
|
cellLayout[3] = "0 0";
|
||||||
|
cellSize[0] = "0";
|
||||||
|
cellSize[1] = "0";
|
||||||
|
cellSize[2] = "0";
|
||||||
|
cellSize[3] = "0";
|
||||||
|
bumpAtlas[0] = "0";
|
||||||
|
bumpAtlas[1] = "0";
|
||||||
|
bumpAtlas[2] = "0";
|
||||||
|
bumpAtlas[3] = "0";
|
||||||
|
castShadows = "0";
|
||||||
|
planarReflection = "0";
|
||||||
|
translucent = "1";
|
||||||
|
translucentBlendOp = "PreMul";
|
||||||
|
translucentZWrite = "0";
|
||||||
|
alphaTest = "0";
|
||||||
|
alphaRef = "1";
|
||||||
|
dynamicCubemap = "0";
|
||||||
|
showFootprints = "1";
|
||||||
|
showDust = "0";
|
||||||
|
effectColor[0] = "0 0 0 0";
|
||||||
|
effectColor[1] = "0 0 0 0";
|
||||||
|
footstepSoundId = "-1";
|
||||||
|
impactSoundId = "-1";
|
||||||
|
ImpactFXIndex = "-1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "1";
|
||||||
|
};
|
||||||
|
//--- OBJECT WRITE END ---
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
//--- OBJECT WRITE BEGIN ---
|
||||||
|
singleton Material(moon_noglow) {
|
||||||
|
mapTo="moon_noglow";
|
||||||
|
DiffuseMapAsset = "Core_Rendering:moon_noglow_image";
|
||||||
|
emissive = true;
|
||||||
|
translucent = true;
|
||||||
|
vertColor[ 0 ] = true;
|
||||||
|
};
|
||||||
|
//--- OBJECT WRITE END ---
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
//--- OBJECT WRITE BEGIN ---
|
||||||
|
singleton Material(moon_wglow) {
|
||||||
|
mapTo="moon_wglow";
|
||||||
|
DiffuseMapAsset = "Core_Rendering:moon_wglow_image";
|
||||||
|
emissive = true;
|
||||||
|
translucent = true;
|
||||||
|
vertColor[ 0 ] = true;
|
||||||
|
};
|
||||||
|
//--- OBJECT WRITE END ---
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
<Setting name="AddDirectoryPrefixToAssetName">0</Setting>
|
<Setting name="AddDirectoryPrefixToAssetName">0</Setting>
|
||||||
<Setting name="AutomaticallyPromptMissingFiles">0</Setting>
|
<Setting name="AutomaticallyPromptMissingFiles">0</Setting>
|
||||||
<Setting name="DuplicatAutoResolution">AutoPrune</Setting>
|
<Setting name="DuplicatAutoResolution">AutoPrune</Setting>
|
||||||
|
<Setting name="DuplicateAutoResolution">AutoPrune</Setting>
|
||||||
<Setting name="PreventImportWithErrors">1</Setting>
|
<Setting name="PreventImportWithErrors">1</Setting>
|
||||||
<Setting name="WarningsAsErrors">0</Setting>
|
<Setting name="WarningsAsErrors">0</Setting>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
|
||||||
|
|
@ -1084,6 +1084,22 @@ $guiContent = new GuiControl(AssetBrowser) {
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
|
new GuiBitmapCtrl() {
|
||||||
|
bitmapAsset = "ToolsModule:smaller_image";
|
||||||
|
position = "5 588";
|
||||||
|
extent = "20 20";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "left";
|
||||||
|
vertSizing = "top";
|
||||||
|
profile = "ToolsGuiDefaultProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
new GuiSliderCtrl() {
|
new GuiSliderCtrl() {
|
||||||
range = "0 2";
|
range = "0 2";
|
||||||
ticks = "5";
|
ticks = "5";
|
||||||
|
|
@ -1092,7 +1108,7 @@ $guiContent = new GuiControl(AssetBrowser) {
|
||||||
useFillBar = "0";
|
useFillBar = "0";
|
||||||
fillBarColor = "255 255 255 255";
|
fillBarColor = "255 255 255 255";
|
||||||
renderTicks = "0";
|
renderTicks = "0";
|
||||||
position = "8 588";
|
position = "28 590";
|
||||||
extent = "75 20";
|
extent = "75 20";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "right";
|
horizSizing = "right";
|
||||||
|
|
@ -1109,6 +1125,22 @@ $guiContent = new GuiControl(AssetBrowser) {
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
|
new GuiBitmapCtrl() {
|
||||||
|
bitmapAsset = "ToolsModule:larger_image";
|
||||||
|
position = "103 588";
|
||||||
|
extent = "20 20";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "left";
|
||||||
|
vertSizing = "top";
|
||||||
|
profile = "ToolsGuiDefaultProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//--- OBJECT WRITE END ---
|
//--- OBJECT WRITE END ---
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ $guiContent = new GuiControl(AssetBrowser_newFolder) {
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
new GuiButtonCtrl() {
|
new GuiButtonCtrl() {
|
||||||
text = "Select";
|
text = "OK";
|
||||||
groupNum = "-1";
|
groupNum = "-1";
|
||||||
buttonType = "PushButton";
|
buttonType = "PushButton";
|
||||||
useMouseEvents = "0";
|
useMouseEvents = "0";
|
||||||
|
|
@ -65,6 +65,7 @@ $guiContent = new GuiControl(AssetBrowser_newFolder) {
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
accelerator = "return";
|
||||||
};
|
};
|
||||||
new GuiButtonCtrl() {
|
new GuiButtonCtrl() {
|
||||||
text = "Cancel";
|
text = "Cancel";
|
||||||
|
|
@ -85,6 +86,7 @@ $guiContent = new GuiControl(AssetBrowser_newFolder) {
|
||||||
isContainer = "0";
|
isContainer = "0";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
accelerator = "escape";
|
||||||
};
|
};
|
||||||
new GuiTextEditCtrl(AssetBrowser_newFolderNameTxt) {
|
new GuiTextEditCtrl(AssetBrowser_newFolderNameTxt) {
|
||||||
historySize = "0";
|
historySize = "0";
|
||||||
|
|
|
||||||
|
|
@ -279,6 +279,7 @@ function AssetBrowser::selectAsset( %this, %asset )
|
||||||
%this.changeAsset();
|
%this.changeAsset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isObject(Inspector))
|
||||||
Inspector.refresh();
|
Inspector.refresh();
|
||||||
|
|
||||||
AssetBrowser.hideDialog();
|
AssetBrowser.hideDialog();
|
||||||
|
|
@ -985,14 +986,31 @@ function AssetBrowser::toggleTagFilterPopup(%this)
|
||||||
|
|
||||||
function AssetBrowser::changeAsset(%this)
|
function AssetBrowser::changeAsset(%this)
|
||||||
{
|
{
|
||||||
|
%targetObject = %this.fieldTargetObject;
|
||||||
|
%inspectorObject = "";
|
||||||
|
|
||||||
|
if(%this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector"))
|
||||||
|
{
|
||||||
|
%inspectorObject = %this.fieldTargetObject;
|
||||||
|
%targetObject = %inspectorObject.getInspectObject();
|
||||||
|
}
|
||||||
|
|
||||||
//alright, we've selectd an asset for a field, so time to set it!
|
//alright, we've selectd an asset for a field, so time to set it!
|
||||||
if(%this.fieldTargetName $= "")
|
if(%this.fieldTargetName $= "")
|
||||||
%cmd = %this.fieldTargetObject @ ".apply(\""@ %this.selectedAsset @ "\");";
|
%cmd = %targetObject @ ".apply(\""@ %this.selectedAsset @ "\");";
|
||||||
else
|
else
|
||||||
%cmd = %this.fieldTargetObject @ "." @ %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
|
%cmd = %targetObject @ "." @ %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
|
||||||
echo("Changing asset via the " @ %cmd @ " command");
|
//echo("Changing asset via the " @ %cmd @ " command");
|
||||||
eval(%cmd);
|
eval(%cmd);
|
||||||
|
|
||||||
|
//Force update our object with the field change
|
||||||
|
%targetObject.inspectPostApply();
|
||||||
|
|
||||||
|
if(isObject(%inspectorObject))
|
||||||
|
{
|
||||||
|
%inspectorObject.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
//Flag us as dirty for editing purposes
|
//Flag us as dirty for editing purposes
|
||||||
EWorldEditor.setSceneAsDirty();
|
EWorldEditor.setSceneAsDirty();
|
||||||
}
|
}
|
||||||
|
|
@ -2317,6 +2335,53 @@ function EWorldEditor::onControlDropped( %this, %payload, %position )
|
||||||
EWorldEditor.isDirty = true;
|
EWorldEditor.isDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function GuiEditor::onControlDropped(%this, %payload, %position)
|
||||||
|
{
|
||||||
|
Canvas.popDialog(EditorDragAndDropLayer);
|
||||||
|
// Make sure we have the right kind of D&D.
|
||||||
|
|
||||||
|
if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_GuiControl" ) &&
|
||||||
|
!%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( %payload.dragSourceControl == %this )
|
||||||
|
return;
|
||||||
|
|
||||||
|
%pos = %payload.getGlobalPosition();
|
||||||
|
%x = getWord(%pos, 0);
|
||||||
|
%y = getWord(%pos, 1);
|
||||||
|
|
||||||
|
if(%payload.assetType !$= "Creator")
|
||||||
|
{
|
||||||
|
//dealing with an actual asset, so build the assetName
|
||||||
|
%assetId = %payload.moduleName @ ":" @ %payload.assetName;
|
||||||
|
%assetType = AssetDatabase.getAssetType(%assetId);
|
||||||
|
|
||||||
|
if(%assetType $= "ImageAsset")
|
||||||
|
{
|
||||||
|
%cmd = "return new guiBitmapCtrl();";
|
||||||
|
%ctrl = eval( %cmd );
|
||||||
|
%ctrl.bitmap = %assetId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%className = %payload.assetName;
|
||||||
|
%cmd = "return new " @ %className @ "();";
|
||||||
|
%ctrl = eval( %cmd );
|
||||||
|
}
|
||||||
|
|
||||||
|
%this.addNewCtrl(%ctrl);
|
||||||
|
|
||||||
|
%ctrl.setPositionGlobal(%x, %y);
|
||||||
|
%this.setFirstResponder();
|
||||||
|
|
||||||
|
if(EditorSettings.value("AssetManagement/Assets/closeBrowserOnDragAction", false))
|
||||||
|
{
|
||||||
|
AssetBrowser.hideDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
|
function AssetBrowserFilterTree::onControlDropped( %this, %payload, %position )
|
||||||
{
|
{
|
||||||
Canvas.popDialog(EditorDragAndDropLayer);
|
Canvas.popDialog(EditorDragAndDropLayer);
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,20 @@ function AssetBrowser::onBeginDropFiles( %this )
|
||||||
|
|
||||||
function AssetBrowser::onDropFile( %this, %filePath )
|
function AssetBrowser::onDropFile( %this, %filePath )
|
||||||
{
|
{
|
||||||
|
if(fileExt(%filePath) $= "")
|
||||||
|
{
|
||||||
|
//we're dealing with a folder, so we gotta parse through it
|
||||||
|
|
||||||
|
%file = findFirstFile( %filePath @ "/*" );
|
||||||
|
while( %file !$= "" )
|
||||||
|
{
|
||||||
|
%this.onDropFile(%file);
|
||||||
|
%file = findNextFile( %filePath @ "/*" );
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(!AssetBrowser.isAwake() || !AssetBrowser.isVisible())
|
if(!AssetBrowser.isAwake() || !AssetBrowser.isVisible())
|
||||||
{
|
{
|
||||||
if(GuiEditorIsActive())
|
if(GuiEditorIsActive())
|
||||||
|
|
@ -501,7 +515,7 @@ function ImportAssetWindow::doRefresh(%this)
|
||||||
}
|
}
|
||||||
if(%this.autoRenamedAssets != 0)
|
if(%this.autoRenamedAssets != 0)
|
||||||
{
|
{
|
||||||
%ImportActionSummary = %ImportActionSummary SPC %this.autoRenamedAssets @ " Auto Renamed|";
|
%ImportActionSummary = %ImportActionSummary SPC %this.autoRenamedAssets @ " Automatically Renamed|";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%ImportActionSummary !$= "")
|
if(%ImportActionSummary !$= "")
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ function setupImportConfigSettingsList()
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Images/GenerateMaterialOnImport", "Generate Material On Import", "bool", "", "1", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Images/GenerateMaterialOnImport", "Generate Material On Import", "bool", "", "1", "");
|
||||||
|
|
||||||
//Sounds
|
//Sounds
|
||||||
|
ImportAssetConfigSettingsList.addNewConfigSetting("Images/ImportSounds", "Import Sounds", "bool", "", "1", "");
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/VolumeAdjust", "Volume Adjustment", "float", "", "1.0", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/VolumeAdjust", "Volume Adjustment", "float", "", "1.0", "");
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/PitchAdjust", "Pitch Adjustment", "float", "", "1.0", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/PitchAdjust", "Pitch Adjustment", "float", "", "1.0", "");
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/Compressed", "Is Compressed", "bool", "", "0", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/Compressed", "Is Compressed", "bool", "", "0", "");
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
function AssetImportConfigEditor::onWake(%this)
|
function AssetImportConfigEditor::onWake(%this)
|
||||||
{
|
{
|
||||||
%this.refresh();
|
%this.refresh();
|
||||||
|
|
||||||
|
%index = AssetImportConfigList.findTextIndex(EditorSettings.value("Assets/AssetImporDefaultConfig", ""));
|
||||||
|
AssetImportConfigList.setSelectedRow(%index);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetImportConfigEditor::refresh(%this)
|
function AssetImportConfigEditor::refresh(%this)
|
||||||
|
|
@ -41,7 +44,7 @@ function AssetImportConfigList::onSelect( %this, %id, %text )
|
||||||
%this.populateConfigListByGroup("Images");
|
%this.populateConfigListByGroup("Images");
|
||||||
%this.populateConfigListByGroup("Sounds");
|
%this.populateConfigListByGroup("Sounds");
|
||||||
%this.populateConfigListByGroup("Animations");
|
%this.populateConfigListByGroup("Animations");
|
||||||
%this.populateConfigListByGroup("Collision");
|
//%this.populateConfigListByGroup("Collision");
|
||||||
|
|
||||||
ImportOptionsConfigList.update();
|
ImportOptionsConfigList.update();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ function AssetBrowser::buildCreatorPreview(%this, %assetDef, %previewData)
|
||||||
|
|
||||||
%previewData.assetName = %name;
|
%previewData.assetName = %name;
|
||||||
%previewData.assetPath = "";
|
%previewData.assetPath = "";
|
||||||
|
%previewData.moduleName = "";
|
||||||
|
|
||||||
%previewData.previewImage = "ToolsModule:" @ %class @ "_image";
|
%previewData.previewImage = "ToolsModule:" @ %class @ "_image";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
function AssetBrowser::createNewFolder(%this)
|
function AssetBrowser::createNewFolder(%this)
|
||||||
{
|
{
|
||||||
AssetBrowser_newFolderNameTxt.text = "NewFolder";
|
AssetBrowser_newFolderNameTxt.text = "NewFolder";
|
||||||
Canvas.pushDialog(AssetBrowser_newFolder);
|
Canvas.pushDialog(AssetBrowser_newFolder, 99, true);
|
||||||
|
|
||||||
|
AssetBrowser_newFolderNameTxt.selectAllText();
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::doCreateNewFolder(%this)
|
function AssetBrowser::doCreateNewFolder(%this)
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 7.4 KiB |
|
|
@ -668,30 +668,6 @@ function GuiEditor::onControlDragged( %this, %payload, %position )
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function GuiEditor::onControlDropped(%this, %payload, %position)
|
|
||||||
{
|
|
||||||
// Make sure we have the right kind of D&D.
|
|
||||||
|
|
||||||
if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_GuiControl" ) &&
|
|
||||||
!%payload.parentGroup.isInNamespaceHierarchy( "AssetPreviewControlType_AssetDrop" ))
|
|
||||||
return;
|
|
||||||
|
|
||||||
%pos = %payload.getGlobalPosition();
|
|
||||||
%x = getWord(%pos, 0);
|
|
||||||
%y = getWord(%pos, 1);
|
|
||||||
|
|
||||||
%asset = %payload.assetName;
|
|
||||||
%cmd = "return new " @ %asset @ "();";
|
|
||||||
%ctrl = eval( %cmd );
|
|
||||||
|
|
||||||
%this.addNewCtrl(%ctrl);
|
|
||||||
|
|
||||||
%ctrl.setPositionGlobal(%x, %y);
|
|
||||||
%this.setFirstResponder();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
function GuiEditor::onGainFirstResponder(%this)
|
function GuiEditor::onGainFirstResponder(%this)
|
||||||
{
|
{
|
||||||
%this.enableMenuItems(true);
|
%this.enableMenuItems(true);
|
||||||
|
|
|
||||||
|
|
@ -816,9 +816,9 @@ function MaterialEditorGui::guiSync( %this, %material )
|
||||||
MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( getAssetPreviewImage(%normalMap) );
|
MaterialEditorPropertiesWindow-->normalMapDisplayBitmap.setBitmap( getAssetPreviewImage(%normalMap) );
|
||||||
|
|
||||||
//ORM Config
|
//ORM Config
|
||||||
%ormMap = (%material).getNormalMap(%layer);
|
%ormMap = (%material).getORMConfigMap(%layer);
|
||||||
%hasOrmMap = (%ormMap !$= "" && %ormMap !$=$MaterialEditor::emptyMaterialImage);
|
%hasOrmMap = (%ormMap !$= "" && %ormMap !$=$MaterialEditor::emptyMaterialImage);
|
||||||
%ormMapText = %hasOrmMap ? (%material).getNormalMapAsset(%layer) : "None";
|
%ormMapText = %hasOrmMap ? (%material).getORMConfigMapAsset(%layer) : "None";
|
||||||
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText(%ormMapText );
|
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText(%ormMapText );
|
||||||
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( getAssetPreviewImage(%ormMap) );
|
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( getAssetPreviewImage(%ormMap) );
|
||||||
|
|
||||||
|
|
|
||||||