Jelajahi Sumber

Added editor's dirty resource management system
Added current scene and project, with a modified flag, to the status bar

BearishSun 10 tahun lalu
induk
melakukan
fcbefc5c89

+ 18 - 0
BansheeEditor/Include/BsGUIStatusBar.h

@@ -52,6 +52,22 @@ namespace BansheeEngine
 
 
 		GUIStatusBar(const PrivatelyConstruct& dummy, const String& style, const GUIDimensions& dimensions);
 		GUIStatusBar(const PrivatelyConstruct& dummy, const String& style, const GUIDimensions& dimensions);
 
 
+		/**
+		 * @brief	Updates the active project displayed on the status bar.
+		 * 	
+		 * @param	name		Name of the project.
+		 * @param	modified	Should the project be displayed as modified (i.e. needs saving).
+		 */
+		void setProject(const WString& name, bool modified);
+
+		/**
+		 * @brief	Updates the active scene displayed on the status bar.
+		 * 	
+		 * @param	name		Name of the scene.
+		 * @param	modified	Should the scene be displayed as modified (i.e. needs saving).
+		 */
+		void setScene(const WString& name, bool modified);
+
 		/**
 		/**
 		 * @copydoc	GUIElement::setTint
 		 * @copydoc	GUIElement::setTint
 		 */
 		 */
@@ -94,6 +110,8 @@ namespace BansheeEngine
 		GUIPanel* mPanel;
 		GUIPanel* mPanel;
 		GUIPanel* mBgPanel;
 		GUIPanel* mBgPanel;
 		GUIButton* mMessage;
 		GUIButton* mMessage;
+		GUILabel* mScene;
+		GUILabel* mProject;
 		GUITexture* mBackground;
 		GUITexture* mBackground;
 
 
 		HEvent mLogEntryAddedConn;
 		HEvent mLogEntryAddedConn;

+ 5 - 0
BansheeEditor/Include/BsMainEditorWindow.h

@@ -35,6 +35,11 @@ namespace BansheeEngine
 		 */
 		 */
 		GUIMenuBar& getMenuBar() const { return *mMenuBar; }
 		GUIMenuBar& getMenuBar() const { return *mMenuBar; }
 
 
