Browse Source

More GUI script stuff done

Marko Pintera 12 years ago
parent
commit
d3a2fcf15f
35 changed files with 711 additions and 53 deletions
  1. 9 0
      BansheeEngine/BansheeEngine.vcxproj
  2. 27 0
      BansheeEngine/BansheeEngine.vcxproj.filters
  3. 2 2
      BansheeEngine/Include/BsGUIArea.h
  4. 7 0
      BansheeEngine/Include/BsGUIOptions.h
  5. 4 0
      BansheeEngine/Include/BsPrerequisites.h
  6. 1 1
      BansheeEngine/Include/BsScriptFont.h
  7. 38 0
      BansheeEngine/Include/BsScriptGUIArea.h
  8. 25 0
      BansheeEngine/Include/BsScriptGUIBase.h
  9. 1 0
      BansheeEngine/Include/BsScriptGUIElementStyle.h
  10. 26 0
      BansheeEngine/Include/BsScriptGUILabel.h
  11. 31 0
      BansheeEngine/Include/BsScriptGUILayout.h
  12. 2 2
      BansheeEngine/Include/BsScriptObject.h
  13. 2 0
      BansheeEngine/Include/BsScriptTexture2D.h
  14. 23 0
      BansheeEngine/Include/BsScriptUtil.h
  15. 2 2
      BansheeEngine/Source/BsGUIArea.cpp
  16. 1 1
      BansheeEngine/Source/BsScriptFont.cpp
  17. 94 0
      BansheeEngine/Source/BsScriptGUIArea.cpp
  18. 48 0
      BansheeEngine/Source/BsScriptGUIBase.cpp
  19. 67 0
      BansheeEngine/Source/BsScriptGUILabel.cpp
  20. 74 0
      BansheeEngine/Source/BsScriptGUILayout.cpp
  21. 12 1
      CSharpWrap.txt
  22. 16 0
      MBansheeEditor/EditorGUI.cs
  23. 1 0
      MBansheeEditor/MBansheeEditor.csproj
  24. 2 14
      MBansheeEditor/ModalWindow.cs
  25. 12 0
      MBansheeEngine/GUI.cs
  26. 40 12
      MBansheeEngine/GUIArea.cs
  27. 17 4
      MBansheeEngine/GUIBase.cs
  28. 15 0
      MBansheeEngine/GUILabel.cs
  29. 20 4
      MBansheeEngine/GUILayout.cs
  30. 9 5
      MBansheeEngine/GUILayoutX.cs
  31. 4 5
      MBansheeEngine/GUILayoutY.cs
  32. 57 0
      MBansheeEngine/GUIOption.cs
  33. 16 0
      MBansheeEngine/GUISkin.cs
  34. 3 0
      MBansheeEngine/MBansheeEngine.csproj
  35. 3 0
      MBansheeEngine/Program.cs

+ 9 - 0
BansheeEngine/BansheeEngine.vcxproj

@@ -229,8 +229,12 @@
     <ClInclude Include="Include\BsApplication.h" />
     <ClInclude Include="Include\BsScriptComponent.h" />
     <ClInclude Include="Include\BsScriptFont.h" />
+    <ClInclude Include="Include\BsScriptGUIArea.h" />
+    <ClInclude Include="Include\BsScriptGUIBase.h" />
     <ClInclude Include="Include\BsScriptGUIElementStateStyle.h" />
     <ClInclude Include="Include\BsScriptGUIElementStyle.h" />
+    <ClInclude Include="Include\BsScriptGUILabel.h" />
+    <ClInclude Include="Include\BsScriptGUILayout.h" />
     <ClInclude Include="Include\BsScriptGUIWidget.h" />
     <ClInclude Include="Include\BsDrawHelper3D.h" />
     <ClInclude Include="Include\BsDrawHelperTemplate.h" />
@@ -295,6 +299,7 @@
     <ClInclude Include="Include\BsScriptProperty.h" />
     <ClInclude Include="Include\BsScriptSpriteTexture.h" />
     <ClInclude Include="Include\BsScriptTexture2D.h" />
+    <ClInclude Include="Include\BsScriptUtil.h" />
     <ClInclude Include="Include\BsSprite.h" />
     <ClInclude Include="Include\BsSpriteTexture.h" />
     <ClInclude Include="Include\BsTextSprite.h" />
@@ -362,8 +367,12 @@
     <ClCompile Include="Source\BsScriptComponent.cpp" />
     <ClCompile Include="Source\BsScriptField.cpp" />
     <ClCompile Include="Source\BsScriptFont.cpp" />
+    <ClCompile Include="Source\BsScriptGUIArea.cpp" />
+    <ClCompile Include="Source\BsScriptGUIBase.cpp" />
     <ClCompile Include="Source\BsScriptGUIElementStateStyle.cpp" />
     <ClCompile Include="Source\BsScriptGUIElementStyle.cpp" />
+    <ClCompile Include="Source\BsScriptGUILabel.cpp" />
+    <ClCompile Include="Source\BsScriptGUILayout.cpp" />
     <ClCompile Include="Source\BsScriptGUIWidget.cpp" />
     <ClCompile Include="Source\BsScriptManager.cpp" />
     <ClCompile Include="Source\BsScriptMethod.cpp" />

+ 27 - 0
BansheeEngine/BansheeEngine.vcxproj.filters

@@ -294,6 +294,21 @@
     <ClInclude Include="Include\BsScriptMacros.h">
       <Filter>Header Files\Script</Filter>
     </ClInclude>
+    <ClInclude Include="Include\BsScriptGUILabel.h">
+      <Filter>Header Files\Script</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsScriptUtil.h">
+      <Filter>Header Files\Script</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsScriptGUILayout.h">
+      <Filter>Header Files\Script</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsScriptGUIArea.h">
+      <Filter>Header Files\Script</Filter>
+    </ClInclude>
+    <ClInclude Include="Include\BsScriptGUIBase.h">
+      <Filter>Header Files\Script</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Source\BsGUIElement.cpp">
@@ -518,5 +533,17 @@
     <ClCompile Include="Source\BsScriptGUIElementStateStyle.cpp">
       <Filter>Source Files\Script</Filter>
     </ClCompile>
+    <ClCompile Include="Source\BsScriptGUILabel.cpp">
+      <Filter>Source Files\Script</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsScriptGUILayout.cpp">
+      <Filter>Source Files\Script</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsScriptGUIArea.cpp">
+      <Filter>Source Files\Script</Filter>
+    </ClCompile>
+    <ClCompile Include="Source\BsScriptGUIBase.cpp">
+      <Filter>Source Files\Script</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>

+ 2 - 2
BansheeEngine/Include/BsGUIArea.h

@@ -13,7 +13,7 @@ namespace BansheeEngine
 		 * @brief	Sets up a new GUI area. All the layouts used in the area will be placed
 		 * 			within the specified bounds.
 		 */
-		static GUIArea* create(GUIWidget& widget, CM::UINT32 x, CM::UINT32 y, CM::UINT32 width = 0, CM::UINT32 height = 0, CM::UINT16 depth = 0);
+		static GUIArea* create(GUIWidget& widget, CM::INT32 x, CM::INT32 y, CM::UINT32 width = 0, CM::UINT32 height = 0, CM::UINT16 depth = 0);
 
 		/**
 		 * @brief	Sets up a new GUI area. All the layouts used in the area will be placed
@@ -80,7 +80,7 @@ namespace BansheeEngine
 
 		GUILayout* mLayout;
 
-		GUIArea(GUIWidget* widget, CM::UINT32 x, CM::UINT32 y, CM::UINT16 depth);
+		GUIArea(GUIWidget* widget, CM::INT32 x, CM::INT32 y, CM::UINT16 depth);
 
 		bool isDirty() const;
 		void updateSizeBasedOnParent(CM::UINT32 parentWidth, CM::UINT32 parentHeight);

+ 7 - 0
BansheeEngine/Include/BsGUIOptions.h

@@ -34,6 +34,8 @@ namespace BansheeEngine
 	class BS_EXPORT GUIOptions
 	{
 	public:
+		GUIOptions() { }
+
 		// Constructor that accepts an arbitrary number of parameters > 0
 #define MAKE_GUIOPTION_CONSTRUCTOR(z, n, unused)											\
 	GUIOptions(BOOST_PP_ENUM_PARAMS(n, const GUIOption& e) )	\
@@ -50,6 +52,11 @@ namespace BansheeEngine
 #undef ADD_OPTION
 #undef MAKE_GUIOPTION_CONSTRUCTOR
 
+		void addOption(const GUIOption& option)
+		{
+			mOptions.push_back(option);
+		}
+
 	private:
 		friend struct GUILayoutOptions;
 

+ 4 - 0
BansheeEngine/Include/BsPrerequisites.h

@@ -75,6 +75,10 @@ namespace BansheeEngine
 	class ScriptTexture2D;
 	class ScriptGUIElementStyle;
 	class ScriptGUIElementStateStyle;
+	class ScriptGUIBase;
+	class ScriptGUIArea;
+	class ScriptGUILayout;
+	class ScriptGUILabel;
 
 	// 2D
 	class TextSprite;

+ 1 - 1
BansheeEngine/Include/BsScriptFont.h

@@ -11,7 +11,7 @@ namespace BansheeEngine
 	public:
 		static void initMetaData();
 
-		virtual void* getNative() const;
+		void* getNativeRaw() const;
 		const CM::HFont& getInternalValue() const { return mFont; }
 
 	private:

+ 38 - 0
BansheeEngine/Include/BsScriptGUIArea.h

@@ -0,0 +1,38 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	class BS_EXPORT ScriptGUIArea : public ScriptObject<ScriptGUIArea>
+	{
+	public:
+		static void initMetaData();
+
+		GUIArea* getInternalValue() const { return mArea; }
+		void* getNativeRaw() const { return mArea; }
+
+		GUIWidget& getParentWidget() const;
+
+	private:
+		static void internal_createInstance(MonoObject* instance, MonoObject* parentGUI, CM::INT32 x, CM::INT32 y, CM::UINT32 width, CM::UINT32 height, CM::UINT16 depth);
+		static void internal_createInstanceResizeableX(MonoObject* instance, MonoObject* parentGUI, CM::UINT32 offsetLeft, CM::UINT32 offsetRight, 
+			CM::UINT32 offsetTop, CM::UINT32 height, CM::UINT16 depth);
+
+		static void internal_createInstanceResizeableY(MonoObject* instance, MonoObject* parentGUI, CM::UINT32 offsetTop, 
+			CM::UINT32 offsetBottom, CM::UINT32 offsetLeft, CM::UINT32 width, CM::UINT16 depth);
+
+		static void internal_createInstanceResizeableXY(MonoObject* instance, MonoObject* parentGUI, CM::UINT32 offsetLeft, 
+			CM::UINT32 offsetRight, CM::UINT32 offsetTop, CM::UINT32 offsetBottom, CM::UINT16 depth);
+
+		static void internal_destroyInstance(ScriptGUIArea* nativeInstance);
+
+		static void initRuntimeData();
+
+		ScriptGUIArea(GUIArea* area, ScriptGUIBase* parentGUI);
+
+		GUIArea* mArea;
+		ScriptGUIBase* mParentGUI;
+	};
+}

+ 25 - 0
BansheeEngine/Include/BsScriptGUIBase.h

@@ -0,0 +1,25 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	class BS_EXPORT ScriptGUIBase : public ScriptObject<ScriptGUIBase>
+	{
+	public:
+		static void initMetaData();
+
+		GUIWidget& getWidget() const { return mWidget; }
+
+	private:
+		static void internal_createInstance(MonoObject* instance);
+		static void internal_destroyInstance(ScriptGUIBase* nativeInstance);
+
+		static void initRuntimeData();
+
+		ScriptGUIBase(GUIWidget& widget);
+
+		GUIWidget& mWidget;
+	};
+}

+ 1 - 0
BansheeEngine/Include/BsScriptGUIElementStyle.h

@@ -24,6 +24,7 @@ namespace BansheeEngine
 		~ScriptGUIElementStyle();
 
 		static void initMetaData();
+		GUIElementStyle* getInternalValue() const { return mElementStyle; }
 
 	private:
 		static void internal_createInstance(MonoObject* instance, MonoString* name);

+ 26 - 0
BansheeEngine/Include/BsScriptGUILabel.h

@@ -0,0 +1,26 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	class BS_EXPORT ScriptGUILabel : public ScriptObject<ScriptGUILabel>
+	{
+	public:
+		static void initMetaData();
+
+		GUILabel* getInternalValue() const { return mLabel; }
+		void* getNativeRaw() const { return mLabel; }
+
+	private:
+		static void internal_createInstance(MonoObject* instance, MonoObject* parentLayout, MonoString* label, MonoObject* style, MonoArray* guiOptions);
+		static void internal_destroyInstance(ScriptGUILabel* nativeInstance);
+
+		static void initRuntimeData();
+
+		ScriptGUILabel(GUILabel* label);
+
+		GUILabel* mLabel;
+	};
+}

+ 31 - 0
BansheeEngine/Include/BsScriptGUILayout.h

@@ -0,0 +1,31 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsScriptObject.h"
+
+namespace BansheeEngine
+{
+	class BS_EXPORT ScriptGUILayout : public ScriptObject<ScriptGUILayout>
+	{
+	public:
+		static void initMetaData();
+
+		GUILayout* getInternalValue() const { return mLayout; }
+		void* getNativeRaw() const { return mLayout; }
+
+		ScriptGUIArea* getParentArea() const { return mParentArea; }
+
+	private:
+		static void internal_createInstanceXFromArea(MonoObject* instance, MonoObject* parentArea);
+		static void internal_createInstanceXFromLayout(MonoObject* instance, MonoObject* parentLayout);
+		static void internal_createInstanceYFromLayout(MonoObject* instance, MonoObject* parentLayout);
+		static void internal_destroyInstance(ScriptGUILayout* nativeInstance);
+
+		static void initRuntimeData();
+
+		ScriptGUILayout(GUILayout* layout, ScriptGUIArea* parentArea);
+
+		GUILayout* mLayout;
+		ScriptGUIArea* mParentArea;
+	};
+}

+ 2 - 2
BansheeEngine/Include/BsScriptObject.h

@@ -43,7 +43,7 @@ namespace BansheeEngine
 		}
 
 		MonoObject* getManagedInstance() const { return mManagedInstance; }
-		virtual void* getNative() const { return nullptr; }
+		virtual void* getNativeRaw() const { return nullptr; }
 
 		static Type* toNative(MonoObject* managedInstance)
 		{
@@ -75,7 +75,7 @@ namespace BansheeEngine
 		static void throwIfInstancesDontMatch(ScriptObject<Type2>* lhs, void* rhs)
 		{
 #if CM_DEBUG_MODE
-			if((lhs == nullptr && rhs != nullptr) || (rhs == nullptr && lhs != nullptr) || lhs->getNative() != rhs)
+			if((lhs == nullptr && rhs != nullptr) || (rhs == nullptr && lhs != nullptr) || lhs->getNativeRaw() != rhs)
 			{
 				CM_EXCEPT(InvalidStateException, "Native and script instance do not match. This usually happens when you modify a native object " \
 					" that is also being referenced from script code. You should only modify such objects directly from script code.");

+ 2 - 0
BansheeEngine/Include/BsScriptTexture2D.h

@@ -11,6 +11,8 @@ namespace BansheeEngine
 	public:
 		static void initMetaData();
 
+		void* getNativeRaw() const { return mTexture.get(); }
+
 	private:
 		static void internal_createInstance(MonoObject* instance, CM::UINT32 format, CM::UINT32 width, CM::UINT32 height, bool hasMipmaps, bool gammaCorrection);
 		static void internal_destroyInstance(ScriptTexture2D* nativeInstance);

+ 23 - 0
BansheeEngine/Include/BsScriptUtil.h

@@ -0,0 +1,23 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include <mono/jit/jit.h>
+
+namespace BansheeEngine
+{
+	class BS_EXPORT ScriptUtil
+	{
+	public:
+		static CM::WString monoToWString(MonoString* str)
+		{
+			int len = mono_string_length(str);
+			mono_unichar2* monoChars = mono_string_chars(str);
+
+			CM::WString ret(len, '0');
+			for(int i = 0; i < len; i++)
+				ret[i] = monoChars[i];
+
+			return ret;
+		}
+	};
+}

+ 2 - 2
BansheeEngine/Source/BsGUIArea.cpp

@@ -9,7 +9,7 @@ using namespace CamelotFramework;
 
 namespace BansheeEngine
 {
-	GUIArea::GUIArea(GUIWidget* widget, UINT32 x, UINT32 y, UINT16 depth)
+	GUIArea::GUIArea(GUIWidget* widget, INT32 x, INT32 y, UINT16 depth)
 		:mWidget(widget), mLeft(x), mTop(y), mDepth(depth), mIsDirty(true), mIsDisabled(false),
 		mResizeXWithWidget(false), mResizeYWithWidget(false), mWidth(0), mHeight(0), mRight(0), mBottom(0)
 	{
@@ -23,7 +23,7 @@ namespace BansheeEngine
 		cm_delete<PoolAlloc>(mLayout);
 	}
 
-	GUIArea* GUIArea::create(GUIWidget& widget, UINT32 x, UINT32 y, UINT32 width, UINT32 height, UINT16 depth)
+	GUIArea* GUIArea::create(GUIWidget& widget, INT32 x, INT32 y, UINT32 width, UINT32 height, UINT16 depth)
 	{
 		GUIArea* area = new (cm_alloc<GUIArea, PoolAlloc>()) GUIArea(&widget, x, y, depth);
 		area->mWidth = width;

+ 1 - 1
BansheeEngine/Source/BsScriptFont.cpp

@@ -22,7 +22,7 @@ namespace BansheeEngine
 		ScriptManager::registerScriptType(&metaData);
 	}
 
-	void* ScriptFont::getNative() const
+	void* ScriptFont::getNativeRaw() const
 	{
 		return (void*)mFont.get();
 	}

+ 94 - 0
BansheeEngine/Source/BsScriptGUIArea.cpp

@@ -0,0 +1,94 @@
+#include "BsScriptGUIArea.h"
+#include "BsScriptMeta.h"
+#include "BsScriptField.h"
+#include "BsScriptClass.h"
+#include "BsScriptManager.h"
+#include "BsScriptGUIArea.h"
+#include "BsGUIArea.h"
+#include "BsGUILayout.h"
+#include "BsScriptGUIBase.h"
+
+using namespace CamelotFramework;
+
+namespace BansheeEngine
+{
+	ScriptGUIArea::ScriptGUIArea(GUIArea* area, ScriptGUIBase* parentGUI)
+		:mArea(area), mParentGUI(parentGUI)
+	{
+
+	}
+
+	void ScriptGUIArea::initMetaData()
+	{
+		metaData = ScriptMeta("MBansheeEngine", "BansheeEngine", "GUIBase", &ScriptGUIArea::initRuntimeData);
+
+		ScriptManager::registerScriptType(&metaData);
+	}
+
+	void ScriptGUIArea::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIArea::internal_createInstance);
+		metaData.scriptClass->addInternalCall("Internal_CreateInstanceResizableX", &ScriptGUIArea::internal_createInstanceResizeableX);
+		metaData.scriptClass->addInternalCall("Internal_CreateInstanceResizableY", &ScriptGUIArea::internal_createInstanceResizeableY);
+		metaData.scriptClass->addInternalCall("Internal_CreateInstanceResizableXY", &ScriptGUIArea::internal_createInstanceResizeableXY);
+		metaData.scriptClass->addInternalCall("Internal_DestroyInstance", &ScriptGUIArea::internal_destroyInstance);
+	}
+
+	GUIWidget& ScriptGUIArea::getParentWidget() const 
+	{ 
+		return mParentGUI->getWidget(); 
+	}
+
+	void ScriptGUIArea::internal_createInstance(MonoObject* instance, MonoObject* parentGUI, CM::INT32 x, CM::INT32 y, CM::UINT32 width, CM::UINT32 height, CM::UINT16 depth)
+	{
+		ScriptGUIBase* scriptGUIBase = ScriptGUIBase::toNative(parentGUI);
+		GUIArea* nativeArea = GUIArea::create(scriptGUIBase->getWidget(), x, y, width, height, depth);
+
+		ScriptGUIArea* nativeInstance = new (cm_alloc<ScriptGUIArea>()) ScriptGUIArea(nativeArea, scriptGUIBase);
+		nativeInstance->createInstance(instance);
+
+		metaData.thisPtrField->setValue(instance, nativeInstance);
+	}
+
+	void ScriptGUIArea::internal_createInstanceResizeableX(MonoObject* instance, MonoObject* parentGUI, CM::UINT32 offsetLeft, CM::UINT32 offsetRight, 
+		CM::UINT32 offsetTop, CM::UINT32 height, CM::UINT16 depth)
+	{
+		ScriptGUIBase* scriptGUIBase = ScriptGUIBase::toNative(parentGUI);
+		GUIArea* nativeArea = GUIArea::createStretchedX(scriptGUIBase->getWidget(), offsetLeft, offsetRight, offsetTop, height, depth);
+		
+		ScriptGUIArea* nativeInstance = new (cm_alloc<ScriptGUIArea>()) ScriptGUIArea(nativeArea, scriptGUIBase);
+		nativeInstance->createInstance(instance);
+
+		metaData.thisPtrField->setValue(instance, nativeInstance);
+	}
+
+	void ScriptGUIArea::internal_createInstanceResizeableY(MonoObject* instance, MonoObject* parentGUI, CM::UINT32 offsetTop, 
+		CM::UINT32 offsetBottom, CM::UINT32 offsetLeft, CM::UINT32 width, CM::UINT16 depth)
+	{
+		ScriptGUIBase* scriptGUIBase = ScriptGUIBase::toNative(parentGUI);
+		GUIArea* nativeArea = GUIArea::createStretchedY(scriptGUIBase->getWidget(), offsetTop, offsetBottom, offsetLeft, width, depth);
+
+		ScriptGUIArea* nativeInstance = new (cm_alloc<ScriptGUIArea>()) ScriptGUIArea(nativeArea, scriptGUIBase);
+		nativeInstance->createInstance(instance);
+
+		metaData.thisPtrField->setValue(instance, nativeInstance);
+	}
+
+	void ScriptGUIArea::internal_createInstanceResizeableXY(MonoObject* instance, MonoObject* parentGUI, CM::UINT32 offsetLeft, 
+		CM::UINT32 offsetRight, CM::UINT32 offsetTop, CM::UINT32 offsetBottom, CM::UINT16 depth)
+	{
+		ScriptGUIBase* scriptGUIBase = ScriptGUIBase::toNative(parentGUI);
+		GUIArea* nativeArea = GUIArea::createStretchedXY(scriptGUIBase->getWidget(), offsetLeft, offsetRight, offsetTop, offsetBottom, depth);
+
+		ScriptGUIArea* nativeInstance = new (cm_alloc<ScriptGUIArea>()) ScriptGUIArea(nativeArea, scriptGUIBase);
+		nativeInstance->createInstance(instance);
+
+		metaData.thisPtrField->setValue(instance, nativeInstance);
+	}
+
+	void ScriptGUIArea::internal_destroyInstance(ScriptGUIArea* nativeInstance)
+	{
+		nativeInstance->destroyInstance();
+		cm_delete(nativeInstance);
+	}
+}

+ 48 - 0
BansheeEngine/Source/BsScriptGUIBase.cpp

@@ -0,0 +1,48 @@
+#include "BsScriptGUIBase.h"
+#include "BsScriptMeta.h"
+#include "BsScriptField.h"
+#include "BsScriptClass.h"
+#include "BsScriptManager.h"
+#include "BsScriptGUIArea.h"
+#include "BsGUIArea.h"
+#include "BsGUILayout.h"
+
+using namespace CamelotFramework;
+
+namespace BansheeEngine
+{
+	ScriptGUIBase::ScriptGUIBase(GUIWidget& widget)
+		:mWidget(widget)
+	{
+
+	}
+
+	void ScriptGUIBase::initMetaData()
+	{
+		metaData = ScriptMeta("MBansheeEngine", "BansheeEngine", "GUIBase", &ScriptGUIBase::initRuntimeData);
+
+		ScriptManager::registerScriptType(&metaData);
+	}
+	void ScriptGUIBase::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIBase::internal_createInstance);
+		metaData.scriptClass->addInternalCall("Internal_DestroyInstance", &ScriptGUIBase::internal_destroyInstance);
+	}
+
+	void ScriptGUIBase::internal_createInstance(MonoObject* instance)
+	{
+		//ScriptGUIArea* scriptArea = ScriptGUIArea::toNative(parentArea);
+		//GUIArea* nativeArea = scriptArea->getInternalValue();
+
+		//ScriptGUILayout* nativeInstance = new (cm_alloc<ScriptGUILayout>()) ScriptGUILayout(nativeArea->getLayout(), scriptArea);
+		//nativeInstance->createInstance(instance);
+
+		//metaData.thisPtrField->setValue(instance, nativeInstance);
+	}
+
+	void ScriptGUIBase::internal_destroyInstance(ScriptGUIBase* nativeInstance)
+	{
+		nativeInstance->destroyInstance();
+		cm_delete(nativeInstance);
+	}
+}

+ 67 - 0
BansheeEngine/Source/BsScriptGUILabel.cpp

@@ -0,0 +1,67 @@
+#include "BsScriptGUILabel.h"
+#include "BsScriptMeta.h"
+#include "BsScriptField.h"
+#include "BsScriptClass.h"
+#include "BsScriptManager.h"
+#include "BsSpriteTexture.h"
+#include "BsScriptUtil.h"
+#include "BsGUILayout.h"
+#include "BsGUILabel.h"
+#include "BsGUIOptions.h"
+#include "BsScriptGUIElementStyle.h"
+#include "BsScriptGUILayout.h"
+#include "BsScriptGUIArea.h"
+
+using namespace CamelotFramework;
+
+namespace BansheeEngine
+{
+	ScriptGUILabel::ScriptGUILabel(GUILabel* label)
+		:mLabel(label)
+	{
+
+	}
+
+	void ScriptGUILabel::initMetaData()
+	{
+		metaData = ScriptMeta("MBansheeEngine", "BansheeEngine", "GUILabel", &ScriptGUILabel::initRuntimeData);
+
+		ScriptManager::registerScriptType(&metaData);
+	}
+	void ScriptGUILabel::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUILabel::internal_createInstance);
+		metaData.scriptClass->addInternalCall("Internal_DestroyInstance", &ScriptGUILabel::internal_destroyInstance);
+	}
+
+	void ScriptGUILabel::internal_createInstance(MonoObject* instance, MonoObject* parentLayout, MonoString* label, MonoObject* style, MonoArray* guiOptions)
+	{
+		ScriptGUILayout* scriptLayout = ScriptGUILayout::toNative(parentLayout);
+		HString nativeLabel(ScriptUtil::monoToWString(label));
+		GUIOptions options;
+
+		UINT32 arrayLen = (UINT32)mono_array_length(guiOptions);
+		for(UINT32 i = 0; i < arrayLen; i++)
+			options.addOption(mono_array_get(guiOptions, GUIOption, i));
+
+		GUIElementStyle* elemStyle = nullptr;
+		
+		if(style != nullptr)
+			elemStyle = ScriptGUIElementStyle::toNative(style)->getInternalValue();
+
+		GUILabel* guiLabel = GUILabel::create(scriptLayout->getParentArea()->getParentWidget(), nativeLabel, options, elemStyle); // TODO - Use proper HString
+		GUILayout* nativeLayout = scriptLayout->getInternalValue();
+		nativeLayout->addElement(guiLabel);
+
+		ScriptGUILabel* nativeInstance = new (cm_alloc<ScriptGUILabel>()) ScriptGUILabel(guiLabel);
+		nativeInstance->createInstance(instance);
+
+		metaData.thisPtrField->setValue(instance, nativeInstance);
+	}
+
+	void ScriptGUILabel::internal_destroyInstance(ScriptGUILabel* nativeInstance)
+	{
+		nativeInstance->destroyInstance();
+		cm_delete(nativeInstance);
+	}
+}

+ 74 - 0
BansheeEngine/Source/BsScriptGUILayout.cpp

@@ -0,0 +1,74 @@
+#include "BsScriptGUILayout.h"
+#include "BsScriptMeta.h"
+#include "BsScriptField.h"
+#include "BsScriptClass.h"
+#include "BsScriptManager.h"
+#include "BsScriptGUIArea.h"
+#include "BsGUIArea.h"
+#include "BsGUILayout.h"
+
+using namespace CamelotFramework;
+
+namespace BansheeEngine
+{
+	ScriptGUILayout::ScriptGUILayout(GUILayout* layout, ScriptGUIArea* parentArea)
+		:mLayout(layout), mParentArea(parentArea)
+	{
+
+	}
+
+	void ScriptGUILayout::initMetaData()
+	{
+		metaData = ScriptMeta("MBansheeEngine", "BansheeEngine", "GUILayout", &ScriptGUILayout::initRuntimeData);
+
+		ScriptManager::registerScriptType(&metaData);
+	}
+	void ScriptGUILayout::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_CreateInstanceXFromArea", &ScriptGUILayout::internal_createInstanceXFromArea);
+		metaData.scriptClass->addInternalCall("Internal_CreateInstanceXFromLayout", &ScriptGUILayout::internal_createInstanceXFromLayout);
+		metaData.scriptClass->addInternalCall("Internal_CreateInstanceYFromLayout", &ScriptGUILayout::internal_createInstanceYFromLayout);
+		metaData.scriptClass->addInternalCall("Internal_DestroyInstance", &ScriptGUILayout::internal_destroyInstance);
+	}
+
+	void ScriptGUILayout::internal_createInstanceXFromArea(MonoObject* instance, MonoObject* parentArea)
+	{
+		ScriptGUIArea* scriptArea = ScriptGUIArea::toNative(parentArea);
+		GUIArea* nativeArea = scriptArea->getInternalValue();
+
+		ScriptGUILayout* nativeInstance = new (cm_alloc<ScriptGUILayout>()) ScriptGUILayout(&nativeArea->getLayout(), scriptArea);
+		nativeInstance->createInstance(instance);
+
+		metaData.thisPtrField->setValue(instance, nativeInstance);
+	}
+
+	void ScriptGUILayout::internal_createInstanceXFromLayout(MonoObject* instance, MonoObject* parentLayout)
+	{
+		ScriptGUILayout* scriptLayout = ScriptGUILayout::toNative(parentLayout);
+		GUILayout* nativeLayout = scriptLayout->getInternalValue();
+		GUILayout& layout = nativeLayout->addLayoutX();
+
+		ScriptGUILayout* nativeInstance = new (cm_alloc<ScriptGUILayout>()) ScriptGUILayout(&layout, scriptLayout->getParentArea());
+		nativeInstance->createInstance(instance);
+
+		metaData.thisPtrField->setValue(instance, nativeInstance);
+	}
+
+	void ScriptGUILayout::internal_createInstanceYFromLayout(MonoObject* instance, MonoObject* parentLayout)
+	{
+		ScriptGUILayout* scriptLayout = ScriptGUILayout::toNative(parentLayout);
+		GUILayout* nativeLayout = scriptLayout->getInternalValue();
+		GUILayout& layout = nativeLayout->addLayoutY();
+
+		ScriptGUILayout* nativeInstance = new (cm_alloc<ScriptGUILayout>()) ScriptGUILayout(&layout, scriptLayout->getParentArea());
+		nativeInstance->createInstance(instance);
+
+		metaData.thisPtrField->setValue(instance, nativeInstance);
+	}
+
+	void ScriptGUILayout::internal_destroyInstance(ScriptGUILayout* nativeInstance)
+	{
+		nativeInstance->destroyInstance();
+		cm_delete(nativeInstance);
+	}
+}

+ 12 - 1
CSharpWrap.txt

@@ -134,6 +134,10 @@ GUIElementStyle
 GUISkin 
  - Has pointers to GUIElementStyles for button, label, etc. plus support for custom styles using GetStyle(name), SetStyle(name)
 
+Immediate:
+ - Implement ScriptGUIBase
+ - Delete: GUIWidget and ScriptGUIWidget
+
 When loading resources I need to be able to load both project resources and engine ones. 
  - BuiltinResources can be used for accessing default resources like GUI skin textures and similar
  - They're all loaded from a special folder that is set in EditorApplication
@@ -142,11 +146,18 @@ Should I make sprite texture a resource?
  - Quite probably, and will need to replace any Ptr references with handle references. I want the user
    to be able to reference the resource in multiple locations and then he can easily edit the SpriteTexture as needed.
 
+ScriptGUILabel currently accepts a WString, while it should be accepting a HString. Check BsScriptGUILabel
+
  BsApplication::getPrimaryViewport is not implemented
 
- Consider moving all script stuff in a separate static lib?
+Reconsider making scripts a static library
+ - The scripts would only have one external header that allows you to start the script engine and load assemblies
+ - So BansheeEngine script library would be dependant on BansheeEngine
+ - BansheeEditor script library would be dependant on BansheeEditor, BansheEngine and BansheeEngineScript
+ - Maybe even make them .dlls? Then BansheeEngine and bansheeeditor doesn't need to know about their includes
 
 IGNORE RESOURCES FOR NOW. When building the GUI make sure that they all temporarily use the native skin
+ - Later implement GUIBase.skin (and actually implement GUISkin because it's just a dummy for now)
 
 
 ----------------------------

+ 16 - 0
MBansheeEditor/EditorGUI.cs

@@ -0,0 +1,16 @@
+using System.Runtime.CompilerServices;
+using BansheeEngine;
+
+namespace BansheeEditor
+{
+    public sealed class EditorGUI : GUIBase
+    {
+        internal EditorGUI(ModalWindow parentWindow)
+        {
+            Internal_CreateInstance(this, parentWindow);
+        }
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_CreateInstance(EditorGUI instance, ModalWindow parentWindow);
+    }
+}

+ 1 - 0
MBansheeEditor/MBansheeEditor.csproj

@@ -40,6 +40,7 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="EditorApplication.cs" />
+    <Compile Include="EditorGUI.cs" />
     <Compile Include="ModalWindow.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />

+ 2 - 14
MBansheeEditor/ModalWindow.cs

@@ -6,27 +6,15 @@ namespace BansheeEditor
 {
     public class ModalWindow : ScriptObject
     {
-        //protected EditorGUIWidget GUI;
+        protected EditorGUI GUI;
 
         public ModalWindow(int top, int left, int width, int height)
         {
             Internal_CreateInstance(this, top, left, width, height);
-
-            //SceneObject modalWindowSO = new SceneObject("ModalWindow");
-            //modalWindowSO.hideFlags = HideFlags.HideInInspector | HideFlags.DontSave;
-
-            //modalWindowSO->addComponent<EditorGUIWidget>(this);
-        }
-
-        ~ModalWindow()
-        {
-            Internal_DestroyInstance(mCachedPtr);
+            GUI = new EditorGUI(this);
         }
 
         [DllImport("__Internal")]
         private static extern void Internal_CreateInstance(ModalWindow instance, int top, int left, int width, int height);
-
-        [DllImport("__Internal")]
-        private static extern void Internal_DestroyInstance(IntPtr nativeInstance);
     }
 }

+ 12 - 0
MBansheeEngine/GUI.cs

@@ -5,11 +5,23 @@ namespace BansheeEngine
 {
     public sealed class GUI : GUIBase
     {
+        private static GUI instance = new GUI();
+
         internal GUI()
         {
             Internal_CreateInstance(this);
         }
 
+        public new static GUIArea AddArea(int x, int y, int width = 0, int height = 0, short depth = 0)
+        {
+            return ((GUIBase)instance).AddArea(x, y, width, height, depth);
+        }
+
+        public new static GUIArea AddResizableArea(int offsetLeft, int offsetRight, int offsetTop, int offsetBottom, GUIArea.ResizeAxis resizeAxis, short depth = 0)
+        {
+            return ((GUIBase)instance).AddResizableArea(offsetLeft, offsetRight, offsetTop, offsetBottom, resizeAxis, depth);
+        }
+
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_CreateInstance(GUI instance);
     }

+ 40 - 12
MBansheeEngine/GUIArea.cs

@@ -12,30 +12,58 @@ namespace BansheeEngine
             get { return _layout;}
         }
 
-        public enum ResizeAxis
+        internal GUIArea()
+        { }
+
+        internal static GUIArea Create(GUIBase parent, int x, int y, int width, int height, short depth)
+        {
+            GUIArea newArea = new GUIArea();
+            Internal_CreateInstance(newArea, parent, x, y, width, height, depth);
+            newArea._layout = new GUILayoutX(newArea);
+
+            return newArea;
+        }
+
+        internal static GUIArea CreateResizableX(GUIBase parent, int offsetLeft, int offsetRight, int offsetTop, int height, short depth)
         {
-            X,
-            Y,
-            XY
+            GUIArea newArea = new GUIArea();
+            Internal_CreateInstanceResizableX(newArea, parent, offsetLeft, offsetRight, offsetTop, height, depth);
+            newArea._layout = new GUILayoutX(newArea);
+
+            return newArea;
         }
 
-        internal GUIArea(GUIBase parent, int x, int y, int width, int height, short depth)
+        internal static GUIArea CreateResizableY(GUIBase parent, int offsetTop, int offsetBottom, int offsetLeft, int width, short depth)
         {
-            Internal_CreateInstance(this, parent, x, y, width, height, depth);
-            _layout = new LayoutX(this);
+            GUIArea newArea = new GUIArea();
+            Internal_CreateInstanceResizableY(newArea, parent, offsetTop, offsetBottom, offsetLeft, width, depth);
+            newArea._layout = new GUILayoutX(newArea);
+
+            return newArea;
         }
 
-        internal GUIArea(GUIBase parent, int offsetLeft, int offsetRight, int offsetTop, int offsetBottom, ResizeAxis resizeAxis, short depth)
+        internal static GUIArea CreateResizableXY(GUIBase parent, int offsetLeft, int offsetRight, int offsetTop, int offsetBottom, short depth)
         {
-            Internal_CreateResizableInstance(this, parent, offsetLeft, offsetRight, offsetTop, offsetBottom, resizeAxis, depth);
-            _layout = new LayoutX(this);
+            GUIArea newArea = new GUIArea();
+            Internal_CreateInstanceResizableXY(newArea, parent, offsetLeft, offsetRight, offsetTop, offsetBottom, depth);
+            newArea._layout = new GUILayoutX(newArea);
+
+            return newArea;
         }
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_CreateInstance(GUIArea instance, GUIBase parent, int x, int y, int width, int height, short depth);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateResizableInstance(GUIArea instance, GUIBase parent, int offsetLeft, int offsetRight, int offsetTop, 
-            int offsetBottom, ResizeAxis resizeAxis, short depth);
+        private static extern void Internal_CreateInstanceResizableX(GUIArea instance, GUIBase parent, int offsetLeft, int offsetRight, int offsetTop, 
+            int height, short depth);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_CreateInstanceResizableY(GUIArea instance, GUIBase parent, int offsetTop, int offsetBottom, int offsetLeft,
+            int width, short depth);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_CreateInstanceResizableXY(GUIArea instance, GUIBase parent, int offsetLeft, int offsetRight, int offsetTop,
+            int offsetBottom, short depth);
     }
 }

+ 17 - 4
MBansheeEngine/GUIBase.cs

@@ -3,6 +3,7 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+
     public class GUIBase : ScriptObject
     {
         private GUIArea mainArea;
@@ -13,22 +14,34 @@ namespace BansheeEngine
             get { return _mainLayout; }
         }
 
+        public GUISkin skin; // TODO
+
         internal GUIBase()
         {
             Internal_CreateInstance(this);
 
-            mainArea = AddResizableArea(0, 0, 0, 0, GUIArea.ResizeAxis.XY);
+            mainArea = AddResizableAreaXY(0, 0, 0, 0);
             _mainLayout = mainArea.layout;
         }
 
         public GUIArea AddArea(int x, int y, int width = 0, int height = 0, short depth = 0)
         {
-            return new GUIArea(this, x, y, width, height, depth);
+            return GUIArea.Create(this, x, y, width, height, depth);
+        }
+
+        public GUIArea AddResizableAreaX(int offsetLeft, int offsetRight, int offsetTop, int height, short depth = 0)
+        {
+            return GUIArea.CreateResizableX(this, offsetLeft, offsetRight, offsetTop, height, depth);
+        }
+
+        public GUIArea AddResizableAreaY(int offsetTop, int offsetBottom, int offsetLeft, int width, short depth = 0)
+        {
+            return GUIArea.CreateResizableY(this, offsetTop, offsetBottom, offsetLeft, width, depth);
         }
 
-        public GUIArea AddResizableArea(int offsetLeft, int offsetRight, int offsetTop, int offsetBottom, GUIArea.ResizeAxis resizeAxis, short depth = 0)
+        public GUIArea AddResizableAreaXY(int offsetLeft, int offsetRight, int offsetTop, int offsetBottom, short depth = 0)
         {
-            return new GUIArea(this, offsetLeft, offsetRight, offsetTop, offsetBottom, resizeAxis, depth);
+            return GUIArea.CreateResizableXY(this, offsetLeft, offsetRight, offsetTop, offsetBottom, depth);
         }
 
         [MethodImpl(MethodImplOptions.InternalCall)]

+ 15 - 0
MBansheeEngine/GUILabel.cs

@@ -0,0 +1,15 @@
+using System.Runtime.CompilerServices;
+
+namespace BansheeEngine
+{
+    public sealed class GUILabel : ScriptObject
+    {
+        internal GUILabel(GUILayout parentLayout, string name, GUIElementStyle style, params GUIOption[] options)
+        {
+            Internal_CreateInstance(this, parentLayout, name, style, options);
+        }
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_CreateInstance(GUILabel instance, GUILayout layout, string name, GUIElementStyle style, GUIOption[] options);
+    }
+}

+ 20 - 4
MBansheeEngine/GUILayout.cs

@@ -3,14 +3,30 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    public class GUILayout : ScriptObject
+    public abstract class GUILayout : ScriptObject
     {
-        internal GUILayout()
+        public GUILabel AddLabel(string name, GUIElementStyle style, params GUIOption[] options)
         {
-            Internal_CreateInstance(this);
+            return new GUILabel(this, name, style, options);
         }
 
+        public GUILabel AddLabel(string name, GUIElementStyle style)
+        {
+            return new GUILabel(this, name, style, new GUIOption[0]);
+        }
+
+        public GUILabel AddLabel(string name, params GUIOption[] options)
+        {
+            return new GUILabel(this, name, null, options);
+        }
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        protected static extern void Internal_CreateInstanceXFromArea(GUILayout instance, GUIArea parentArea);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        protected static extern void Internal_CreateInstanceXFromLayout(GUILayout instance, GUILayout parentLayout);
+
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(GUILayout instance);
+        protected static extern void Internal_CreateInstanceYFromLayout(GUILayout instance, GUILayout parentLayout);
     }
 }

+ 9 - 5
MBansheeEngine/GUILayoutX.cs

@@ -3,14 +3,18 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    public class GUILayoutX : GUILayout
+    public sealed class GUILayoutX : GUILayout
     {
-        internal GUILayoutX()
+        internal GUILayoutX() { }
+
+        internal GUILayoutX(GUIArea parentArea)
         {
-            Internal_CreateInstance(this);
+            Internal_CreateInstanceXFromArea(this, parentArea);
         }
 
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(GUILayoutX instance);
+        internal GUILayoutX(GUILayout parentLayout)
+        {
+            Internal_CreateInstanceXFromLayout(this, parentLayout);
+        }
     }
 }

+ 4 - 5
MBansheeEngine/GUILayoutY.cs

@@ -5,12 +5,11 @@ namespace BansheeEngine
 {
     public sealed class GUILayoutY : GUILayout
     {
-        internal GUILayoutY()
+        internal GUILayoutY() { }
+
+        internal GUILayoutY(GUILayout parentLayout)
         {
-            Internal_CreateInstance(this);
+            Internal_CreateInstanceYFromLayout(this, parentLayout);
         }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(GUILayoutY instance);
     }
 }

+ 57 - 0
MBansheeEngine/GUIOption.cs

@@ -0,0 +1,57 @@
+using System.Runtime.InteropServices;
+
+namespace BansheeEngine
+{
+    [StructLayout(LayoutKind.Sequential)]
+    public struct GUIOption
+    {
+        internal enum Type
+        {
+            FixedWidth,
+            FlexibleWidth,
+            FixedHeight,
+            FlexibleHeight
+        }
+
+        internal int min, max;
+        internal Type type;
+
+        public static GUIOption FixedWidth(int width)
+        {
+            GUIOption option = new GUIOption();
+            option.min = option.max = width;
+            option.type = Type.FixedWidth;
+
+            return option;
+        }
+
+        public static GUIOption FixedHeight(int height)
+        {
+            GUIOption option = new GUIOption();
+            option.min = option.max = height;
+            option.type = Type.FixedHeight;
+
+            return option;
+        }
+
+        public static GUIOption FlexibleWidth(int minWidth, int maxWidth)
+        {
+            GUIOption option = new GUIOption();
+            option.min = minWidth;
+            option.max = maxWidth;
+            option.type = Type.FlexibleWidth;
+
+            return option;
+        }
+
+        public static GUIOption FlexibleHeight(int minHeight, int maxHeight)
+        {
+            GUIOption option = new GUIOption();
+            option.min = minHeight;
+            option.max = maxHeight;
+            option.type = Type.FlexibleHeight;
+
+            return option;
+        }
+    }
+}

+ 16 - 0
MBansheeEngine/GUISkin.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Runtime.CompilerServices;
+
+namespace BansheeEngine
+{
+    public sealed class GUISkin : ScriptObject
+    {
+        public GUISkin()
+        {
+            Internal_CreateInstance(this);
+        }
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_CreateInstance(GUISkin instance);
+    }
+}

+ 3 - 0
MBansheeEngine/MBansheeEngine.csproj

@@ -50,9 +50,12 @@
     <Compile Include="GUIBase.cs" />
     <Compile Include="GUIElementStateStyle.cs" />
     <Compile Include="GUIElementStyle.cs" />
+    <Compile Include="GUILabel.cs" />
     <Compile Include="GUILayout.cs" />
     <Compile Include="GUILayoutX.cs" />
     <Compile Include="GUILayoutY.cs" />
+    <Compile Include="GUIOption.cs" />
+    <Compile Include="GUISkin.cs" />
     <Compile Include="GUIWidget.cs" />
     <Compile Include="MathEx.cs" />
     <Compile Include="Matrix3.cs" />

+ 3 - 0
MBansheeEngine/Program.cs

@@ -1,5 +1,8 @@
 using System;
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo("MBansheeEditor")]
 
 namespace BansheeEngine
 {