Explorar o código

Added Ping to GUISceneTreeView
Hooked up ping for Project and Hierarchy window to Resource/GameObject/Texture fields
Fixed an issue where C# DragDrop wasn't properly populating the dragged scene object array
Fixed an issue where ProjectWindow has incorrectly picking up all external drop events regardless of their position
Fixed an issue where external drag events weren't being registered ProjectDropTarget
Normalized colors between Project and Hierarchy windows

Marko Pintera %!s(int64=10) %!d(string=hai) anos
pai
achega
02ce72bd87

+ 1 - 0
BansheeEditor/Include/BsBuiltinEditorResources.h

@@ -317,6 +317,7 @@ namespace BansheeEngine
 		static const WString TreeViewExpandButtonOnHover;
 		static const WString TreeViewExpandButtonOnHover;
 
 
 		static const WString TreeViewSelectionBackground;
 		static const WString TreeViewSelectionBackground;
+		static const WString TreeViewHighlightBackground;
 		static const WString TreeViewEditBox;
 		static const WString TreeViewEditBox;
 
 
 		static const WString TreeViewElementHighlight;
 		static const WString TreeViewElementHighlight;

+ 10 - 8
BansheeEditor/Include/BsGUIResourceTreeView.h

@@ -56,6 +56,7 @@ namespace BansheeEngine
 		 * @param	backgroundStyle				Name of the style for the tree view background.
 		 * @param	backgroundStyle				Name of the style for the tree view background.
 		 * @param	elementBtnStyle				Name of the style for a normal tree view element.
 		 * @param	elementBtnStyle				Name of the style for a normal tree view element.
 		 * @param	foldoutBtnStyle				Name of the style for a foldout element (e.g. for a folder).
 		 * @param	foldoutBtnStyle				Name of the style for a foldout element (e.g. for a folder).
+		 * @param	highlightBackgroundStyle	Name of the style for the background of highlighted elements.
 		 * @param	selectionBackgroundStyle	Name of the style for the background of selected elements.
 		 * @param	selectionBackgroundStyle	Name of the style for the background of selected elements.
 		 * @param	editBoxStyle				Name of the style for element that is being renamed.
 		 * @param	editBoxStyle				Name of the style for element that is being renamed.
 		 * @param	dragHighlightStyle			Name of the style for the element being dragged over.
 		 * @param	dragHighlightStyle			Name of the style for the element being dragged over.
@@ -64,9 +65,9 @@ namespace BansheeEngine
 		 */	
 		 */	
 		static GUIResourceTreeView* create(
 		static GUIResourceTreeView* create(
 			const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK, 
 			const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK, 
-			const String& foldoutBtnStyle = StringUtil::BLANK, const String& selectionBackgroundStyle = StringUtil::BLANK,
-			const String& editBoxStyle = StringUtil::BLANK, const String& dragHighlightStyle = StringUtil::BLANK, 
-			const String& dragSepHighlightStyle = StringUtil::BLANK);
+			const String& foldoutBtnStyle = StringUtil::BLANK, const String& highlightBackgroundStyle = StringUtil::BLANK,
+			const String& selectionBackgroundStyle = StringUtil::BLANK, const String& editBoxStyle = StringUtil::BLANK, 
+			const String& dragHighlightStyle = StringUtil::BLANK, const String& dragSepHighlightStyle = StringUtil::BLANK);
 
 
 		/**
 		/**
 		 * @brief	Creates a new resource tree view element.
 		 * @brief	Creates a new resource tree view element.
@@ -76,6 +77,7 @@ namespace BansheeEngine
 		 * @param	backgroundStyle				Name of the style for the tree view background.
 		 * @param	backgroundStyle				Name of the style for the tree view background.
 		 * @param	elementBtnStyle				Name of the style for a normal tree view element.
 		 * @param	elementBtnStyle				Name of the style for a normal tree view element.
 		 * @param	foldoutBtnStyle				Name of the style for a foldout element (e.g. for a folder).
 		 * @param	foldoutBtnStyle				Name of the style for a foldout element (e.g. for a folder).
+		 * @param	highlightBackgroundStyle	Name of the style for the background of highlighted elements.
 		 * @param	selectionBackgroundStyle	Name of the style for the background of selected elements.
 		 * @param	selectionBackgroundStyle	Name of the style for the background of selected elements.
 		 * @param	editBoxStyle				Name of the style for element that is being renamed.
 		 * @param	editBoxStyle				Name of the style for element that is being renamed.
 		 * @param	dragHighlightStyle			Name of the style for the element being dragged over.
 		 * @param	dragHighlightStyle			Name of the style for the element being dragged over.
@@ -84,9 +86,9 @@ namespace BansheeEngine
 		 */	
 		 */	
 		static GUIResourceTreeView* create(const GUIOptions& options, 
 		static GUIResourceTreeView* create(const GUIOptions& options, 
 			const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK, 
 			const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK, 
-			const String& foldoutBtnStyle = StringUtil::BLANK, const String& selectionBackgroundStyle = StringUtil::BLANK,
-			const String& editBoxStyle = StringUtil::BLANK, const String& dragHighlightStyle = StringUtil::BLANK, 
-			const String& dragSepHighlightStyle = StringUtil::BLANK);
+			const String& foldoutBtnStyle = StringUtil::BLANK, const String& highlightBackgroundStyle = StringUtil::BLANK, 
+			const String& selectionBackgroundStyle = StringUtil::BLANK, const String& editBoxStyle = StringUtil::BLANK, 
+			const String& dragHighlightStyle = StringUtil::BLANK, const String& dragSepHighlightStyle = StringUtil::BLANK);
 
 
 		/**
 		/**
 		 * @brief	Returns a list of paths of currently selected resources (if any).
 		 * @brief	Returns a list of paths of currently selected resources (if any).
@@ -118,8 +120,8 @@ namespace BansheeEngine
 		HEvent mDropTargetLeaveConn;
 		HEvent mDropTargetLeaveConn;
 		HEvent mDropTargetDroppedConn;
 		HEvent mDropTargetDroppedConn;
 
 
-		GUIResourceTreeView(const String& backgroundStyle, const String& elementBtnStyle, 
-			const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& editBoxStyle, 
+		GUIResourceTreeView(const String& backgroundStyle, const String& elementBtnStyle, const String& foldoutBtnStyle, 
+			const String& highlightBackgroundStyle, const String& selectionBackgroundStyle, const String& editBoxStyle,
 			const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions);
 			const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions);
 
 
 		/**
 		/**

+ 15 - 8
BansheeEditor/Include/BsGUISceneTreeView.h

@@ -52,6 +52,7 @@ namespace BansheeEngine
 		 * @param	elementBtnStyle				Name of the style for a normal tree view element.
 		 * @param	elementBtnStyle				Name of the style for a normal tree view element.
 		 * @param	foldoutBtnStyle				Name of the style for a foldout element (e.g. for a folder).
 		 * @param	foldoutBtnStyle				Name of the style for a foldout element (e.g. for a folder).
 		 * @param	selectionBackgroundStyle	Name of the style for the background of selected elements.
 		 * @param	selectionBackgroundStyle	Name of the style for the background of selected elements.
+		 * @param	highlightBackgroundStyle	Name of the style for the background of highlighted elements.
 		 * @param	editBoxStyle				Name of the style for element that is being renamed.
 		 * @param	editBoxStyle				Name of the style for element that is being renamed.
 		 * @param	dragHighlightStyle			Name of the style for the element being dragged over.
 		 * @param	dragHighlightStyle			Name of the style for the element being dragged over.
 		 * @param	dragSepHighlightStyle		Name of the style for the separator displayed while dragging
 		 * @param	dragSepHighlightStyle		Name of the style for the separator displayed while dragging
@@ -59,9 +60,9 @@ namespace BansheeEngine
 		 */	
 		 */	
 		static GUISceneTreeView* create(
 		static GUISceneTreeView* create(
 			const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK, 
 			const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK, 
-			const String& foldoutBtnStyle = StringUtil::BLANK, const String& selectionBackgroundStyle = StringUtil::BLANK,
-			const String& editBoxStyle = StringUtil::BLANK, const String& dragHighlightStyle = StringUtil::BLANK, 
-			const String& dragSepHighlightStyle = StringUtil::BLANK);
+			const String& foldoutBtnStyle = StringUtil::BLANK, const String& highlightBackgroundStyle = StringUtil::BLANK, 
+			const String& selectionBackgroundStyle = StringUtil::BLANK, const String& editBoxStyle = StringUtil::BLANK, 
+			const String& dragHighlightStyle = StringUtil::BLANK, const String& dragSepHighlightStyle = StringUtil::BLANK);
 
 
 		/**
 		/**
 		 * @brief	Creates a new resource tree view element.
 		 * @brief	Creates a new resource tree view element.
@@ -71,6 +72,7 @@ namespace BansheeEngine
 		 * @param	backgroundStyle				Name of the style for the tree view background.
 		 * @param	backgroundStyle				Name of the style for the tree view background.
 		 * @param	elementBtnStyle				Name of the style for a normal tree view element.
 		 * @param	elementBtnStyle				Name of the style for a normal tree view element.
 		 * @param	foldoutBtnStyle				Name of the style for a foldout element (e.g. for a folder).
 		 * @param	foldoutBtnStyle				Name of the style for a foldout element (e.g. for a folder).
+		 * @param	highlightBackgroundStyle	Name of the style for the background of highlighted elements.
 		 * @param	selectionBackgroundStyle	Name of the style for the background of selected elements.
 		 * @param	selectionBackgroundStyle	Name of the style for the background of selected elements.
 		 * @param	editBoxStyle				Name of the style for element that is being renamed.
 		 * @param	editBoxStyle				Name of the style for element that is being renamed.
 		 * @param	dragHighlightStyle			Name of the style for the element being dragged over.
 		 * @param	dragHighlightStyle			Name of the style for the element being dragged over.
@@ -79,9 +81,9 @@ namespace BansheeEngine
 		 */	
 		 */	
 		static GUISceneTreeView* create(const GUIOptions& options, 
 		static GUISceneTreeView* create(const GUIOptions& options, 
 			const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK, 
 			const String& backgroundStyle = StringUtil::BLANK, const String& elementBtnStyle = StringUtil::BLANK, 
-			const String& foldoutBtnStyle = StringUtil::BLANK, const String& selectionBackgroundStyle = StringUtil::BLANK,
-			const String& editBoxStyle = StringUtil::BLANK, const String& dragHighlightStyle = StringUtil::BLANK, 
-			const String& dragSepHighlightStyle = StringUtil::BLANK);
+			const String& foldoutBtnStyle = StringUtil::BLANK, const String& highlightBackgroundStyle = StringUtil::BLANK,
+			const String& selectionBackgroundStyle = StringUtil::BLANK, const String& editBoxStyle = StringUtil::BLANK, 
+			const String& dragHighlightStyle = StringUtil::BLANK, const String& dragSepHighlightStyle = StringUtil::BLANK);
 
 
 		/**
 		/**
 		 * @brief	Returns a list of SceneObject&s currently selected (if any).
 		 * @brief	Returns a list of SceneObject&s currently selected (if any).
@@ -93,6 +95,11 @@ namespace BansheeEngine
 		 */	
 		 */	
 		void setSelection(const Vector<HSceneObject>& objects);
 		void setSelection(const Vector<HSceneObject>& objects);
 
 
