UETOOL-213 - Minimize Slate FString -> FText conversion (remove SLATE_TEXT_ATTRIBUTE)
This fixes any editor/engine specific code that was passing text to Slate as FString rather than FText.
[CL 2399803 by Jamie Dale in Main 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]
UETOOL-129 - Investigate SOutputLog performance degradation
FTextLayout::AddLine was causing a re-flow of the entire document when a new line was added. This change makes it only flow the line that is being added (providing the rest of the layout is already up-to-date).
ReviewedBy Justin.Sargent
[CL 2363200 by Jamie Dale in Main branch]
This was causing the focus to ultimately switch back to the widget that was already focused, however it was also causing IMEs to lose their current context. This force focus isn't needed, as the suggestions list is already set to not take focus when it's spawned.
[CL 2350270 by Jamie Dale in Main branch]
* 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]
- Window menu is now sectioned and labeled based on the current editor. There's now a local workspace root member in FTabManager and a workspace category in FAssetEditorToolkit (both are FWorkspaceItem objects). Individual editors attach their local category to the tab manager's local root. Workflow app modes have their own category members that are swapped out when the mode changes.
- Finally, the AssetEditorCategory of FWorkspaceMenuStructure has been removed entirely.
- Replaced the AddMenuSeparator() call in FTabManager::PopulateSpawnerMenu_Helper() with a section of the same title as the workspace category.
- Tab spawner menu entries for the local editor now properly show the icon of the associated tab. To accomplish this it was necessary to change FWorkflowTabFactory::TabIcon to be an FSlateIcon instead of an FSlateBrush*. All factory instances have been updated accordingly.
- Added & updated lots of icons! (those missing will be TTP'd)
- The nomad tab spawner section (named "General" in the menu) has been largely compressed into the Developer Tools submenu, which has also been organized into sections for readability.
- Unreal frontend options were also moved into a context menu within the General section
- Moved all experimental tools to their own section of the Window menu. When they're no longer experimental they should register as nomads in the appropriate category
- Undo history now under Edit menu
[CL 2324285 by Dan Hertzka in Main branch]
FOutputLogTextLayoutMarshaller::GetText wasn't implemented, so it was always returning an empty string. I've implemented this and verified that it doesn't cause any performance issues for the output log.
I had to change SMultiLineEditableText::LoadText to only do that when it was bound to a delegate, as that was causing a hitch while the output log was updated when you gave it focus.
I also fixed giving the output log focus sometimes jumping to the top of the log (SMultiLineEditableText::OnKeyboardFocusReceived needed the same fix as SMultiLineEditableText::OnKeyboardFocusLost to prevent the cursor jumping into focus).
ReviewedBy Justin.Sargent
[CL 2308259 by Jamie Dale in Main branch]
It wasn't actually needed as we're able to perform the scroll immediately in all cases we need to, rather than wait until the next Tick().
#codereview Max.Preussner
[CL 2306688 by Jamie Dale in Main branch]
1) The selected text colour is now easier on the eyes
2) The output log will always scroll to the end when you enter a command
3) The output log will now correctly scroll to the bottom when it is first opened (it forces the scrollbars to always visible to avoid the horizontal scrollbar being able to move the vertical scrollbar up slightly from the bottom of the log)
ReviewedBy Andrew.Rodham
[CL 2305438 by Jamie Dale in Main branch]
This is using a custom text marshaller to efficiently convert an FLogMessage into something understood by the FTextLayout.
ReviewedBy Justin.Sargent
[CL 2297960 by Jamie Dale in Main branch]
TTP# 345402 - CRITICAL: Regression: EDITOR: CRASH: Closing the editor
There was a static instance of SOutputLog being created, which was persisting beyond the lifespan of both Slate and ICU.
#codereview Justin.Sargent
[CL 2282175 by Jamie Dale in Main branch]