+		/**
+		 * @brief	Gets status bar GUI element.
+		 */
+		GUIStatusBar& getStatusBar() const { return *mStatusBar; }
+
 		/**
 		/**
 		 * @brief	Creates a new main editor window. If one is already open this method
 		 * @brief	Creates a new main editor window. If one is already open this method
 		 *			will return the existing one.
 		 *			will return the existing one.

+ 23 - 0
BansheeEditor/Source/BsGUIStatusBar.cpp

@@ -28,6 +28,8 @@ namespace BansheeEngine
 
 
 		mBackground = GUITexture::create(GUIOptions(GUIOption::flexibleWidth()), getSubStyleName(getGUIBackgroundTypeName()));
 		mBackground = GUITexture::create(GUIOptions(GUIOption::flexibleWidth()), getSubStyleName(getGUIBackgroundTypeName()));
 		mMessage = GUIButton::create(HString(L""), GUIOptions(GUIOption::flexibleWidth()), getSubStyleName(getGUIMessageTypeName()));
 		mMessage = GUIButton::create(HString(L""), GUIOptions(GUIOption::flexibleWidth()), getSubStyleName(getGUIMessageTypeName()));
+		mScene = GUILabel::create(HString(L"Scene: None"), GUIOptions(GUIOption::fixedWidth(150)));
+		mProject = GUILabel::create(HString(L"Project: None"), GUIOptions(GUIOption::fixedWidth(150)));
 
 
 		GUILayoutY* vertLayout = mPanel->addNewElement<GUILayoutY>();
 		GUILayoutY* vertLayout = mPanel->addNewElement<GUILayoutY>();
 		vertLayout->addNewElement<GUIFixedSpace>(3);
 		vertLayout->addNewElement<GUIFixedSpace>(3);
@@ -36,6 +38,7 @@ namespace BansheeEngine
 		horzLayout->addNewElement<GUIFixedSpace>(10);
 		horzLayout->addNewElement<GUIFixedSpace>(10);
 		horzLayout->addElement(mMessage);
 		horzLayout->addElement(mMessage);
 		horzLayout->addNewElement<GUIFixedSpace>(20);
 		horzLayout->addNewElement<GUIFixedSpace>(20);
+		horzLayout->addNewElement<GUIFixedSpace>(20);
 
 
 		mBgPanel->addElement(mBackground);
 		mBgPanel->addElement(mBackground);
 
 
@@ -66,6 +69,26 @@ namespace BansheeEngine
 
 
 		return bs_new<GUIStatusBar>(PrivatelyConstruct(), *curStyle, GUIDimensions::create());
 		return bs_new<GUIStatusBar>(PrivatelyConstruct(), *curStyle, GUIDimensions::create());
 	}
 	}
+
+	void GUIStatusBar::setProject(const WString& name, bool modified)
+	{
+		WString content = L"Project: " + name;
+
+		if (modified)
+			content += L"*";
+
+		mProject->setContent(HString(content));
+	}
+
+	void GUIStatusBar::setScene(const WString& name, bool modified)
+	{
+		WString content = L"Scene: " + name;
+
+		if (modified)
+			content += L"*";
+
+		mScene->setContent(HString(content));
+	}
 	
 	
 	void GUIStatusBar::setTint(const Color& color)
 	void GUIStatusBar::setTint(const Color& color)
 	{
 	{

+ 100 - 7
MBansheeEditor/EditorApplication.cs

@@ -132,6 +132,7 @@ namespace BansheeEditor
 
 
         private static EditorApplication instance;
         private static EditorApplication instance;
         private static FolderMonitor monitor;
         private static FolderMonitor monitor;
+        private static HashSet<string> dirtyResources;
 
 
         /// <summary>
         /// <summary>
         /// Constructs a new editor application. Called at editor start-up by the runtime.
         /// Constructs a new editor application. Called at editor start-up by the runtime.
@@ -207,7 +208,7 @@ namespace BansheeEditor
             if (!string.IsNullOrEmpty(Scene.ActiveSceneUUID))
             if (!string.IsNullOrEmpty(Scene.ActiveSceneUUID))
             {
             {
                 string scenePath = ProjectLibrary.GetPath(Scene.ActiveSceneUUID);
                 string scenePath = ProjectLibrary.GetPath(Scene.ActiveSceneUUID);
-                Internal_SaveScene(scenePath);
+                SaveScene(scenePath);
             }
             }
             else
             else
                 SaveSceneAs();
                 SaveSceneAs();
@@ -230,7 +231,10 @@ namespace BansheeEditor
                     // TODO - If path points to an existing non-scene asset or folder I should delete it otherwise
                     // TODO - If path points to an existing non-scene asset or folder I should delete it otherwise
                     //        Internal_SaveScene will silently fail.
                     //        Internal_SaveScene will silently fail.
 
 
-                    Scene.ActiveSceneUUID = Internal_SaveScene(scenePath + ".prefab");
+                    scenePath = ".prefab";
+
+                    SaveScene(scenePath);
+                    LoadScene(scenePath);
                 }
                 }
             }
             }
         }
         }
@@ -239,13 +243,14 @@ namespace BansheeEditor
         /// Loads a prefab as the current scene at the specified path. If current scene is modified the user is offered a 
         /// Loads a prefab as the current scene at the specified path. If current scene is modified the user is offered a 
         /// chance to save it.
         /// chance to save it.
         /// </summary>
         /// </summary>
-        /// <param name="path">Path to a valid prefab, relative to the resource folder.</param>
+        /// <param name="path">Path to a valid prefab relative to the resource folder.</param>
         public static void LoadScene(string path)
         public static void LoadScene(string path)
         {
         {
             Action<string> continueLoad =
             Action<string> continueLoad =
                 (scenePath) =>
                 (scenePath) =>
                 {
                 {
                     Scene.Load(path);
                     Scene.Load(path);
+                    SetStatusScene(Scene.ActiveSceneName, false);
 
 
                     ProjectSettings.LastOpenScene = scenePath;
                     ProjectSettings.LastOpenScene = scenePath;
                     ProjectSettings.Save();
                     ProjectSettings.Save();
@@ -263,7 +268,7 @@ namespace BansheeEditor
                     continueLoad(path);
                     continueLoad(path);
             };
             };
 
 
-            if (Scene.IsModified())
+            if (IsSceneModified())
             {
             {
                 DialogBox.Open("Warning", "You current scene has modifications. Do you wish to save them first?",
                 DialogBox.Open("Warning", "You current scene has modifications. Do you wish to save them first?",
                     DialogBox.Type.YesNoCancel, dialogCallback);
                     DialogBox.Type.YesNoCancel, dialogCallback);
@@ -272,6 +277,18 @@ namespace BansheeEditor
                 continueLoad(path);
                 continueLoad(path);
         }
         }
 
 
+        /// <summary>
+        /// Saves the currently loaded scene to the specified path.
+        /// </summary>
+        /// <param name="path">Path relative to the resource folder. This can be the path to the existing scene
+        ///                    prefab it just needs updating. </param>
+        public static void SaveScene(string path)
+        {
+            Internal_SaveScene(path);
+            SetStatusScene(Scene.ActiveSceneName, false);
+            dirtyResources.Remove(path);
+        }
+
         /// <summary>
         /// <summary>
         /// Checks does the folder at the provieded path contain a valid project.
         /// Checks does the folder at the provieded path contain a valid project.
         /// </summary>
         /// </summary>
@@ -309,7 +326,17 @@ namespace BansheeEditor
         [ToolbarItem("Save Project", ToolbarIcon.SaveProject, "", 1999)]
         [ToolbarItem("Save Project", ToolbarIcon.SaveProject, "", 1999)]
         public static void SaveProject()
         public static void SaveProject()
         {
         {
-            // TODO - Save dirty resources
+            foreach (var resourceUUID in dirtyResources)
+            {
+                string path = ProjectLibrary.GetPath(resourceUUID);
+                Resource resource = ProjectLibrary.Load<Resource>(path);
+
+                if(resource != null)
+                    ProjectLibrary.Save(resource);
+            }
+                
+            dirtyResources.Clear();
+            SetStatusProject(false);
 
 
             Internal_SaveProject();
             Internal_SaveProject();
         }
         }
@@ -334,6 +361,7 @@ namespace BansheeEditor
                 UnloadProject();
                 UnloadProject();
 
 
             Internal_LoadProject(path); // Triggers OnProjectLoaded when done
             Internal_LoadProject(path); // Triggers OnProjectLoaded when done
+            SetStatusProject(false);
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -352,7 +380,36 @@ namespace BansheeEditor
         /// <param name="resource">Resource to mark as dirty</param>
         /// <param name="resource">Resource to mark as dirty</param>
         public static void SetDirty(Resource resource)
         public static void SetDirty(Resource resource)
         {
         {
-            // TODO - Not implemented
+            if (resource == null)
+                return;
+
+            if (Scene.ActiveSceneUUID == resource.UUID)
+            {
+                SetStatusScene(Scene.ActiveSceneName, true);
+            }
+
+            SetStatusProject(true);
+            dirtyResources.Add(resource.UUID);
+        }
+
+        /// <summary>
+        /// Checks is the specific resource dirty and needs saving.
+        /// </summary>
+        /// <param name="resource">Resource to check.</param>
+        /// <returns>True if the resource requires saving, false otherwise.</returns>
+        public static bool IsDirty(Resource resource)
+        {
+            return dirtyResources.Contains(resource.UUID);
+        }
+
+        /// <summary>
+        /// Checks is the resource with the specified UUID dirty and needs saving.
+        /// </summary>
+        /// <param name="uuid">Identifier of the resource to check.</param>
+        /// <returns>True if the resource requires saving, false otherwise.</returns>
+        public static bool IsDirty(string uuid)
+        {
+            return dirtyResources.Contains(uuid);
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -430,6 +487,8 @@ namespace BansheeEditor
                         window.Reset();
                         window.Reset();
 
 
                     Internal_UnloadProject();
                     Internal_UnloadProject();
+                    SetStatusScene("None", false);
+                    SetStatusProject(false);
                 };
                 };
 
 
             Action<DialogBox.ResultType> dialogCallback =
             Action<DialogBox.ResultType> dialogCallback =
@@ -441,7 +500,7 @@ namespace BansheeEditor
                 continueUnload();
                 continueUnload();
             };
             };
 
 
-            if (Scene.IsModified())
+            if (IsSceneModified())
             {
             {
                 DialogBox.Open("Warning", "You current scene has modifications. Do you wish to save them first?",
                 DialogBox.Open("Warning", "You current scene has modifications. Do you wish to save them first?",
                     DialogBox.Type.YesNoCancel, dialogCallback);
                     DialogBox.Type.YesNoCancel, dialogCallback);
@@ -450,6 +509,40 @@ namespace BansheeEditor
                 continueUnload();
                 continueUnload();
         }
         }
 
 
+        /// <summary>
+        /// Changes the scene displayed on the status bar.
+        /// </summary>
+        /// <param name="name">Name of the scene.</param>
+        /// <param name="modified">Whether to display the scene as modified or not.</param>
+        private static void SetStatusScene(string name, bool modified)
+        {
+            Internal_SetStatusScene(name, modified);
+        }
+
+        /// <summary>
+        /// Changes the project state displayed on the status bar.
+        /// </summary>
+        /// <param name="modified">Whether to display the project as modified or not.</param>
+        private static void SetStatusProject(bool modified)
+        {
+            Internal_SetStatusProject(modified);
+        }
+
+        /// <summary>
+        /// Checks did we make any modifications to the scene since it was last saved.
+        /// </summary>
+        /// <returns>True if the scene was never saved, or was modified after last save.</returns>
+        public static bool IsSceneModified()
+        {
+            return IsDirty(Scene.ActiveSceneUUID);
+        }
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetStatusScene(string name, bool modified);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetStatusProject(bool modified);
+
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern string Internal_GetProjectPath();
         private static extern string Internal_GetProjectPath();
 
 

+ 11 - 0
MBansheeEngine/Resource.cs

@@ -16,7 +16,18 @@ namespace BansheeEngine
             get { return Internal_GetName(mCachedPtr); }
             get { return Internal_GetName(mCachedPtr); }
         }
         }
 
 
+        /// <summary>
+        /// Returns a universally unique identifier of this resource.
+        /// </summary>
+        public string UUID
+        {
+            get { return Internal_GetUUID(mCachedPtr); }
+        }
+
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern string Internal_GetName(IntPtr nativeInstance);
         private static extern string Internal_GetName(IntPtr nativeInstance);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern string Internal_GetUUID(IntPtr nativeInstance);
     }
     }
 }
 }

+ 17 - 12
MBansheeEngine/Scene.cs

@@ -8,19 +8,17 @@ namespace BansheeEngine
     public static class Scene
     public static class Scene
     {
     {
         /// <summary>
         /// <summary>
-        /// Returns the UUID of the scene prefab. This is empty if scene hasn't been saved yet.
+        /// Returns the name of the scene prefab. This is empty if scene hasn't been saved yet.
         /// </summary>
         /// </summary>
-        internal static string ActiveSceneUUID { get; set; }
+        public static string ActiveSceneName { get { return activeSceneName; } }
 
 
         /// <summary>
         /// <summary>
-        /// Checks did we make any modifications to the scene since it was last saved.
+        /// Returns the UUID of the scene prefab. This is empty if scene hasn't been saved yet.
         /// </summary>
         /// </summary>
-        /// <returns>True if the scene was never saved, or was modified after last save.</returns>
-        public static bool IsModified()
-        {
-            // TODO - Needs implementing
-            return true;
-        }
+        internal static string ActiveSceneUUID { get { return activeSceneUUID; } }
+
+        private static string activeSceneName;
+        private static string activeSceneUUID;
 
 
         /// <summary>
         /// <summary>
         /// Clears all scene objects from the current scene.
         /// Clears all scene objects from the current scene.
@@ -28,7 +26,8 @@ namespace BansheeEngine
         public static void Clear()
         public static void Clear()
         {
         {
             Internal_ClearScene();
             Internal_ClearScene();
-            ActiveSceneUUID = null;
+            activeSceneUUID = null;
+            activeSceneName = "None";
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -38,11 +37,17 @@ namespace BansheeEngine
         public static void Load(string path)
         public static void Load(string path)
         {
         {
             Clear();
             Clear();
-            ActiveSceneUUID = Internal_LoadScene(path);
+            Prefab scene = Internal_LoadScene(path);
+
+            if (scene != null)
+            {
+                activeSceneUUID = scene.UUID;
+                activeSceneName = scene.Name;
+            }
         }
         }
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern string Internal_LoadScene(string path);
+        private static extern Prefab Internal_LoadScene(string path);
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_ClearScene();
         private static extern void Internal_ClearScene();

+ 2 - 0
SBansheeEditor/Include/BsScriptEditorApplication.h

@@ -27,6 +27,8 @@ namespace BansheeEngine
 		/************************************************************************/
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
 		/************************************************************************/
