UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ConsoleSlateDebuggerPassBase.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5
7
8#if WITH_SLATE_DEBUGGING
9
10#include "CoreMinimal.h"
12#include "Delegates/Delegate.h"
13#include "HAL/IConsoleManager.h"
15
17{
18public:
21
22 /* Starts debugging by setting the enabled CVar to true. See GetEnabledCVar */
23 void StartDebugging();
24 /* Stops debugging by setting the enabled CVar to false. See GetEnabledCVar */
25 void StopDebugging();
26
27 bool IsEnabled() const { return bEnabled; }
28
29 virtual void LoadConfig();
30 virtual void SaveConfig();
31
32protected:
33 /* Return the name of the config section used to load and save the config */
34 virtual FString GetConfigSection() const = 0;
35 /* Return the text to be shown on screen indicating the number of widgets updated when bDisplayWidgetsNameList is true */
37 /* Return the CVar used to enable/disable the debugger pass. Used by Start/StopDebugging */
39 /* Function called when the debugging starts. Used to attach delegates */
40 virtual void StartDebugging_Internal();
41 /* Function called when the debugging stops. Used to remove delegates */
42 virtual void StopDebugging_Internal();
43
50 virtual void AddUpdatedWidget(const SWidget& Widget, const FConsoleSlateDebuggerUtility::TSWindowId WindowId, bool bIncrementUpdateCount = true) = 0;
51
52 struct FWidgetInfo
53 {
54 FConsoleSlateDebuggerUtility::TSWindowId Window;
55 TWeakPtr<const SWidget> Widget; // used to check if the widget has been destroyed
58 FString WidgetName;
59
61 double LastUpdatedTime;
62 int32 UpdateCount;
63 };
64
73 FWidgetInfo& AddUpdatedWidget_Internal(const SWidget& Widget, const FConsoleSlateDebuggerUtility::TSWindowId WindowId, uint32 LastUpdatedFrame);
74
75 /* Should be called by the GetEnabledCVar when it is updated. Will end up calling Start/StopDebugging_Internal */
77 /* Should be called by the CVar enabling a one time log of the updated widgets */
78 void HandleLogOnce();
79 /* Should be called by the CVar enabling the updated widget list to be shown on screen */
81 /* Should be called by CVars that should only save the current config */
83 /* Should be called by the CVar that changes the scope of the widgets retrieved. Ends up rebuilding the widget list */
85 /* Called on EndFrame to reset the counts and remove deleted widgets */
86 void HandleEndFrame();
87 /* Called by Slate to draw additional elements on screen. */
89
90private:
91 /* Not all widgets are accessible from the PaintEvents, so we need to loop through all of them to add all current ones */
93
94 void AddInitialVisibleWidget(const SWidget& Widget, const FConsoleSlateDebuggerUtility::TSWindowId WindowId);
95
96protected:
97 //~ Settings
98 bool bEnabled;
101 bool bDrawBox;
102 bool bDrawBorder;
103 bool bLogWidgetName;
110 float FadeDuration;
111 const FName PIEWindowTag;
112
113 FVector2f WidgetLogLocation{10.f, 10.f};
114
117};
118
119#endif //WITH_SLATE_DEBUGGING
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition IConsoleManager.h:1580
Definition NameTypes.h:617
Definition PaintArgs.h:23
Definition DrawElements.h:220
Definition IConsoleManager.h:558
Definition SWidget.h:165
Definition UnrealString.h.inl:34
Definition SharedPointer.h:1295
bool IsEnabled()
Definition IAudioLinkFactory.cpp:13
Definition Geometry.h:40
Definition Color.h:48