2
0
Эх сурвалжийг харах

Text rendering will no longer move a word to a newline if that means leaving the current line empty
Fixed a couple of issues with drag and drop while renaming elements in Library window

BearishSun 10 жил өмнө
parent
commit
724442dc25

+ 1 - 1
BansheeCore/Source/BsTextData.cpp

@@ -425,7 +425,7 @@ namespace BansheeEngine
 						TextWord& lastWord = MemBuffer->WordBuffer[lastWordIdx];
 
 						bool wordFits = lastWord.calcWidthWithChar(charDesc) <= width;
-						if (wordFits)
+						if (wordFits && !curLine->isEmpty())
 						{
 							curLine->finalize(false);
 

+ 5 - 0
BansheeEditor/Source/BsBuiltinEditorResources.cpp

@@ -1130,6 +1130,11 @@ namespace BansheeEngine
 
 		skin->setStyle("TreeViewElementBtn", treeViewEntryStyle);
 
+		// Background
+		GUIElementStyle treeViewBackgroundStyle;
+
+		skin->setStyle("TreeViewBackground", treeViewBackgroundStyle);
+
 		// Selection background
 		GUIElementStyle treeViewSelBackgroundStyle;
 		treeViewSelBackgroundStyle.normal.texture = getGUITexture(SelectionBgTex);

+ 32 - 16
BansheeUtility/Source/Win32/BsWin32FileSystem.cpp

@@ -11,45 +11,61 @@ namespace BansheeEngine
 		switch (error)
 		{
 		case ERROR_FILE_NOT_FOUND:
-			BS_EXCEPT(FileNotFoundException, "File at path: \"" + toString(path) + "\" not found.");
+			LOGERR("File at path: \"" + toString(path) + "\" not found.");
+			break;
 		case ERROR_PATH_NOT_FOUND:
 		case ERROR_BAD_NETPATH:
 		case ERROR_CANT_RESOLVE_FILENAME:
 		case ERROR_INVALID_DRIVE:
-			BS_EXCEPT(FileNotFoundException, "Path \"" + toString(path) + "\" not found.");
+			LOGERR("Path \"" + toString(path) + "\" not found.");
+			break;
 		case ERROR_ACCESS_DENIED:
-			BS_EXCEPT(IOException, "Access to path \"" + toString(path) + "\" denied.");
+			LOGERR("Access to path \"" + toString(path) + "\" denied.");
+			break;
 		case ERROR_ALREADY_EXISTS:
 		case ERROR_FILE_EXISTS:
-			BS_EXCEPT(IOException, "File/folder at path \"" + toString(path) + "\" already exists.");
+			LOGERR("File/folder at path \"" + toString(path) + "\" already exists.");
+			break;
 		case ERROR_INVALID_NAME:
 		case ERROR_DIRECTORY:
 		case ERROR_FILENAME_EXCED_RANGE:
 		case ERROR_BAD_PATHNAME:
-			BS_EXCEPT(IOException, "Invalid path string: \"" + toString(path) + "\".");
+			LOGERR("Invalid path string: \"" + toString(path) + "\".");
+			break;
 		case ERROR_FILE_READ_ONLY:
-			BS_EXCEPT(IOException, "File at path \"" + toString(path) + "\" is read only.");
+			LOGERR("File at path \"" + toString(path) + "\" is read only.");
+			break;
 		case ERROR_CANNOT_MAKE:
-			BS_EXCEPT(IOException, "Cannot create file/folder at path: \"" + toString(path) + "\".");
+			LOGERR("Cannot create file/folder at path: \"" + toString(path) + "\".");
+			break;
 		case ERROR_DIR_NOT_EMPTY:
-			BS_EXCEPT(IOException, "Directory at path \"" + toString(path) + "\" not empty.");
+			LOGERR("Directory at path \"" + toString(path) + "\" not empty.");
+			break;
 		case ERROR_WRITE_FAULT:
-			BS_EXCEPT(IOException, "Error while writing a file at path \"" + toString(path) + "\".");
+			LOGERR("Error while writing a file at path \"" + toString(path) + "\".");
+			break;
 		case ERROR_READ_FAULT:
-			BS_EXCEPT(IOException, "Error while reading a file at path \"" + toString(path) + "\".");
+			LOGERR("Error while reading a file at path \"" + toString(path) + "\".");
+			break;
 		case ERROR_SHARING_VIOLATION:
-			BS_EXCEPT(IOException, "Sharing violation at path \"" + toString(path) + "\".");
+			LOGERR("Sharing violation at path \"" + toString(path) + "\".");
+			break;
 		case ERROR_LOCK_VIOLATION:
-			BS_EXCEPT(IOException, "Lock violation at path \"" + toString(path) + "\".");
+			LOGERR("Lock violation at path \"" + toString(path) + "\".");
+			break;
 		case ERROR_HANDLE_EOF:
-			BS_EXCEPT(IOException, "End of file reached for file at path \"" + toString(path) + "\".");
+			LOGERR("End of file reached for file at path \"" + toString(path) + "\".");
+			break;
 		case ERROR_HANDLE_DISK_FULL:
 		case ERROR_DISK_FULL:
-			BS_EXCEPT(IOException, "Disk full.");
+			LOGERR("Disk full.");
+			break;
 		case ERROR_NEGATIVE_SEEK:
-			BS_EXCEPT(IOException, "Negative seek.");
+			LOGERR("Negative seek.");
+			break;
 		default:
-			BS_EXCEPT(IOException, "Undefined file system exception: " + toString((UINT32)error));
+			LOGERR("Undefined file system exception: " + toString((UINT32)error));
+			break;
 		}
 	}
 

+ 1 - 1
MBansheeEditor/Library/LibraryGUIEntry.cs

@@ -199,7 +199,7 @@ namespace BansheeEditor
             if (renameTextBox != null)
                 return;
 
-            renameTextBox = new GUITextBox(false);
+            renameTextBox = new GUITextBox(true);
             renameTextBox.Bounds = label.Bounds;
             owner.RenameOverlay.AddElement(renameTextBox);
 

+ 4 - 0
MBansheeEditor/Library/LibraryWindow.cs

@@ -1169,6 +1169,10 @@ namespace BansheeEditor
         /// <param name="windowPos">Coordinates where the drag operation started, relative to the window.</param>
         private void OnDragStart(Vector2I windowPos)
         {
+            bool isRenameInProgress = inProgressRenameElement != null;
+            if (isRenameInProgress)
+                return;
+
             LibraryGUIEntry underCursorElem = FindElementAt(windowPos);
             if (underCursorElem == null)
             {