+		static void internal_SetStatusScene(MonoString* name, bool modified);
+		static void internal_SetStatusProject(bool modified);
 		static MonoString* internal_GetProjectPath();
 		static MonoString* internal_GetProjectPath();
 		static MonoString* internal_GetProjectName();
 		static MonoString* internal_GetProjectName();
 		static bool internal_GetProjectLoaded();
 		static bool internal_GetProjectLoaded();

+ 23 - 0
SBansheeEditor/Source/BsScriptEditorApplication.cpp

@@ -9,6 +9,9 @@
 #include "BsPrefab.h"
 #include "BsPrefab.h"
 #include "BsPrefabUtility.h"
 #include "BsPrefabUtility.h"
 #include "BsSceneManager.h"
 #include "BsSceneManager.h"
+#include "BsEditorWindowManager.h"
+#include "BsMainEditorWindow.h"
+#include "BsGUIStatusBar.h"
 #include "BsPlatform.h"
 #include "BsPlatform.h"
 #include "BsResources.h"
 #include "BsResources.h"
 #include "BsScriptEditorWindow.h"
 #include "BsScriptEditorWindow.h"
@@ -31,6 +34,8 @@ namespace BansheeEngine
 
 
 	void ScriptEditorApplication::initRuntimeData()
 	void ScriptEditorApplication::initRuntimeData()
 	{
 	{
+		metaData.scriptClass->addInternalCall("Internal_SetStatusScene", &ScriptEditorApplication::internal_SetStatusScene);
+		metaData.scriptClass->addInternalCall("Internal_SetStatusProject", &ScriptEditorApplication::internal_SetStatusProject);
 		metaData.scriptClass->addInternalCall("Internal_GetProjectPath", &ScriptEditorApplication::internal_GetProjectPath);
 		metaData.scriptClass->addInternalCall("Internal_GetProjectPath", &ScriptEditorApplication::internal_GetProjectPath);
 		metaData.scriptClass->addInternalCall("Internal_GetProjectName", &ScriptEditorApplication::internal_GetProjectName);
 		metaData.scriptClass->addInternalCall("Internal_GetProjectName", &ScriptEditorApplication::internal_GetProjectName);
 		metaData.scriptClass->addInternalCall("Internal_GetProjectLoaded", &ScriptEditorApplication::internal_GetProjectLoaded);
 		metaData.scriptClass->addInternalCall("Internal_GetProjectLoaded", &ScriptEditorApplication::internal_GetProjectLoaded);
@@ -67,6 +72,24 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
+	void ScriptEditorApplication::internal_SetStatusScene(MonoString* name, bool modified)
+	{
+		WString nativeScene = MonoUtil::monoToWString(name);
+
+		MainEditorWindow* mainWindow = EditorWindowManager::instance().getMainWindow();
+		mainWindow->getStatusBar().setScene(nativeScene, modified);
+	}
+
+	void ScriptEditorApplication::internal_SetStatusProject(bool modified)
+	{
+		MainEditorWindow* mainWindow = EditorWindowManager::instance().getMainWindow();
+
+		if (gEditorApplication().isProjectLoaded())
+			mainWindow->getStatusBar().setProject(gEditorApplication().getProjectName(), modified);
+		else
+			mainWindow->getStatusBar().setProject(L"None", false);
+	}
+
 	MonoString* ScriptEditorApplication::internal_GetProjectPath()
 	MonoString* ScriptEditorApplication::internal_GetProjectPath()
 	{
 	{
 		Path projectPath = gEditorApplication().getProjectPath();
 		Path projectPath = gEditorApplication().getProjectPath();

+ 1 - 0
SBansheeEngine/Include/BsScriptResource.h

@@ -157,5 +157,6 @@ namespace BansheeEngine
 		/* 								CLR HOOKS						   		*/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
 		/************************************************************************/
 		static MonoString* internal_getName(ScriptResourceBase* nativeInstance);
 		static MonoString* internal_getName(ScriptResourceBase* nativeInstance);
+		static MonoString* internal_getUUID(ScriptResourceBase* nativeInstance);
 	};
 	};
 }
 }

