瀏覽代碼

minor changes for the play button inside of the editor

Carlos Marti 9 年之前
父節點
當前提交
65d20bc621

+ 8 - 8
Source/BansheeEditor/Include/BsEditorWidgetContainer.h

@@ -47,6 +47,14 @@ namespace BansheeEngine
 		 */
 		void setPosition(INT32 x, INT32 y);
 
+		/**
+		* Changes the currently active widget to the one at the specified index. Making the widget active means it will be
+		* visible in the container.
+		*
+		* @param[in]	idx		Unique widget index (not sequential).
+		*/
+		void setActiveWidget(UINT32 idx);
+
 		/**	Returns the number of widgets currently docked in this container. */
 		UINT32 getNumWidgets() const { return (UINT32)mWidgets.size(); }
 
@@ -102,14 +110,6 @@ namespace BansheeEngine
 		/**	Removes a widget without triggering a widget closed event. */
 		void removeInternal(EditorWidgetBase& widget);
 
-		/**
-		 * Changes the currently active widget to the one at the specified index. Making the widget active means it will be
-		 * visible in the container.
-		 *
-		 * @param[in]	idx		Unique widget index (not sequential).
-		 */
-		void setActiveWidget(UINT32 idx);
-
 		/**
 		 * Triggered when a user clicks on a tab in the tabbed title bar.
 		 *

+ 1 - 1
Source/BansheeEditor/Source/BsEditorWidget.cpp

@@ -60,7 +60,7 @@ namespace BansheeEngine
 		if (parentContainer == nullptr)
 			return;
 
-		parentContainer->getParentWidget().setIsActive(active);
+		parentContainer->setActiveWidget();
 	}
 
 	void EditorWidgetBase::close()

+ 5 - 0
Source/MBansheeEditor/Window/EditorWindow.cs

@@ -83,6 +83,11 @@ namespace BansheeEditor
             get { return Internal_IsActive(mCachedPtr); }
         }
 
+        public UInt32 WidgetIndx
+        {
+            get { return Internal_GetIndex(mCachedPtr); }
+        }
+
         /// <summary>
         /// GUI panel that you may use for adding GUI elements to the window.
         /// </summary>

+ 5 - 3
Source/MBansheeEditor/Windows/GameWindow.cs

@@ -55,15 +55,17 @@ namespace BansheeEditor
                 EditorApplication.IsPaused = false;
             }
             else
-                /*if(GetWindow<GameWindow>().HasFocus && GetWindow<GameWindow>().Active)
+                if(GetWindow<GameWindow>().HasFocus && GetWindow<GameWindow>().Active)
                 {
                     
                     GetWindow<GameWindow>().HasFocus = false;
                     GetWindow<GameWindow>().Active = false;
 
+                
+                    GetWindow<SceneWindow>().HasFocus = true;
+                    GetWindow<SceneWindow>().Active = true;
                     
-                    
-                }*/
+                }
                 EditorApplication.IsPlaying = !EditorApplication.IsPlaying;
         }