+		/**
+		 * @brief	Scrolls to and highlights the selected object (does not select it).
+		 */
+		void ping(const HSceneObject& object);
+
 		Event<void()> onSelectionChanged; /**< Triggered whenever the selection changes. Call ::getSelection() to retrieve new selection: */
 		Event<void()> onSelectionChanged; /**< Triggered whenever the selection changes. Call ::getSelection() to retrieve new selection: */
 		static const MessageId SELECTION_CHANGED_MSG;
 		static const MessageId SELECTION_CHANGED_MSG;
 	protected:
 	protected:
@@ -102,8 +109,8 @@ namespace BansheeEngine
 		SceneTreeElement mRootElement;
 		SceneTreeElement mRootElement;
 
 
 		GUISceneTreeView(const String& backgroundStyle, const String& elementBtnStyle, 
 		GUISceneTreeView(const String& backgroundStyle, const String& elementBtnStyle, 
-			const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& editBoxStyle, 
-			const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions);
+			const String& foldoutBtnStyle, const String& highlightBackgroundStyle, const String& selectionBackgroundStyle, 
+			const String& editBoxStyle, const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions);
 
 
 		/**
 		/**
 		 * @brief	Checks it the SceneObject referenced by this tree element changed in any way and updates
 		 * @brief	Checks it the SceneObject referenced by this tree element changed in any way and updates

+ 20 - 1
BansheeEditor/Include/BsGUITreeView.h

@@ -53,6 +53,7 @@ namespace BansheeEngine
 			UINT32 mSortedIdx;
 			UINT32 mSortedIdx;
 			bool mIsExpanded;
 			bool mIsExpanded;
 			bool mIsSelected;
 			bool mIsSelected;
+			bool mIsHighlighted;
 			bool mIsVisible;
 			bool mIsVisible;
 
 
 			bool isParentRec(TreeElement* element) const;
 			bool isParentRec(TreeElement* element) const;
@@ -82,6 +83,10 @@ namespace BansheeEngine
 		 */
 		 */
 		struct SelectedElement
 		struct SelectedElement
 		{
 		{
+			SelectedElement()
+				:element(nullptr), background(nullptr)
+			{ }
+
 			SelectedElement(TreeElement* elem, GUITexture* back)
 			SelectedElement(TreeElement* elem, GUITexture* back)
 				:element(elem), background(back)
 				:element(elem), background(back)
 			{ }
 			{ }
@@ -106,7 +111,7 @@ namespace BansheeEngine
 
 
 	protected:
 	protected:
 		GUITreeView(const String& backgroundStyle, const String& elementBtnStyle, 
 		GUITreeView(const String& backgroundStyle, const String& elementBtnStyle, 
-			const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& editBoxStyle, 
+			const String& foldoutBtnStyle, const String& highlightBackgroundStyle, const String& selectionBackgroundStyle, const String& editBoxStyle,
 			const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions);
 			const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions);
 
 
 		virtual ~GUITreeView();
 		virtual ~GUITreeView();
@@ -295,6 +300,16 @@ namespace BansheeEngine
 		 */
 		 */
 		GUIScrollArea* findParentScrollArea() const;
 		GUIScrollArea* findParentScrollArea() const;
 
 
+		/**
+		 * @brief	Scrolls the tree view to the specified element and highlights it.
+		 */
+		void ping(TreeElement* element);
+
+		/**
+		 * @brief	Clears the ping highlight on the currently highlighted element.
+		 */
+		void clearPing();
+
 		/**
 		/**
 		 * @brief	Triggered when the user accepts the changes during a rename operation.
 		 * @brief	Triggered when the user accepts the changes during a rename operation.
 		 */
 		 */
@@ -309,6 +324,7 @@ namespace BansheeEngine
 		String mElementBtnStyle;
 		String mElementBtnStyle;
 		String mFoldoutBtnStyle;
 		String mFoldoutBtnStyle;
 		String mSelectionBackgroundStyle;
 		String mSelectionBackgroundStyle;
+		String mHighlightBackgroundStyle;
 		String mEditBoxStyle;
 		String mEditBoxStyle;
 		String mDragHighlightStyle;
 		String mDragHighlightStyle;
 		String mDragSepHighlightStyle;
 		String mDragSepHighlightStyle;
@@ -320,6 +336,9 @@ namespace BansheeEngine
 		bool mIsElementSelected;
 		bool mIsElementSelected;
 		Vector<SelectedElement> mSelectedElements;
 		Vector<SelectedElement> mSelectedElements;
 
 
+		bool mIsElementHighlighted;
+		SelectedElement mHighlightedElement;
+
 		TreeElement* mEditElement;
 		TreeElement* mEditElement;
 		GUITreeViewEditBox* mNameEditBox;
 		GUITreeViewEditBox* mNameEditBox;
 
 

+ 22 - 0
BansheeEditor/Include/BsSelection.h

@@ -54,11 +54,33 @@ namespace BansheeEngine
 		 */
 		 */
 		void clearResourceSelection();
 		void clearResourceSelection();
 
 
+		/**
+		 * @brief	Pings the scene object, highlighting it in its respective editors.
+		 */
+		void ping(const HSceneObject& sceneObject);
+
+		/**
+		 * @brief	Pings the resource, highlighting it in its respective editors.
+		 */
+		void ping(const Path& resourcePath);
+
 		/**
 		/**
 		 * @brief	Triggered whenever scene object or resource selection changes. The provided
 		 * @brief	Triggered whenever scene object or resource selection changes. The provided
 		 *			parameters will contain the newly selected objects/resource paths.
 		 *			parameters will contain the newly selected objects/resource paths.
 		 */
 		 */
 		Event<void(const Vector<HSceneObject>&, const Vector<Path>&)> onSelectionChanged; 
 		Event<void(const Vector<HSceneObject>&, const Vector<Path>&)> onSelectionChanged; 
+
+		/**
+		 * @brief	Triggered when a scene object ping is requested. Ping usually means the
+		 *			object will be highlighted in its respective editors.
+		 */
+		Event<void(const HSceneObject&)> onSceneObjectPing; 
+
+		/**
+		 * @brief	Triggered when a resource ping is requested. Ping usually means the
+		 *			object will be highlighted in its respective editors.
+		 */
+		Event<void(const Path&)> onResourcePing; 
 	private:
 	private:
 		/**
 		/**
 		 * @brief	Triggered when the scene object selection in the scene tree view changes.
 		 * @brief	Triggered when the scene object selection in the scene tree view changes.

+ 11 - 0
BansheeEditor/Source/BsBuiltinEditorResources.cpp

@@ -209,6 +209,7 @@ namespace BansheeEngine
 	const WString BuiltinEditorResources::TreeViewExpandButtonOnHover = L"TreeViewExpandButtonOnHover.psd";
 	const WString BuiltinEditorResources::TreeViewExpandButtonOnHover = L"TreeViewExpandButtonOnHover.psd";
 
 
 	const WString BuiltinEditorResources::TreeViewSelectionBackground = L"TreeViewSelectionBackground.psd";
 	const WString BuiltinEditorResources::TreeViewSelectionBackground = L"TreeViewSelectionBackground.psd";
+	const WString BuiltinEditorResources::TreeViewHighlightBackground = L"TreeViewHighlightBackground.psd";
 	const WString BuiltinEditorResources::TreeViewEditBox = L"TreeViewEditBox.psd";
 	const WString BuiltinEditorResources::TreeViewEditBox = L"TreeViewEditBox.psd";
 	const WString BuiltinEditorResources::TreeViewElementHighlight = L"TreeViewElementHighlight.psd";
 	const WString BuiltinEditorResources::TreeViewElementHighlight = L"TreeViewElementHighlight.psd";
 	const WString BuiltinEditorResources::TreeViewElementSepHighlight = L"TreeViewElementSepHighlight.psd";
 	const WString BuiltinEditorResources::TreeViewElementSepHighlight = L"TreeViewElementSepHighlight.psd";
@@ -927,6 +928,16 @@ namespace BansheeEngine
 
 
 		skin->setStyle("TreeViewSelectionBackground", treeViewSelBackgroundStyle);
 		skin->setStyle("TreeViewSelectionBackground", treeViewSelBackgroundStyle);
 
 
+		// Highlight background
+		GUIElementStyle treeViewHLBackgroundStyle;
+		treeViewHLBackgroundStyle.normal.texture = getGUITexture(TreeViewHighlightBackground);
+		treeViewHLBackgroundStyle.fixedHeight = false;
+		treeViewHLBackgroundStyle.fixedWidth = false;
+		treeViewHLBackgroundStyle.height = 2;
+		treeViewHLBackgroundStyle.width = 2;
+
+		skin->setStyle("TreeViewHighlightBackground", treeViewHLBackgroundStyle);
+
 		// Edit box
 		// Edit box
 		GUIElementStyle treeViewEditBox;
 		GUIElementStyle treeViewEditBox;
 		treeViewEditBox.normal.texture = getGUITexture(TreeViewEditBox);
 		treeViewEditBox.normal.texture = getGUITexture(TreeViewEditBox);

+ 16 - 11
BansheeEditor/Source/BsGUIResourceTreeView.cpp

@@ -30,11 +30,12 @@ namespace BansheeEngine
 		resourcePaths = nullptr;
 		resourcePaths = nullptr;
 	}
 	}
 
 
-	GUIResourceTreeView::GUIResourceTreeView(const String& backgroundStyle, const String& elementBtnStyle, 
-		const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& editBoxStyle, 
+	GUIResourceTreeView::GUIResourceTreeView(const String& backgroundStyle, const String& elementBtnStyle, const String& foldoutBtnStyle, 
+		const String& highlightBackgroundStyle, const String& selectionBackgroundStyle, const String& editBoxStyle,
 		const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions)
 		const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions)
-		:GUITreeView(backgroundStyle, elementBtnStyle, foldoutBtnStyle, selectionBackgroundStyle, editBoxStyle, dragHighlightStyle,
-		dragSepHighlightStyle, dimensions), mDraggedResources(nullptr), mCurrentWindow(nullptr), mDropTarget(nullptr), mDropTargetDragActive(false)
+		:GUITreeView(backgroundStyle, elementBtnStyle, foldoutBtnStyle, highlightBackgroundStyle, 
+		selectionBackgroundStyle, editBoxStyle, dragHighlightStyle, dragSepHighlightStyle, dimensions), 
+		mDraggedResources(nullptr), mCurrentWindow(nullptr), mDropTarget(nullptr), mDropTargetDragActive(false)
 	{
 	{
 		ResourceTreeViewLocator::_provide(this);
 		ResourceTreeViewLocator::_provide(this);
 
 
@@ -59,19 +60,20 @@ namespace BansheeEngine
 	}
 	}
 
 
 	GUIResourceTreeView* GUIResourceTreeView::create(const String& backgroundStyle, const String& elementBtnStyle, 
 	GUIResourceTreeView* GUIResourceTreeView::create(const String& backgroundStyle, const String& elementBtnStyle, 
-		const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& editBoxStyle, const String& dragHighlightStyle, 
-		const String& dragSepHighlightStyle)
+		const String& foldoutBtnStyle, const String& highlightBackgroundStyle, const String& selectionBackgroundStyle, 
+		const String& editBoxStyle, const String& dragHighlightStyle, const String& dragSepHighlightStyle)
 	{
 	{
 		return new (bs_alloc<GUIResourceTreeView, PoolAlloc>()) GUIResourceTreeView(backgroundStyle, elementBtnStyle, foldoutBtnStyle, 
 		return new (bs_alloc<GUIResourceTreeView, PoolAlloc>()) GUIResourceTreeView(backgroundStyle, elementBtnStyle, foldoutBtnStyle, 
-			selectionBackgroundStyle, editBoxStyle, dragHighlightStyle, dragSepHighlightStyle, GUIDimensions::create());
+			highlightBackgroundStyle, selectionBackgroundStyle, editBoxStyle, dragHighlightStyle, dragSepHighlightStyle, GUIDimensions::create());
 	}
 	}
 
 
 	GUIResourceTreeView* GUIResourceTreeView::create(const GUIOptions& options, const String& backgroundStyle,
 	GUIResourceTreeView* GUIResourceTreeView::create(const GUIOptions& options, const String& backgroundStyle,
-		const String& elementBtnStyle, const String& foldoutBtnStyle, const String& selectionBackgroundStyle, 
-		const String& editBoxStyle, const String& dragHighlightStyle, const String& dragSepHighlightStyle)
+		const String& elementBtnStyle, const String& foldoutBtnStyle, const String& highlightBackgroundStyle, 
+		const String& selectionBackgroundStyle, const String& editBoxStyle, const String& dragHighlightStyle,
+		const String& dragSepHighlightStyle)
 	{
 	{
-		return new (bs_alloc<GUIResourceTreeView, PoolAlloc>()) GUIResourceTreeView(backgroundStyle, elementBtnStyle, 
-			foldoutBtnStyle, selectionBackgroundStyle, editBoxStyle, dragHighlightStyle, dragSepHighlightStyle, GUIDimensions::create(options));
+		return new (bs_alloc<GUIResourceTreeView, PoolAlloc>()) GUIResourceTreeView(backgroundStyle, elementBtnStyle, foldoutBtnStyle, 
+			highlightBackgroundStyle, selectionBackgroundStyle, editBoxStyle, dragHighlightStyle, dragSepHighlightStyle, GUIDimensions::create(options));
 	}
 	}
 
 
 	void GUIResourceTreeView::_updateLayoutInternal(const GUILayoutData& data)
 	void GUIResourceTreeView::_updateLayoutInternal(const GUILayoutData& data)
@@ -166,6 +168,9 @@ namespace BansheeEngine
 	{
 	{
 		closeTemporarilyExpandedElements(); // In case this element is one of them
 		closeTemporarilyExpandedElements(); // In case this element is one of them
 
 
+		if (element->mIsHighlighted)
+			clearPing();
+
 		if(element->mIsSelected)
 		if(element->mIsSelected)
 			unselectElement(element);
 			unselectElement(element);
 
 

+ 40 - 10
BansheeEditor/Source/BsGUISceneTreeView.cpp

@@ -30,9 +30,9 @@ namespace BansheeEngine
 	}
 	}
 
 
 	GUISceneTreeView::GUISceneTreeView(const String& backgroundStyle, const String& elementBtnStyle, 
 	GUISceneTreeView::GUISceneTreeView(const String& backgroundStyle, const String& elementBtnStyle, 
-		const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& editBoxStyle, 
-		const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions)
-		:GUITreeView(backgroundStyle, elementBtnStyle, foldoutBtnStyle, selectionBackgroundStyle, editBoxStyle, dragHighlightStyle,
+		const String& foldoutBtnStyle, const String& highlightBackgroundStyle, const String& selectionBackgroundStyle, 
+		const String& editBoxStyle, const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions)
+		:GUITreeView(backgroundStyle, elementBtnStyle, foldoutBtnStyle, highlightBackgroundStyle, selectionBackgroundStyle, editBoxStyle, dragHighlightStyle,
 		dragSepHighlightStyle, dimensions)
 		dragSepHighlightStyle, dimensions)
 	{
 	{
 		SceneTreeViewLocator::_provide(this);
 		SceneTreeViewLocator::_provide(this);
@@ -43,20 +43,21 @@ namespace BansheeEngine
 		SceneTreeViewLocator::_provide(nullptr);
 		SceneTreeViewLocator::_provide(nullptr);
 	}
 	}
 
 
-	GUISceneTreeView* GUISceneTreeView::create(const String& backgroundStyle, const String& elementBtnStyle, 
-		const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& editBoxStyle, const String& dragHighlightStyle, 
+	GUISceneTreeView* GUISceneTreeView::create(const String& backgroundStyle, const String& elementBtnStyle, const String& foldoutBtnStyle, 
+		const String& highlightBackgroundStyle, const String& selectionBackgroundStyle, const String& editBoxStyle, const String& dragHighlightStyle,
 		const String& dragSepHighlightStyle)
 		const String& dragSepHighlightStyle)
 	{
 	{
 		return new (bs_alloc<GUISceneTreeView, PoolAlloc>()) GUISceneTreeView(backgroundStyle, elementBtnStyle, foldoutBtnStyle, 
 		return new (bs_alloc<GUISceneTreeView, PoolAlloc>()) GUISceneTreeView(backgroundStyle, elementBtnStyle, foldoutBtnStyle, 
-			selectionBackgroundStyle, editBoxStyle, dragHighlightStyle, dragSepHighlightStyle, GUIDimensions::create());
+			highlightBackgroundStyle, selectionBackgroundStyle, editBoxStyle, dragHighlightStyle, dragSepHighlightStyle, GUIDimensions::create());
 	}
 	}
 
 
-	GUISceneTreeView* GUISceneTreeView::create(const GUIOptions& options, const String& backgroundStyle,
-		const String& elementBtnStyle, const String& foldoutBtnStyle, const String& selectionBackgroundStyle, 
+	GUISceneTreeView* GUISceneTreeView::create(const GUIOptions& options, const String& backgroundStyle, const String& elementBtnStyle, 
+		const String& foldoutBtnStyle, const String& highlightBackgroundStyle, const String& selectionBackgroundStyle,
 		const String& editBoxStyle, const String& dragHighlightStyle, const String& dragSepHighlightStyle)
 		const String& editBoxStyle, const String& dragHighlightStyle, const String& dragSepHighlightStyle)
 	{
 	{
 		return new (bs_alloc<GUISceneTreeView, PoolAlloc>()) GUISceneTreeView(backgroundStyle, elementBtnStyle, 
 		return new (bs_alloc<GUISceneTreeView, PoolAlloc>()) GUISceneTreeView(backgroundStyle, elementBtnStyle, 
-			foldoutBtnStyle, selectionBackgroundStyle, editBoxStyle, dragHighlightStyle, dragSepHighlightStyle, GUIDimensions::create(options));
+			foldoutBtnStyle, highlightBackgroundStyle, selectionBackgroundStyle, editBoxStyle, 
+			dragHighlightStyle, dragSepHighlightStyle, GUIDimensions::create(options));
 	}
 	}
 
 
 	void GUISceneTreeView::updateTreeElement(SceneTreeElement* element)
 	void GUISceneTreeView::updateTreeElement(SceneTreeElement* element)
@@ -234,6 +235,9 @@ namespace BansheeEngine
 	{
 	{
 		closeTemporarilyExpandedElements(); // In case this element is one of them
 		closeTemporarilyExpandedElements(); // In case this element is one of them
 
 
+		if (element->mIsHighlighted)
+			clearPing();
+
 		if(element->mIsSelected)
 		if(element->mIsSelected)
 			unselectElement(element);
 			unselectElement(element);
 
 
@@ -260,7 +264,7 @@ namespace BansheeEngine
 		}
 		}
 
 
 		DragAndDropManager::instance().startDrag((UINT32)DragAndDropType::SceneObject, (void*)draggedSceneObjects, 
 		DragAndDropManager::instance().startDrag((UINT32)DragAndDropType::SceneObject, (void*)draggedSceneObjects, 
-			std::bind(&GUISceneTreeView::dragAndDropFinalize, this), true);
+			std::bind(&GUISceneTreeView::dragAndDropFinalize, this), false);
 	}
 	}
 
 
 	void GUISceneTreeView::dragAndDropEnded(TreeElement* overTreeElement)
 	void GUISceneTreeView::dragAndDropEnded(TreeElement* overTreeElement)
@@ -386,6 +390,32 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
+	void GUISceneTreeView::ping(const HSceneObject& object)
+	{
+		SceneTreeElement& root = mRootElement;
+
+		Stack<SceneTreeElement*> todo;
+		todo.push(&mRootElement);
+
+		while (!todo.empty())
+		{
+			SceneTreeElement* currentElem = todo.top();
+			todo.pop();
+
+			if (currentElem->mSceneObject == object)
+			{
+				GUITreeView::ping(currentElem);
+				break;
+			}
+
+			for (auto& child : currentElem->mChildren)
+			{
+				SceneTreeElement* sceneChild = static_cast<SceneTreeElement*>(child);
+				todo.push(sceneChild);
+			}
+		}
+	}
+
 	const String& GUISceneTreeView::getGUITypeName()
 	const String& GUISceneTreeView::getGUITypeName()
 	{
 	{
 		static String typeName = "SceneTreeView";
 		static String typeName = "SceneTreeView";

+ 79 - 11
BansheeEditor/Source/BsGUITreeView.cpp

@@ -25,14 +25,14 @@ namespace BansheeEngine
 	const UINT32 GUITreeView::DRAG_MIN_DISTANCE = 3;
 	const UINT32 GUITreeView::DRAG_MIN_DISTANCE = 3;
 	const float GUITreeView::AUTO_EXPAND_DELAY_SEC = 0.5f;
 	const float GUITreeView::AUTO_EXPAND_DELAY_SEC = 0.5f;
 	const float GUITreeView::SCROLL_AREA_HEIGHT_PCT = 0.1f;
 	const float GUITreeView::SCROLL_AREA_HEIGHT_PCT = 0.1f;
-	const UINT32 GUITreeView::SCROLL_SPEED_PX_PER_SEC = 25;
+	const UINT32 GUITreeView::SCROLL_SPEED_PX_PER_SEC = 100;
 
 
 	VirtualButton GUITreeView::mRenameVB = VirtualButton("Rename");
 	VirtualButton GUITreeView::mRenameVB = VirtualButton("Rename");
 	VirtualButton GUITreeView::mDeleteVB = VirtualButton("Delete");
 	VirtualButton GUITreeView::mDeleteVB = VirtualButton("Delete");
 
 
 	GUITreeView::TreeElement::TreeElement()
 	GUITreeView::TreeElement::TreeElement()
 		:mParent(nullptr), mFoldoutBtn(nullptr), mElement(nullptr), mIsSelected(false),
 		:mParent(nullptr), mFoldoutBtn(nullptr), mElement(nullptr), mIsSelected(false),
-		mIsExpanded(false), mSortedIdx(0), mIsVisible(true)
+		mIsExpanded(false), mSortedIdx(0), mIsVisible(true), mIsHighlighted(false)
 	{ }
 	{ }
 
 
 	GUITreeView::TreeElement::~TreeElement()
 	GUITreeView::TreeElement::~TreeElement()
@@ -80,13 +80,13 @@ namespace BansheeEngine
 	}
 	}
 
 
 	GUITreeView::GUITreeView(const String& backgroundStyle, const String& elementBtnStyle, 
 	GUITreeView::GUITreeView(const String& backgroundStyle, const String& elementBtnStyle, 
-		const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& editBoxStyle, 
-		const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions)
+		const String& foldoutBtnStyle, const String& selectionBackgroundStyle, const String& highlightBackgroundStyle, 
+		const String& editBoxStyle, const String& dragHighlightStyle, const String& dragSepHighlightStyle, const GUIDimensions& dimensions)
 		:GUIElementContainer(dimensions), mBackgroundStyle(backgroundStyle),
 		:GUIElementContainer(dimensions), mBackgroundStyle(backgroundStyle),
 		mElementBtnStyle(elementBtnStyle), mFoldoutBtnStyle(foldoutBtnStyle), mEditBoxStyle(editBoxStyle), mEditElement(nullptr), mIsElementSelected(false),
 		mElementBtnStyle(elementBtnStyle), mFoldoutBtnStyle(foldoutBtnStyle), mEditBoxStyle(editBoxStyle), mEditElement(nullptr), mIsElementSelected(false),
-		mNameEditBox(nullptr), mSelectionBackgroundStyle(selectionBackgroundStyle), mDragInProgress(nullptr), mDragHighlightStyle(dragHighlightStyle),
-		mDragSepHighlightStyle(dragSepHighlightStyle), mDragHighlight(nullptr), mDragSepHighlight(nullptr), mMouseOverDragElement(nullptr), mMouseOverDragElementTime(0.0f),
-		mScrollState(ScrollState::None), mLastScrollTime(0.0f)
+		mNameEditBox(nullptr), mHighlightBackgroundStyle(highlightBackgroundStyle), mSelectionBackgroundStyle(selectionBackgroundStyle), mDragInProgress(nullptr), 
+		mDragHighlightStyle(dragHighlightStyle), mDragSepHighlightStyle(dragSepHighlightStyle), mDragHighlight(nullptr), mDragSepHighlight(nullptr), mMouseOverDragElement(nullptr), 
+		mMouseOverDragElementTime(0.0f), mScrollState(ScrollState::None), mLastScrollTime(0.0f), mIsElementHighlighted(false)
 	{
 	{
 		if(mBackgroundStyle == StringUtil::BLANK)
 		if(mBackgroundStyle == StringUtil::BLANK)
 			mBackgroundStyle = "TreeViewBackground";
 			mBackgroundStyle = "TreeViewBackground";
@@ -100,6 +100,9 @@ namespace BansheeEngine
 		if(mSelectionBackgroundStyle == StringUtil::BLANK)
 		if(mSelectionBackgroundStyle == StringUtil::BLANK)
 			mSelectionBackgroundStyle = "TreeViewSelectionBackground";
 			mSelectionBackgroundStyle = "TreeViewSelectionBackground";
 
 
+		if (mHighlightBackgroundStyle == StringUtil::BLANK)
+			mHighlightBackgroundStyle = "TreeViewHighlightBackground";
+
 		if(mEditBoxStyle == StringUtil::BLANK)
 		if(mEditBoxStyle == StringUtil::BLANK)
 			mEditBoxStyle = "TreeViewEditBox";
 			mEditBoxStyle = "TreeViewEditBox";
 
 
@@ -209,7 +212,11 @@ namespace BansheeEngine
 
 
 			if (treeElement != nullptr)
 			if (treeElement != nullptr)
 			{
 			{
-				if (event.getPosition().x >= treeElement->mElement->_getLayoutData().area.x)
+				bool onFoldout = false;
+				if (treeElement->mFoldoutBtn != nullptr)
+					onFoldout = treeElement->mFoldoutBtn->_getClippedBounds().contains(event.getPosition());
+
+				if (!onFoldout)
 				{
 				{
 					if (event.isCtrlDown())
 					if (event.isCtrlDown())
 					{
 					{
@@ -296,6 +303,8 @@ namespace BansheeEngine
 		}
 		}
 		else if(event.getType() == GUIMouseEventType::MouseDragStart)
 		else if(event.getType() == GUIMouseEventType::MouseDragStart)
 		{
 		{
+			clearPing();
+
 			mDragStartPosition = event.getPosition();
 			mDragStartPosition = event.getPosition();
 		}
 		}
 		else if(event.getType() == GUIMouseEventType::MouseDrag)
 		else if(event.getType() == GUIMouseEventType::MouseDrag)
@@ -336,6 +345,8 @@ namespace BansheeEngine
 		{
 		{
 			if(acceptDragAndDrop())
 			if(acceptDragAndDrop())
 			{
 			{
+				clearPing();
+
 				mDragPosition = event.getPosition();
 				mDragPosition = event.getPosition();
 				mDragInProgress = true;
 				mDragInProgress = true;
 				_markLayoutAsDirty();
 				_markLayoutAsDirty();
@@ -446,6 +457,7 @@ namespace BansheeEngine
 		{
 		{
 			if(isSelectionActive() && mEditElement == nullptr)
 			if(isSelectionActive() && mEditElement == nullptr)
 			{
 			{
+				clearPing();
 				enableEdit(mSelectedElements[0].element);
 				enableEdit(mSelectedElements[0].element);
 				unselectAll();
 				unselectAll();
 			}
 			}
@@ -485,6 +497,7 @@ namespace BansheeEngine
 						elementsToDelete.push_back(mSelectedElements[i].element);
 						elementsToDelete.push_back(mSelectedElements[i].element);
 				}
 				}
 
 
+				clearPing();
 				unselectAll();
 				unselectAll();
 
 
 				for(auto& elem : elementsToDelete)
 				for(auto& elem : elementsToDelete)
@@ -502,13 +515,15 @@ namespace BansheeEngine
 
 
 	void GUITreeView::selectElement(TreeElement* element)
 	void GUITreeView::selectElement(TreeElement* element)
 	{
 	{
+		clearPing();
+
 		auto iterFind = std::find_if(mSelectedElements.begin(), mSelectedElements.end(), 
 		auto iterFind = std::find_if(mSelectedElements.begin(), mSelectedElements.end(), 
 			[&] (const SelectedElement& x) { return x.element == element; });
 			[&] (const SelectedElement& x) { return x.element == element; });
 
 
 		if(iterFind == mSelectedElements.end())
 		if(iterFind == mSelectedElements.end())
 		{
 		{
 			GUITexture* background = GUITexture::create(mSelectionBackgroundStyle);
 			GUITexture* background = GUITexture::create(mSelectionBackgroundStyle);
-			background->_setElementDepth(2);
+			background->_setElementDepth(3);
 			_registerChildElement(background);
 			_registerChildElement(background);
 
 
 			element->mIsSelected = true;
 			element->mIsSelected = true;
@@ -522,6 +537,8 @@ namespace BansheeEngine
 
 
 	void GUITreeView::unselectElement(TreeElement* element)
 	void GUITreeView::unselectElement(TreeElement* element)
 	{
 	{
+		clearPing();
+
 		auto iterFind = std::find_if(mSelectedElements.begin(), mSelectedElements.end(), 
 		auto iterFind = std::find_if(mSelectedElements.begin(), mSelectedElements.end(), 
 			[&] (const SelectedElement& x) { return x.element == element; });
 			[&] (const SelectedElement& x) { return x.element == element; });
 
 
@@ -541,6 +558,8 @@ namespace BansheeEngine
 
 
 	void GUITreeView::unselectAll()
 	void GUITreeView::unselectAll()
 	{
 	{
+		clearPing();
+
 		for(auto& selectedElem : mSelectedElements)
 		for(auto& selectedElem : mSelectedElements)
 		{
 		{
 			selectedElem.element->mIsSelected = false;
 			selectedElem.element->mIsSelected = false;
@@ -555,6 +574,41 @@ namespace BansheeEngine
 		selectionChanged();
 		selectionChanged();
 	}
 	}
 
 
+	void GUITreeView::ping(TreeElement* element)
+	{
+		clearPing();
+
+		expandToElement(element);
+		scrollToElement(element, true);
+
+		GUITexture* background = GUITexture::create(mHighlightBackgroundStyle);
+		background->_setElementDepth(2);
+		_registerChildElement(background);
+
+		element->mIsHighlighted = true;
+
+		mHighlightedElement.element = element;
+		mHighlightedElement.background = background;
+
+		mIsElementHighlighted = true;
+		_markLayoutAsDirty();
+	}
+
+	void GUITreeView::clearPing()
+	{
+		if (!mIsElementHighlighted)
+			return;
+
+		mHighlightedElement.element->mIsHighlighted = false;
+		GUIElement::destroy(mHighlightedElement.background);
+
+		mHighlightedElement.element = nullptr;
+		mHighlightedElement.background = nullptr;
+		mIsElementHighlighted = false;
+
+		_markLayoutAsDirty();
+	}
+
 	void GUITreeView::expandToElement(TreeElement* element)
 	void GUITreeView::expandToElement(TreeElement* element)
 	{
 	{
 		if (element->mIsVisible || element->mParent == nullptr)
 		if (element->mIsVisible || element->mParent == nullptr)
@@ -630,6 +684,7 @@ namespace BansheeEngine
 				todo.pop();
 				todo.pop();
 
 
 				curElem->mIsVisible = false;
 				curElem->mIsVisible = false;
+
 				if(curElem->mIsSelected)
 				if(curElem->mIsSelected)
 					unselectElement(curElem);
 					unselectElement(curElem);
 
 
@@ -705,6 +760,8 @@ namespace BansheeEngine
 
 
 	void GUITreeView::elementToggled(TreeElement* element, bool toggled)
 	void GUITreeView::elementToggled(TreeElement* element, bool toggled)
 	{
 	{
+		clearPing();
+
 		if(toggled)
 		if(toggled)
 			expandElement(element);
 			expandElement(element);
 		else
 		else
@@ -948,6 +1005,17 @@ namespace BansheeEngine
 			selectedElem.background->_setLayoutData(childData);
 			selectedElem.background->_setLayoutData(childData);
 		}
 		}
 
 
+		if (mIsElementHighlighted)
+		{
+			GUILabel* targetElement = mHighlightedElement.element->mElement;
+
+			GUILayoutData childData = data;
+			childData.area.y = targetElement->_getLayoutData().area.y;
+			childData.area.height = targetElement->_getLayoutData().area.height;
+
+			mHighlightedElement.background->_setLayoutData(childData);
+		}
+
 		if(mEditElement != nullptr)
 		if(mEditElement != nullptr)
 		{
 		{
 			GUILabel* targetElement = mEditElement->mElement;
 			GUILabel* targetElement = mEditElement->mElement;
@@ -1168,9 +1236,9 @@ namespace BansheeEngine
 			INT32 elemVertCenter = element->mElement->_getLayoutData().area.y + (INT32)Math::roundToInt(element->mElement->_getLayoutData().area.height * 0.5f);
 			INT32 elemVertCenter = element->mElement->_getLayoutData().area.y + (INT32)Math::roundToInt(element->mElement->_getLayoutData().area.height * 0.5f);
 
 
 			if(elemVertCenter > clipVertCenter)
 			if(elemVertCenter > clipVertCenter)
-				scrollArea->scrollUpPx(elemVertCenter - clipVertCenter);
+				scrollArea->scrollDownPx(elemVertCenter - clipVertCenter);
 			else
 			else
-				scrollArea->scrollDownPx(clipVertCenter - elemVertCenter);
+				scrollArea->scrollUpPx(clipVertCenter - elemVertCenter);
 		}
 		}
 		else
 		else
 		{
 		{

+ 14 - 0
BansheeEditor/Source/BsSelection.cpp

@@ -94,6 +94,20 @@ namespace BansheeEngine
 		setResourceUUIDs({});
 		setResourceUUIDs({});
 	}
 	}
 
 
+	void Selection::ping(const HSceneObject& sceneObject)
+	{
+		GUISceneTreeView* sceneTreeView = SceneTreeViewLocator::instance();
+		if (sceneTreeView != nullptr)
+			sceneTreeView->ping(sceneObject);
+
+		onSceneObjectPing(sceneObject);
+	}
+
+	void Selection::ping(const Path& resourcePath)
+	{
+		onResourcePing(resourcePath);
+	}
+
 	void Selection::sceneSelectionChanged()
 	void Selection::sceneSelectionChanged()
 	{
 	{
 		GUISceneTreeView* sceneTreeView = SceneTreeViewLocator::instance();
 		GUISceneTreeView* sceneTreeView = SceneTreeViewLocator::instance();

+ 20 - 17
MBansheeEditor/ProjectDropTarget.cs

@@ -23,9 +23,9 @@ namespace BansheeEditor
         private Rect2I bounds;
         private Rect2I bounds;
 
 
         private bool isMouseDown;
         private bool isMouseDown;
-        private bool isDragInProgress;
-        private bool triggerStartDrag;
-        private bool triggerEndDrag;
+        private bool isLocalDragInProgress;
+        private bool triggerStartLocalDrag;
+        private bool triggerEndLocalDrag;
         private bool isDragInBounds;
         private bool isDragInBounds;
         private bool isOSDragActive;
         private bool isOSDragActive;
         private Vector2I mouseDownScreenPos;
         private Vector2I mouseDownScreenPos;
@@ -60,7 +60,7 @@ namespace BansheeEditor
         {
         {
             Vector2I currentWindowPos = parentWindow.ScreenToWindowPos(ev.screenPos);
             Vector2I currentWindowPos = parentWindow.ScreenToWindowPos(ev.screenPos);
 
 
-            if (isMouseDown && !isDragInProgress)
+            if (isMouseDown && !isLocalDragInProgress)
             {
             {
                 Vector2I startWindowPos = parentWindow.ScreenToWindowPos(mouseDownScreenPos);
                 Vector2I startWindowPos = parentWindow.ScreenToWindowPos(mouseDownScreenPos);
                 if (!Bounds.Contains(startWindowPos))
                 if (!Bounds.Contains(startWindowPos))
@@ -68,17 +68,17 @@ namespace BansheeEditor
 
 
                 int distance = Vector2I.Distance(startWindowPos, currentWindowPos);
                 int distance = Vector2I.Distance(startWindowPos, currentWindowPos);
                 if (distance >= DragStartDistancePx)
                 if (distance >= DragStartDistancePx)
-                    triggerStartDrag = true;
+                    triggerStartLocalDrag = true;
             }
             }
         }
         }
 
 
         void Input_OnPointerReleased(PointerEvent ev)
         void Input_OnPointerReleased(PointerEvent ev)
         {
         {
-            isDragInProgress = false;
+            isLocalDragInProgress = false;
             isMouseDown = false;
             isMouseDown = false;
             isDragInBounds = false;
             isDragInBounds = false;
-            triggerEndDrag = true;
-            triggerStartDrag = false;
+            triggerEndLocalDrag = true;
+            triggerStartLocalDrag = false;
         }
         }
 
 
         void Input_OnPointerPressed(PointerEvent ev)
         void Input_OnPointerPressed(PointerEvent ev)
@@ -91,18 +91,18 @@ namespace BansheeEditor
         {
         {
             Vector2I currentWindowPos = parentWindow.ScreenToWindowPos(Input.PointerPosition);
             Vector2I currentWindowPos = parentWindow.ScreenToWindowPos(Input.PointerPosition);
 
 
-            if (triggerStartDrag)
+            if (triggerStartLocalDrag)
             {
             {
-                isDragInProgress = true;
-                triggerStartDrag = false;
+                isLocalDragInProgress = true;
+                triggerStartLocalDrag = false;
 
 
                 if (OnStart != null)
                 if (OnStart != null)
                     OnStart(currentWindowPos);
                     OnStart(currentWindowPos);
             }
             }
 
 
-            if (triggerEndDrag)
+            if (triggerEndLocalDrag)
             {
             {
-                triggerEndDrag = false;
+                triggerEndLocalDrag = false;
 
 
                 if (OnEnd != null)
                 if (OnEnd != null)
                     OnEnd(currentWindowPos);
                     OnEnd(currentWindowPos);
@@ -111,7 +111,8 @@ namespace BansheeEditor
             if (isOSDragActive)
             if (isOSDragActive)
                 return;
                 return;
 
 
-            if (isDragInProgress)
+            bool externalDragInProgress = DragDrop.DragInProgress && DragDrop.Type == DragDropType.SceneObject;
+            if (isLocalDragInProgress || externalDragInProgress)
             {
             {
                 if (lastDragWindowPos != currentWindowPos)
                 if (lastDragWindowPos != currentWindowPos)
                 {
                 {
@@ -142,13 +143,13 @@ namespace BansheeEditor
                 }
                 }
             }
             }
 
 
-            if (DragDrop.DropInProgress)
+            if (DragDrop.DropInProgress && Bounds.Contains(currentWindowPos))
             {
             {
                 if (DragDrop.Type == DragDropType.Resource)
                 if (DragDrop.Type == DragDropType.Resource)
                 {
                 {
                     if (OnDropResource != null)
                     if (OnDropResource != null)
                     {
                     {
-                        ResourceDragDropData resourceDragDrop = (ResourceDragDropData) DragDrop.Data;
+                        ResourceDragDropData resourceDragDrop = (ResourceDragDropData)DragDrop.Data;
                         OnDropResource(currentWindowPos, resourceDragDrop.Paths);
                         OnDropResource(currentWindowPos, resourceDragDrop.Paths);
                     }
                     }
                 }
                 }
@@ -156,10 +157,12 @@ namespace BansheeEditor
                 {
                 {
                     if (OnDropSceneObject != null)
                     if (OnDropSceneObject != null)
                     {
                     {
-                        SceneObjectDragDropData sceneDragDrop = (SceneObjectDragDropData) DragDrop.Data;
+                        SceneObjectDragDropData sceneDragDrop = (SceneObjectDragDropData)DragDrop.Data;
                         OnDropSceneObject(currentWindowPos, sceneDragDrop.Objects);
                         OnDropSceneObject(currentWindowPos, sceneDragDrop.Objects);
                     }
                     }
                 }
                 }
+
+                isDragInBounds = false;
             }
             }
         }
         }
 
 

+ 12 - 10
MBansheeEditor/ProjectWindow.cs

@@ -149,11 +149,13 @@ namespace BansheeEditor
             dropTarget.OnEnd += DoOnDragEnd;
             dropTarget.OnEnd += DoOnDragEnd;
 
 
             Selection.OnSelectionChanged += OnSelectionChanged;
             Selection.OnSelectionChanged += OnSelectionChanged;
+            Selection.OnResourcePing += OnPing;
         }
         }
 
 
         private void OnDestroy()
         private void OnDestroy()
         {
         {
             Selection.OnSelectionChanged -= OnSelectionChanged;
             Selection.OnSelectionChanged -= OnSelectionChanged;
+            Selection.OnResourcePing -= OnPing;
         }
         }
 
 
         private ElementEntry FindElementAt(Vector2I windowPos)
         private ElementEntry FindElementAt(Vector2I windowPos)
@@ -329,15 +331,14 @@ namespace BansheeEditor
             if (EndDragSelection())
             if (EndDragSelection())
                 return;
                 return;
 
 
-            string resourceDir = ProjectLibrary.ResourceFolder;
-            string destinationFolder = Path.Combine(resourceDir, currentDirectory);
+            string destinationFolder = currentDirectory;
 
 
             ElementEntry underCursorElement = FindElementAt(windowPos);
             ElementEntry underCursorElement = FindElementAt(windowPos);
             if (underCursorElement != null)
             if (underCursorElement != null)
             {
             {
                 LibraryEntry entry = ProjectLibrary.GetEntry(underCursorElement.path);
                 LibraryEntry entry = ProjectLibrary.GetEntry(underCursorElement.path);
                 if (entry != null && entry.Type == LibraryEntryType.Directory)
                 if (entry != null && entry.Type == LibraryEntryType.Directory)
-                    destinationFolder = Path.Combine(resourceDir, entry.Path);
+                    destinationFolder = entry.Path;
             }
             }
 
 
             if (objects != null)
             if (objects != null)
@@ -375,7 +376,7 @@ namespace BansheeEditor
             hoverHighlightPath = "";
             hoverHighlightPath = "";
         }
         }
 
 
-        public void Ping(Resource resource)
+        public void Ping(string path)
         {
         {
             if (!string.IsNullOrEmpty(pingPath))
             if (!string.IsNullOrEmpty(pingPath))
             {
             {
@@ -384,11 +385,7 @@ namespace BansheeEditor
                     entry.MarkAsPinged(false);
                     entry.MarkAsPinged(false);
             }
             }
 
 
-            if (resource != null)
-                pingPath = ProjectLibrary.GetPath(resource);
-            else
-                pingPath = "";
-
+            pingPath = path;
             if (!string.IsNullOrEmpty(pingPath))
             if (!string.IsNullOrEmpty(pingPath))
             {
             {
                 ElementEntry entry;
                 ElementEntry entry;
@@ -560,7 +557,7 @@ namespace BansheeEditor
                 }
                 }
             }
             }
 
 
-            Ping(null);
+            Ping("");
             StopRename();
             StopRename();
 
 
             if (!onlyInternal)
             if (!onlyInternal)
@@ -1179,6 +1176,11 @@ namespace BansheeEditor
                 DeselectAll(true);
                 DeselectAll(true);
         }
         }
 
 
+        private void OnPing(string path)
+        {
+            Ping(path);
+        }
+
         private void OnFolderButtonClicked(string path)
         private void OnFolderButtonClicked(string path)
         {
         {
             EnterDirectory(path);
             EnterDirectory(path);

+ 32 - 0
MBansheeEditor/Selection.cs

@@ -7,6 +7,8 @@ namespace BansheeEditor
     public sealed class Selection
     public sealed class Selection
     {
     {
         public static Action<SceneObject[], string[]> OnSelectionChanged;
         public static Action<SceneObject[], string[]> OnSelectionChanged;
+        public static Action<SceneObject> OnSceneObjectPing;
+        public static Action<string> OnResourcePing;
 
 
         public static SceneObject[] sceneObjects
         public static SceneObject[] sceneObjects
         {
         {
@@ -50,12 +52,36 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        public static void Ping(Resource resource)
+        {
+            string path = ProjectLibrary.GetPath(resource);
+
+            Internal_PingResource(path);
+        }
+
+        public static void Ping(SceneObject so)
+        {
+            Internal_PingSceneObject(so);
+        }
+
         private static void Internal_TriggerSelectionChanged(SceneObject[] objects, string[] paths)
         private static void Internal_TriggerSelectionChanged(SceneObject[] objects, string[] paths)
         {
         {
             if (OnSelectionChanged != null)
             if (OnSelectionChanged != null)
                 OnSelectionChanged(objects, paths);
                 OnSelectionChanged(objects, paths);
         }
         }
 
 
+        private static void Internal_TriggerSceneObjectPing(SceneObject so)
+        {
+            if (OnSceneObjectPing != null)
+                OnSceneObjectPing(so);
+        }
+
+        private static void Internal_TriggerResourcePing(string path)
+        {
+            if (OnResourcePing != null)
+                OnResourcePing(path);
+        }
+
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern void Internal_GetSceneObjectSelection(out SceneObject[] selection);
         internal static extern void Internal_GetSceneObjectSelection(out SceneObject[] selection);
 
 
@@ -73,5 +99,11 @@ namespace BansheeEditor
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         internal static extern void Internal_SetResourcePathSelection(string[] selection);
         internal static extern void Internal_SetResourcePathSelection(string[] selection);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        internal static extern void Internal_PingResource(string resourcePath);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        internal static extern void Internal_PingSceneObject(SceneObject so);
     }
     }
 }
 }

+ 1 - 0
SBansheeEditor/Include/BsGUIGameObjectField.h

@@ -62,6 +62,7 @@ namespace BansheeEngine
 		void styleUpdated();
 		void styleUpdated();
 
 
 		void dataDropped(void* data);
 		void dataDropped(void* data);
+		void onDropButtonClicked();
 		void onClearButtonClicked();
 		void onClearButtonClicked();
 
 
 	private:
 	private:

+ 1 - 0
SBansheeEditor/Include/BsGUIResourceField.h

@@ -65,6 +65,7 @@ namespace BansheeEngine
 		void styleUpdated();
 		void styleUpdated();
 
 
 		void dataDropped(void* data);
 		void dataDropped(void* data);
+		void onDropButtonClicked();
 		void onClearButtonClicked();
 		void onClearButtonClicked();
 
 
 	private:
 	private:

+ 1 - 0
SBansheeEditor/Include/BsGUITextureField.h

@@ -65,6 +65,7 @@ namespace BansheeEngine
 		void styleUpdated() override;
 		void styleUpdated() override;
 
 
 		void dataDropped(void* data);
 		void dataDropped(void* data);
+		void onDropButtonClicked();
 		void onClearButtonClicked();
 		void onClearButtonClicked();
 
 
 	private:
 	private:

+ 12 - 0
SBansheeEditor/Include/BsScriptSelection.h

@@ -17,6 +17,8 @@ namespace BansheeEngine
 		ScriptSelection(MonoObject* instance);
 		ScriptSelection(MonoObject* instance);
 
 
 		static void onSelectionChanged(const Vector<HSceneObject>& sceneObjects, const Vector<Path>& resPaths);
 		static void onSelectionChanged(const Vector<HSceneObject>& sceneObjects, const Vector<Path>& resPaths);
+		static void onResourcePing(const Path& resPath);
+		static void onSceneObjectPing(const HSceneObject& sceneObject);
 
 
 		static void internal_GetSceneObjectSelection(MonoArray** selection);
 		static void internal_GetSceneObjectSelection(MonoArray** selection);
 		static void internal_SetSceneObjectSelection(MonoArray* selection);
 		static void internal_SetSceneObjectSelection(MonoArray* selection);
@@ -27,9 +29,19 @@ namespace BansheeEngine
 		static void internal_GetResourcePathSelection(MonoArray** selection);
 		static void internal_GetResourcePathSelection(MonoArray** selection);
 		static void internal_SetResourcePathSelection(MonoArray* selection);
 		static void internal_SetResourcePathSelection(MonoArray* selection);
 
 
+		static void internal_PingResource(MonoString* resourcePath);
+		static void internal_PingSceneObject(MonoObject* so);
+
 		typedef void(__stdcall *OnSelectionChangedThunkDef) (MonoArray*, MonoArray*, MonoException**);
 		typedef void(__stdcall *OnSelectionChangedThunkDef) (MonoArray*, MonoArray*, MonoException**);
+		typedef void(__stdcall *OnPingResourceThunkDef) (MonoString*, MonoException**);
+		typedef void(__stdcall *OnPingSceneObjectThunkDef) (MonoObject*, MonoException**);
+
 		static OnSelectionChangedThunkDef OnSelectionChangedThunk;
 		static OnSelectionChangedThunkDef OnSelectionChangedThunk;
+		static OnPingResourceThunkDef OnPingResourceThunk;
+		static OnPingSceneObjectThunkDef OnPingSceneObjectThunk;
 
 
 		static HEvent OnSelectionChangedConn;
 		static HEvent OnSelectionChangedConn;
+		static HEvent OnPingResourceConn;
+		static HEvent OnPingSceneObjectConn;
 	};
 	};
 }
 }

+ 26 - 0
SBansheeEditor/Source/BsGUIGameObjectField.cpp

@@ -15,6 +15,8 @@
 #include "BsManagedComponent.h"
 #include "BsManagedComponent.h"
 #include "BsMonoManager.h"
 #include "BsMonoManager.h"
 #include "BsBuiltinEditorResources.h"
 #include "BsBuiltinEditorResources.h"
+#include "BsComponent.h"
+#include "BsSelection.h"
 
 
 using namespace std::placeholders;
 using namespace std::placeholders;
 
 
@@ -43,6 +45,7 @@ namespace BansheeEngine
 		mLayout->addElement(mClearButton);
 		mLayout->addElement(mClearButton);
 
 
 		mDropButton->onDataDropped.connect(std::bind(&GUIGameObjectField::dataDropped, this, _1));
 		mDropButton->onDataDropped.connect(std::bind(&GUIGameObjectField::dataDropped, this, _1));
+		mDropButton->onClick.connect(std::bind(&GUIGameObjectField::onDropButtonClicked, this));
 	}
 	}
 
 
 	GUIGameObjectField::~GUIGameObjectField()
 	GUIGameObjectField::~GUIGameObjectField()
@@ -204,6 +207,29 @@ namespace BansheeEngine
 		return mLayout->_getOptimalSize();
 		return mLayout->_getOptimalSize();
 	}
 	}
 
 
+	void GUIGameObjectField::onDropButtonClicked()
+	{
+		if (mInstanceId == 0)
+			return;
+
+		HGameObject go;
+		if (GameObjectManager::instance().tryGetObject(mInstanceId, go))
+		{
+			HSceneObject so;
+			if (rtti_is_of_type<SceneObject>(go.get()))
+			{
+				so = static_object_cast<SceneObject>(go);
+			}
+			else if(rtti_is_subclass<Component>(go.get()))
+			{
+				HComponent component = static_object_cast<Component>(go);
+				so = component->SO();
+			}
+
+			Selection::instance().ping(so);
+		}
+	}
+
 	void GUIGameObjectField::dataDropped(void* data)
 	void GUIGameObjectField::dataDropped(void* data)
 	{
 	{
 		DraggedSceneObjects* draggedSceneObjects = reinterpret_cast<DraggedSceneObjects*>(data);
 		DraggedSceneObjects* draggedSceneObjects = reinterpret_cast<DraggedSceneObjects*>(data);

+ 11 - 0
SBansheeEditor/Source/BsGUIResourceField.cpp

@@ -30,6 +30,7 @@
 #include "BsScriptStringTable.h"
 #include "BsScriptStringTable.h"
 #include "BsScriptPrefab.h"
 #include "BsScriptPrefab.h"
 #include "BsScriptManagedResource.h"
 #include "BsScriptManagedResource.h"
+#include "BsSelection.h"
 
 
 using namespace std::placeholders;
 using namespace std::placeholders;
 
 
@@ -58,6 +59,7 @@ namespace BansheeEngine
 		mLayout->addElement(mClearButton);
 		mLayout->addElement(mClearButton);
 
 
 		mDropButton->onDataDropped.connect(std::bind(&GUIResourceField::dataDropped, this, _1));
 		mDropButton->onDataDropped.connect(std::bind(&GUIResourceField::dataDropped, this, _1));
+		mDropButton->onClick.connect(std::bind(&GUIResourceField::onDropButtonClicked, this));
 	}
 	}
 
 
 	GUIResourceField::~GUIResourceField()
 	GUIResourceField::~GUIResourceField()
@@ -222,6 +224,15 @@ namespace BansheeEngine
 		return mLayout->_getOptimalSize();
 		return mLayout->_getOptimalSize();
 	}
 	}
 
 
+	void GUIResourceField::onDropButtonClicked()
+	{
+		if (mUUID == "")
+			return;
+
+		Path resPath = ProjectLibrary::instance().uuidToPath(mUUID);
+		Selection::instance().ping(resPath);
+	}
+
 	void GUIResourceField::dataDropped(void* data)
 	void GUIResourceField::dataDropped(void* data)
 	{
 	{
 		DraggedResources* draggedResources = reinterpret_cast<DraggedResources*>(data);
 		DraggedResources* draggedResources = reinterpret_cast<DraggedResources*>(data);

+ 11 - 0
SBansheeEditor/Source/BsGUITextureField.cpp

@@ -12,6 +12,7 @@
 #include "BsGUISpace.h"
 #include "BsGUISpace.h"
 #include "BsProjectResourceMeta.h"
 #include "BsProjectResourceMeta.h"
 #include "BsSpriteTexture.h"
 #include "BsSpriteTexture.h"
+#include "BsSelection.h"
 
 
 using namespace std::placeholders;
 using namespace std::placeholders;
 
 
@@ -52,6 +53,7 @@ namespace BansheeEngine
 			mLayout->addNewElement<GUIFlexibleSpace>();
 			mLayout->addNewElement<GUIFlexibleSpace>();
 
 
 		mDropButton->onDataDropped.connect(std::bind(&GUITextureField::dataDropped, this, _1));
 		mDropButton->onDataDropped.connect(std::bind(&GUITextureField::dataDropped, this, _1));
+		mDropButton->onClick.connect(std::bind(&GUITextureField::onDropButtonClicked, this));
 
 
 		setValue(HTexture());
 		setValue(HTexture());
 	}
 	}
@@ -223,6 +225,15 @@ namespace BansheeEngine
 		return mLayout->_getOptimalSize();
 		return mLayout->_getOptimalSize();
 	}
 	}
 
 
+	void GUITextureField::onDropButtonClicked()
+	{
+		if (mUUID == "")
+			return;
+
+		Path resPath = ProjectLibrary::instance().uuidToPath(mUUID);
+		Selection::instance().ping(resPath);
+	}
+
 	void GUITextureField::dataDropped(void* data)
 	void GUITextureField::dataDropped(void* data)
 	{
 	{
 		DraggedResources* draggedResources = reinterpret_cast<DraggedResources*>(data);
 		DraggedResources* draggedResources = reinterpret_cast<DraggedResources*>(data);

+ 1 - 1
SBansheeEditor/Source/BsScriptDragDropManager.cpp

@@ -103,7 +103,7 @@ namespace BansheeEngine
 		{
 		{
 			ScriptSceneObject* scriptSceneObject = ScriptGameObjectManager::instance().getOrCreateScriptSceneObject(so);
 			ScriptSceneObject* scriptSceneObject = ScriptGameObjectManager::instance().getOrCreateScriptSceneObject(so);
 
 
-			arrSceneObjects.set(idx, scriptSceneObject);
+			arrSceneObjects.set(idx, scriptSceneObject->getManagedInstance());
 			idx++;
 			idx++;
 		}
 		}
 
 

+ 44 - 0
SBansheeEditor/Source/BsScriptSelection.cpp

@@ -10,7 +10,12 @@
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
 	ScriptSelection::OnSelectionChangedThunkDef ScriptSelection::OnSelectionChangedThunk;
 	ScriptSelection::OnSelectionChangedThunkDef ScriptSelection::OnSelectionChangedThunk;
+	ScriptSelection::OnPingResourceThunkDef ScriptSelection::OnPingResourceThunk;
+	ScriptSelection::OnPingSceneObjectThunkDef ScriptSelection::OnPingSceneObjectThunk;
+
 	HEvent ScriptSelection::OnSelectionChangedConn;
 	HEvent ScriptSelection::OnSelectionChangedConn;
+	HEvent ScriptSelection::OnPingResourceConn;
+	HEvent ScriptSelection::OnPingSceneObjectConn;
 
 
 	ScriptSelection::ScriptSelection(MonoObject* instance)
 	ScriptSelection::ScriptSelection(MonoObject* instance)
 		:ScriptObject(instance)
 		:ScriptObject(instance)
@@ -26,8 +31,12 @@ namespace BansheeEngine
 		metaData.scriptClass->addInternalCall("Internal_SetResourceUUIDSelection", &ScriptSelection::internal_SetResourceUUIDSelection);
 		metaData.scriptClass->addInternalCall("Internal_SetResourceUUIDSelection", &ScriptSelection::internal_SetResourceUUIDSelection);
 		metaData.scriptClass->addInternalCall("Internal_GetResourcePathSelection", &ScriptSelection::internal_GetResourcePathSelection);
 		metaData.scriptClass->addInternalCall("Internal_GetResourcePathSelection", &ScriptSelection::internal_GetResourcePathSelection);
 		metaData.scriptClass->addInternalCall("Internal_SetResourcePathSelection", &ScriptSelection::internal_SetResourcePathSelection);
 		metaData.scriptClass->addInternalCall("Internal_SetResourcePathSelection", &ScriptSelection::internal_SetResourcePathSelection);
+		metaData.scriptClass->addInternalCall("Internal_PingResource", &ScriptSelection::internal_PingResource);
+		metaData.scriptClass->addInternalCall("Internal_PingSceneObject", &ScriptSelection::internal_PingSceneObject);
 
 
 		OnSelectionChangedThunk = (OnSelectionChangedThunkDef)metaData.scriptClass->getMethod("Internal_TriggerSelectionChanged", 2)->getThunk();
 		OnSelectionChangedThunk = (OnSelectionChangedThunkDef)metaData.scriptClass->getMethod("Internal_TriggerSelectionChanged", 2)->getThunk();
+		OnPingResourceThunk = (OnPingResourceThunkDef)metaData.scriptClass->getMethod("Internal_TriggerResourcePing", 1)->getThunk();
+		OnPingSceneObjectThunk = (OnPingSceneObjectThunkDef)metaData.scriptClass->getMethod("Internal_TriggerSceneObjectPing", 1)->getThunk();
 	}
 	}
 
 
 	void ScriptSelection::internal_GetSceneObjectSelection(MonoArray** selection)
 	void ScriptSelection::internal_GetSceneObjectSelection(MonoArray** selection)
@@ -139,15 +148,33 @@ namespace BansheeEngine
 		Selection::instance().setResourcePaths(paths);
 		Selection::instance().setResourcePaths(paths);
 	}
 	}
 
 
+	void ScriptSelection::internal_PingResource(MonoString* resourcePath)
+	{
+		Path path = MonoUtil::monoToString(resourcePath);
+
+		Selection::instance().ping(path);
+	}
+
+	void ScriptSelection::internal_PingSceneObject(MonoObject* so)
+	{
+		ScriptSceneObject* scriptSO = ScriptSceneObject::toNative(so);
+		HSceneObject soHandle = static_object_cast<SceneObject>(scriptSO->getNativeHandle());
+
+		Selection::instance().ping(soHandle);
+	}
 
 
 	void ScriptSelection::startUp()
 	void ScriptSelection::startUp()
 	{
 	{
 		OnSelectionChangedConn = Selection::instance().onSelectionChanged.connect(&ScriptSelection::onSelectionChanged);
 		OnSelectionChangedConn = Selection::instance().onSelectionChanged.connect(&ScriptSelection::onSelectionChanged);
+		OnPingResourceConn = Selection::instance().onResourcePing.connect(&ScriptSelection::onResourcePing);
+		OnPingSceneObjectConn = Selection::instance().onSceneObjectPing.connect(&ScriptSelection::onSceneObjectPing);
 	}
 	}
 
 
 	void ScriptSelection::shutDown()
 	void ScriptSelection::shutDown()
 	{
 	{
 		OnSelectionChangedConn.disconnect();
 		OnSelectionChangedConn.disconnect();
+		OnPingResourceConn.disconnect();
+		OnPingSceneObjectConn.disconnect();
 	}
 	}
 
 
 	void ScriptSelection::onSelectionChanged(const Vector<HSceneObject>& sceneObjects, const Vector<Path>& resPaths)
 	void ScriptSelection::onSelectionChanged(const Vector<HSceneObject>& sceneObjects, const Vector<Path>& resPaths)
@@ -173,4 +200,21 @@ namespace BansheeEngine
 		MonoArray* monoPaths = scriptPaths.getInternal();
 		MonoArray* monoPaths = scriptPaths.getInternal();
 		MonoUtil::invokeThunk(OnSelectionChangedThunk, monoObjects, monoPaths);
 		MonoUtil::invokeThunk(OnSelectionChangedThunk, monoObjects, monoPaths);
 	}
 	}
+
+	void ScriptSelection::onResourcePing(const Path& resPath)
+	{
+		MonoString* monoResPath = MonoUtil::wstringToMono(MonoManager::instance().getDomain(), resPath.toWString());
+
+		MonoUtil::invokeThunk(OnPingResourceThunk, monoResPath);
+	}
+
+	void ScriptSelection::onSceneObjectPing(const HSceneObject& sceneObject)
+	{
+		// TODO - This bit is commonly used, I should add a method in ScriptGameObjectManager
+		ScriptSceneObject* scriptSceneObject = ScriptGameObjectManager::instance().getScriptSceneObject(sceneObject);
+		if (scriptSceneObject == nullptr)
+			scriptSceneObject = ScriptGameObjectManager::instance().createScriptSceneObject(sceneObject);
+
+		MonoUtil::invokeThunk(OnPingSceneObjectThunk, scriptSceneObject->getManagedInstance());
+	}
 }
 }

+ 3 - 6
TODO.txt

@@ -56,13 +56,10 @@ Polish
 
 
 SceneTreeView
 SceneTreeView
  - Add cut/copy/duplicate/paste functionality (+ appropriate context menu)
  - Add cut/copy/duplicate/paste functionality (+ appropriate context menu)
- - Does delete, rename, drag and drop work properly?
-  - Delete + rename should be undoable
- - ELement cant be deselected by clicking on empty space
  - Clicking on an already selected element should start rename
  - Clicking on an already selected element should start rename
  - Also add context with "New SceneObject" & "New SceneObject (Child)"
  - Also add context with "New SceneObject" & "New SceneObject (Child)"
- - ping() method (scrolls to element and displays a bg for it until user clicks elsewhere)
- - Elements in SceneTreeView aren't ordered properly
+ - Elements in SceneTreeView aren't ordered properly (they reorder as I delete elements)
+ - Dragging and dropping an element caused a crash when element was dropped
 
 
 Ribek use:
 Ribek use:
  - Camera, Renderable, Material, Texture inspector
  - Camera, Renderable, Material, Texture inspector
@@ -91,8 +88,8 @@ First screenshot:
    - Possibly create helper objects: Cube, Sphere, Plane, Quad, Capsule, Cylinder
    - Possibly create helper objects: Cube, Sphere, Plane, Quad, Capsule, Cylinder
   - Component (also add to inspector context): Camera, Renderable, Point/Spot/Directional light, all other components from scripts
   - Component (also add to inspector context): Camera, Renderable, Point/Spot/Directional light, all other components from scripts
   - Help - About, API Reference (link to site)
   - Help - About, API Reference (link to site)
- - Normalize colors between project and hierarchy windows (both blue or both orange selection + same ping color)
  - (Optionally) New UI look (tabs, component/array containers, better buttons)
  - (Optionally) New UI look (tabs, component/array containers, better buttons)
+   - Foldout in scene tree view is hard to click, make it bigger
  - (Optionally) Console window
  - (Optionally) Console window
 
 
 Other polish:
 Other polish: