Commit Graph

13 Commits

Author SHA1 Message Date
Matthew Griffin
b72d8c4683 [INTEGRATE] Change 2432062 by Jamie.Dale@Pitbull_JDaleReleases on 2015/02/04 13:56:41
Improved and unified the folder drag and drop validation in the Content Browser

	UE-9025 - User gets green check mark when trying to move class into content folder

	The Content Browser folder drag and drop validation had not been updated to handle class folders. This meant that it was possible to crash the editor by dragging class folders around, and also meant that you were given misinformation when trying to copy a class around.

	I've unified all the duplicated logic from SPathView, SAssetView, SAssetTreeItem, and SAssetViewItem into utility functions inside a new DragDropHandler in the Content Browser. This class correctly validates that you can only interact with assets and asset paths, but doesn't outright prevent you being able to include classes and class paths in your drag operations (it just warns you about them, and the strips them out of the drop lists).

[CL 2438229 by Matthew Griffin in Main branch]
2015-02-09 11:42:01 -05:00
Ben Marsh
09467b3147 [INTEGRATE] Change 2418662 by Jamie.Dale@Pitbull_JDaleReleases on 2015/01/26 11:12:12
Added a "C++" overlay for C++ source code folders in SPathView

	UE-7184 - Show game c++ classes and engine c++ classes in the content browser

[CL 2419743 by Ben Marsh in Main branch]
2015-01-26 20:22:53 -05:00
Jamie Dale
55c3728d11 Added support for showing game and engine classes in the Content Browser
UE-7184 - Show game c++ classes and engine c++ classes in the content browser

The Content Browser now has extra entries for "Game C++ Classes" and "Engine C++ Classes" (with "Game" and "Engine" being renamed to "Game Content" and "Engine Content" respectively). These new folders serve as hosts for the list of available C++ modules, with each module internally mirroring the folder structure on disk.

For example:
- Game C++ Classes
    - ShooterGame
        - Classes
            - Bots
                - ShooterBot
                - ShooterAIController
                - [...]
            - [...]

The Content Browser allows you to navigate and search these classes like you can with assets, and provides convenient access to either edit an existing class, or create a new class (either within a selected folder, or derived from a selected class).

As the Content Browser only shows you known UClass types, any new classes need to be compiled into a loaded module before they will appear. This means that adding a new class will now automatically hot-reload your target module. Should you prefer to handle building and loading your modules manually, you can disable the automatic hot-reload via "Editor Settings" -> "Miscellaneous" -> "Hot Reload" -> "Automatically Hot Reload New Classes" (see UEditorUserSettings::bAutomaticallyHotReloadNewClasses).

[CL 2409386 by Jamie Dale in Main branch]
2015-01-16 15:39:47 -05:00
Steve Robb
0756ef15b9 Delegate comparisons deprecated, lots of other associated code deprecated, and lots of warning fixups:
* Multicast delegate Add* calls now return FDelegateHandles, and Remove* calls are now all deprecated, except for a new Remove function which takes a FDelegateHandle.
* New FConsoleManager::RegisterConsoleVariableSink_Handle and UnregisterConsoleVariableSink_Handle functions which work in terms of FConsoleVariableSinkHandle.
* Timer calls which don't take FTimerHandles are deprecated.
* FTicker::AddTicker now returns an FDelegateHandle and is removed by an overloaded Remove function.
* DEFINE_ONLINE_DELEGATE* macros now define _Handle variants of the Add/Remove functions which return/take handles.
* Various other handle-based registration changes.
* Some unity build fixes.
* Some simplification of delegate code.
* Fixes for lots of existing code to use handle-based registration and unregistration.

#codereview robert.manuszewski

[CL 2400883 by Steve Robb in Main branch]
2015-01-08 09:29:27 -05:00
Dan Hertzka
c042ddcb94 ---- Merging with SlateDev branch ----
Introduces the concept of "Active Ticking" to allow Slate to go to sleep when there is no need to update the UI.

While asleep, Slate will skip the Tick & Paint pass for that frame entirely.
- There are TWO ways to "wake" Slate and cause a Tick/Paint pass:
    1. Provide some sort of input (mouse movement, clicks, and key presses). Slate will always tick when the user is active.
        - Therefore, if the logic in a given widget's Tick is only relevant in response to user action, there is no need to register an active tick.
    2. Register an Active Tick. Currently this is an all-or-nothing situation, so if a single active tick needs to execute, all of Slate will be ticked.

- The purpose of an Active Tick is to allow a widget to "drive" Slate and guarantee a Tick/Paint pass in the absence of any user action.
    - Examples include animation, async operations that update periodically, progress updates, loading bars, etc.

- An empty active tick is registered for viewports when they are real-time, so game project widgets are unaffected by this change and should continue to work as before.

- An Active Tick is registered by creating an FWidgetActiveTickDelegate and passing it to SWidget::RegisterActiveTick()
    - There are THREE ways to unregister an active tick:
        1. Return EActiveTickReturnType::StopTicking from the active tick function
        2. Pass the FActiveTickHandle returned by RegisterActiveTick() to SWidget::UnregisterActiveTick()
        3. Destroy the widget responsible for the active tick

- Sleeping is currently disabled, can be enabled with Slate.AllowSlateToSleep cvar
- There is currently a little buffer time during which Slate continues to tick following any input. Long-term, this is planned to be removed.
    - The duration of the buffer can be adjusted using Slate.SleepBufferPostInput cvar (defaults to 1.0f)