+ 1 - 1
SBansheeEngine/Include/BsScriptScene.h

@@ -19,7 +19,7 @@ namespace BansheeEngine
 		/************************************************************************/
 		/************************************************************************/
 		/* 								CLR HOOKS						   		*/
 		/* 								CLR HOOKS						   		*/
 		/************************************************************************/
 		/************************************************************************/
-		static MonoString* internal_LoadScene(MonoString* path);
+		static MonoObject* internal_LoadScene(MonoString* path);
 		static void internal_ClearScene();
 		static void internal_ClearScene();
 	};
 	};
 }
 }

+ 6 - 0
SBansheeEngine/Source/BsScriptResource.cpp

@@ -34,6 +34,7 @@ namespace BansheeEngine
 	void ScriptResource::initRuntimeData()
 	void ScriptResource::initRuntimeData()
 	{
 	{
 		metaData.scriptClass->addInternalCall("Internal_GetName", &ScriptResource::internal_getName);
 		metaData.scriptClass->addInternalCall("Internal_GetName", &ScriptResource::internal_getName);
+		metaData.scriptClass->addInternalCall("Internal_GetUUID", &ScriptResource::internal_getUUID);
 	}
 	}
 
 
 	ScriptResourceType ScriptResource::getTypeFromTypeId(UINT32 typeId)
 	ScriptResourceType ScriptResource::getTypeFromTypeId(UINT32 typeId)
