Explorar el Código

ProjectWindow:
- Fixing paste logic
- Interacting with folder bar doesn't cause the window to lose keyboard focus anymore

Marko Pintera hace 10 años
padre
commit
d31e04da58
Se han modificado 2 ficheros con 27 adiciones y 8 borrados
  1. 19 4
      MBansheeEditor/ProjectWindow.cs
  2. 8 4
      TODO.txt

+ 19 - 4
MBansheeEditor/ProjectWindow.cs

@@ -800,7 +800,8 @@ namespace BansheeEditor
             {
             {
                 for (int i = 0; i < copyPaths.Count; i++)
                 for (int i = 0; i < copyPaths.Count; i++)
                 {
                 {
-                    string destination = Path.Combine(destinationFolder, Path.GetFileName(copyPaths[i]));
+                    string cleanPath = copyPaths[i].TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
+                    string destination = Path.Combine(destinationFolder, Path.GetFileName(cleanPath));
 
 
                     ProjectLibrary.Copy(copyPaths[i], destination, true);
                     ProjectLibrary.Copy(copyPaths[i], destination, true);
                 }
                 }
@@ -811,7 +812,8 @@ namespace BansheeEditor
             {
             {
                 for (int i = 0; i < cutPaths.Count; i++)
                 for (int i = 0; i < cutPaths.Count; i++)
                 {
                 {
-                    string destination = Path.Combine(destinationFolder, Path.GetFileName(cutPaths[i]));
+                    string cleanPath = cutPaths[i].TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
+                    string destination = Path.Combine(destinationFolder, Path.GetFileName(cleanPath));
 
 
                     ProjectLibrary.Move(cutPaths[i], destination, true);
                     ProjectLibrary.Move(cutPaths[i], destination, true);
                 }
                 }
@@ -1043,11 +1045,24 @@ namespace BansheeEditor
             catchAll.Bounds = contentBounds;
             catchAll.Bounds = contentBounds;
             catchAll.OnClick += OnCatchAllClicked;
             catchAll.OnClick += OnCatchAllClicked;
             catchAll.SetContextMenu(entryContextMenu);
             catchAll.SetContextMenu(entryContextMenu);
-            catchAll.OnFocusChanged += OnContentsFocusChanged;
 
 
             contentInfo.underlay.AddElement(catchAll);
             contentInfo.underlay.AddElement(catchAll);
 
 
-            Debug.Log(contentBounds);
+            Rect2I focusBounds = contentBounds; // Contents + Folder bar
+            Rect2I scrollBounds = contentScrollArea.Bounds;
+            focusBounds.x += scrollBounds.x;
+            focusBounds.y += scrollBounds.y;
+
+            Rect2I folderBarBounds = folderListLayout.Bounds;
+            focusBounds.y -= folderBarBounds.height;
+            focusBounds.height += folderBarBounds.height;
+
+            GUIButton focusCatcher = new GUIButton("", EditorStyles.Blank);
+            focusCatcher.OnFocusChanged += OnContentsFocusChanged;
+            focusCatcher.Bounds = focusBounds;
+
+            GUIPanel focusPanel = GUI.AddPanel(3);
+            focusPanel.AddElement(focusCatcher);
 
 
             UpdateDragSelection(dragSelectionEnd);
             UpdateDragSelection(dragSelectionEnd);
         }
         }

+ 8 - 4
TODO.txt

@@ -25,18 +25,22 @@ TODO - When importing/reimporting stuff there should be a progress bar
  - And onImportDone(entry) for each reimported asset
  - And onImportDone(entry) for each reimported asset
  - Then have EditorApplication subscribe to those events and show a progress bar when needed
  - Then have EditorApplication subscribe to those events and show a progress bar when needed
    - TODO: I will need to either skip a frame, or force GUI to update meshes in order for the progress bar to update
    - TODO: I will need to either skip a frame, or force GUI to update meshes in order for the progress bar to update
-TODO - Might need to handle overwritting better when importing/moving 
+ - PROBABLY: PRojectLibrary should skip import into time slices (e.g. 16ms). If import took longer than 16ms wait till next
+   frame to continue. This was progress bar can update normally.
+ - TODO: The current import queue only deals with dependant resources. I should probably make it work even when
+   main resources are imported
+TODO - Might need to handle overwritting better when importing/moving
+ - When pasting generate a unique filename if the same one already exists
+ - Do the same when drag and dropping (either internal, or OS)
 
 
 Simple tasks:
 Simple tasks:
  - Hook up scene view drag and drop instantiation
  - Hook up scene view drag and drop instantiation
 
 
-Test:
- - Cut/Copy/Paste/Duplicate
-
 Later:
 Later:
  - Hook up ping effect so it triggers when I select a resource or sceneobject
  - Hook up ping effect so it triggers when I select a resource or sceneobject
   - Add ping to SceneTreeView
   - Add ping to SceneTreeView
  - Consider delaying search until user stops pressing keys
  - Consider delaying search until user stops pressing keys
+ - When interacting with directory bar the window should keep focus
 
 
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 Resources
 Resources