A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
SDlgDataDisplay.cpp
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
3
4#include "Widgets/Layout/SBorder.h"
5#include "Widgets/Text/STextBlock.h"
6#include "Widgets/Layout/SMissingWidget.h"
7#include "Widgets/Input/SButton.h"
8#include "Widgets/SBoxPanel.h"
9
10// #if WITH_EDITOR
11// #include "Editor.h"
12// #endif
13
14#include "DlgManager.h"
15#include "DlgContext.h"
17#include "Logging/DlgLogger.h"
18
20DEFINE_LOG_CATEGORY(LogDlgSystemDataDisplay)
22
23#define LOCTEXT_NAMESPACE "SDlgDataDisplay"
24
25
27// SDlgDataDisplay
28void SDlgDataDisplay::Construct(const FArguments& InArgs, const TWeakObjectPtr<const UObject>& InWorldContextObjectPtr)
29{
30 WorldContextObjectPtr = InWorldContextObjectPtr;
31 RootTreeItem = MakeShared<FDlgDataDisplayTreeRootNode>();
32 ActorsTreeView = SNew(STreeView<TSharedPtr<FDlgDataDisplayTreeNode>>)
33 .ItemHeight(32)
34 .TreeItemsSource(&RootChildren)
35 .OnGenerateRow(this, &Self::HandleGenerateRow)
36 .OnSelectionChanged(this, &Self::HandleTreeSelectionChanged)
37 .OnGetChildren(this, &Self::HandleGetChildren)
38 .SelectionMode(ESelectionMode::Single)
39 .OnMouseButtonDoubleClick(this, &Self::HandleDoubleClick)
40 .OnSetExpansionRecursive(this, &Self::HandleSetExpansionRecursive)
41 .HeaderRow(
42 SNew(SHeaderRow)
43 .Visibility(EVisibility::Visible)
44 +SHeaderRow::Column(NAME_Name)
45 .DefaultLabel(LOCTEXT("Name", "Name"))
46 );
47
48 ChildSlot
49 [
50 SNew(SBorder)
51 .BorderImage(FCoreStyle::Get().GetBrush("ToolPanel.GroupBorder"))
52 .BorderBackgroundColor(FLinearColor::Gray) // Darken the outer border
53 [
54 SNew(SVerticalBox)
55
56 // Top bar
57 +SVerticalBox::Slot()
58 .AutoHeight()
59 .Padding(2.f, 1.f)
60 [
61 SNew(SHorizontalBox)
62
63 // Search Input
64 +SHorizontalBox::Slot()
65 .FillWidth(1.0f)
66 .Padding(0.f, 0.f, 4.f, 0.f)
67 [
69 ]
70
71 // Refresh Actors
72 +SHorizontalBox::Slot()
73 .AutoWidth()
74 [
75 SNew(SButton)
76 .ToolTipText(LOCTEXT("RefreshToolTip", "Refreshes/Reloads the Actors Dialogue data."))
77 .OnClicked(this, &Self::HandleOnRefresh)
78 [
79 SNew(STextBlock)
80 .Text(LOCTEXT("RefreshDialogues", "Refresh"))
81 ]
82 ]
83 ]
84
85 // The Tree view
86 +SVerticalBox::Slot()
87 .AutoHeight()
88 .FillHeight(1.0f)
89 [
90 SNew(SBorder)
91 .BorderImage(FCoreStyle::Get().GetBrush("ToolPanel.GroupBorder"))
92 .Padding(FMargin(0.0f, 4.0f))
93 [
94 ActorsTreeView.ToSharedRef()
95 ]
96 ]
97 ]
98 ];
99
100 RefreshTree(false);
101}
102
103void SDlgDataDisplay::RefreshTree(bool bPreserveExpansion)
104{
105 // First, save off current expansion state
106 TSet<TSharedPtr<FDlgDataDisplayTreeNode>> OldExpansionState;
107 if (bPreserveExpansion)
108 {
109 ActorsTreeView->GetExpandedItems(OldExpansionState);
110 }
111
112 RootTreeItem->ClearChildren();
113 RootChildren.Empty();
114 ActorsProperties.Empty();
115
116 // Try the actor World
117 UWorld* World = WorldContextObjectPtr.IsValid() ? WorldContextObjectPtr->GetWorld() : nullptr;
118
119// // Try The Editor World
120// #if WITH_EDITOR
121// if (World == nullptr && GEditor)
122// {
123// World = GEditor->GetEditorWorldContext().World();
124// }
125// #endif
126
127 // Can't do anything without the world
128 if (!IsValid(World))
129 {
131 TEXT("Failed to refresh SDlgDataDisplay tree. World is a null pointer. "
132 "Is the game running? "
133 "Did you setup the DlgSystem Console commands in your GameMode BeginPlay/StartPlay?")
134 );
135 return;
136 }
137
138 const TArray<UDlgDialogue*> Dialogues = UDlgManager::GetAllDialoguesFromMemory();
139 const TArray<TWeakObjectPtr<AActor>> Actors = UDlgManager::GetAllWeakActorsWithDialogueParticipantInterface(World);
140
141 // Build fast lookup for ParticipantNames
142 // Maps from ParticipantName => Array of Dialogues that have this Participant.
143 TMap<FName, TSet<TWeakObjectPtr<const UDlgDialogue>>> ParticipantNamesDialoguesMap;
144 for (const UDlgDialogue* Dialogue : Dialogues)
145 {
146 TSet<FName> ParticipantsNames;
147 Dialogue->GetAllParticipantNames(ParticipantsNames);
148
149 for (const FName& ParticipantName : ParticipantsNames)
150 {
151 TSet<TWeakObjectPtr<const UDlgDialogue>>* ValuePtr = ParticipantNamesDialoguesMap.Find(ParticipantName);
152 if (ValuePtr == nullptr)
153 {
154 // does not exist
155 TSet<TWeakObjectPtr<const UDlgDialogue>> ValueArray{Dialogue};
156 ParticipantNamesDialoguesMap.Add(ParticipantName, ValueArray);
157 }
158 else
159 {
160 // exists, add the Dialogue
161 ValuePtr->Add(Dialogue);
162 }
163 }
164 }
165
166 // Build the fast lookup structure for Actors (the ActorsProperties)
167 for (TWeakObjectPtr<AActor> Actor : Actors)
168 {
169 if (!Actor.IsValid())
170 {
171 return;
172 }
173
174 // Should never happen, the actor should always be unique in the Actors array.
175 ensure(ActorsProperties.Find(Actor) == nullptr);
176
177 // Find out the Dialogues that have the ParticipantName of this Actor.
178 const FName ParticipantName = IDlgDialogueParticipant::Execute_GetParticipantName(Actor.Get());
179 TSet<TWeakObjectPtr<const UDlgDialogue>> ActorDialogues;
180 TSet<TWeakObjectPtr<const UDlgDialogue>>* ActorDialoguesPtr = ParticipantNamesDialoguesMap.Find(ParticipantName);
181 if (ActorDialoguesPtr != nullptr)
182 {
183 // Found some dialogue
184 ActorDialogues = *ActorDialoguesPtr;
185 }
186
187 // Create Key in the ActorsProperties for this Actor.
188 TSharedPtr<FDlgDataDisplayActorProperties> ActorsPropertiesValue =
189 MakeShared<FDlgDataDisplayActorProperties>(ActorDialogues);
190 ActorsProperties.Add(Actor, ActorsPropertiesValue);
191
192 // Gather Data from the Dialogues
193 for (TWeakObjectPtr<const UDlgDialogue> Dialogue : ActorDialogues)
194 {
195 if (!Dialogue.IsValid())
196 {
197 return;
198 }
199
200 // Populate Event Names
201 TSet<FName> EventsNames;
202 Dialogue->GetEvents(ParticipantName, EventsNames);
203 for (const FName& EventName : EventsNames)
204 {
205 ActorsPropertiesValue->AddDialogueToEvent(EventName, Dialogue);
206 }
207
208 // Populate conditions
209 TSet<FName> ConditionNames;
210 Dialogue->GetConditions(ParticipantName, ConditionNames);
211 for (const FName& ConditionName : ConditionNames)
212 {
213 ActorsPropertiesValue->AddDialogueToCondition(ConditionName, Dialogue);
214 }
215
216 // Populate int variable names
217 TSet<FName> IntVariableNames;
218 Dialogue->GetIntNames(ParticipantName, IntVariableNames);
219 for (const FName& IntVariableName : IntVariableNames)
220 {
221 ActorsPropertiesValue->AddDialogueToIntVariable(IntVariableName, Dialogue);
222 }
223
224 // Populate float variable names
225 TSet<FName> FloatVariableNames;
226 Dialogue->GetFloatNames(ParticipantName, FloatVariableNames);
227 for (const FName& FloatVariableName : FloatVariableNames)
228 {
229 ActorsPropertiesValue->AddDialogueToFloatVariable(FloatVariableName, Dialogue);
230 }
231
232 // Populate bool variable names
233 TSet<FName> BoolVariableNames;
234 Dialogue->GetBoolNames(ParticipantName, BoolVariableNames);
235 for (const FName& BoolVariableName : BoolVariableNames)
236 {
237 ActorsPropertiesValue->AddDialogueToBoolVariable(BoolVariableName, Dialogue);
238 }
239
240 // Populate FName variable names
241 TSet<FName> FNameVariableNames;
242 Dialogue->GetNameNames(ParticipantName, FNameVariableNames);
243 for (const FName& NameVariableName : FNameVariableNames)
244 {
245 ActorsPropertiesValue->AddDialogueToFNameVariable(NameVariableName, Dialogue);
246 }
247
248 // Populate UClass int variable names
249 TSet<FName> ClassIntVariableNames;
250 Dialogue->GetClassIntNames(ParticipantName, ClassIntVariableNames);
251 for (const FName& IntVariableName : ClassIntVariableNames)
252 {
253 ActorsPropertiesValue->AddDialogueToClassIntVariable(IntVariableName, Dialogue);
254 }
255
256 // Populate UClass float variable names
257 TSet<FName> ClassFloatVariableNames;
258 Dialogue->GetClassFloatNames(ParticipantName, ClassFloatVariableNames);
259 for (const FName& FloatVariableName : ClassFloatVariableNames)
260 {
261 ActorsPropertiesValue->AddDialogueToClassFloatVariable(FloatVariableName, Dialogue);
262 }
263
264 // Populate UClass bool variable names
265 TSet<FName> ClassBoolVariableNames;
266 Dialogue->GetClassBoolNames(ParticipantName, ClassBoolVariableNames);
267 for (const FName& BoolVariableName : ClassBoolVariableNames)
268 {
269 ActorsPropertiesValue->AddDialogueToClassBoolVariable(BoolVariableName, Dialogue);
270 }
271
272 // Populate UClass FName variable names
273 TSet<FName> ClassFNameVariableNames;
274 Dialogue->GetClassNameNames(ParticipantName, ClassFNameVariableNames);
275 for (const FName& NameVariableName : ClassFNameVariableNames)
276 {
277 ActorsPropertiesValue->AddDialogueToClassFNameVariable(NameVariableName, Dialogue);
278 }
279
280 // Populate UClass FText variable names
281 TSet<FName> ClassFTextVariableNames;
282 Dialogue->GetClassTextNames(ParticipantName, ClassFTextVariableNames);
283 for (const FName& NameVariableName : ClassFTextVariableNames)
284 {
285 ActorsPropertiesValue->AddDialogueToClassFTextVariable(NameVariableName, Dialogue);
286 }
287 }
288 }
289
290 // Build the Actors Tree View (aka the actual tree)
291 for (const auto& Elem : ActorsProperties)
292 {
293 // Key: AActor
294 if (!Elem.Key.IsValid())
295 {
296 continue;
297 }
298
299 AActor* Actor = Elem.Key.Get();
300 TSharedPtr<FDlgDataDisplayTreeNode> ActorItem =
301 MakeShared<FDlgDataDisplayTreeActorNode>(FText::FromString(Actor->GetName()), RootTreeItem, Actor);
302 BuildTreeViewItem(ActorItem);
303 RootTreeItem->AddChild(ActorItem);
304 }
305 RootChildren = RootTreeItem->GetChildren();
306
307 // Clear Previous states
308 ActorsTreeView->ClearSelection();
309 // Triggers RequestTreeRefresh
310 ActorsTreeView->ClearExpandedItems();
311
312 // Restore old Expansion
313 if (bPreserveExpansion && OldExpansionState.Num() > 0)
314 {
315 // Flattened tree
316 TArray<TSharedPtr<FDlgDataDisplayTreeNode>> AllNodes;
317 RootTreeItem->GetAllNodes(AllNodes);
318
319 // Expand to match the old state
320 FDlgTreeViewHelper::RestoreTreeExpansionState<TSharedPtr<FDlgDataDisplayTreeNode>>(ActorsTreeView,
321 AllNodes, OldExpansionState, Self::PredicateCompareDlgDataDisplayTreeNode);
322 }
323}
324
326{
327 if (FilterString.IsEmpty())
328 {
329 // No filtering, empty filter, restore original
330 RefreshTree(false);
331 return;
332 }
333
334 // Get all valid paths
335 TArray<TArray<TSharedPtr<FDlgDataDisplayTreeNode>>> OutPaths;
336 RootTreeItem->FilterPathsToNodesThatContainText(FilterString, OutPaths);
337 RootChildren.Empty();
338 RootTreeItem->GetVisibleChildren(RootChildren);
339
340 // Refresh, clear expansion
341 ActorsTreeView->ClearExpandedItems(); // Triggers RequestTreeRefresh
342
343 // Mark paths as expanded
344 for (const TArray<TSharedPtr<FDlgDataDisplayTreeNode>>& Path : OutPaths)
345 {
346 const int32 PathNum = Path.Num();
347 for (int32 PathIndex = 0; PathIndex < PathNum; PathIndex++)
348 {
349 Path[PathIndex]->SetIsVisible(true);
350 ActorsTreeView->SetItemExpansion(Path[PathIndex], true);
351 }
352 }
353}
354
356{
357 // Is it cached?
358 if (FilterTextBoxWidget.IsValid())
359 {
360 return FilterTextBoxWidget.ToSharedRef();
361 }
362
363 // Cache it
364 FilterTextBoxWidget = SNew(SSearchBox)
365 .HintText(LOCTEXT("SearchBoxHintText", "Search by Name"))
366 .OnTextChanged(this, &Self::HandleSearchTextCommited, ETextCommit::Default)
367 .OnTextCommitted(this, &Self::HandleSearchTextCommited)
368 .SelectAllTextWhenFocused(false)
369 .DelayChangeNotificationsWhileTyping(false);
370
371 // Should return a valid widget
372 return GetFilterTextBoxWidget();
373}
374
376 const TSharedPtr<FDlgDataDisplayTreeNode>& Item,
377 const TMap<FName, TSharedPtr<FDlgDataDisplayVariableProperties>>& Variables,
378 const FText& DisplayTextFormat,
380)
381{
382 if (!Item.IsValid())
383 {
384 return;
385 }
386
387 for (const auto& Pair : Variables)
388 {
389 const FName VariableName = Pair.Key;
390 FFormatOrderedArguments Args;
391 Args.Add(FText::FromName(VariableName));
392 const FText DisplayText = FText::Format(DisplayTextFormat, Args);
393
394 // Create Node
395 const TSharedPtr<FDlgDataDisplayTreeVariableNode> ChildItem =
396 MakeShared<FDlgDataDisplayTreeVariableNode>(DisplayText, Item, VariableName, VariableType);
397 Item->AddChild(ChildItem);
398 }
399}
400
401void SDlgDataDisplay::BuildTreeViewItem(const TSharedPtr<FDlgDataDisplayTreeNode>& Item)
402{
403 TWeakObjectPtr<AActor> Actor = Item->GetParentActor();
404 if (!Actor.IsValid())
405 {
406 return;
407 }
408
409 // Do we have the actor cached?
410 TSharedPtr<FDlgDataDisplayActorProperties>* ValuePtr = ActorsProperties.Find(Actor);
411 if (ValuePtr == nullptr)
412 {
413 return;
414 }
415 TSharedPtr<FDlgDataDisplayActorProperties> ActorPropertiesValue = *ValuePtr;
416
417 if (Item->IsText())
418 {
419 switch (Item->GetTextType())
420 {
422 Item->AddChild(MakeShared<FDlgDataDisplayTreeCategoryNode>(
423 LOCTEXT("EventKey", "Events"), Item, EDlgDataDisplayCategoryTreeNodeType::Event));
424 Item->AddChild(MakeShared<FDlgDataDisplayTreeCategoryNode>(
425 LOCTEXT("ConditionKey", "Conditions"), Item, EDlgDataDisplayCategoryTreeNodeType::Condition));
426 Item->AddChild(MakeShared<FDlgDataDisplayTreeCategoryNode>(
427 LOCTEXT("VariablesKey", "Variables"), Item, EDlgDataDisplayCategoryTreeNodeType::Variables));
428 break;
429
431 // No children for variable.
432 break;
433
434 default:
435 unimplemented()
436 }
437 }
438 else if (Item->IsCategory())
439 {
440 // Add variables for each appropriate category
441 switch (Item->GetCategoryType())
442 {
444 for (const auto& Pair: ActorPropertiesValue->GetEvents())
445 {
446 const TSharedPtr<FDlgDataDisplayTreeNode> EventItem = MakeShared<FDlgDataDisplayTreeVariableNode>(
447 FText::FromName(Pair.Key), Item, Pair.Key, EDlgDataDisplayVariableTreeNodeType::Event
448 );
449 Item->AddChild(EventItem);
450 }
451 break;
452
454 for (const auto& Pair: ActorPropertiesValue->GetConditions())
455 {
456 const TSharedPtr<FDlgDataDisplayTreeNode> ConditionItem = MakeShared<FDlgDataDisplayTreeVariableNode>(
457 FText::FromName(Pair.Key), Item, Pair.Key, EDlgDataDisplayVariableTreeNodeType::Condition
458 );
459 Item->AddChild(ConditionItem);
460 }
461 break;
462
464 {
465 AddVariableChildrenToItem(Item, ActorPropertiesValue->GetIntegers(),
466 LOCTEXT("VariableIntKey", "int {0} = "), EDlgDataDisplayVariableTreeNodeType::Integer);
467 AddVariableChildrenToItem(Item, ActorPropertiesValue->GetFloats(),
468 LOCTEXT("VariableFloatKey", "float {0} = "), EDlgDataDisplayVariableTreeNodeType::Float);
469 AddVariableChildrenToItem(Item, ActorPropertiesValue->GetBools(),
470 LOCTEXT("VariableBoolKey", "bool {0} = "), EDlgDataDisplayVariableTreeNodeType::Bool);
471 AddVariableChildrenToItem(Item, ActorPropertiesValue->GetFNames(),
472 LOCTEXT("VariableFNameKey", "FName {0} = "), EDlgDataDisplayVariableTreeNodeType::FName);
473
474 AddVariableChildrenToItem(Item, ActorPropertiesValue->GetClassIntegers(),
475 LOCTEXT("VariableIntKey", "int {0} = "), EDlgDataDisplayVariableTreeNodeType::ClassInteger);
476 AddVariableChildrenToItem(Item, ActorPropertiesValue->GetClassFloats(),
477 LOCTEXT("VariableFloatKey", "float {0} = "), EDlgDataDisplayVariableTreeNodeType::ClassFloat);
478 AddVariableChildrenToItem(Item, ActorPropertiesValue->GetClassBools(),
479 LOCTEXT("VariableBoolKey", "bool {0} = "), EDlgDataDisplayVariableTreeNodeType::ClassBool);
480 AddVariableChildrenToItem(Item, ActorPropertiesValue->GetClassFNames(),
481 LOCTEXT("VariableFNameKey", "FName {0} = "), EDlgDataDisplayVariableTreeNodeType::ClassFName);
482 AddVariableChildrenToItem(Item, ActorPropertiesValue->GetClassFTexts(),
483 LOCTEXT("VariableFTextKey", "FText {0} = "), EDlgDataDisplayVariableTreeNodeType::ClassFText);
484 break;
485 }
486 default:
487 unimplemented();
488 }
489 }
490
491 // Recursively call on children
492 for (const TSharedPtr<FDlgDataDisplayTreeNode>& ChildItem : Item->GetChildren())
493 {
494 BuildTreeViewItem(ChildItem);
495 }
496}
497
498void SDlgDataDisplay::HandleSearchTextCommited(const FText& InText, ETextCommit::Type InCommitType)
499{
500 // Trim and sanitized the filter text (so that it more likely matches)
501 FilterString = FText::TrimPrecedingAndTrailing(InText).ToString();
503}
504
505TSharedRef<ITableRow> SDlgDataDisplay::HandleGenerateRow(TSharedPtr<FDlgDataDisplayTreeNode> InItem,
506 const TSharedRef<STableViewBase>& OwnerTable)
507{
508 // Build row
509 TSharedPtr<STableRow<TSharedPtr<FDlgDataDisplayTreeNode>>> TableRow;
510 const FMargin RowPadding = FMargin(2.f, 2.f);
511 TableRow = SNew(STableRow<TSharedPtr<FDlgDataDisplayTreeNode>>, OwnerTable)
512 .Padding(1.0f);
513
514 // Default row content
515 TSharedPtr<STextBlock> DefaultTextBlock = SNew(STextBlock)
516 .Text(InItem->GetDisplayText())
517 .HighlightText(this, &Self::GetFilterText);
518
519 TSharedPtr<SWidget> RowContent = DefaultTextBlock;
520 TSharedPtr<SHorizontalBox> RowContainer;
521 TableRow->SetRowContent(SAssignNew(RowContainer, SHorizontalBox));
522
523 if (InItem->IsText())
524 {
525 // Add custom widget for variables/events/conditions
526 if (InItem->GetTextType() == EDlgDataDisplayTextTreeNodeType::Variable)
527 {
528 TSharedPtr<SDlgDataPropertyValue> RightWidget;
529 TSharedPtr<FDlgDataDisplayTreeVariableNode> VariableNode =
530 StaticCastSharedPtr<FDlgDataDisplayTreeVariableNode>(InItem);
531
532 // The widget on the right depends on the variable type.
533 switch (VariableNode->GetVariableType())
534 {
542 // Editable text box
543 SAssignNew(RightWidget, SDlgDataTextPropertyValue, VariableNode);
544 break;
545
547 // Trigger Event Button
548 SAssignNew(RightWidget, SDlgDataEventPropertyValue, VariableNode);
549 break;
550
554 // Checkbox
555 SAssignNew(RightWidget, SDlgDataBoolPropertyValue, VariableNode);
556 break;
557
559 default:
560 // Static text
561 SAssignNew(RightWidget, SDlgDataPropertyValue, VariableNode);
562 break;
563 }
564
565 RowContent = SNew(SHorizontalBox)
566 // <variable type> <variable name> =
567 +SHorizontalBox::Slot()
568 .FillWidth(1.0f)
569 .HAlign(HAlign_Left)
570 .VAlign(VAlign_Center)
571 [
572 DefaultTextBlock.ToSharedRef()
573 ]
574
575 +SHorizontalBox::Slot()
576 .FillWidth(1.0f)
577 .HAlign(HAlign_Left)
578 .VAlign(VAlign_Center)
579 [
580 RightWidget.ToSharedRef()
581 ];
582 }
583 }
584
585 // Add expand arrow
586 RowContainer->AddSlot()
587 .AutoWidth()
588 .VAlign(VAlign_Fill)
589 .HAlign(HAlign_Right)
590 [
591 SNew(SExpanderArrow, TableRow)
592 ];
593
594 // Add the row content
595 RowContainer->AddSlot()
596 .FillWidth(1.0)
597 .Padding(RowPadding)
598 [
599 RowContent.ToSharedRef()
600 ];
601
602 return TableRow.ToSharedRef();
603}
604
605void SDlgDataDisplay::HandleGetChildren(TSharedPtr<FDlgDataDisplayTreeNode> InItem,
606 TArray<TSharedPtr<FDlgDataDisplayTreeNode>>& OutChildren)
607{
608 if (!InItem.IsValid())
609 {
610 return;
611 }
612
613 OutChildren = InItem->GetChildren();
614}
615
616void SDlgDataDisplay::HandleTreeSelectionChanged(TSharedPtr<FDlgDataDisplayTreeNode> InItem, ESelectInfo::Type SelectInfo)
617{
618 // Ignored
619}
620
621void SDlgDataDisplay::HandleDoubleClick(TSharedPtr<FDlgDataDisplayTreeNode> InItem)
622{
623 if (!InItem.IsValid())
624 {
625 return;
626 }
627
628 // Expand on double click
629 if (InItem->HasChildren())
630 {
631 ActorsTreeView->SetItemExpansion(InItem, !ActorsTreeView->IsItemExpanded(InItem));
632 }
633}
634
635void SDlgDataDisplay::HandleSetExpansionRecursive(TSharedPtr<FDlgDataDisplayTreeNode> InItem, bool bInIsItemExpanded)
636{
637 if (InItem.IsValid() && InItem->HasChildren())
638 {
639 ActorsTreeView->SetItemExpansion(InItem, bInIsItemExpanded);
640 for (const TSharedPtr<FDlgDataDisplayTreeNode>& Child : InItem->GetChildren())
641 {
642 HandleSetExpansionRecursive(Child, bInIsItemExpanded);
643 }
644 }
645}
646
647#undef LOCTEXT_NAMESPACE
EDlgDataDisplayVariableTreeNodeType
DEFINE_LOG_CATEGORY(LogVaRest)
static FDlgLogger & Get()
Definition DlgLogger.h:24
FORCEINLINE void Error(const FString &Message)
Definition INYLogger.h:325
void HandleTreeSelectionChanged(TSharedPtr< FDlgDataDisplayTreeNode > InItem, ESelectInfo::Type SelectInfo)
void HandleSetExpansionRecursive(TSharedPtr< FDlgDataDisplayTreeNode > InItem, bool bInIsItemExpanded)
void HandleSearchTextCommited(const FText &InText, ETextCommit::Type InCommitType)
TMap< TWeakObjectPtr< AActor >, TSharedPtr< FDlgDataDisplayActorProperties > > ActorsProperties
TSharedPtr< STreeView< TSharedPtr< FDlgDataDisplayTreeNode > > > ActorsTreeView
void AddVariableChildrenToItem(const TSharedPtr< FDlgDataDisplayTreeNode > &Item, const TMap< FName, TSharedPtr< FDlgDataDisplayVariableProperties > > &Variables, const FText &DisplayTextFormat, EDlgDataDisplayVariableTreeNodeType VariableType)
void Construct(const FArguments &InArgs, const TWeakObjectPtr< const UObject > &InWorldContextObjectPtr)
TSharedRef< ITableRow > HandleGenerateRow(TSharedPtr< FDlgDataDisplayTreeNode > InItem, const TSharedRef< STableViewBase > &OwnerTable)
void BuildTreeViewItem(const TSharedPtr< FDlgDataDisplayTreeNode > &Item)
void RefreshTree(bool bPreserveExpansion)
FReply HandleOnRefresh()
TWeakObjectPtr< const UObject > WorldContextObjectPtr
void HandleGetChildren(TSharedPtr< FDlgDataDisplayTreeNode > InItem, TArray< TSharedPtr< FDlgDataDisplayTreeNode > > &OutChildren)
TSharedPtr< FDlgDataDisplayTreeNode > RootTreeItem
static bool PredicateCompareDlgDataDisplayTreeNode(const TSharedPtr< FDlgDataDisplayTreeNode > &FirstNode, const TSharedPtr< FDlgDataDisplayTreeNode > &SecondNode)
void HandleDoubleClick(TSharedPtr< FDlgDataDisplayTreeNode > InItem)
TSharedRef< SWidget > GetFilterTextBoxWidget()
FText GetFilterText() const
TArray< TSharedPtr< FDlgDataDisplayTreeNode > > RootChildren
TSharedPtr< SSearchBox > FilterTextBoxWidget
UCLASS(BlueprintType, Meta = (DisplayThumbnail = "true"))
Definition DlgDialogue.h:85
static TArray< TWeakObjectPtr< AActor > > GetAllWeakActorsWithDialogueParticipantInterface(UWorld *World)
static TArray< UDlgDialogue * > GetAllDialoguesFromMemory()