@@ -102,4 +103,9 @@ namespace BansheeEngine
 	{
 	{
 		return MonoUtil::wstringToMono(MonoManager::instance().getDomain(), nativeInstance->getGenericHandle()->getName());
 		return MonoUtil::wstringToMono(MonoManager::instance().getDomain(), nativeInstance->getGenericHandle()->getName());
 	}
 	}
+
+	MonoString* ScriptResource::internal_getUUID(ScriptResourceBase* nativeInstance)
+	{
+		return MonoUtil::stringToMono(MonoManager::instance().getDomain(), nativeInstance->getGenericHandle().getUUID());
+	}
 }
 }

+ 6 - 4
SBansheeEngine/Source/BsScriptScene.cpp

@@ -9,6 +9,8 @@
 #include "BsApplication.h"
 #include "BsApplication.h"
 #include "BsSceneObject.h"
 #include "BsSceneObject.h"
 #include "BsGameResourceManager.h"
 #include "BsGameResourceManager.h"
+#include "BsScriptResourceManager.h"
+#include "BsScriptPrefab.h"
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
@@ -22,7 +24,7 @@ namespace BansheeEngine
 		metaData.scriptClass->addInternalCall("Internal_ClearScene", &ScriptScene::internal_ClearScene);
 		metaData.scriptClass->addInternalCall("Internal_ClearScene", &ScriptScene::internal_ClearScene);
 	}
 	}
 
 
