Files
UnrealEngineUWP/Engine/Source/Editor/RewindDebuggerInterface/Public/RewindDebuggerTrack.h
roland munguia f30e2a5b41 Adds ability to watch properties in Rewind Debugger. (Property Watch Track)
**New**
- Added `FPropertiesTrack` as the root track that handles the watched properties via Rewind Debugger.
- Added `FPropertyTrack` used to for watched property tracks via Rewind Debugger.
- Added `FPropertyWatchManager` used to keep track of watched traced properties.
- Added `FPropertyTracks` type specializations:`FBoolPropertyTrack` and `FNumericPropertyTrack`.
- Added `ReadObjectPropertiesStorage` method in `IGameplayProvider`. Used to access container where traced object properties are stored.
- Added `FindPropertyValueFromStorageIndex` method in `IGameplayProvider`. Used to access a traced property given its id.
- Added context menu building support via `FPropertyTrack` and `SPropertiesDebugViewBase`.
- Added a delegate for mouse button down on an `SVariantValueView`.
- Added `SPropertyTrackView` to show a single `FPropertyTrack` variable information in the Rewind Debugger details panel.
- Improved traced property variables displaying. Friendly display names. Specialization for bools, vector, vector2d and quaternions.
- Added a log category for Rewind Debugger. `LogRewindDebugger`.

**Changed**
- Updated `FObjectPropertyValue` to keep track of its unique name id, and unique parent id.
- Updated `FRewindDebugger` to handle menu registration for `ComponentContextMenu`.
- Updated `FVariantTreeNode` to support storing a trace property id. Used for details context menu to support having a menu entry to watch property.
- Updated `SPropertiesDebugViewBase` to have the ability to create a context menu.
- Updated `SObjectPropertiesView` to better display traced properties.
- Updated object property tracing to handle updated `FObjectPropertyValue`. Create unique named ids for properties.
- Updated `FGameAnalyzer` to handle new version of `FObjectPropertyValue`.
- Updated `FRewindDebuggerTrack` to support a building context menu.
- Updated `UComponentContextMenuContext` to stored the current Rewind Debugger selected track.

**Removed**
- Removed usage of `FObjectPropertiesViewCreator`. Now using `FPropertiesTrackCreator`.

#jira UE-159126
#preflight 634f0394dd0d2ceafae78188

[CL 22610498 by roland munguia in ue5-main branch]
2022-10-18 16:44:57 -04:00

127 lines
3.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "IRewindDebuggerViewCreator.h"
#include "IRewindDebugger.h"
namespace TraceServices
{
class IAnalysisSession;
}
struct FToolMenuSection;
namespace RewindDebugger
{
class FRewindDebuggerTrack
{
public:
FRewindDebuggerTrack(): bExpanded(true), bVisible(true)
{
}
virtual ~FRewindDebuggerTrack()
{
}
bool GetIsExpanded()
{
return bExpanded;
}
void SetIsExpanded(bool bIsExpanded)
{
bExpanded = bIsExpanded;
}
// Update should do work to compute children etc for the current time range. Return true if children have changed.
bool Update()
{
return UpdateInternal();
}
// Get a widget to show in the timeline view for this track
TSharedPtr<SWidget> GetTimelineView()
{
return GetTimelineViewInternal();
}
// Get a widget to show in the details tab, when this track is selected
TSharedPtr<SWidget> GetDetailsView()
{
return GetDetailsViewInternal();
}
// unique name for track (must match creator name if track is created by an IRewindDebuggerViewCreator)
FName GetName() const
{
return GetNameInternal();
}
// icon to display in the tree view
FSlateIcon GetIcon()
{
return GetIconInternal();
}
// display name for track in Tree View
FText GetDisplayName() const
{
return GetDisplayNameInternal();
}
// insights object id for an object associated with this track
uint64 GetObjectId() const
{
return GetObjectIdInternal();
}
// iterate over all sub-tracks of this track and call Iterator function
void IterateSubTracks(TFunction<void(TSharedPtr<FRewindDebuggerTrack> SubTrack)> IteratorFunction)
{
IterateSubTracksInternal(IteratorFunction);
}
// returns true for tracks that contain debug data (used for filtering out parts of the hierarchy with no useful information in them)
bool HasDebugData() const
{
return HasDebugDataInternal();
}
// Called when a track is double clicked. Returns true if the track handled the double click
bool HandleDoubleClick()
{
return HandleDoubleClickInternal();
}
bool IsVisible() const { return bVisible; }
void SetIsVisible(bool bInIsVisible) { bVisible = bInIsVisible; }
// Called to generate context menu for the current selected track
virtual void BuildContextMenu(FToolMenuSection& InMenuSection) {};
private:
virtual bool UpdateInternal() { return false; }
virtual TSharedPtr<SWidget> GetTimelineViewInternal() { return TSharedPtr<SWidget>(); }
virtual TSharedPtr<SWidget> GetDetailsViewInternal() { return TSharedPtr<SWidget>(); }
virtual FSlateIcon GetIconInternal() { return FSlateIcon(); }
virtual FName GetNameInternal() const { return ""; }
virtual FText GetDisplayNameInternal() const { return FText(); }
virtual uint64 GetObjectIdInternal() const { return 0; }
virtual bool HasDebugDataInternal() const { return true; }
virtual void IterateSubTracksInternal(TFunction<void(TSharedPtr<FRewindDebuggerTrack> SubTrack)> IteratorFunction) { }
virtual bool HandleDoubleClickInternal()
{
IRewindDebugger::Instance()->OpenDetailsPanel();
return true;
};
bool bExpanded;
bool bVisible;
};
}