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]
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]