-	MonoString* ScriptScene::internal_LoadScene(MonoString* path)
+	MonoObject* ScriptScene::internal_LoadScene(MonoString* path)
 	{
 	{
 		Path nativePath = MonoUtil::monoToWString(path);
 		Path nativePath = MonoUtil::monoToWString(path);
 
 
@@ -41,10 +43,10 @@ namespace BansheeEngine
 			root->destroy();
 			root->destroy();
 		}
 		}
 
 
-		MonoString* uuid = MonoUtil::stringToMono(MonoManager::instance().getDomain(), prefab.getUUID());
+		ScriptPrefab* scriptPrefab;
+		ScriptResourceManager::instance().getScriptResource(prefab, &scriptPrefab, true);
 
 
-		// TODO - Return actual prefab
-		return uuid;
+		return scriptPrefab->getManagedInstance();
 	}
 	}
 
 
 	void ScriptScene::internal_ClearScene()
 	void ScriptScene::internal_ClearScene()

+ 0 - 6
TODO.txt

@@ -38,14 +38,8 @@ Add "dirty object" system to C#. Each ScriptResource and ScriptGameObject should
 Polish
 Polish
 
 
 Ribek use:
 Ribek use:
- - Default material has no shader. What shader to assign to default materials?
  - When I'm directly editing a resource like material, I need to save it after editing is done. Use the "dirty" system for that?
  - When I'm directly editing a resource like material, I need to save it after editing is done. Use the "dirty" system for that?
  - Hook up color picker to guicolor field
  - Hook up color picker to guicolor field
- - Test release mode
- - Track C++ signals and save log when they occurr
-  - Save stack trace?
-  - How to track exceptions, especially cross-dll ones? std:: throws them. Best option would be not to use them as I force everyone
-    to compile all plugins using the same compiler.
 
 
 Other polish:
 Other polish:
  - Add menu items:
  - Add menu items: