瀏覽代碼

Project library now maintains UUIDs of native resources even if the resource manifest failed to save
Progress bar will now build its UI immediately when it is shown

BearishSun 10 年之前
父節點
當前提交
962b3a0fbc
共有 3 個文件被更改,包括 12 次插入3 次删除
  1. 7 1
      BansheeEditor/Source/BsProjectLibrary.cpp
  2. 4 1
      MBansheeEditor/ProgressBar.cs
  3. 1 1
      MBansheeEditor/ProjectLibrary.cs

+ 7 - 1
BansheeEditor/Source/BsProjectLibrary.cpp

@@ -393,9 +393,15 @@ namespace BansheeEngine
 				curImportOptions = importOptions;
 				curImportOptions = importOptions;
 
 
 			HResource importedResource;
 			HResource importedResource;
-
 			if (isNativeResource)
 			if (isNativeResource)
+			{
+				// If meta exists make sure it is registered in the manifest before load, otherwise it will get assigned a new UUID.
+				// This can happen if library isn't properly saved before exiting the application.
+				if (resource->meta != nullptr && !mResourceManifest->uuidExists(resource->meta->getUUID()))
+					mResourceManifest->registerResource(resource->meta->getUUID(), resource->path);
+
 				importedResource = gResources().load(resource->path);
 				importedResource = gResources().load(resource->path);
+			}
 
 
 			if(resource->meta == nullptr)
 			if(resource->meta == nullptr)
 			{
 			{

+ 4 - 1
MBansheeEditor/ProgressBar.cs

@@ -53,7 +53,10 @@ namespace BansheeEditor
         public static void Show(LocString title, LocString message, float percent)
         public static void Show(LocString title, LocString message, float percent)
         {
         {
             if (instance == null)
             if (instance == null)
+            {
                 instance = new ProgressBar(title, message, percent);
                 instance = new ProgressBar(title, message, percent);
+                instance.BuildGUI();
+            }
             else
             else
             {
             {
                 instance.Title = title;
                 instance.Title = title;
@@ -91,7 +94,7 @@ namespace BansheeEditor
             this.percent = percent;
             this.percent = percent;
         }
         }
 
 
-        private void OnInitialize()
+        private void BuildGUI()
         {
         {
             progressBar = new GUIProgressBar();
             progressBar = new GUIProgressBar();
             messageLabel = new GUILabel("");
             messageLabel = new GUILabel("");

+ 1 - 1
MBansheeEditor/ProjectLibrary.cs

@@ -306,7 +306,7 @@ namespace BansheeEditor
                     }
                     }
 
 
                     float pct = numImportedFiles / (float)totalFilesToImport;
                     float pct = numImportedFiles / (float)totalFilesToImport;
-                    ProgressBar.Show("Importing (" + numImportedFiles + "/" + totalFilesToImport + ")", displayName, 0.5f);
+                    ProgressBar.Show("Importing (" + numImportedFiles + "/" + totalFilesToImport + ")", displayName, pct);
                 }
                 }
 
 
                 importInProgress = true;
                 importInProgress = true;