* Fixes handling for Image, Material and Shape Assets' inspector fields so they properly work with non-object targeted inspectors, such as the PostFXEditor

* Updated PostFXEditor scripts to handle refreshing properly when certainl field types(assetId fields) are changed
* Adjusted display handling of slider values on guiGameSettingsCtrl to show 0.x decimal format instead of 0.xxxxx
* Fixed pad length of item names in guiTreeView for items that are marked to avoid console spam
* Fixed local offseting for popupMenus so scaled/offset window position doesn't cause the popup menu to offset from mouse click position(courtesy OTHG_Mars)
* Fix issue with terrain where, due to default value save validation, the global scope for the terrain collision list would be whiped when saving, causing players to fall through terrain. Moved to per-terrain convexLists
* Fixed issue with the core camera model mesh and updated references so camera bookmarks display properly
* Fixed console spam during asset browser initialization where it would try and expand the directory tree even though the dir tree isn't populated yet
* Fixed handling of Open File Location RMB menu action to properly deal with script and datablock types
* Removed unusuable "Create ___" asset type prompts from the RMB menus for the AB to avoid confusion
* Improved slider offset positioning for various popup sliders on editor toolbars
* Anchored the visibility popup menu to the button for more consistent formatting and better feel
* Shifted various visibility toggles from 'in place' on the menu buttons to functions, allowing it to also properly mark the menu entries as checked or not, improving usability
This commit is contained in:
Areloch 2022-08-26 15:25:17 -05:00
parent 6a0cd22e7a
commit ded99cd8cb
29 changed files with 276 additions and 127 deletions

View file

@ -470,9 +470,6 @@ void GuiInspectorTypeImageAssetPtr::consoleInit()
GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl() GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
{ {
if (mInspector->getInspectObject() == nullptr)
return nullptr;
// Create base filename edit controls // Create base filename edit controls
GuiControl* retCtrl = Parent::constructEditControl(); GuiControl* retCtrl = Parent::constructEditControl();
if (retCtrl == NULL) if (retCtrl == NULL)
@ -480,16 +477,28 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
retCtrl->getRenderTooltipDelegate().bind(this, &GuiInspectorTypeImageAssetPtr::renderTooltip); retCtrl->getRenderTooltipDelegate().bind(this, &GuiInspectorTypeImageAssetPtr::renderTooltip);
// Change filespec if (mInspector->getInspectObject() != nullptr)
char szBuffer[512]; {
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);", // Change filespec
mInspector->getIdString(), mCaption); char szBuffer[512];
mBrowseButton->setField("Command", szBuffer); dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
}
else
{
//if we don't have a target object, we'll be manipulating the desination value directly
char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ImageAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mVariableName);
mBrowseButton->setField("Command", szBuffer);
}
// Create "Open in ShapeEditor" button mImageEdButton = NULL;
mImageEdButton = new GuiBitmapButtonCtrl(); // Create "Open in ImageEditor" button
/*mImageEdButton = new GuiBitmapButtonCtrl();
char bitmapName[512] = "ToolsModule:GameTSCtrl_image"; char bitmapName[512] = "ToolsModule:GameTSCtrl_image";
mImageEdButton->setBitmap(StringTable->insert(bitmapName)); mImageEdButton->setBitmap(StringTable->insert(bitmapName));
@ -498,10 +507,10 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
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");
mImageEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000"); mImageEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
mImageEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the Shape Editor"); mImageEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the Image Editor");
mImageEdButton->registerObject(); mImageEdButton->registerObject();
addObject(mImageEdButton); addObject(mImageEdButton);*/
return retCtrl; return retCtrl;
} }
@ -517,18 +526,21 @@ bool GuiInspectorTypeImageAssetPtr::updateRects()
mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y); mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y);
bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent); bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent);
if (mBrowseButton != NULL)
{
mBrowseRect.set(fieldExtent.x - 32, 2, 14, fieldExtent.y - 4);
resized |= mBrowseButton->resize(mBrowseRect.point, mBrowseRect.extent);
}
if (mImageEdButton != NULL) if (mImageEdButton != NULL)
{ {
RectI shapeEdRect(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4); RectI shapeEdRect(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4);
resized |= mImageEdButton->resize(shapeEdRect.point, shapeEdRect.extent); resized |= mImageEdButton->resize(shapeEdRect.point, shapeEdRect.extent);
} }
if (mBrowseButton != NULL)
{
if(mImageEdButton != NULL)
mBrowseRect.set(fieldExtent.x - 32, 2, 14, fieldExtent.y - 4);
else
mBrowseRect.set(fieldExtent.x - 16, 2, 14, fieldExtent.y - 4);
resized |= mBrowseButton->resize(mBrowseRect.point, mBrowseRect.extent);
}
return resized; return resized;
} }

View file

