Răsfoiți Sursa

Slight fixes to EditorWidget and C# GUIArea depth

Marko Pintera 11 ani în urmă
părinte
comite
8782c6cc48

+ 1 - 1
BansheeEditor/Source/BsEditorWidget.cpp

@@ -126,7 +126,7 @@ namespace BansheeEngine
 			if(parent != nullptr)
 			{
 				if(mContent == nullptr)
-					mContent = GUIArea::create(parent->getParentWidget(), 0, 0, 0, 0, 10000);
+					mContent = GUIArea::create(parent->getParentWidget(), 0, 0, 0, 0, 0);
 				else
 					mContent->changeParentWidget(&parent->getParentWidget());
 			}

+ 1 - 1
BansheeEditor/Source/BsEditorWidgetContainer.cpp

@@ -20,7 +20,7 @@ namespace BansheeEngine
 		:mParent(parent), mX(0), mY(0), mWidth(0), mHeight(0), mTitleBar(nullptr), mActiveWidget(-1),
 		mTitleBarArea(nullptr), mParentWindow(parentEditorWindow)
 	{
-		mTitleBarArea = GUIArea::create(*parent, 0, 0, 0, 0, 9900);
+		mTitleBarArea = GUIArea::create(*parent, 0, 0, 0, 0, 0);
 
 		mTitleBar = GUITabbedTitleBar::create();
 		mTitleBar->onTabActivated.connect(std::bind(&EditorWidgetContainer::tabActivated, this, _1));

+ 2 - 2
BansheeEditor/Source/BsGUIMenuBar.cpp

@@ -21,8 +21,8 @@ namespace BansheeEngine
 		:mParentWidget(parent), mParentWindow(parentWindow), mMainArea(nullptr), mBgTextureArea(nullptr), 
 		mBgTexture(nullptr), mLogoTexture(nullptr), mSubMenuOpen(false), mSubMenuButton(nullptr)
 	{
-		mBgTextureArea = GUIArea::create(*parent, 0, 0, 1, 13, 9900);
-		mMainArea = GUIArea::create(*parent, 0, 0, 1, 13, 9899);
+		mBgTextureArea = GUIArea::create(*parent, 0, 0, 1, 13, 1);
+		mMainArea = GUIArea::create(*parent, 0, 0, 1, 13, 0);
 
 		mBgTexture = GUITexture::create(GUIImageScaleMode::StretchToFit, GUIOptions(GUIOption::flexibleWidth(), GUIOption::flexibleHeight()), "MenuBarBg");
 		mBgTextureArea->getLayout().addElement(mBgTexture);

+ 4 - 4
MBansheeEngine/GUI/GUIArea.cs

@@ -29,7 +29,7 @@ namespace BansheeEngine
         }
 
         // Note: Should only ever be called by its parent GUIPanel
-        internal static GUIArea Create(GUIPanel parent, int x, int y, int width, int height, short depth)
+        internal static GUIArea Create(GUIPanel parent, int x, int y, int width, int height, UInt16 depth)
         {
             GUIArea newArea = new GUIArea();
             Internal_CreateInstance(newArea, parent, x, y, width, height, depth);
@@ -38,7 +38,7 @@ namespace BansheeEngine
             return newArea;
         }
 
-        public void SetArea(int x, int y, int width, int height, short depth = 0)
+        public void SetArea(int x, int y, int width, int height, UInt16 depth = 0)
         {
             Internal_SetArea(mCachedPtr, x, y, width, height, depth);
         }
@@ -63,10 +63,10 @@ namespace BansheeEngine
         }
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(GUIArea instance, GUIPanel parent, int x, int y, int width, int height, short depth);
+        private static extern void Internal_CreateInstance(GUIArea instance, GUIPanel parent, int x, int y, int width, int height, UInt16 depth);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetArea(IntPtr nativeInstance, int x, int y, int width, int height, short depth);
+        private static extern void Internal_SetArea(IntPtr nativeInstance, int x, int y, int width, int height, UInt16 depth);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_Destroy(IntPtr nativeInstance);

+ 1 - 1
MBansheeEngine/GUI/GUIPanel.cs

@@ -29,7 +29,7 @@ namespace BansheeEngine
             _mainLayout = mainArea.layout;
         }
 
-        public GUIArea AddArea(int x, int y, int width, int height, short depth = 0)
+        public GUIArea AddArea(int x, int y, int width, int height, UInt16 depth = 0)
         {
             GUIArea area = GUIArea.Create(this, x, y, width, height, depth);
             area.SetParent(this);

+ 1 - 1
SBansheeEngine/Include/BsScriptGUIPanel.h

@@ -30,7 +30,7 @@ namespace BansheeEngine
 
 		static void internal_createInstance(MonoObject* instance);
 		static void internal_setArea(ScriptGUIPanel* thisPtr, INT32 x, INT32 y, 
-			UINT32 width, UINT32 height, UINT16 depth);
+			UINT32 width, UINT32 height);
 
 		void updateArea();
 

+ 1 - 0
SBansheeEngine/Source/BsScriptGUIArea.cpp

@@ -66,6 +66,7 @@ namespace BansheeEngine
 		thisPtr->mArea.height = height;
 
 		thisPtr->updateArea();
+		thisPtr->mGUIArea->setDepth(depth);
 	}
 
 	void ScriptGUIArea::updateArea()

+ 1 - 1
SBansheeEngine/Source/BsScriptGUIPanel.cpp

@@ -31,7 +31,7 @@ namespace BansheeEngine
 		ScriptGUIPanel* nativeInstance = new (bs_alloc<ScriptGUIPanel>()) ScriptGUIPanel(instance);
 	}
 
-	void ScriptGUIPanel::internal_setArea(ScriptGUIPanel* thisPtr, INT32 x, INT32 y, UINT32 width, UINT32 height, UINT16 depth)
+	void ScriptGUIPanel::internal_setArea(ScriptGUIPanel* thisPtr, INT32 x, INT32 y, UINT32 width, UINT32 height)
 	{
 		thisPtr->mMyArea.x = x;
 		thisPtr->mMyArea.y = y;