Explorar el Código

Fixed various issues with Inspector element areas

Marko Pintera hace 11 años
padre
commit
27d6c98bb2

+ 1 - 1
MBansheeEditor/Inspector/GenericInspector.cs

@@ -40,7 +40,7 @@ namespace BansheeEditor
 
             foreach (var field in inspectableFields)
             {
-                field.Refresh(GUI.layout);
+                field.Refresh(layout);
             }
         }
 

+ 3 - 0
MBansheeEditor/Inspector/InspectableInt.cs

@@ -32,6 +32,9 @@ namespace BansheeEditor
 
         protected override bool IsModified()
         {
+            if (!isInitialized)
+                return true;
+
             int newPropertyValue = property.GetValue<int>();
             if (oldPropertyValue != newPropertyValue)
             {

+ 1 - 1
MBansheeEditor/Inspector/InspectableObject.cs

@@ -30,7 +30,7 @@ namespace BansheeEditor
                 return;
 
             guiLabel = new GUILabel(title);
-            layout.AddElement(guiLabel); // TODO - Add foldout and hook up its callbacks
+            layout.AddElement(guiLabel);
 
             guiChildLayout = layout.AddLayoutX();
             guiChildLayout.AddSpace(IndentAmount);

+ 3 - 0
MBansheeEditor/Inspector/Inspector.cs

@@ -9,11 +9,13 @@ namespace BansheeEditor
     public abstract class Inspector
     {
         protected GUIPanel GUI;
+        protected GUILayout layout;
         protected object referencedObject;
 
         internal void Initialize(GUIPanel gui, object instance)
         {
             GUI = gui;
+            layout = gui.layout.AddLayoutY();
             referencedObject = instance;
         }
 
@@ -29,6 +31,7 @@ namespace BansheeEditor
 
         internal void Destroy()
         {
+            layout.Destroy();
             GUI.Destroy();
         }
 

+ 2 - 0
MBansheeEditor/Inspector/InspectorWindow.cs

@@ -79,6 +79,8 @@ namespace BansheeEditor
 
         protected override void WindowResized(int width, int height)
         {
+            base.WindowResized(width, height);
+
             RepositionInspectors();
         }
 

+ 1 - 1
MBansheeEngine/GUI/GUIPanel.cs

@@ -56,7 +56,7 @@ namespace BansheeEngine
         {
             Internal_SetArea(mCachedPtr, x, y, width, height);
 
-            mainArea.SetArea(x, y, width, height);
+            mainArea.SetArea(0, 0, width, height);
         }
 
         internal void Destroy()