You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3219796 on 2016/12/02 by Rolando.Caloca DR - vk - Increase timeout to 60ms Change 3219884 on 2016/12/02 by Daniel.Wright Assert to help track down rare crash locking capsule indirect shadow vertex buffer Change 3219885 on 2016/12/02 by Daniel.Wright Fixed saving a package that doesn't exist on disk but exists in p4 at a newer revision when the user chooses 'Mark Writable' Change 3219886 on 2016/12/02 by Daniel.Wright Don't create projected shadows when r.ShadowQuality is 0 * Fixes crash in the forward path trying to render shadows * In the deferred path, the shadowmap was still being rendered and only the projection skipped, now all cost will be skipped Change 3219887 on 2016/12/02 by Daniel.Wright Changed ClearRenderTarget2D default alpha to 1, which is necessary for correct compositing Change 3219893 on 2016/12/02 by Daniel.Wright AMD AGS library with approved TPS Disabled DFAO on AMD pre-GCN PC video cards to workaround a driver bug which won't be fixed (Radeon 6xxx and below) Change 3219913 on 2016/12/02 by Daniel.Wright Level unload of a lighting scenario propagates the lighting scenario change - fixes crash when precomputed lighting volume data gets unloaded Change 3220029 on 2016/12/02 by Daniel.Wright Async shader compiling now recreates scene proxies which are affected by the material which was compiled. This fixes crashes which were occuring as proxies cache various material properties, but applying compiled materials would not update these cached properties (bRequiresAdjacencyInformation). * A new ensure has been added in FMeshElementCollector::AddMesh and FBatchingSPDI::DrawMesh to catch attempts to render with a material not reported in GetUsedMaterials * Fixed UParticleSystemComponent::GetUsedMaterials and UMaterialBillboardComponent::GetUsedMaterials * FMaterialUpdateContext should be changed to use the same pattern, but that hasn't been done yet Change 3220108 on 2016/12/02 by Daniel.Wright Fixed shadowmap channel assignment for stationary lights which are not in a lighting scenario level, when a lighting scenario level is present Change 3220504 on 2016/12/03 by Mark.Satterthwaite Metal Desktop Tessellation support from Unicorn. - Apple: Metal tessellation support added to MetalShaderFormat, MetalRHI and incl. changes to engine runtime/shaders for Desktop renderer and enabled in ElementalDemo by default (OS X 10.11 will run SM4). - Epic: Support for different Metal shader standards on Mac, iOS & tvOS which required moving some RHI functions around as this is a project setting and not a compile-time constant. - Epic: Fragment shader UAV support, which is also tied to newer Metal shader standard like Tessellation. - Epic: Significant refactor of MetalRHI's internals to clearly separate state-caching from render-pass management and command-encoding. - Epic: Internal MetalRHI validation code is now cleanly separated out into custom implementations of the Metal @protocol's and is on by default. - Epic: Various fixes to Layered Rendering for Metal. - Omits Mobile Tessellation support which needs further revision. Change 3220881 on 2016/12/04 by Mark.Satterthwaite Compiles fixes for iOS & static analysis fixes from Windows. Change 3221180 on 2016/12/05 by Guillaume.Abadie Avoid compiling PreviousFrameSwitch's both Current Frame and Previous Frame inputs every time. Change 3221217 on 2016/12/05 by Chris.Bunner More NVAPI warning fixups. Change 3221219 on 2016/12/05 by Chris.Bunner When comparing overriden properties used to force instance recompilation we need to check against the base material, not assume the immediate parent. #jira UE-37792 Change 3221220 on 2016/12/05 by Chris.Bunner Exported GetAllStaticSwitchParamNames and GetAllStaticComponentMaskParamNames. #jira UE-35132 Change 3221221 on 2016/12/05 by Chris.Bunner PR #2785: Fix comment typo in RendererInterface.h (Contributed by dustin-biser) #jira UE-35760 Change 3221223 on 2016/12/05 by Chris.Bunner Default to include dev-code when compiling material preview stats. #jira UE-20321 Change 3221534 on 2016/12/05 by Rolando.Caloca DR - Added FDynamicRHI::GetName() Change 3221833 on 2016/12/05 by Chris.Bunner Set correct output extent on PostProcessUpscale (allows users to extend chain correctly). #jira UE-36989 Change 3221852 on 2016/12/05 by Chris.Bunner 32-bit/ch EXR screenshot and frame dump output. Fixed row increment bug in 128-bit/px surface format readback. #jira UE-37962 Change 3222059 on 2016/12/05 by Rolando.Caloca DR - vk - Fix memory type not found Change 3222104 on 2016/12/05 by Rolando.Caloca DR - Lambdaize - Added quicker method to check if system textures are initialized Change 3222290 on 2016/12/05 by Mark.Satterthwaite Trivial fixes to reporting Metal shader pipeline errors - need to check if Hull & Domain exist. Change 3222864 on 2016/12/06 by Rolando.Caloca DR - Fix mem leak when exiting Change 3222873 on 2016/12/06 by Rolando.Caloca DR - vk - Minor info to help track down leaks Change 3222875 on 2016/12/06 by Rolando.Caloca DR - Fix mem leak with VisualizeTexture #jira UE-39360 Change 3223226 on 2016/12/06 by Chris.Bunner Static analysis warning workaround. Change 3223235 on 2016/12/06 by Ben.Woodhouse Integrate from NREAL: Set a custom projection matrix on a SceneCapture2D Change 3223343 on 2016/12/06 by Chris.Bunner Moved HLOD persistent data to viewstate to fix per-view compatability. #jira UE-37539 Change 3223349 on 2016/12/06 by Chris.Bunner Fixed HLOD with FreezeRendering command. #jira UE-29839 Change 3223371 on 2016/12/06 by Michael.Trepka Removed obsolete check() in FMetalSurface constructor Change 3223450 on 2016/12/06 by Chris.Bunner Added explicit ScRGB output device selection rather than Nvidia-only hardcoded checks. Allows easier support for Mac and other devices moving forward. Change 3223638 on 2016/12/06 by Michael.Trepka Restored part of the check() in FMetalSurface constructor removed in CL 3223371 Change 3223642 on 2016/12/06 by Mark.Satterthwaite Experimental Metal EDR/HDR output support for Mac (iOS/tvOS need custom formats & shaders so they are not supported yet). - Only available on macOS Sierra (10.12) for Macs with HDR displays (e.g. Retina iMacs). - Enable with -metaledr command-line argument as it is off-by-default. - Sets up the CAMetalLayer & the back-buffer for RGBA_FP16 output on Mac using DCI-P3 as the color gamut and ACES 1000 nit ScRGB output encoding. Change 3223830 on 2016/12/06 by Rolando.Caloca DR - vk - Better error when finding an invalid Vulkan driver #jira UE-37495 Change 3223869 on 2016/12/06 by Rolando.Caloca DR - vk - Reuse fences Change 3223906 on 2016/12/06 by Guillaume.Abadie Fix alpha through TempAA artifact causing a small darker edge layouts. Change 3224199 on 2016/12/06 by Mark.Satterthwaite Fix a dumb copy-paste error from the HDR changes to Metal. Change 3224220 on 2016/12/06 by Mark.Satterthwaite Fix various errors with Metal UAV & Render-Pass Restart support so that we can use the Pixel Shader culling for DistanceField effects. - Unfortunately Metal requires that a texture be bound to start a render-pass, so reuse the dummy depth-stencil surface from the problematic editor preview tile rendering. Change 3224236 on 2016/12/06 by Mark.Satterthwaite IWYU CIS compile fix for iOS. Change 3224366 on 2016/12/06 by Mark.Satterthwaite Simplify some of the changes from CL# 3224220 so that we don't perform unnecessary clears. - If the RenderPass is broken to issue compute or blit operations then treat the cached RenderTargetsInfo as invalid, unless the RenderPass is restarted. - This guarantees that we don't erroneously ignore calls to SetRenderTargets if the calling code issues a dispatch between two RenderPasses that use the same RenderTargetsInfo. Change 3224416 on 2016/12/06 by Uriel.Doyon New default implementation for UPrimitiveComponent::GetStreamingTextureInfo using a conservative heuristic where the textures are stretched across the bounds. Optimized UPrimitiveComponent::GetStreamingTextureInfoWithNULLRemoval by not handling registered components with no proxy (essentially hidden game / collision primitives). Added blueprint support for texture streaming built data through FStaticMeshComponentInstanceData. Fix for material texture streaming data not being available on some cooked builds. Enabled split requests on all texture load requests (first loading everything visible and then loaded everything not visible). This is controlled by "r.Streaming.MinMipForSplitRequest" which defines the minimum mip for which to allow splitting. Forced residency are now loaded in two steps (visible, then forced), improving reactiveness. Updated "stat streaming" to include "UnkownRefMips" which represent texture with no known component referencing them, and also "LastRenderTimeMips" which related to timed primitives. Changed "Forced Mips" so that it only shows mips that are loaded become of forced residency. "Texture Streaming Build" now updates the map check after execution. Removed Orphaned texture logic as this has become irrelevant with the latest retention priority logic. Updated "r.streaming.usenewmetrics" so that it shows behavior before and after 4.12 improvements. Change 3224532 on 2016/12/07 by Uriel.Doyon Integrated CL 3223965 : Building texture streaming data for materials does not wait for pending shaders to finish compilation anymore. Added more options to allow the user to cancel this build also. Change 3224714 on 2016/12/07 by Ben.Woodhouse Cherry pick CL 3223972 from //fortnite/main: Disable Geometry shader onchip on XB1. This saves 4ms for a single shadow casting point light @ 512x512 (4.8ms to 1.8ms) Change 3224715 on 2016/12/07 by Ben.Woodhouse New version of d3dx12.h from Microsoft which incorporates my suggested static analysis fixes. This avoids us diverging from the official version Change 3224975 on 2016/12/07 by Rolando.Caloca DR - vk - Dump improvements Change 3225012 on 2016/12/07 by Rolando.Caloca DR - Show warning if trying to use num samples != (1,2,4,8,16) Change 3225126 on 2016/12/07 by Chris.Bunner Added 'force 128-bit rendering pipeline' to high-res screenshot tool. #jira UE-39345 Change 3225449 on 2016/12/07 by Chris.Bunner Updated engine rendering defaults to better match current best practices. #jira UE-38081 Change 3225485 on 2016/12/07 by Chris.Bunner Moved QuantizeSceneBufferSize to RenderCore and added call for PostProcess settings. Fixes screenpercentage out-of-bounds reads in some cases. #jira UE-19394 Change 3225486 on 2016/12/07 by Chris.Bunner Only disable TAA during HighResScreenshots if we don't have a reasonable frame-delay enabled. Change 3225505 on 2016/12/07 by Daniel.Wright Fixed exponential height fog disappearing with no skybox Change 3225655 on 2016/12/07 by Benjamin.Hyder Updating TM-Shadermodels to include Translucent lighting, Two sided, updated cloth animation, and adjusted lighting. Change 3225668 on 2016/12/07 by Chris.Bunner Dirty owning packages when user manually forces regeneration of all reflection captures. #jira UE-38759 Change 3226139 on 2016/12/07 by Rolando.Caloca DR - Fix recompute tangents disabling skin cache - Make some macros into lambdas #jira UE-39143 Change 3226212 on 2016/12/07 by Daniel.Wright Features which require a full prepass use DDM_AllOpaque instead of DDM_AllOccluders, which can be skipped if the component has bUseAsOccluder=false Change 3226213 on 2016/12/07 by Daniel.Wright Scene Capture 2D can specify a global clip plane, which is useful for portals * Requires the global clip plane project setting to be enabled Change 3226214 on 2016/12/07 by Daniel.Wright Improved deferred shadowing with MSAA by upsampling light attenuation intelligently in the base pass * If the current fragment's depth doesn't match what was used for deferred shadowing, the neighbor (cross pattern) with the nearest depth's shadowing is used * Edge artifacts can still occur where the upsample fails or the shadow factor was computed per-sample due to depth / stencil testing * Indirect Occlusion from capsule shadows also uses the nearest depth neighbor UV for no extra cost * Base pass on 970 GTX 1.69ms -> 1.85ms (.16ms) in RoboRecall Change 3226258 on 2016/12/07 by Rolando.Caloca DR - Typo fix Change 3226259 on 2016/12/07 by Rolando.Caloca DR - compile fix #jira UE-39143 Change 3226932 on 2016/12/08 by Chris.Bunner Re-saved Infiltrator maps to update reflection captures. #jira UE-38759 Change3227063on 2016/12/08 by Mark.Satterthwaite For Metal platforms ONLY temporarily disable USE_LIGHT_GRID_REFLECTION_CAPTURE_CULLING to avoid UE-37436 while the Nvidia driver team investigate why this doesn't work for them but does for the others. This won't affect non-Metal platforms and the intent is to revert this prior to 4.16 provided we can work through the problem with Nvidia. #jira UE-37436 Change 3227120 on 2016/12/08 by Gil.Gribb Merging //UE4/Dev-Main@3226895 to Dev-Rendering (//UE4/Dev-Rendering) Change 3227211 on 2016/12/08 by Arne.Schober DR - UE-38585 - Fixing crash where HierInstStaticMesh duplication fails. Also reverting the fix from UE-28189 which is redundant. Change 3227257 on 2016/12/08 by Marc.Olano Extension to PseudoVolumeTexture for more flexible layout Change by ryan.brucks Change 3227286 on 2016/12/08 by Rolando.Caloca DR - Fix crash when using custom expressions and using reserved keywords #jira UE-39311 Change3227376on 2016/12/08 by Mark.Satterthwaite Must not include a private header inside the MenuStack public header as that causes compile errors in plugins. Change 3227415 on 2016/12/08 by Mark.Satterthwaite Fix shader compilation due to my disabling of USE_LIGHT_GRID_REFLECTION_CAPTURE_CULLING on Metal - InstancedCompositeTileReflectionCaptureIndices needs to be defined even though Metal doesn't support instanced-stereo rendering. Change 3227516 on 2016/12/08 by Daniel.Wright Implemented UWidgetComponent::GetUsedMaterials Change 3227521 on 2016/12/08 by Guillaume.Abadie Fixes post process volume's indirect lighting color. #jira UE-38888 Change 3227567 on 2016/12/08 by Marc.Olano New upscale filters: Lanczos-2 (new default), Lanczos-3 and Gaussian Unsharp Mask Change 3227628 on 2016/12/08 by Daniel.Wright Removed redundant ResolveSceneDepthTexture from the merge Change 3227635 on 2016/12/08 by Daniel.Wright Forward renderer supports shadowing from movable lights and light functions * Only 4 shadow casting movable or stationary lights can overlap at any point in space, otherwise the movable lights will lose their shadows and an on-screen message will be displayed * Light functions only work on shadow casting lights since they need a shadowmap channel to be assigned Change 3227660 on 2016/12/08 by Rolando.Caloca DR - vk - Fix r.MobileMSAA on Vulkan - r.MobileMSAA is now read-only (to be fixed on 4.16) - Show time for PSO creation hitches #jira UE-39184 Change3227704on 2016/12/08 by Mark.Satterthwaite Fix Mac HDR causing incorrect output color encoding being used, HDR support is now entirely off unless you pass -metaledr which will enable it regardless of whether the current display supports HDR (as we haven't written the detection code yet). Fixed the LUT/UI compositing along the way - Mac Metal wasn't using volume LUT as it should have been, RHISupportsVertexShaderLayer now correctly returns false for non-Mac Metal platforms. Change 3227705 on 2016/12/08 by Daniel.Wright Replaced built-in samplers in the nearest depth translucency upsample because the built-in samplers are no longer bound on PC (cl 2852426) Change 3227787 on 2016/12/08 by Chris.Bunner Added extent clear to motion blur pass to catch misized buffers bringing in errors. Added early out to clear call when excluded region matches RT region. #jira UE-39437 Change 3228177 on 2016/12/08 by Marc.Olano Fix DCC sqrt(int) error Change 3228285 on 2016/12/08 by Chris.Bunner Back out changelist 3225449. #jira UE-39528 Change 3228680 on 2016/12/09 by Gil.Gribb Merging //UE4/Dev-Main@3228528 to Dev-Rendering (//UE4/Dev-Rendering) Change 3228940 on 2016/12/09 by Mark.Satterthwaite Editor fixes for 4.15: - PostProcessTonemap can't fail to bind a texture to the ColorLUT or the subsequent rendering will be garbage: the changes for optimising stereo rendering forgot to account for the Editor's use of Views without States for the asset preview thumbnails. Amended the CombineLUT post-processing to allocate a local output texture when there's no ViewState and read from this when this situation arises which makes everything function again. - Don't start render-passes without a valid render-target-array in MetalRHI. Change 3228950 on 2016/12/09 by Mark.Satterthwaite Make GPUSkinCache run on Mac Metal - it wasn't working because it was forcibly disabled on all platforms but for Windows D3D 11. - Fixed the Skeleton editor tree trying to access a widget before it has been constructed. - Enable GPUSkinCache for Metal SM5: doesn't render correctly, even on AMD, so needs Radar's filing and investigation. #jira UE-39256 Change 3229013 on 2016/12/09 by Mark.Satterthwaite Further tidy up in SSkeletonTreeView as suggested by Nick.A. Change 3229101 on 2016/12/09 by Chris.Bunner Log compile error fix and updated cvar comments. Change 3229236 on 2016/12/09 by Ben.Woodhouse XB1 D3D11 and D3D12: Use the DXGI frame statistics to get accurate GPU time unaffected by bubbles Change 3229430 on 2016/12/09 by Ben.Woodhouse PR #2680: Optimized histogram generation. (Contributed by PjotrSvetachov) Profiled on nvidia 980GTX (2x faster), and on XB1 (marginally faster) Change3229580on 2016/12/09 by Marcus.Wassmer DepthBoundsTest for AMD. Change 3229701 on 2016/12/09 by Michael.Trepka Changed "OS X" to "macOS" in few places where we display it and updated the code that asks users to update to latest version to check for 10.12.2 Change 3229706 on 2016/12/09 by Chris.Bunner Added GameUserSettings controls for HDR display output. Removed Metal commandline as this should replace the need for it. Change 3229774 on 2016/12/09 by Michael.Trepka Disabled OpenGL on Mac. -opengl is now ignored, we always use Metal. On old Macs that do not support Metal we show a message saying that the app requires Metal and exit. Change 3229819 on 2016/12/09 by Chris.Bunner Updated engine rendering defaults to better match current best practices. #jira UE-38081 Change 3229948 on 2016/12/09 by Rolando.Caloca DR - Fix d3d debug error #jira UE-39589 Change 3230341 on 2016/12/11 by Mark.Satterthwaite Don't fatally assert that the game-thread stalled waiting for the rendering thread in the Editor executable, even when running -game as the rendering thread can take a while to respond if shaders need to be compiled. #jira UE-39613 Change 3230860 on 2016/12/12 by Marcus.Wassmer Experimental Nvidia AFR support. Change 3230930 on 2016/12/12 by Mark.Satterthwaite Disable RHICmdList state-caching on Mac - Metal already does this internally and depends on receiving all state changes in order to function. Change 3231252 on 2016/12/12 by Marcus.Wassmer Fix NumGPU detection. (SLI only crash) Change 3231486 on 2016/12/12 by Mark.Satterthwaite Fix a stupid mistake in MetalStateCache::CommitResourceTable that would unnecessarily rebind samplers. Change 3231661 on 2016/12/12 by Mark.Satterthwaite Retain the RHI samplers in MetalRHI to guarantee lifetime. [CL 3231696 by Gil Gribb in Main branch]
427 lines
20 KiB
C++
427 lines
20 KiB
C++
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Input/PopupMethodReply.h"
|
|
#include "Framework/Application/IMenu.h"
|
|
#include "Layout/SlateRect.h"
|
|
#include "Widgets/SWidget.h"
|
|
#include "Types/SlateStructs.h"
|
|
#include "Widgets/SWindow.h"
|
|
#include "Application/ThrottleManager.h"
|
|
|
|
class FWidgetPath;
|
|
class SMenuPanel;
|
|
class FMenuBase;
|
|
|
|
typedef TArray<TSharedPtr<SWindow>> FMenuWindowList; // deprecated
|
|
|
|
#if UE_BUILD_DEBUG
|
|
// Debugging is harder with the inline allocator
|
|
typedef TArray<TSharedPtr<IMenu>> FMenuList;
|
|
#else
|
|
typedef TArray<TSharedPtr<IMenu>, TInlineAllocator<4>> FMenuList;
|
|
#endif
|
|
|
|
|
|
/** Describes a simple animation for popup window introductions */
|
|
struct FPopupTransitionEffect
|
|
{
|
|
/** Direction to slide in from */
|
|
enum ESlideDirection
|
|
{
|
|
/** No sliding */
|
|
None,
|
|
|
|
/** Sliding direction for a combo button */
|
|
ComboButton,
|
|
|
|
/** Sliding direction for a top-level pull-down menu or combo box */
|
|
TopMenu,
|
|
|
|
/** Sliding direction for a sub-menu */
|
|
SubMenu,
|
|
|
|
/** Sliding direction for a popup that lets the user type in data */
|
|
TypeInPopup,
|
|
|
|
/** Sliding direction preferred for context menu popups */
|
|
ContextMenu,
|
|
|
|
} SlideDirection;
|
|
|
|
|
|
/** Constructor */
|
|
FPopupTransitionEffect( const ESlideDirection InitSlideDirection )
|
|
: SlideDirection(InitSlideDirection)
|
|
{ }
|
|
};
|
|
|
|
/**
|
|
* Represents a stack of open menus. The last item in the stack is the top most menu
|
|
* Menus are described as IMenus. Implementations of IMenu can control how the menus are created and presented (e.g. in their own window)
|
|
*/
|
|
class FMenuStack
|
|
{
|
|
public:
|
|
/** Constructor */
|
|
FMenuStack()
|
|
: bHostWindowGuard(false)
|
|
{}
|
|
|
|
/**
|
|
* [Deprecated] Pushes a new menu onto the stack. Automatically removes windows from the stack that are no longer valid
|
|
* Invalid windows are those that are not parents of the window menu being pushed and any windows on the same stack level
|
|
* This is the old method for creating menus.
|
|
*
|
|
* @param InParentWindow The parent window of the menu
|
|
* @param InContent The menu's content
|
|
* @param SummonLocation Location where the menu should appear
|
|
* @param TransitionEffect Animation to use when the popup appears
|
|
* @param bFocusImmediately Should the popup steal focus when shown?
|
|
* @param bShouldAutoSize True if the new window should automatically size itself to its content
|
|
* @param WindowSize When bShouldAutoSize=false, this must be set to the size of the window to be created
|
|
* @param SummonLocationSize An optional size around the summon location which describes an area in which the menu may not appear
|
|
*/
|
|
DEPRECATED(4.9, "PushMenu() returning an SWindow is deprecated. Use Push() that returns an IMenu instead.")
|
|
TSharedRef<SWindow> PushMenu( const TSharedRef<SWindow>& InParentWindow, const TSharedRef<SWidget>& InContent, const FVector2D& SummonLocation, const FPopupTransitionEffect& TransitionEffect, const bool bFocusImmediately = true, const bool bShouldAutoSize = true, const FVector2D& WindowSize = FVector2D::ZeroVector, const FVector2D& SummonLocationSize = FVector2D::ZeroVector );
|
|
|
|
/**
|
|
* Pushes a new menu onto the stack. The widget path will be searched for existing menus and the new menu will be parented appropriately.
|
|
* Menus are always auto-sized. Use fixed-size content if a fixed size is required.
|
|
*
|
|
* @param InOwnerPath The widget path for the parent widget of this menu.
|
|
* @param InContent The menu's content
|
|
* @param SummonLocation Location in screen-space where the menu should appear
|
|
* @param TransitionEffect Animation to use when the popup appears
|
|
* @param bFocusImmediately Should the popup steal focus when shown?
|
|
* @param SummonLocationSize An optional size around the summon location which describes an area in which the menu may not appear
|
|
* @param InMethod An optional popup method that will override the default method for the widgets in InOwnerPath
|
|
* @param bIsCollapsedByParent Is this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it.
|
|
* @param bEnablePerPixelTransparency Does the menu's content require per pixel transparency?
|
|
*/
|
|
TSharedRef<IMenu> Push(const FWidgetPath& InOwnerPath, const TSharedRef<SWidget>& InContent, const FVector2D& SummonLocation, const FPopupTransitionEffect& TransitionEffect, const bool bFocusImmediately = true, const FVector2D& SummonLocationSize = FVector2D::ZeroVector, TOptional<EPopupMethod> InMethod = TOptional<EPopupMethod>(), const bool bIsCollapsedByParent = true, const bool bEnablePerPixelTransparency = false);
|
|
|
|
/**
|
|
* Pushes a new child menu onto the stack.
|
|
* Menus are always auto-sized. Use fixed-size content if a fixed size is required.
|
|
*
|
|
* @param InParentMenu The parent menu for this menu
|
|
* @param InContent The menu's content
|
|
* @param SummonLocation Location in screen-space where the menu should appear
|
|
* @param TransitionEffect Animation to use when the popup appears
|
|
* @param bFocusImmediately Should the popup steal focus when shown?
|
|
* @param SummonLocationSize An optional size around the summon location which describes an area in which the menu may not appear
|
|
* @param bIsCollapsedByParent Is this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it.
|
|
* @param bEnablePerPixelTransparency Does the menu's content require per pixel transparency?
|
|
*/
|
|
TSharedRef<IMenu> Push(const TSharedPtr<IMenu>& InParentMenu, const TSharedRef<SWidget>& InContent, const FVector2D& SummonLocation, const FPopupTransitionEffect& TransitionEffect, const bool bFocusImmediately = true, const FVector2D& SummonLocationSize = FVector2D::ZeroVector, const bool bIsCollapsedByParent = true, const bool bEnablePerPixelTransparency = false);
|
|
|
|
/**
|
|
* Pushes a new menu onto the stack that is drawn by an external host widget.
|
|
* The widget path will be searched for existing menus and the new menu will be parented appropriately.
|
|
* Menus are always auto-sized. Use fixed-size content if a fixed size is required.
|
|
*
|
|
* @param InOwnerPath The widget path for the parent widget of this menu
|
|
* @param InMenuHost The host widget that draws the menu's content
|
|
* @param InContent The menu's content
|
|
* @param OutWrappedContent Returns the InContent wrapped with widgets needed by the menu stack system. This is what should be drawn by the host after this call.
|
|
* @param TransitionEffect Animation to use when the popup appears
|
|
* @param bIsCollapsedByParent Is this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it.
|
|
*/
|
|
TSharedRef<IMenu> PushHosted(const FWidgetPath& InOwnerPath, const TSharedRef<IMenuHost>& InMenuHost, const TSharedRef<SWidget>& InContent, TSharedPtr<SWidget>& OutWrappedContent, const FPopupTransitionEffect& TransitionEffect, EShouldThrottle ShouldThrottle, const bool bIsCollapsedByParent = true);
|
|
|
|
/**
|
|
* Pushes a new child menu onto the stack that is drawn by an external host widget.
|
|
* Menus are always auto-sized. Use fixed-size content if a fixed size is required.
|
|
*
|
|
* @param InParentMenu The parent menu for this menu
|
|
* @param InMenuHost The host widget that draws the menu's content
|
|
* @param InContent The menu's content
|
|
* @param OutWrappedContent Returns the InContent wrapped with widgets needed by the menu stack system. This is what should be drawn by the host after this call.
|
|
* @param TransitionEffect Animation to use when the popup appears
|
|
* @param bIsCollapsedByParent Is this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it.
|
|
*/
|
|
TSharedRef<IMenu> PushHosted(const TSharedPtr<IMenu>& InParentMenu, const TSharedRef<IMenuHost>& InMenuHost, const TSharedRef<SWidget>& InContent, TSharedPtr<SWidget>& OutWrappedContent, const FPopupTransitionEffect& TransitionEffect, EShouldThrottle ShouldThrottle, const bool bIsCollapsedByParent = true);
|
|
|
|
/**
|
|
* [Deprecated] Dismisses the menu stack up to a certain level (by default removes all levels in the stack)
|
|
* Dismisses in reverse order so to keep just the first level you would pass in 1
|
|
*
|
|
* @param FirstStackIndexToRemove The first level of the stack to remove
|
|
*/
|
|
DEPRECATED(4.9, "Dismiss() taking a stack index is deprecated. Use DismissFrom() or DismissAll().")
|
|
void Dismiss( int32 FirstStackIndexToRemove = 0 );
|
|
|
|
/**
|
|
* Dismisses the menu stack including InFromMenu and all its child menus
|
|
* Dismisses in reverse order (children first)
|
|
*
|
|
* @param InFromMenu The menu to remove along with its children
|
|
*/
|
|
void DismissFrom(const TSharedPtr<IMenu>& InFromMenu);
|
|
|
|
/**
|
|
* Dismisses the entire menu stack
|
|
*/
|
|
void DismissAll();
|
|
|
|
/**
|
|
* Removes a window from the stack and all of its children. Assumes the window is cleaned up elsewhere
|
|
*
|
|
* @param WindowToRemove The window to remove (will remove all children of this window as well)
|
|
*/
|
|
DEPRECATED(4.9, "RemoveWindow() is deprecated. Do not use.")
|
|
void RemoveWindow( TSharedRef<SWindow> WindowToRemove );
|
|
|
|
/**
|
|
* Called by the application when any window is destroyed.
|
|
*
|
|
* @param InWindow The window that was destroyed
|
|
*/
|
|
void OnWindowDestroyed(TSharedRef<SWindow> InWindow);
|
|
|
|
/**
|
|
* Notifies the stack that a new window was activated. The menu stack will be dismissed if the activated window is not a menu in the stack
|
|
*
|
|
* @param ActivatedWindow The window that was just activated
|
|
*/
|
|
void OnWindowActivated( TSharedRef<SWindow> ActivatedWindow );
|
|
|
|
/**
|
|
* [Deprecated] Finds a window in the stack. (Deprecated but not using the deprecation macro. This is to avoid warnings as this is still called from a deprecated FSlateApplication method)
|
|
* This is deprecated because menus are no longer necessarily windows. Callers should also not need to know the stack levels by index. Menus are identified using the IMenu interface.
|
|
*
|
|
* @param WindowToFind The window to look for
|
|
* @return The level of the stack where the window is located or INDEX_NONE if the window could not be found
|
|
*/
|
|
int32 FindLocationInStack( TSharedPtr<SWindow> WindowToFind ) const;
|
|
|
|
/**
|
|
* Finds a menu in the stack that owns InWindow.
|
|
* Although this method isn't deprecated, it is intended for private use inside FMenuStack
|
|
* and its use as a public method should be avoided. Menus should be identified in client code as IMenu interfaces.
|
|
*
|
|
* @param InWindow The window to look for
|
|
* @return The menu in the stack that owns InWindow, or an invalid ptr if not found
|
|
*/
|
|
TSharedPtr<IMenu> FindMenuFromWindow(TSharedRef<SWindow> InWindow) const;
|
|
|
|
/**
|
|
* Searches from bottom to top of the widget path for a menu in the stack.
|
|
* If the widget at the end of PathToQuery is inside a menu, there will be a menu content wrapper widget in the path.
|
|
*
|
|
* @param PathToQuery The widget path to search for a menu
|
|
* @return The menu in the stack that contains the widget at the end of PathToQuery, or an invalid ptr if not found
|
|
*/
|
|
TSharedPtr<IMenu> FindMenuInWidgetPath(const FWidgetPath& PathToQuery) const;
|
|
|
|
/**
|
|
* Called by the application when showing tooltips. It prevents tooltips from drawing over menu items.
|
|
*
|
|
* @param InMenu A menu in the stack, used to generate the force field rect
|
|
* @param PathContainingMenu A widget path containing InMenu. This could be generated but the application has the path so it helps performance to pass it in here.
|
|
* @return A rectangle enclosing the menu's children (created from the clipping rects in the geometry in PathContainingMenu)
|
|
*/
|
|
FSlateRect GetToolTipForceFieldRect(TSharedRef<IMenu> InMenu, const FWidgetPath& PathContainingMenu) const;
|
|
|
|
/**
|
|
* [Deprecated]
|
|
* @return Returns the size of the menu stack
|
|
*/
|
|
DEPRECATED(4.9, "GetNumStackLevels() is deprecated. Consider HasMenus().")
|
|
int32 GetNumStackLevels( ) const;
|
|
|
|
/**
|
|
* @return Returns the window that is the parent of everything in the stack, if any. If the stack is empty, returns an invalid ptr.
|
|
*/
|
|
TSharedPtr<SWindow> GetHostWindow() const;
|
|
|
|
/**
|
|
* @return True if the stack has one or more menus in it, false if it is empty.
|
|
*/
|
|
bool HasMenus() const;
|
|
|
|
/**
|
|
* [Deprecated] This is deprecated because menus are no longer necessarily windows. Menus are identified using the IMenu interface.
|
|
*
|
|
* @return Returns whether the window has child menus. If the window is not a menu, returns false.
|
|
*/
|
|
DEPRECATED(4.9, "HasOpenSubMenus() taking a window is deprecated. Use HasOpenSubMenus() taking an IMenu as a parameter.")
|
|
bool HasOpenSubMenus( const TSharedRef<SWindow>& Window ) const;
|
|
|
|
/**
|
|
* @return Returns whether the menu has child menus. If the menu isn't in the stack, returns false.
|
|
*/
|
|
bool HasOpenSubMenus(TSharedPtr<IMenu> InMenu) const;
|
|
|
|
/**
|
|
* [Deprecated] Returned all of the windows at the specified stack level index. Always returns an empty list because it's deprecated and the return type is not supported.
|
|
*
|
|
* @param StackLevelIndex Index into the menu stack
|
|
*
|
|
* @return List of windows at this stack level (returns an empty list because it's deprecated)
|
|
*/
|
|
DEPRECATED(4.9, "GetWindowsAtStackLevel() is deprecated. Do not use.")
|
|
FMenuWindowList& GetWindowsAtStackLevel( const int32 StackLevelIndex );
|
|
|
|
private:
|
|
/**
|
|
* Queries the widgets in the path for a menu popup method.
|
|
*
|
|
* @param PathToQuery The path to query
|
|
*
|
|
* @return The popup method chosen by a widget in the path. Defaults to EPopupMethod::CreateNewWindow if no widgets in the path have a preference.
|
|
*/
|
|
FPopupMethodReply QueryPopupMethod(const FWidgetPath& PathToQuery);
|
|
|
|
/**
|
|
* Called by public Dismiss methods. Dismisses all menus in the stack from FirstStackIndexToRemove and below.
|
|
*
|
|
* @param FirstStackIndexToRemove Index into the stack from which menus are dismissed.
|
|
*/
|
|
void DismissInternal(int32 FirstStackIndexToRemove);
|
|
|
|
/**
|
|
* Handles changes to the owner path, potentially locating and establishing the new host. Makes sure overlay slots are added/removed as appropriate.
|
|
*/
|
|
void SetHostPath(const FWidgetPath& InOwnerPath);
|
|
|
|
/**
|
|
* Callback method called by all menus when they are dismissed. Handles changes to the stack state when a menu is destroyed.
|
|
*
|
|
* @param InMenu The menu that was destroyed.
|
|
*/
|
|
void OnMenuDestroyed(TSharedRef<IMenu> InMenu);
|
|
|
|
/**
|
|
* Callback method called by all menus when they lose focus. Handles dismissing menus that have lost focus.
|
|
*
|
|
* @param InFocussedPath The new focus path.
|
|
*/
|
|
void OnMenuContentLostFocus(const FWidgetPath& InFocussedPath);
|
|
|
|
/**
|
|
* Called by all menus during creation. Handles wrapping content in SMenuContentWrapper that acts as a marker in widget paths and in a box that sets minimum size.
|
|
*
|
|
* @param InContent The unwrapped content.
|
|
* @param OptionalMinWidth Optional minimum width for the wrapped content.
|
|
* @param OptionalMinHeight Optional minimum height for the wrapped content.
|
|
*/
|
|
TSharedRef<SWidget> WrapContent(TSharedRef<SWidget> InContent, FOptionalSize OptionalMinWidth = FOptionalSize(), FOptionalSize OptionalMinHeight = FOptionalSize());
|
|
|
|
/** Contains all the options passed to the pre-push stage of the menu creation process */
|
|
struct FPrePushArgs
|
|
{
|
|
FPrePushArgs() : TransitionEffect(FPopupTransitionEffect::None) {}
|
|
|
|
TSharedPtr<SWidget> Content;
|
|
FSlateRect Anchor;
|
|
FPopupTransitionEffect TransitionEffect;
|
|
bool bFocusImmediately;
|
|
bool bIsCollapsedByParent;
|
|
};
|
|
|
|
/** Contains all the options returned from the pre-push stage of the menu creation process */
|
|
struct FPrePushResults
|
|
{
|
|
TSharedPtr<SWidget> WrappedContent;
|
|
TSharedPtr<SWidget> WidgetToFocus;
|
|
FVector2D AnimStartLocation;
|
|
FVector2D AnimFinalLocation;
|
|
bool bAnchorSetsMinWidth;
|
|
FVector2D ExpectedSize;
|
|
bool bAllowAnimations;
|
|
bool bFocusImmediately;
|
|
bool bIsCollapsedByParent;
|
|
};
|
|
|
|
/**
|
|
* This is the pre-push stage of menu creation.
|
|
* It is responsible for wrapping content and calculating menu positioning. This stage is not used by "hosted" menus.
|
|
*
|
|
* @param InArgs Pre-push options.
|
|
*
|
|
* @return Pre-push results.
|
|
*/
|
|
FPrePushResults PrePush(const FPrePushArgs& InArgs);
|
|
|
|
/**
|
|
* This is the common code used during menu creation. This stage is not used by "hosted" menus.
|
|
* It handles pre-push, actual menu creation and post-push stack updates.
|
|
*
|
|
* @param InParentMenu The parent menu for this menu
|
|
* @param InContent The menu's content
|
|
* @param Anchor The anchor location for the menu (rect around the parent widget that is summoning the menu)
|
|
* @param TransitionEffect Animation to use when the popup appears
|
|
* @param bFocusImmediately Should the popup steal focus when shown?
|
|
* @param bIsCollapsedByParent Is this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it.
|
|
*
|
|
* @return The newly created menu.
|
|
*/
|
|
TSharedRef<IMenu> PushInternal(const TSharedPtr<IMenu>& InParentMenu, const TSharedRef<SWidget>& InContent, FSlateRect Anchor, const FPopupTransitionEffect& TransitionEffect, const bool bFocusImmediately, EShouldThrottle ShouldThrottle, const bool bIsCollapsedByParent, const bool bEnablePerPixelTransparency);
|
|
|
|
/**
|
|
* This is the actual menu object creation method for FMenuInWindow menus.
|
|
* It creates a new SWindow and new FMenuInWindow that uses it.
|
|
*
|
|
* @param InParentMenu The parent menu for this menu
|
|
* @param InPrePushResults The results of the pre-push stage
|
|
*
|
|
* @return The newly created FMenuInWindow menu.
|
|
*/
|
|
TSharedRef<FMenuBase> PushNewWindow(TSharedPtr<IMenu> InParentMenu, const FPrePushResults& InPrePushResults, const bool bEnablePerPixelTransparency);
|
|
|
|
/**
|
|
* This is the actual menu object creation method for FMenuInPopup menus.
|
|
* It creates a new FMenuInWindow and adds it into the overlay layer on the host window.
|
|
*
|
|
* @param InParentMenu The parent menu for this menu
|
|
* @param InPrePushResults The results of the pre-push stage
|
|
*
|
|
* @return The newly created FMenuInPopup menu.
|
|
*/
|
|
TSharedRef<FMenuBase> PushPopup(TSharedPtr<IMenu> InParentMenu, const FPrePushResults& InPrePushResults);
|
|
|
|
/**
|
|
* This is the post-push stage of menu creation.
|
|
* It is responsible for updating the stack with the new menu and removing any that it replaces.
|
|
*
|
|
* @param InParentMenu The parent menu for this menu
|
|
* @param InMenu A newly created menu
|
|
* @param ShouldThrottle Should pushing this menu enable throttling of the engine for a more responsive UI
|
|
*/
|
|
void PostPush(TSharedPtr<IMenu> InParentMenu, TSharedRef<FMenuBase> InMenu, EShouldThrottle ShouldThrottle);
|
|
|
|
/** The popup method currently used by the whole stack. It can only use one at a time */
|
|
FPopupMethodReply ActiveMethod;
|
|
|
|
/** The parent window of the root menu in the stack. NOT the actual menu window if it's a CreateNewWindow */
|
|
TSharedPtr<SWindow> HostWindow;
|
|
|
|
/** The parent window of the root menu in the stack. NOT the actual menu window if it's a CreateNewWindow */
|
|
TSharedPtr<SMenuPanel> HostWindowPopupPanel;
|
|
|
|
/** The popup layer that contains our HostWindowPopupPanel. */
|
|
TSharedPtr<FPopupLayer> HostPopupLayer;
|
|
|
|
/** The array of menus in the stack */
|
|
TArray<TSharedPtr<class FMenuBase>> Stack;
|
|
|
|
/** Maps top-level content widgets (should always be SMenuContentWrappers) to menus in the stack */
|
|
TMap<TSharedPtr<const SWidget>, TSharedPtr<class FMenuBase>> CachedContentMap;
|
|
|
|
/** Handle to a throttle request made to ensure the menu is responsive in low FPS situations */
|
|
FThrottleRequest ThrottleHandle;
|
|
|
|
/** Temporary ptr to a new window created during the menu creation process. Nulled before the Push() call returns. Stops activation of the new window collapsing the stack. */
|
|
TSharedPtr<SWindow> PendingNewWindow;
|
|
|
|
/** Temporary ptr to a new menu created during the menu creation process. Nulled before the Push() call returns. Stops it collapsing the stack when it gets focus. */
|
|
TSharedPtr<class FMenuBase> PendingNewMenu;
|
|
|
|
/** Guard to prevent the HostWindow and HostWindowPopupPanel being set reentrantly */
|
|
bool bHostWindowGuard;
|
|
};
|