@rextimmy fix for GuiWindowCtrl so they snap correctly again

Added asset loose files for editor and bake level files on level asset
Correct return of ConsoleGetType on TypeShapeAssetPtr
Adds shape asset support to TSStatic, now will support either raw shape file or ShapeAsset
Adds onInspect function behavior, so when object is inspected, it can do special editor behavior
Adds callback for when editTSCtrl is resized
Added editor setting to force the world editor sidebar(scene tree and inspector windows) to resize to fit to the right side of the screen automatically instead of float
If assimp loader encounters error, it's output into the console log
Makes root Data item in folder hierarchy tree in Asset Browser able to support right mouse popup menu action
Material and Shape assets now correctly base on current browsed folder
Material asset generation now more properly fills out common maps, as well as handles skipped dependencies better
More theme corrections
Updated TestGrid images asset defs to have proper loose file handling
This commit is contained in:
Areloch 2019-11-18 03:30:04 -06:00
parent 7ff451ec89
commit 7b5e1c3c58
35 changed files with 619 additions and 295 deletions

View file

@ -31,7 +31,7 @@
#include "gfx/gfxDevice.h"
#include "gfx/gfxDrawUtil.h"
#include "gui/containers/guiRolloutCtrl.h"
#include "gui/editor/guiMenuBar.h"
IMPLEMENT_CONOBJECT( GuiWindowCtrl );
@ -855,6 +855,18 @@ void GuiWindowCtrl::onMouseDragged(const GuiEvent &event)
snapZone.point.y -= SnapDistance;
snapZone.extent.x += SnapDistance + SnapDistance;
snapZone.extent.y += SnapDistance + SnapDistance;
//check if we need to offset because of the menubar
U32 menuBarHeight = 0;
GuiCanvas* guiCanvas = getRoot();
if (guiCanvas)
{
GuiMenuBar* menuBar = dynamic_cast<GuiMenuBar*>(guiCanvas->getMenuBar());
if (menuBar)
{
menuBarHeight = menuBar->getHeight();
}
}
// Build valid snap and window vectors to compare against
Vector< GuiWindowCtrl* > windowList;
@ -864,11 +876,15 @@ void GuiWindowCtrl::onMouseDragged(const GuiEvent &event)
{
// Make sure the window is both horizontally and vertically
// within the snap zone for this window.
if( !snapZone.overlaps( windowList[i]->getGlobalBounds() ) )
RectI windowBounds = windowList[i]->getGlobalBounds();
//offset position by menubar height
windowBounds.point.y -= menuBarHeight;
if( !snapZone.overlaps(windowBounds) )
continue;
// Build edges for snap detection
EdgeRectI snapRect( windowList[i]->getGlobalBounds(), mResizeMargin );
EdgeRectI snapRect(windowBounds, mResizeMargin );
if( snapRect.right.position.x <= edges.left.position.x + SnapDistance &&
snapRect.right.position.x >= edges.left.position.x - SnapDistance )

View file

@ -589,6 +589,8 @@ void GuiInspector::refresh()
mGroups.push_back(general);
addObject(general);
mTargets.first()->onInspect(this);
//Entity inspector group
if (mTargets.first()->getClassRep()->isSubclassOf("Entity"))
{
@ -669,7 +671,7 @@ void GuiInspector::refresh()
#endif
// The group ended up having no fields. Remove it.
newGroup->deleteObject();
newGroup->deleteObject();
}
else
{

View file

@ -106,6 +106,11 @@ public:
/// @note Only valid in single-object mode.
void setName( StringTableEntry newName );
void addInspectorGroup(GuiInspectorGroup* group)
{
mGroups.push_back(group);
}
/// Deletes all GuiInspectorGroups
void clearGroups();
@ -163,4 +168,4 @@ protected:
void refresh();
};
#endif
#endif

View file

@ -284,6 +284,18 @@ void EditTSCtrl::consoleInit()
//------------------------------------------------------------------------------
bool EditTSCtrl::resize(const Point2I& newPosition, const Point2I& newExtent)
{
if (!Parent::resize(newPosition, newExtent))
return false;
// Notify the scripts
if (isMethod("onResize"))
Con::executef(this, "onResize", newPosition, newExtent);
return true;
}
//------------------------------------------------------------------------------
void EditTSCtrl::make3DMouseEvent(Gui3DMouseEvent & gui3DMouseEvent, const GuiEvent & event)
{
(GuiEvent&)(gui3DMouseEvent) = event;

View file

@ -191,6 +191,8 @@ class EditTSCtrl : public GuiTSCtrl
virtual bool isMiddleMouseDown() {return mMiddleMouseDown;}
virtual bool resize(const Point2I& newPosition, const Point2I& newExtent);
S32 getDisplayType() const {return mDisplayType;}
virtual void setDisplayType(S32 type);