@ -479,11 +479,22 @@ GuiControl* GuiInspectorTypeMaterialAssetPtr::constructEditControl()
// Change filespec // Change filespec
char szBuffer[512]; char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); if (mInspector->getInspectObject() != nullptr)
{
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
}
else
{
//if we don't have a target object, we'll be manipulating the desination value directly
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"MaterialAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mVariableName);
mBrowseButton->setField("Command", szBuffer);
}
// Create "Open in Editor" button // Create "Open in Editor" button
mEditButton = new GuiBitmapButtonCtrl(); mEditButton = new GuiBitmapButtonCtrl();

View file

@ -749,11 +749,21 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl()
// Change filespec // Change filespec
char szBuffer[512]; char szBuffer[512];
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);", if (mInspector->getInspectObject() != nullptr)
mInspector->getIdString(), mCaption); {
mBrowseButton->setField("Command", szBuffer); dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mCaption);
mBrowseButton->setField("Command", szBuffer);
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString()); setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
}
else
{
//if we don't have a target object, we'll be manipulating the desination value directly
dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"ShapeAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
mInspector->getIdString(), mVariableName);
mBrowseButton->setField("Command", szBuffer);
}
// Create "Open in ShapeEditor" button // Create "Open in ShapeEditor" button
mShapeEdButton = new GuiBitmapButtonCtrl(); mShapeEdButton = new GuiBitmapButtonCtrl();

View file

@ -393,7 +393,7 @@ void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset)
GFont* font = mProfile->mFont; GFont* font = mProfile->mFont;
char stringVal[32]; char stringVal[32];
dSprintf(stringVal, 32, "%f", mValue); dSprintf(stringVal, 32, "%.1f", mValue);
S32 stringWidth = font->getStrWidth(stringVal); S32 stringWidth = font->getStrWidth(stringVal);
Point2I textOffset(sliderRect.point.x + sliderRect.extent.x, 0); Point2I textOffset(sliderRect.point.x + sliderRect.extent.x, 0);

View file

@ -1982,7 +1982,7 @@ bool GuiTreeViewCtrl::_hitTest(const Point2I & pnt, Item* & item, BitSet32 & fla
min += mProfile->mTextOffset.x; min += mProfile->mTextOffset.x;
FrameAllocatorMarker txtAlloc; FrameAllocatorMarker txtAlloc;
U32 bufLen = item->getDisplayTextLength() + 1; U32 bufLen = item->getDisplayTextLength() + 2;
char *buf = (char*)txtAlloc.alloc(bufLen); char *buf = (char*)txtAlloc.alloc(bufLen);
item->getDisplayText(bufLen, buf); item->getDisplayText(bufLen, buf);

View file

@ -428,7 +428,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */)
Point2I pos = Point2I::Zero; Point2I pos = Point2I::Zero;
if (x == -1 && y == -1) if (x == -1 && y == -1)
pos = owner->getCursorPos(); pos = owner->getCursorPosLocal();
else else
pos = Point2I(x, y); pos = Point2I(x, y);

View file