- The FCurveSequence API has been updated to work with the active tick system
    - Playing a curve sequence now requires that you pass the widget being animated by the sequence
    - The active tick will automatically be registered on behalf of the widget and unregister when the sequence is complete
    - GetLerpLooping() has been removed. Instead, pass true as the second param to Play() to indicate that the animation will loop. This causes the active tick to be registered indefinitely until paused or jumped to the start/end.

[CL 2391669 by Dan Hertzka in Main branch]
2014-12-17 16:07:57 -05:00
Ben Marsh
149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00
Jamie Dale
dd020dea5c Fixed code relying on SLATE_TEXT_ATTRIBUTE for SToolTip
Made sure everything was using FText rather than FString.

[CL 2373727 by Jamie Dale in Main branch]
2014-12-02 10:22:37 -05:00
Wes Hunt
31e2bb00ac Removed a bunch of stuff from Slate standard include, created SlateBasics.h
* Moved Slate.h into SlateBasics.h and began shifting less commonly used headers into SlateExtras.h.
* Slate.h now simply includes SlateBasics.h and SlateExtras.h.
* Slate.h includes a deprecated warning now to indicate that SlateBasics.h + specific includes should be used instead.
* Moved dozens of inlined functions using Slate widgets into .cpp files to avoid header dependencies.
* All code samples now include SlateBasics.h and SlateExtras.h so future shifts will not break most those projects, but not trigger the deprecation warning of including Slate.h.
#BUN

[CL 2329610 by Wes Hunt in Main branch]
2014-10-14 22:50:06 -04:00
Andrew Brown
1b2040bf7b Folder Rename can now be done in the Content Browser Path View
#ttp 342267 - Editor Usability: Select a folder in Content Browser and pressing F2 to rename it, triggers a rename of an actor or asset instead!

#branch UE4

SContentBrowser
Added functions for Can/Execute Rename/Delete which forward to the active context menu
Moved Rename/Delete bind commands to the content browser, so it can forward the request to the correct context menu
(this was necessary as it wasn't possible to bind to both context menus without the code complaining about it already being bound)
Modified GetFolderContextMenu to take an extra param to indicate whether it was the path view or asset view which called it - it then uses this to clear the asset view selection when the path view context menu is requested - we can then use the selection information to determine which context menu was opened later on when processing rename/delete (ideally it should clear when the path view recieves focus, but that's harder to determine).

FAssetContextMenu
Made Can/Execute Rename/Delete public - so they can be called by the Content Browser
Removed BindCommands as it's no longer needed
Removed condition for adding Rename to the menu, as it now always is and is greyed out if not possible.

FPathContextMenu
Added delegate for when rename folder is requested - the same as FAssetContextMenu
Added handling for whether folder renaming is possible, and executing.
Removed condition for adding Rename to the menu, as it now always is and is greyed out if not possible.
Fixed issue with Delete not mapping to keyboard shortcut

SPathView
Added function to rename folder (similar to SAssetView)
Fixed issue with VerifyFolderNameChanged not generating the correct path when checking to see if a folder exists (it was previous just checking to old path - which would always return true).
Modified FolderNameChanged to take 'OldPath' as a param (inline with the delegate change). This function is called when a folder is created or renamed... if it's the latter it has to handle moving the contents of the folder to the new location, which it could only do if it knew where the previous location was (again, similar to SAssetView)

SAssetTreeItem
Added extra param to FOnNameChanged (OldPath) - so we can move assets when a folder is renamed

FTreeItem
Renamed variable bNewFolder to bNamingFolder - as it's true whenever the folder is being named, not just when it's new

reviewed by Thomas.Sarkanen

[CL 2239648 by Andrew Brown in Main branch]
2014-08-01 05:51:26 -04:00
Jamie Dale
4dd8fa6bf4 #ttp 331051 - EDITOR: Can we extend the Set Color on folder functionality in the content browser to Collections as well?
#proj UE4
#branch UE4
#summary Collections now store and display a custom colour based on the local user settings
#extra This works the same was as it does for folders.
#reviewedby Thomas.Sarkanen, Max.Preussner

[CL 2043079 by Jamie Dale in Main branch]
2014-04-23 18:13:40 -04:00
Andrew Rodham
07b90d1da2 #ttp 331268 - SLATE: Replace instances of DragDrop::IsTypeMatch with FDragDropEvent::GetOperationAs()
#summary  Replaced instances of DragDrop::IsTypeMatch with FDragDropEvent::GetOperationAs()
#note Please change any instances of DragDrop::IsTypeMatch for the templated FDragDropEvent::GetOperationAs<>() or FDragDropOperation::IsOfType<>() where necessary
#proj Editor
#branch UE4
#reviewedby Nick.Atamas

[CL 2042222 by Andrew Rodham in Main branch]
2014-04-23 18:00:50 -04:00
Nick Darnell
b96d695522 * FDragDropOperation now inherits from TSharedFromThis, no need to do it on subclasses any more. I've removed it from the subclasses that were also doing it.
* FDecoratedDragDropOp's Hover text is now FText, instead of FString.

[CL 2041690 by Nick Darnell in Main branch]
2014-04-23 17:55:20 -04:00
Tim Sweeney
324683ce78 Engine source (Main branch up to CL 2026164) 2014-03-14 14:13:41 -04:00