Live Config
Loading...
Searching...
No Matches
SLiveConfigPropertyValueWidget.h
1// Copyright (c) 2026 Nicholas Arthur
2// Licensed under the MIT License
3
4#pragma once
5
6#include "CoreMinimal.h"
7#include "Widgets/SCompoundWidget.h"
8#include "LiveConfigTypes.h"
9
10#include "StructViewerFilter.h"
11
12class FLiveConfigStructFilter : public IStructViewerFilter
13{
14public:
16
17 virtual bool IsStructAllowed(const FStructViewerInitializationOptions& InInitOptions, const UScriptStruct* InStruct, TSharedRef<class FStructViewerFilterFuncs> InNode) override;
18
19 virtual bool IsUnloadedStructAllowed(const FStructViewerInitializationOptions& InInitOptions, const FSoftObjectPath& InStructPath, TSharedRef<class FStructViewerFilterFuncs> InNode) override;
20
21private:
22 bool IsPackageAllowed(const FString& PackageName) const;
23
24 TArray<FString> AllowedScripts;
25};
26
27class LIVECONFIGEDITOR_API SLiveConfigPropertyValueWidget : public SCompoundWidget
28{
29public:
30 SLATE_DECLARE_WIDGET(SLiveConfigPropertyValueWidget, SCompoundWidget);
31
32 DECLARE_DELEGATE_OneParam(FOnValueChanged, const FString&);
33
34 SLATE_BEGIN_ARGS(SLiveConfigPropertyValueWidget)
35 : _Value()
36 , _PropertyType(ELiveConfigPropertyType::String)
37 , _bReadOnly(false)
38 {}
39 SLATE_ATTRIBUTE(FString, Value);
40 SLATE_ATTRIBUTE(ELiveConfigPropertyType, PropertyType);
41 SLATE_ATTRIBUTE(bool, bReadOnly);
42 SLATE_EVENT(FOnValueChanged, OnValueChanged);
43 SLATE_EVENT(FSimpleDelegate, OnEnter);
44 SLATE_END_ARGS();
45
46 void Construct(const FArguments& InArgs);
47
48 void RequestFocus();
49
50private:
51 TSharedRef<SWidget> OnGetStructPickerMenu();
52 void OnStructPicked(const UScriptStruct* ChosenStruct);
53 bool VerifyValueText(const FText& NewText, FText& OutError);
54 void ValueTextCommitted(const FText& NewText, ETextCommit::Type CommitType);
55
56 TAttribute<FString> ValueAttribute;
57 TAttribute<ELiveConfigPropertyType> PropertyTypeAttribute;
58 TAttribute<bool> bReadOnlyAttribute;
59 FOnValueChanged OnValueChanged;
60 FSimpleDelegate OnEnter;
61
62 TSharedPtr<class SEditableTextBox> ValueTextBox;
63 TSharedPtr<class SCheckBox> ValueCheckBox;
64 TSharedPtr<class SComboButton> StructComboButton;
65};
Definition SLiveConfigPropertyValueWidget.h:13
Definition SLiveConfigPropertyValueWidget.h:28