@ -34,9 +34,6 @@ static const U32 MaxExtent = 256;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
Convex sTerrainConvexList;
// Number of vertices followed by point index // Number of vertices followed by point index
S32 sVertexList[5][5] = { S32 sVertexList[5][5] = {
{ 3, 1,2,3 }, // 135 B { 3, 1,2,3 }, // 135 B
@ -350,7 +347,7 @@ void TerrainBlock::buildConvex(const Box3F& box,Convex* convex)
{ {
PROFILE_SCOPE( TerrainBlock_buildConvex ); PROFILE_SCOPE( TerrainBlock_buildConvex );
sTerrainConvexList.collectGarbage(); mTerrainConvexList.collectGarbage();
// First check to see if the query misses the // First check to see if the query misses the
// terrain elevation range. // terrain elevation range.
@ -415,7 +412,7 @@ void TerrainBlock::buildConvex(const Box3F& box,Convex* convex)
// Create a new convex. // Create a new convex.
TerrainConvex* cp = new TerrainConvex; TerrainConvex* cp = new TerrainConvex;
sTerrainConvexList.registerObject(cp); mTerrainConvexList.registerObject(cp);
convex->addToWorkingList(cp); convex->addToWorkingList(cp);
cp->halfA = true; cp->halfA = true;
cp->square = 0; cp->square = 0;
@ -448,7 +445,7 @@ void TerrainBlock::buildConvex(const Box3F& box,Convex* convex)
cp->normal[1].normalize(); cp->normal[1].normalize();
if (mDot(vp[3] - vp[1],cp->normal[0]) > 0) { if (mDot(vp[3] - vp[1],cp->normal[0]) > 0) {
TerrainConvex* nc = new TerrainConvex(*cp); TerrainConvex* nc = new TerrainConvex(*cp);
sTerrainConvexList.registerObject(nc); mTerrainConvexList.registerObject(nc);
convex->addToWorkingList(nc); convex->addToWorkingList(nc);
nc->halfA = false; nc->halfA = false;
nc->square = cp; nc->square = cp;
@ -463,7 +460,7 @@ void TerrainBlock::buildConvex(const Box3F& box,Convex* convex)
cp->normal[1].normalize(); cp->normal[1].normalize();
if (mDot(vp[2] - vp[0],cp->normal[0]) > 0) { if (mDot(vp[2] - vp[0],cp->normal[0]) > 0) {
TerrainConvex* nc = new TerrainConvex(*cp); TerrainConvex* nc = new TerrainConvex(*cp);
sTerrainConvexList.registerObject(nc); mTerrainConvexList.registerObject(nc);
convex->addToWorkingList(nc); convex->addToWorkingList(nc);
nc->halfA = false; nc->halfA = false;
nc->square = cp; nc->square = cp;

View file

@ -220,13 +220,10 @@ TerrainBlock::TerrainBlock()
mTerrainAssetId = StringTable->EmptyString(); mTerrainAssetId = StringTable->EmptyString();
} }
extern Convex sTerrainConvexList;
TerrainBlock::~TerrainBlock() TerrainBlock::~TerrainBlock()
{ {
// Kill collision // Kill collision
sTerrainConvexList.nukeList(); mTerrainConvexList.nukeList();
SAFE_DELETE(mLightMap); SAFE_DELETE(mLightMap);
mLightMapTex = NULL; mLightMapTex = NULL;

View file

@ -55,7 +55,10 @@
#endif #endif
#ifndef TERRAINASSET_H #ifndef TERRAINASSET_H
#include "T3D/assets/TerrainAsset.h" #include "T3D/assets/TerrainAsset.h"
#endif #endif
#ifndef _CONVEX_H_
#include "collision/convex.h"
#endif
class GBitmap; class GBitmap;
class TerrainBlock; class TerrainBlock;
@ -217,6 +220,9 @@ protected:
/// True if the zoning needs to be recalculated for the terrain. /// True if the zoning needs to be recalculated for the terrain.
bool mZoningDirty; bool mZoningDirty;
/// Holds the generated convex list stuff for this terrain
Convex mTerrainConvexList;
String _getBaseTexCacheFileName() const; String _getBaseTexCacheFileName() const;
void _rebuildQuadtree(); void _rebuildQuadtree();

View file

@ -139,7 +139,7 @@ datablock MissionMarkerData(SpawnSphereMarker)
datablock MissionMarkerData(CameraBookmarkMarker) datablock MissionMarkerData(CameraBookmarkMarker)
{ {
category = "Misc"; category = "Misc";
shapeAsset = "Core_GameObjects:Camera"; shapeAsset = "Core_GameObjects:camera_shape";
}; };
datablock CameraData(Observer) datablock CameraData(Observer)

View file

@ -5,6 +5,7 @@
materialDefinitionName="CameraMat" materialDefinitionName="CameraMat"
VersionId="1"> VersionId="1">
<Material <Material
mapTo="CameraMat"
Name="CameraMat" Name="CameraMat"
doubleSided="1" doubleSided="1"
translucent="1" translucent="1"

View file

@ -0,0 +1,5 @@
<ShapeAsset
AssetName="camera_shape"
fileName="@assetFile=camera.fbx"
constuctorFileName="@assetFile=camera_shape.tscript"
materialSlot0="@asset=Core_GameObjects:CameraMat"/>

View file

@ -0,0 +1,11 @@
singleton TSShapeConstructor(cameradts2)
{
baseShapeAsset = "Core_GameObjects:Camera_shape";
singleDetailSize = "0";
flipUVCoords = "0";
JoinIdenticalVerts = "0";
reverseWindingOrder = "0";
removeRedundantMats = "0";
animFPS = "2";
};

View file

@ -608,8 +608,11 @@ function AssetBrowser::doRefresh(%this)
//Forces a clean collapse of the tree for any not-really-exposed items //Forces a clean collapse of the tree for any not-really-exposed items
%dataItem = AssetBrowser-->filterTree.findItemByName("data"); %dataItem = AssetBrowser-->filterTree.findItemByName("data");
AssetBrowser-->filterTree.expandItem(%dataItem, false); if(%dataItem != 0)
AssetBrowser-->filterTree.expandItem(%dataItem); {
AssetBrowser-->filterTree.expandItem(%dataItem, false);
AssetBrowser-->filterTree.expandItem(%dataItem);
}
%this.dirty = false; %this.dirty = false;
} }
@ -985,14 +988,21 @@ function AssetBrowser::changeAsset(%this)
%targetObject = %this.fieldTargetObject; %targetObject = %this.fieldTargetObject;
%inspectorObject = ""; %inspectorObject = "";
if(%this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector")) if(isObject(%this.fieldTargetObject) && %this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector"))
{ {
%inspectorObject = %this.fieldTargetObject; %inspectorObject = %this.fieldTargetObject;
%targetObject = %inspectorObject.getInspectObject(); if(%inspectorObject.getNumInspectObjects() != 0)
{
%inspectorObject.setObjectField(%this.fieldTargetName, %this.selectedAsset); %targetObject = %inspectorObject.getInspectObject();
%inspectorObject.setObjectField(%this.fieldTargetName, %this.selectedAsset);
}
else if(startsWith(%this.fieldTargetName, "$"))
{
//we're targeting a variable directly, so deal with that then
%cmd = %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
}
} }
else else if(isObject(%this.fieldTargetObject))
{ {
//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 $= "")
@ -1000,11 +1010,23 @@ function AssetBrowser::changeAsset(%this)
else else
%cmd = %targetObject @ "." @ %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); }
else if(startsWith(%this.fieldTargetName, "$"))
{
//we're targeting a variable directly, so deal with that then
%cmd = %this.fieldTargetName @ "=\"" @ %this.selectedAsset @ "\";";
} }
eval(%cmd);
//Force update our object with the field change //Force update our object with the field change
%targetObject.inspectPostApply(); if(isObject(%targetObject))
{
if(%this.fieldTargetObject.isInNamespaceHierarchy("GuiInspector"))
%this.fieldTargetObject.refresh();
else
%targetObject.inspectPostApply();
}
//Flag us as dirty for editing purposes //Flag us as dirty for editing purposes
EWorldEditor.setSceneAsDirty(); EWorldEditor.setSceneAsDirty();

View file

@ -499,7 +499,30 @@ function AssetBrowser::openFileLocation(%this)
%filePath = ""; %filePath = "";
if(EditAssetPopup.assetId !$= "") if(EditAssetPopup.assetId !$= "")
{ {
%filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId); if(AssetDatabase.isDeclaredAsset(EditAssetPopup.assetId))
{
%filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId);
}
else
{
//probably a file path
%pathSplit = strpos(EditAssetPopup.assetId, ":");
if(%pathSplit != -1)
{
%path = getSubStr(EditAssetPopup.assetId, 0, %pathSplit);
%file = getSubStr(EditAssetPopup.assetId, %pathSplit + 1);
//datablocks pack the originator file in the parent path as-is, so check that
if(fileExt(%path) !$= "")
{
%filePath = %path;
}
else
{
%filePath = %path @ "/" @ %file;
}
}
}
} }
else if(EditLevelAssetPopup.assetId !$= "") else if(EditLevelAssetPopup.assetId !$= "")
{ {
@ -510,16 +533,20 @@ function AssetBrowser::openFileLocation(%this)
%filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId); %filePath = AssetDatabase.getAssetPath(EditAssetPopup.assetId);
} }
if(%filePath !$= "") if(isFile(%filePath) || isDirectory(%filePath))
{ {
%fullPath = makeFullPath(%filePath);
if(fileExt(%fullPath) $= ".tscript")
%fullPath = filePath(%fullPath);
if($platform $= "windows") if($platform $= "windows")
{ {
%cmd = "cd \"" @ makeFullPath(%filePath) @ "\" && start ."; %cmd = "cd \"" @ %fullPath @ "\" && start .";
systemCommand(%cmd); systemCommand(%cmd);
} }
else else
{ {
%cmd = "open \"" @ makeFullPath(%filePath) @ "\""; %cmd = "open \"" @ %fullPath @ "\"";
systemCommand(%cmd); systemCommand(%cmd);
} }
} }

View file

@ -137,18 +137,9 @@ function AssetBrowser::buildPopupMenus(%this)
item[ 3 ] = "-"; item[ 3 ] = "-";
item[ 4 ] = "Create Terrain Data" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule);"; item[ 4 ] = "Create Terrain Data" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule);";
item[ 5 ] = "-"; item[ 5 ] = "-";
item[ 6 ] = "Create Shape" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"Shape\", AssetBrowser.selectedModule);"; item[ 6 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);";
item[ 7 ] = "Create Shape Animation" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ShapeAnimationAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewShapeAnimationAsset(\"NewShapeAnimation\", AssetBrowser.selectedModule);"; item[ 7 ] = "-";
item[ 8 ] = "-"; item[ 8 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);";
item[ 9 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);";
item[ 10 ] = "-";
item[ 11 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);";
item[ 12 ] = "-";
item[ 13 ] = "Create Sound" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"SoundAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewSoundAsset(\"NewSound\", AssetBrowser.selectedModule);";
item[ 14 ] = "-";
item[ 15 ] = "Create Particle Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ParticleEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewParticleEffectAsset(\"NewParticleEffect\", AssetBrowser.selectedModule);";
item[ 16 ] = "-";
item[ 17 ] = "Create Cubemap" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CubemapAsset\", AssetBrowser.selectedModule);";
}; };
} }
@ -232,13 +223,6 @@ function AssetBrowser::buildPopupMenus(%this)
}; };
} }
//Some assets are not yet ready/implemented, so disable their creation here
AddNewArtAssetPopup.enableItem(6, false); //shape
AddNewArtAssetPopup.enableItem(7, false); //shape animation
AddNewArtAssetPopup.enableItem(13, false); //sound asset
AddNewArtAssetPopup.enableItem(15, false); //particle effect
AddNewArtAssetPopup.enableItem(17, false); //cubemap
if( !isObject( EditFolderPopup ) ) if( !isObject( EditFolderPopup ) )
{ {
new PopupMenu( EditFolderPopup ) new PopupMenu( EditFolderPopup )

View file

@ -362,8 +362,8 @@ new GuiMouseEventCtrl(ForestBrushSizeSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(ForestBrushSizeTextEditContainer.position) + firstWord(ForestEditToolbar.position)+11 SPC position = ForestBrushSizeTextEditContainer.position.x + ForestEditToolbar.position.x + 50 SPC
(getWord(ForestBrushSizeTextEditContainer, 1)) + 25; ForestBrushSizeTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -392,8 +392,8 @@ new GuiMouseEventCtrl(ForestBrushPressureSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(ForestBrushPressureTextEditContainer.position) + firstWord(ForestEditToolbar.position) SPC position = ForestBrushPressureTextEditContainer.position.x + ForestEditToolbar.position.x + 50 SPC
(getWord(ForestBrushPressureTextEditContainer, 1)) + 25; ForestBrushPressureTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -422,8 +422,8 @@ new GuiMouseEventCtrl(ForestBrushHardnessSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(ForestBrushHardnessTextEditContainer.position) + firstWord(ForestEditToolbar.position) SPC position = ForestBrushPressureTextEditContainer.position.x + ForestEditToolbar.position.x + 50 SPC
(getWord(TForestBrushHardnessTextEditContainer, 1)) + 25; ForestBrushPressureTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -42,9 +42,14 @@ function PostFXEditor::editDefaultPostFXSettings( %this )
PostFXEditorActionButton.command = "PostFXManager::savePresetHandler($PostFXManager::defaultPreset);"; PostFXEditorActionButton.command = "PostFXManager::savePresetHandler($PostFXManager::defaultPreset);";
} }
function PostEffectEditorInspector::refresh(%this)
{
PostFXEditor.refresh();
}
function PostFXEditor::refresh(%this) function PostFXEditor::refresh(%this)
{ {
%selectedItem = PostEffectEditorList.getSelectedRow();
PostEffectEditorList.clear(); PostEffectEditorList.clear();
%count = PostFXManager.Count(); %count = PostFXManager.Count();
@ -55,6 +60,8 @@ function PostFXEditor::refresh(%this)
if(%postEffect.isEnabled()) if(%postEffect.isEnabled())
PostEffectEditorList.addRow( %i, %postEffect.getName() ); PostEffectEditorList.addRow( %i, %postEffect.getName() );
} }
PostEffectEditorList.setSelectedRow(%selectedItem);
} }
function PostFXEditor::apply(%this) function PostFXEditor::apply(%this)

View file

@ -302,8 +302,8 @@ new GuiMouseEventCtrl(MeshRoadDefaultWidthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(MeshRoadDefaultWidthTextEditContainer.position) + firstWord(MeshRoadEditorToolbar.position) + 10 SPC position = MeshRoadDefaultWidthTextEditContainer.position.x + MeshRoadEditorToolbar.position.x + 50 SPC
(getWord(MeshRoadDefaultWidthTextEditContainer, 1)) + 25; MeshRoadDefaultWidthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -331,8 +331,8 @@ new GuiMouseEventCtrl(MeshRoadDefaultDepthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(MeshRoadDefaultDepthTextEditContainer.position) + firstWord(MeshRoadEditorToolbar.position) + 10 SPC position = MeshRoadDefaultDepthTextEditContainer.position.x + MeshRoadEditorToolbar.position.x + 50 SPC
(getWord(MeshRoadDefaultDepthTextEditContainer, 1)) + 25; MeshRoadDefaultDepthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -280,8 +280,8 @@ new GuiMouseEventCtrl(RiverDefaultWidthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(RiverDefaultWidthTextEditContainer.position) + firstWord(RiverEditorToolbar.position) + 10 SPC position = RiverDefaultWidthTextEditContainer.position.x + RiverEditorToolbar.position.x + 50 SPC
(getWord(RiverDefaultWidthTextEditContainer, 1)) + 25; RiverDefaultWidthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -309,8 +309,8 @@ new GuiMouseEventCtrl(RiverDefaultDepthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(RiverDefaultDepthTextEditContainer.position) + firstWord(RiverEditorToolbar.position) + 10 SPC position = RiverDefaultDepthTextEditContainer.position.x + RiverEditorToolbar.position.x + 50 SPC
(getWord(RiverDefaultDepthTextEditContainer, 1)) + 25; RiverDefaultDepthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -259,8 +259,8 @@ new GuiMouseEventCtrl(RoadDefaultWidthSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(RoadDefaultWidthTextEditContainer.position) + firstWord(RoadEditorToolbar.position) + 10 SPC position = RoadDefaultWidthTextEditContainer.position.x + RoadEditorToolbar.position.x + 50 SPC
(getWord(RoadDefaultWidthTextEditContainer, 1)) + 25; RoadDefaultWidthTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -510,8 +510,8 @@ new GuiMouseEventCtrl(TerrainBrushSizeSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(TerrainBrushSizeTextEditContainer.position) + firstWord(EWTerrainEditToolbar.position)+11 SPC position = TerrainBrushSizeTextEditContainer.position.x + EWTerrainEditToolbar.position.x + 50 SPC
(getWord(TerrainBrushSizeTextEditContainer, 1)) + 25; TerrainBrushSizeTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -540,8 +540,8 @@ new GuiMouseEventCtrl(TerrainBrushPressureSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(TerrainBrushPressureTextEditContainer.position) + firstWord(EWTerrainEditToolbar.position) SPC position = TerrainBrushPressureTextEditContainer.position.x + EWTerrainEditToolbar.position.x + 50 SPC
(getWord(TerrainBrushPressureTextEditContainer, 1)) + 25; TerrainBrushPressureTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -570,8 +570,8 @@ new GuiMouseEventCtrl(TerrainBrushSoftnessSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(TerrainBrushSoftnessTextEditContainer.position) + firstWord(EWTerrainEditToolbar.position) SPC position = TerrainBrushSoftnessTextEditContainer.position.x + EWTerrainEditToolbar.position.x + 50 SPC
(getWord(TerrainBrushSoftnessTextEditContainer, 1)) + 25; TerrainBrushSoftnessTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -600,8 +600,8 @@ new GuiMouseEventCtrl(TerrainSetHeightSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(TerrainSetHeightTextEditContainer.position) + firstWord(EWTerrainEditToolbar.position) SPC position = TerrainSetHeightTextEditContainer.position.x + EWTerrainEditToolbar.position.x SPC
(getWord(TerrainSetHeightTextEditContainer, 1)) + 25; TerrainSetHeightTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -222,7 +222,7 @@ $guiContent = new GuiControl(EWTerrainPainterToolbar,EditorGuiGroup) {
Profile = "ToolsGuiDefaultProfile"; Profile = "ToolsGuiDefaultProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
Position = "222 5"; Position = "245 5";
Extent = "256 50"; Extent = "256 50";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -382,7 +382,7 @@ $guiContent = new GuiControl(EWTerrainPainterToolbar,EditorGuiGroup) {
Profile = "ToolsGuiTransparentProfile"; Profile = "ToolsGuiTransparentProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = "480 5"; position = "490 5";
Extent = "120 50"; Extent = "120 50";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -524,8 +524,8 @@ new GuiMouseEventCtrl(PaintBrushSizeSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushSizeTextEditContainer.position) + firstWord(EWTerrainPainterToolbar.position)+11 SPC position = PaintBrushSizeTextEditContainer.position.x + EWTerrainPainterToolbar.position.x + 50 SPC
(getWord(PaintBrushSizeTextEditContainer, 1)) + 25; PaintBrushSizeTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -554,8 +554,8 @@ new GuiMouseEventCtrl(PaintBrushSlopeMinContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushSlopeControl.position) + firstWord(EWTerrainPainterToolbar.position)+firstWord(PaintBrushSlopeControl->SlopeMinAngle.position) - 40 SPC position = PaintBrushSlopeControl.position.x + EWTerrainPainterToolbar.position.x + PaintBrushSlopeControl->SlopeMinAngle.position.x - 40 SPC
(getWord(PaintBrushSlopeControl, 1)) + 25; PaintBrushSlopeControl.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -589,8 +589,8 @@ new GuiMouseEventCtrl(PaintBrushSlopeMaxContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushSlopeControl.position) + firstWord(EWTerrainPainterToolbar.position)+firstWord(PaintBrushSlopeControl->SlopeMaxAngle.position) - 40 SPC position = PaintBrushSlopeControl.position.x + EWTerrainPainterToolbar.position.x + PaintBrushSlopeControl->SlopeMaxAngle.position.x - 40 SPC
(getWord(PaintBrushSlopeControl, 1)) + 25; PaintBrushSlopeControl.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -629,8 +629,8 @@ new GuiMouseEventCtrl(PaintBrushPressureSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushPressureTextEditContainer.position) + firstWord(EWTerrainPainterToolbar.position) SPC position = PaintBrushPressureTextEditContainer.position.x + EWTerrainPainterToolbar.position.x + 50 SPC
(getWord(PaintBrushPressureTextEditContainer, 1)) + 25; PaintBrushPressureTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";
@ -659,8 +659,8 @@ new GuiMouseEventCtrl(PaintBrushSoftnessSliderCtrlContainer,EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(PaintBrushSoftnessTextEditContainer.position) + firstWord(EWTerrainPainterToolbar.position) SPC position = PaintBrushSoftnessTextEditContainer.position.x + EWTerrainPainterToolbar.position.x + 50 SPC
(getWord(PaintBrushSoftnessTextEditContainer, 1)) + 25; PaintBrushSoftnessTextEditContainer.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -684,8 +684,8 @@ new GuiMouseEventCtrl(softSnapSizeSliderCtrlContainer, EditorGuiGroup) {
Profile = "ToolsGuiSliderBoxProfile"; Profile = "ToolsGuiSliderBoxProfile";
HorizSizing = "right"; HorizSizing = "right";
VertSizing = "bottom"; VertSizing = "bottom";
position = firstWord(EWorldEditorToolbar-->softSnapSizeTextEdit.getGlobalPosition()) - 12 SPC position = EWorldEditorToolbar.position.x + EWorldEditorToolbar-->softSnapSizeTextEditContainer.position.x + 50 SPC
(getWord(EWorldEditorToolbar-->softSnapSizeTextEdit.getGlobalPosition(), 1)) + 18; EWorldEditorToolbar-->softSnapSizeTextEdit.position.y + 50;
Extent = "112 20"; Extent = "112 20";
MinExtent = "8 2"; MinExtent = "8 2";
canSave = "1"; canSave = "1";

View file

@ -734,7 +734,7 @@ function EditorGui::addCameraBookmarkByGui( %this )
// look for a NewCamera name to grab // look for a NewCamera name to grab
for(%i = 0; ; %i++){ for(%i = 0; ; %i++){
%name = "NewCamera_" @ %i; %name = "NewCamera_" @ %i;
if( !CameraBookmarks.findObjectByInternalName(%name) ){ if( !isObject(CameraBookmarks) || !CameraBookmarks.findObjectByInternalName(%name) ){
break; break;
} }
} }
@ -1340,7 +1340,9 @@ function CameraTypesDropdownToggle()
function VisibilityDropdownToggle() function VisibilityDropdownToggle()
{ {
EditorVisibilityOptions.showPopup(Canvas); %pos = visibilityToggleBtn.getGlobalPosition();
%pos.y += visibilityToggleBtn.extent.y;
EditorVisibilityOptions.showPopup(Canvas, %pos.x, %pos.y);
} }
function CameraTypesDropdownDecoy::onMouseLeave() function CameraTypesDropdownDecoy::onMouseLeave()

View file

@ -436,3 +436,55 @@ function toggleVolumeViz(%vizName)
EVisibilityVolumeOptions.checkItem(7, $SFXSpace::isRenderable); EVisibilityVolumeOptions.checkItem(7, $SFXSpace::isRenderable);
} }
} }
//
//
function togglePlayerCollisionViz()
{
$Player::renderCollision = !$Player::renderCollision;
EVisibilityDebugRenderOptions.checkItem(0, $Player::renderCollision);
}
function toggleTerrainDebugViz()
{
$TerrainBlock::debugRender = !$TerrainBlock::debugRender;
EVisibilityDebugRenderOptions.checkItem(1, $TerrainBlock::debugRender);
}
function toggleDecalsDebugViz()
{
$Decals::debugRender = !$Decals::debugRender;
EVisibilityDebugRenderOptions.checkItem(2, $Decals::debugRender);
}
function toggleBoundingBoxesViz()
{
$Scene::renderBoundingBoxes = !$Scene::renderBoundingBoxes;
EVisibilityDebugRenderOptions.checkItem(3, $Scene::renderBoundingBoxes);
}
//
//
function toggleWireframeViz()
{
$gfx::wireframe = !$gfx::wireframe;
EditorVisibilityOptions.checkItem(3, $gfx::wireframe);
}
function toggleFrustumLockViz()
{
$Scene::lockCull = !$Scene::lockCull;
EditorVisibilityOptions.checkItem(4, $Scene::lockCull);
}
function toggleZoneCulling()
{
$Scene::disableZoneCulling = !$Scene::disableZoneCulling;
EditorVisibilityOptions.checkItem(7, $Scene::disableZoneCulling);
}
function toggleTerrainCulling()
{
$Scene::disableTerrainOcclusion = !$Scene::disableTerrainOcclusion;
EditorVisibilityOptions.checkItem(8, $Scene::disableTerrainOcclusion);
}

View file

@ -98,15 +98,17 @@ function setupEditorVisibilityMenu()
superClass = "MenuBuilder"; superClass = "MenuBuilder";
class = "EditorWorldMenu"; class = "EditorWorldMenu";
item[ 0 ] = "Show Player Collision" TAB "" TAB "$Player::renderCollision = !$Player::renderCollision;"; item[ 0 ] = "Show Player Collision" TAB "" TAB "togglePlayerCollisionViz();";
item[ 1 ] = "Show Terrain Debug" TAB "" TAB "$TerrainBlock::debugRender = !$TerrainBlock::debugRender;"; item[ 1 ] = "Show Terrain Debug" TAB "" TAB "toggleTerrainDebugViz();";
item[ 2 ] = "Show Decals Debug" TAB "" TAB "$Decals::debugRender = !$Decals::debugRender;"; item[ 2 ] = "Show Decals Debug" TAB "" TAB "toggleDecalsDebugViz();";
item[ 3 ] = "Show Bounding Boxes" TAB "" TAB "$Scene::renderBoundingBoxes = !$Scene::renderBoundingBoxes;"; item[ 3 ] = "Show Bounding Boxes" TAB "" TAB "toggleBoundingBoxesViz();";
item[ 4 ] = "Show Physics World" TAB "" TAB "togglePhysicsDebugViz();"; item[ 4 ] = "Show Physics World" TAB "" TAB "togglePhysicsDebugViz();";
item[ 5 ] = "Show Texel Density" TAB "" TAB "toggleTexelDensityViz();"; item[ 5 ] = "Show Texel Density" TAB "" TAB "toggleTexelDensityViz();";
}; };
%debugRenderpopup.enableItem(4, false); if(!physicsPluginPresent())
%debugRenderpopup.enableItem(4, false);
%debugRenderpopup.enableItem(5, false); %debugRenderpopup.enableItem(5, false);
// //
@ -231,12 +233,12 @@ function setupEditorVisibilityMenu()
item[ 0 ] = "Volumes Visibility" TAB EVisibilityVolumeOptions; item[ 0 ] = "Volumes Visibility" TAB EVisibilityVolumeOptions;
item[ 1 ] = "Debug Rendering" TAB EVisibilityDebugRenderOptions; item[ 1 ] = "Debug Rendering" TAB EVisibilityDebugRenderOptions;
item[ 2 ] = "-" TAB "" TAB ""; item[ 2 ] = "-" TAB "" TAB "";
item[ 3 ] = "Wireframe" TAB "" TAB "$gfx::wireframe = !$gfx::wireframe;"; item[ 3 ] = "Wireframe" TAB "" TAB "toggleWireframeViz();";
item[ 4 ] = "Frustum Lock" TAB "" TAB "$Scene::lockCull = !$Scene::lockCull;"; item[ 4 ] = "Frustum Lock" TAB "" TAB "toggleFrustumLockViz();";
item[ 5 ] = "Colorblindness" TAB EVisibilityColorblindnessOptions; item[ 5 ] = "Colorblindness" TAB EVisibilityColorblindnessOptions;
item[ 6 ] = "-" TAB "" TAB ""; item[ 6 ] = "-" TAB "" TAB "";
item[ 7 ] = "Disable Zone Culling" TAB "" TAB "$Scene::disableZoneCulling = !$Scene::disableZoneCulling;"; item[ 7 ] = "Disable Zone Culling" TAB "" TAB "toggleZoneCulling();";
item[ 8 ] = "Disable Terrain Culling" TAB "" TAB "$Scene::disableTerrainOcclusion = !$Scene::disableTerrainOcclusion;"; item[ 8 ] = "Disable Terrain Culling" TAB "" TAB "toggleTerrainCulling();";
item[ 9 ] = "-" TAB "" TAB ""; item[ 9 ] = "-" TAB "" TAB "";
item[ 10 ] = "Lighting Modes" TAB EVisibilityLightingModesOptions; item[ 10 ] = "Lighting Modes" TAB EVisibilityLightingModesOptions;
item[ 11 ] = "Lights" TAB EVisibilityLightsOptions; item[ 11 ] = "Lights" TAB EVisibilityLightsOptions;
@ -383,14 +385,17 @@ function EVisibility::addClassOptions( %this )
} }
} }
function togglePhysicsDebugViz( %enable ) function togglePhysicsDebugViz( )
{ {
$PhysicsWorld::render = %enable; $PhysicsWorld::render = !$PhysicsWorld::render;
if(physicsPluginPresent()) if(physicsPluginPresent())
{ {
physicsDebugDraw(%enable); physicsDebugDraw($PhysicsWorld::render);
} }
EVisibilityDebugRenderOptions.checkItem(4, $PhysicsWorld::render);
} }
function disableVisualizers() function disableVisualizers()