ArticyXImporter
ArticyXImporter for Unreal Engine
Loading...
Searching...
No Matches
SArticyRefProperty.h
1//
2// Copyright (c) 2023 articy Software GmbH & Co. KG. All rights reserved.
3//
4
5#pragma once
6
7#include "CoreMinimal.h"
8#include "Slate/AssetPicker/SArticyObjectTileView.h"
9#include "Customizations/ArticyEditorCustomizationManager.h"
10#include "SArticyIdProperty.h"
11#include "AssetPicker/SArticyObjectAssetPicker.h"
12
16
17DECLARE_DELEGATE_OneParam(FOnArticyRefChanged, const FArticyRef&);
18
22class ARTICYEDITOR_API SArticyRefProperty : public SCompoundWidget
23{
24public:
25
26 SLATE_BEGIN_ARGS(SArticyRefProperty)
27 : _ArticyRefToDisplay(FArticyRef())
28 , _TopLevelClassRestriction(UArticyObject::StaticClass())
29 , _bExactClass(false)
30 , _bExactClassEditable(true)
31 , _bIsReadOnly(false)
32 {}
33 SLATE_ATTRIBUTE(FArticyRef, ArticyRefToDisplay)
34 SLATE_EVENT(FOnArticyRefChanged, OnArticyRefChanged)
35 SLATE_ATTRIBUTE(UClass*, TopLevelClassRestriction)
36 SLATE_ATTRIBUTE(bool, bExactClass)
37 SLATE_ATTRIBUTE(bool, bExactClassEditable)
38 SLATE_ATTRIBUTE(bool, bIsReadOnly)
39 SLATE_END_ARGS()
40
41
46 void Construct(const FArguments& InArgs);
47
55 virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
56
61
62private:
63 TAttribute<FArticyRef> ArticyRefToDisplay;
64 FOnArticyRefChanged OnArticyRefChanged;
65 TAttribute<UClass*> TopLevelClassRestriction;
66 TAttribute<bool> bExactClass;
67 TAttribute<bool> bExactClassEditable;
68 TAttribute<bool> bClassFilterEditable;
69 TAttribute<bool> bIsReadOnly;
70
76 void OnArticyIdChanged(const FArticyId& ArticyId);
77
83 FArticyId GetArticyIdToDisplay() const;
84
85 // the articy object this widget currently represents
86 TWeakObjectPtr<UArticyObject> CachedArticyObject = nullptr;
87 mutable FArticyRef CachedArticyRef = FArticyRef();
88
89 TSharedPtr<SArticyIdProperty> ArticyIdProperty;
90 TSharedPtr<FExtender> ArticyIdExtender;
91
92private:
98 void CreateAdditionalRefWidgets(FToolBarBuilder& Builder);
99
105 void Update(const FArticyRef& NewRef);
106
110 void UpdateWidget();
111
112private:
116 void OnCopyProperty() const;
117
121 void OnPasteProperty();
122
128 bool CanPasteProperty() const;
129};
Definition SArticyRefProperty.h:23
void Construct(const FArguments &InArgs)
Definition SArticyRefProperty.cpp:27
virtual void Tick(const FGeometry &AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override
Definition SArticyRefProperty.cpp:60
void CreateInternalWidgets()
Definition SArticyRefProperty.cpp:72
Definition ArticyBaseTypes.h:18
Definition ArticyRef.h:13