Explorar o código

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 %!s(int64=10) %!d(string=hai) anos
pai
achega
962b3a0fbc

+ 7 - 1
BansheeEditor/Source/BsProjectLibrary.cpp

@@ -393,9 +393,15 @@ namespace BansheeEngine
 				curImportOptions = importOptions;
 
 			HResource importedResource;
-
 			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);
+			}
 
 			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)
         {
             if (instance == null)
+            {
                 instance = new ProgressBar(title, message, percent);
+                instance.BuildGUI();
+            }
             else
             {
                 instance.Title = title;
@@ -91,7 +94,7 @@ namespace BansheeEditor
             this.percent = percent;
         }
 
-        private void OnInitialize()
+        private void BuildGUI()
         {
             progressBar = new GUIProgressBar();
             messageLabel = new GUILabel("");

+ 1 - 1
MBansheeEditor/ProjectLibrary.cs

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