Commit Graph

387 Commits

Author SHA1 Message Date
Matt Kuhlenschmidt
375a2f18a6 Added support for materials to be used on Slate based fonts.
[CL 2588529 by Matt Kuhlenschmidt in Main branch]
2015-06-16 09:30:13 -04:00
Dmitry Rekman
eae52c65aa Linux: switch from LinuxNativeDialogs to SlateFileDialogs.
- Still experimental at this point.

#codereview Nick.Atamas, Matthew.Lewis, Josh.Adams

[CL 2587983 by Dmitry Rekman in Main branch]
2015-06-15 18:14:07 -04:00
Nick Darnell
3eb2f83b75 Slate - Small perf boost to clip rect transform code so that we're doing as few transforms as possible.
#codereview matt.kuhlenschmidt, nick.atamas, wes.hunt

[CL 2584692 by Nick Darnell in Main branch]
2015-06-11 14:51:39 -04:00
Richard Hinckley
f198304c7f Enum changes to improve documentation.
[CL 2584625 by Richard Hinckley in Main branch]
2015-06-11 14:11:12 -04:00
Nick Darnell
7df02678ad Slate - Continuing to refine the fixes to clipping in slate, no longer pixel snapping twice. Now snapping the points of the clip rect after transforming them. Then calculating the extents, but no longer snapping them as that would artifically inflate or even potentially shrink the bounding box.
#codereview matt.kuhlenschmidt, nick.atamas, wes.hunt

[CL 2584253 by Nick Darnell in Main branch]
2015-06-11 11:02:00 -04:00
Nick Darnell
b43c10a755 Slate - IT'S FIXED! No more clip rounding error in Slate causing the last column or row of pixels to sometimes get clipped incorrectly. In slate we do pixel snapping on each vertex individually, which means that a box that's at x.3 and extends to w.7, will visually rendered at x to (w+1). The clipping rect was determined in pre-vertex rounding space, the clip rect is represented as origin, extentsX and extentsY. The extents are all computed in pre-pixel snapping space, so a box that goes from x.3 to w.7, becomes an extents of z.4, and is then rounded down. Meaning that on certain pixel offsets, some boxes ended up with an extents that is 1 pixel smaller from the visual version where each vertex is rounded individually. The solution is to perform pixel snapping on the axis aligned clipping rect, which is then used to create the rotated clip rect which is formed with the extents, then to transform it, and again pixel snap.
Also removing the option to use halfs for clipping data when sending it to the pixel shader as it doesn't make a ton of sense to keep this codepath available after discussing it with the others working on Slate.

#codereview matt.kuhlenschmidt nick.atamas wes.hunt

[CL 2583548 by Nick Darnell in Main branch]
2015-06-10 18:48:52 -04:00
Nick Darnell
d3a71caef3 Slate - Disabling the float16 precision version of the slate shader on all platforms. Since the clip values are all in window space, it's terribly easy on modern monitors to exceed single digit precision (2048), causing multiple columns worth of additional pixel clipping erroneously. Tweaking the way we pass that down to the vertex shader for compile so that it now properly algins with whatever we set the option to in C++. We can consider turning it on for platforms where it wont matter, like the consoles 1920 will be your largest visible value.
#codereview matt.kuhlenschmidt nick.atamas

[CL 2582065 by Nick Darnell in Main branch]
2015-06-09 19:05:11 -04:00
Justin Sargent
273cde1704 Merging using UE4-To-UE4-LauncherDev
#platformnotify Josh.Adams

[CL 2581810 by Justin Sargent in Main branch]
2015-06-09 16:41:53 -04:00
Andrew Brown
b9a44148d3 [INTEGRATE] merge ue4<-ue4-launcherDev cl 2581195
[CL 2581266 by Andrew Brown in Main branch]
2015-06-09 10:30:29 -04:00
Chris Wood
8a112d6140 PushMenu() now respects QueryPopupMethod(). All menus now support reusing windows.
UE-14641 - Fix PushMenu() to use QueryPopupMethod()

Pretty big refactor
Adds IMenu as way to identify menus. Replaces referring to menus as SWindows.
Lots of uses of PushMenu() fixed up to match new API

#codereview Nick.Atamas

[CL 2579277 by Chris Wood in Main branch]
2015-06-05 20:19:33 -04:00
Jamie Dale
23592d149c Converted FUIAction to use ECheckBoxState when reporting its check state
There are now overloads to FUIAction that take a FGetActionCheckState delegate which is able to return any of the entries from ECheckBoxState. FIsActionChecked still exists for backwards compatibility, and converts the returned bool into a ECheckBoxState via a passthrough function.

#codereview Matt.Kuhlenschmidt

[CL 2570717 by Jamie Dale in Main branch]
2015-05-29 12:57:25 -04:00
Nick Darnell
4c0b7e1e63 Slate - Little code cleanup removing some unused variables.
[CL 2567627 by Nick Darnell in Main branch]
2015-05-27 18:42:07 -04:00
Matt Kuhlenschmidt
96caf16b7b Fixed font measuring crashing when attempting to measure an empty string
[CL 2567299 by Matt Kuhlenschmidt in Main branch]
2015-05-27 16:25:58 -04:00
Lee Clark
3a2a555110 Fix initalization order
[CL 2562550 by Lee Clark in Main branch]
2015-05-22 10:08:30 -04:00
Nick Darnell
db78503230 UMG - The slatebrush's ResourceObject property is no longer directly accessible in a blueprint. You'll need to use the functions, GetBrushResource, SetBrushResourceToTexture, and SetBrushResourceToMaterial to change the value.
#APIBreak

