Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Source/PropertyHistory/Private/PropertyHistoryHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#include "SourceControlOperations.h"
#include "PropertyHistoryUtilities.h"
#include "PropertyHistoryProcessor.h"
#include "Framework/Application/SlateApplication.h"
#include "Framework/Docking/TabManager.h"
#include "UObject/Package.h"
#include "Widgets/Docking/SDockTab.h"

FPropertyHistoryHandler::FPropertyHistoryHandler(const FPropertyHistoryProcessor& Processor)
: PropertyChain(Processor.Properties)
Expand Down Expand Up @@ -355,4 +359,4 @@ void FPropertyHistoryHandler::AddError(const FString& NewError)
{
Error = NewError;
}
}
}
8 changes: 7 additions & 1 deletion Source/PropertyHistory/Private/PropertyHistoryHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
#include "CoreMinimal.h"
#include "StructUtils/PropertyBag.h"
#include "PropertyHistoryProcessor.h"
#include "Async/Future.h"
#include "Containers/Ticker.h"

class IPropertyHandle;
class IDetailTreeNode;
class IPropertyRowGenerator;
class ISourceControlRevision;
class ISourceControlState;
class FDetailColumnSizeData;

Expand Down Expand Up @@ -66,4 +72,4 @@ class FPropertyHistoryHandler

void Tick();
void AddError(const FString& NewError);
};
};
11 changes: 7 additions & 4 deletions Source/PropertyHistory/Private/PropertyHistoryModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
#include "Editor/PropertyEditor/Private/PropertyHandleImpl.h"
#include "Editor/PropertyEditor/Private/SDetailSingleItemRow.h"
#include "Editor/PropertyEditor/Private/DetailRowMenuContextPrivate.h"
#include "Framework/Docking/TabManager.h"
#include "Widgets/Docking/SDockTab.h"

DEFINE_PRIVATE_ACCESS(FPropertyNode, InstanceMetaData)

DEFINE_PRIVATE_ACCESS(SDetailsViewBase, DetailLayouts)
DEFINE_PRIVATE_ACCESS(SDetailTableRowBase, OwnerTreeNode)
DEFINE_PRIVATE_ACCESS_FUNCTION(SDetailSingleItemRow, GetPropertyNode);
Expand Down Expand Up @@ -160,7 +163,7 @@ class FPropertyHistoryModule : public IModuleInterface
}

int32 ArrayIndex = -1;
LexFromString(ArrayIndex, Parts[2]);
Parts[2] = FString::Format(TEXT("%d"), {ArrayIndex});

Properties.Add({ Property, ArrayIndex });
NumAddedProperties++;
Expand All @@ -172,7 +175,7 @@ class FPropertyHistoryModule : public IModuleInterface
#if PROPERTY_HISTORY_ENGINE_VERSION >= 506
const TSharedPtr<SDetailsViewBase> DetailsViewBase = StaticCastSharedPtr<SDetailsViewBase>(Context->DetailsView.Pin());
#else
SDetailsViewBase* DetailsViewBase = reinterpret_cast<SDetailsViewBase*>(Context->DetailsView);
SDetailsViewBase* DetailsViewBase = reinterpret_cast<SDetailsViewBase*>(Context->DetailsView.Pin().Get());
#endif
const TSharedPtr<FPropertyNode> RootNode = INLINE_LAMBDA -> TSharedPtr<FPropertyNode>
{
Expand Down Expand Up @@ -257,7 +260,7 @@ class FPropertyHistoryModule : public IModuleInterface
#if PROPERTY_HISTORY_ENGINE_VERSION >= 506
Processor.DetailsView = Context->DetailsView.Pin();
#else
Processor.DetailsView = Context->DetailsView;
Processor.DetailsView = Context->DetailsView.Pin().Get();
#endif
void* Container = nullptr;
if (!Processor.Process(Container))
Expand Down Expand Up @@ -292,4 +295,4 @@ class FPropertyHistoryModule : public IModuleInterface
}
};

IMPLEMENT_MODULE(FPropertyHistoryModule, PropertyHistory);
IMPLEMENT_MODULE(FPropertyHistoryModule, PropertyHistory);
4 changes: 3 additions & 1 deletion Source/PropertyHistory/Private/PropertyHistoryProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "CoreMinimal.h"
#include "PropertyHistoryUtilities.h"

class IDetailsView;
class UMaterialExpression;
class UPreviewMaterial;
class UMaterialEditorInstanceConstant;

Expand Down Expand Up @@ -61,4 +63,4 @@ struct FPropertyHistoryProcessor
private:
UScriptStruct* TargetStampStruct = nullptr;
bool bFetchMaterialParameterName = false;
};
};
6 changes: 5 additions & 1 deletion Source/PropertyHistory/Private/PropertyHistoryUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
#pragma once

#include "CoreMinimal.h"
#include "UObject/UnrealType.h"
#include "Runtime/Launch/Resources/Version.h"

#define PROPERTY_HISTORY_ENGINE_VERSION (ENGINE_MAJOR_VERSION * 100 + ENGINE_MINOR_VERSION)

class IInterface;

struct FLambdaCaller
{
template<typename T>
Expand Down Expand Up @@ -411,4 +415,4 @@ FProperty& FindFPropertyChecked_Impl(const FName Name)
return Property; \
}())

#define FindFPropertyChecked(Class, Name) FindFPropertyChecked_ByName(Class, GET_MEMBER_NAME_CHECKED(Class, Name))
#define FindFPropertyChecked(Class, Name) FindFPropertyChecked_ByName(Class, GET_MEMBER_NAME_CHECKED(Class, Name))
12 changes: 9 additions & 3 deletions Source/PropertyHistory/Private/SPropertyHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
#include "IDetailTreeNode.h"
#include "IDetailPropertyRow.h"
#include "IPropertyRowGenerator.h"
#include "ISourceControlRevision.h"
#include "PropertyHistoryUtilities.h"
#include "Widgets/Images/SThrobber.h"
#include "Widgets/Layout/SScaleBox.h"
#include "Framework/Commands/GenericCommands.h"
#include "InstancedPropertyBagStructureDataProvider.h"
#include "ISourceControlRevision.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "Misc/ConfigCacheIni.h"
#include "Modules/ModuleManager.h"
#include "Styling/StyleColors.h"
#include "Widgets/Layout/SSeparator.h"
#include "Widgets/Layout/SSpacer.h"

void SPropertyHistory::Construct(const FArguments& Args)
{
Expand Down Expand Up @@ -559,7 +565,7 @@ FSlateColor SPropertyEntry::GetRowBackgroundColor(const int32 IndentLevel, const
}
}

static const uint8 ColorOffsets[] =
static constexpr uint8 ColorOffsets[] =
{
0, 4, (4 + 2), (6 + 4), (10 + 6)
};
Expand Down Expand Up @@ -827,4 +833,4 @@ FSlateColor SPropertyEntryRowIndent::GetRowBackgroundColor(const int32 IndentLev
return SPropertyEntry::GetRowBackgroundColor(
IndentLevel,
Row && Row->IsHovered());
}
}
4 changes: 3 additions & 1 deletion Source/PropertyHistory/Private/SPropertyHistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "CoreMinimal.h"
#include "DetailColumnSizeData.h"
#include "PropertyHistoryHandler.h"
#include "Widgets/SCompoundWidget.h"
#include "Widgets/Views/STreeView.h"

class SPropertyHistory : public SCompoundWidget
{
Expand Down Expand Up @@ -86,4 +88,4 @@ class SPropertyEntryRowIndent : public SCompoundWidget

private:
TWeakPtr<SPropertyEntryValue> WeakRow;
};
};