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
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void SPCGExCollectionGridTile::Construct(const FArguments& InArgs)
OnTileClicked = InArgs._OnTileClicked;
OnTileDragDetected = InArgs._OnTileDragDetected;
OnTileCategoryChanged = InArgs._OnTileCategoryChanged;
OnTilePropertyChanged = InArgs._OnTilePropertyChanged;
ThumbnailCachePtr = InArgs._ThumbnailCachePtr;
BatchFlagPtr = InArgs._BatchFlagPtr;

Expand Down Expand Up @@ -247,6 +248,7 @@ void SPCGExCollectionGridTile::Construct(const FArguments& InArgs)
Coll->PostEditChange();
if (BatchFlagPtr) { *BatchFlagPtr = false; }
RefreshThumbnail();
OnTilePropertyChanged.ExecuteIfBound();
})
]
]
Expand Down Expand Up @@ -298,6 +300,7 @@ void SPCGExCollectionGridTile::Construct(const FArguments& InArgs)
if (UPCGExAssetCollection* Coll = WeakColl.Get()) { Coll->PostEditChange(); }
if (GEditor) { GEditor->EndTransaction(); }
if (BatchFlagPtr) { *BatchFlagPtr = false; }
OnTilePropertyChanged.ExecuteIfBound();
})
.OnValueCommitted_Lambda([this, WeakColl, Idx](int32 NewVal, ETextCommit::Type CommitType)
{
Expand All @@ -311,6 +314,7 @@ void SPCGExCollectionGridTile::Construct(const FArguments& InArgs)
Entry->Weight = NewVal;
Coll->PostEditChange();
if (BatchFlagPtr) { *BatchFlagPtr = false; }
OnTilePropertyChanged.ExecuteIfBound();
})
.Font(FCoreStyle::GetDefaultFontStyle("Regular", 8))
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ void SPCGExCollectionGridView::RebuildGroupedLayout()
.BatchFlagPtr(&bIsBatchOperation)
.OnTileClicked(FOnTileClicked::CreateSP(this, &SPCGExCollectionGridView::OnTileClicked))
.OnTileDragDetected(FOnTileDragDetected::CreateSP(this, &SPCGExCollectionGridView::OnTileDragDetected))
.OnTileCategoryChanged(FSimpleDelegate::CreateSP(this, &SPCGExCollectionGridView::OnTileCategoryChanged));
.OnTileCategoryChanged(FSimpleDelegate::CreateSP(this, &SPCGExCollectionGridView::OnTileCategoryChanged))
.OnTilePropertyChanged(FSimpleDelegate::CreateSP(this, &SPCGExCollectionGridView::OnTilePropertyChanged));

Group->AddTile(TileWidget);
ActiveTiles.Add(EntryIdx, Tile);
Expand Down Expand Up @@ -454,7 +455,8 @@ void SPCGExCollectionGridView::IncrementalCategoryRefresh()
.BatchFlagPtr(&bIsBatchOperation)
.OnTileClicked(FOnTileClicked::CreateSP(this, &SPCGExCollectionGridView::OnTileClicked))
.OnTileDragDetected(FOnTileDragDetected::CreateSP(this, &SPCGExCollectionGridView::OnTileDragDetected))
.OnTileCategoryChanged(FSimpleDelegate::CreateSP(this, &SPCGExCollectionGridView::OnTileCategoryChanged));
.OnTileCategoryChanged(FSimpleDelegate::CreateSP(this, &SPCGExCollectionGridView::OnTileCategoryChanged))
.OnTilePropertyChanged(FSimpleDelegate::CreateSP(this, &SPCGExCollectionGridView::OnTilePropertyChanged));

Group->AddTile(TileWidget);
ActiveTiles.Add(EntryIdx, Tile);
Expand Down Expand Up @@ -649,6 +651,11 @@ void SPCGExCollectionGridView::OnTileCategoryChanged()
}
}

void SPCGExCollectionGridView::OnTilePropertyChanged()
{
UpdateDetailForSelection();
}

// ── Category operations ─────────────────────────────────────────────────────

void SPCGExCollectionGridView::OnTileDropOnCategory(FName TargetCategory, const TArray<int32>& Indices, int32 InsertBeforeLocalIndex)
Expand Down Expand Up @@ -1037,7 +1044,8 @@ void SPCGExCollectionGridView::PopulateCategoryTiles(FName Category)
.BatchFlagPtr(&bIsBatchOperation)
.OnTileClicked(FOnTileClicked::CreateSP(this, &SPCGExCollectionGridView::OnTileClicked))
.OnTileDragDetected(FOnTileDragDetected::CreateSP(this, &SPCGExCollectionGridView::OnTileDragDetected))
.OnTileCategoryChanged(FSimpleDelegate::CreateSP(this, &SPCGExCollectionGridView::OnTileCategoryChanged));
.OnTileCategoryChanged(FSimpleDelegate::CreateSP(this, &SPCGExCollectionGridView::OnTileCategoryChanged))
.OnTilePropertyChanged(FSimpleDelegate::CreateSP(this, &SPCGExCollectionGridView::OnTilePropertyChanged));

Group->AddTile(TileWidget);
ActiveTiles.Add(EntryIdx, Tile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PCGEXCOLLECTIONSEDITOR_API SPCGExCollectionGridTile : public SCompoundWidg
SLATE_EVENT(FOnTileClicked, OnTileClicked)
SLATE_EVENT(FOnTileDragDetected, OnTileDragDetected)
SLATE_EVENT(FSimpleDelegate, OnTileCategoryChanged)
SLATE_EVENT(FSimpleDelegate, OnTilePropertyChanged)
SLATE_END_ARGS()

void Construct(const FArguments& InArgs);
Expand Down Expand Up @@ -97,6 +98,7 @@ class PCGEXCOLLECTIONSEDITOR_API SPCGExCollectionGridTile : public SCompoundWidg
FOnTileClicked OnTileClicked;
FOnTileDragDetected OnTileDragDetected;
FSimpleDelegate OnTileCategoryChanged;
FSimpleDelegate OnTilePropertyChanged;

// Batch flag — pointer to grid view's bIsBatchOperation (suppresses OnObjectModified during tile edits)
bool* BatchFlagPtr = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class PCGEXCOLLECTIONSEDITOR_API SPCGExCollectionGridView : public SCompoundWidg
void OnTileClicked(int32 Index, const FPointerEvent& MouseEvent);
FReply OnTileDragDetected(int32 Index, const FPointerEvent& MouseEvent);
void OnTileCategoryChanged();
void OnTilePropertyChanged();

// Detail panel management
void UpdateDetailForSelection();
Expand Down