[CL 2562526 by Nick Darnell in Main branch]
2015-05-22 09:56:12 -04:00
Matt Kuhlenschmidt
afcb67680f Optimized the element batcher to perform less memory allocations per frame and pass off some processing to the render thead earlier to avoid additional memcopy's
- The Slate RHI renderer now uses a larger upfront pool for vertex buffers to avoid many upfront recreations of the vertex buffers
- The window element lists are no longer destroyed each frame and are reused as long as the window that they reference exists.  This reduces memory allocations because arrays are no longer destroyed
- Creation of the final rendering batches has now been moved to the rendering thread
- The mapping of layers to element batch arrays has been simplified and is no longer emptied each frame thus avoiding memory allocations

[CL 2560820 by Matt Kuhlenschmidt in Main branch]
2015-05-21 10:48:33 -04:00
Nick Atamas
b4118bfb2e #Slate Removed unnecessary use of Geometry.AbsolutePosition
#codereview Wes.Hunt

[CL 2559303 by Nick Atamas in Main branch]
2015-05-20 14:47:12 -04:00
Jamie Dale
c4593880ee Fixed a discrepancy between the scale passed to SlatePrepass and the scale used when rendering.
This was caused by SWindow applying the application scale twice.

ReviewedBy Nick.Atamas

[CL 2557099 by Jamie Dale in Main branch]
2015-05-19 11:22:57 -04:00
Justin Sargent
dc2c4f1dc0 Added logic to enforce the min window size when calling Resize on the window.
Merging using UE4-To-UE4-LauncherDev

[CL 2556007 by Justin Sargent in Main branch]
2015-05-18 17:55:43 -04:00
Jamie Dale
81c3fb6177 Removed the animation from SEditableText so that Slate can sleep
UE-11632 - Make SEditableText sleep-friendly.

SEditableText used to have spring animations for moving the caret and changing the selection, however these animations required the editable text to keep Slate active while they had focus in order to smoothly update the animation.

These animations have been removed, and the only ticking the editable text now needs to do is to blink the cursor (which is a much coarser animation). This also brings the look-and-feel of SEditableText and SMultiLineEditableText closer together, as the latter has never used these spring animations.

[CL 2555414 by Jamie Dale in Main branch]
2015-05-18 13:23:14 -04:00
Jamie Dale
256fd8f3cb Activating a window now sets focus for all users
UE-14833 - Cannot get input from input device without Controller already being created

FSceneViewport used to require you to click on it after alt-tabbing away from the game so that you got focus back for all users (as FSceneViewport::OnMouseButtonDown claimed focus for all users). This was due to the window re-activation only claiming focus for the keyboard user.

ReviewedBy Chris.Gagnon

[CL 2552411 by Jamie Dale in Main branch]
2015-05-15 07:12:35 -04:00
Chris Gagnon
4506889aaa APlayerController now respects Slate UI when generating it's Mouse Enter and Leave events.
Merging using UE4-Fortnite-To-UE4

[CL 2551376 by Chris Gagnon in Main branch]
2015-05-14 16:35:16 -04:00
Matt Kuhlenschmidt
763676bdc1 Added some missing slate stats and renamed a few slate stats
[CL 2551057 by Matt Kuhlenschmidt in Main branch]
2015-05-14 14:26:55 -04:00
Jamie Dale
2c4112bd6c Fixed a regression caused by CL# 2537219
UE-15050 - black edge padding around message windows

We now only adjust the client size given to SWindow::Resize if we're using a window to which we've added window decorations (ie, a regular window). This avoids us inflating the size of tooltip and popup windows.

#codereview Graeme.Thornton

[CL 2550919 by Jamie Dale in Main branch]
2015-05-14 12:35:35 -04:00
Andrew Rodham
fb032c66cc Fixed slate application focus not being applied correctly when activating windows
There are 2 issues at play here:
    * When setting the keyboard focus to a particular widget, it was possible for a widget to forward this focus onto another widget (inside SWidget::OnFocusReceived, called from FSlateApplication::SetUserFocus). If this handler returned an FReply that also set the user focus, the window's WidgetToFocusOnActivate would end up not being set to the correct widget. We now set WidgetToFocusOnActivate *before* invoking the focus received handler to ensure that the widget is set in the correct order.

    * WidgetToFocusOnActivate is now entirely managed by SWindow, and handled only through window activation, rather than forcing keyboard focus to the window, and having the OnReceivedFocus handler focussing WidgetToFocusOnActivate. This prevents widgets temporarily losing focus when windows are activated (particularly things like editable text blocks that will close edit operations when focus is lost).

This addresses UE-14872 - Unable to name Variables upon creation

Reviewed by Matt Kuhlenschmidt

[CL 2547704 by Andrew Rodham in Main branch]
2015-05-12 15:38:25 -04:00