diff --git a/Source/PCGExCollectionsEditor/Private/Details/Collections/SPCGExCollectionGridTile.cpp b/Source/PCGExCollectionsEditor/Private/Details/Collections/SPCGExCollectionGridTile.cpp index ca8bea2fc..eda419f27 100644 --- a/Source/PCGExCollectionsEditor/Private/Details/Collections/SPCGExCollectionGridTile.cpp +++ b/Source/PCGExCollectionsEditor/Private/Details/Collections/SPCGExCollectionGridTile.cpp @@ -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; @@ -247,6 +248,7 @@ void SPCGExCollectionGridTile::Construct(const FArguments& InArgs) Coll->PostEditChange(); if (BatchFlagPtr) { *BatchFlagPtr = false; } RefreshThumbnail(); + OnTilePropertyChanged.ExecuteIfBound(); }) ] ] @@ -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) { @@ -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)) ] diff --git a/Source/PCGExCollectionsEditor/Private/Details/Collections/SPCGExCollectionGridView.cpp b/Source/PCGExCollectionsEditor/Private/Details/Collections/SPCGExCollectionGridView.cpp index 060ee056b..18107d201 100644 --- a/Source/PCGExCollectionsEditor/Private/Details/Collections/SPCGExCollectionGridView.cpp +++ b/Source/PCGExCollectionsEditor/Private/Details/Collections/SPCGExCollectionGridView.cpp @@ -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); @@ -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); @@ -649,6 +651,11 @@ void SPCGExCollectionGridView::OnTileCategoryChanged() } } +void SPCGExCollectionGridView::OnTilePropertyChanged() +{ + UpdateDetailForSelection(); +} + // ── Category operations ───────────────────────────────────────────────────── void SPCGExCollectionGridView::OnTileDropOnCategory(FName TargetCategory, const TArray& Indices, int32 InsertBeforeLocalIndex) @@ -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); diff --git a/Source/PCGExCollectionsEditor/Public/Details/Collections/SPCGExCollectionGridTile.h b/Source/PCGExCollectionsEditor/Public/Details/Collections/SPCGExCollectionGridTile.h index 33834872d..5697898f8 100644 --- a/Source/PCGExCollectionsEditor/Public/Details/Collections/SPCGExCollectionGridTile.h +++ b/Source/PCGExCollectionsEditor/Public/Details/Collections/SPCGExCollectionGridTile.h @@ -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); @@ -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; diff --git a/Source/PCGExCollectionsEditor/Public/Details/Collections/SPCGExCollectionGridView.h b/Source/PCGExCollectionsEditor/Public/Details/Collections/SPCGExCollectionGridView.h index 7f3a64b17..1a17c9bdc 100644 --- a/Source/PCGExCollectionsEditor/Public/Details/Collections/SPCGExCollectionGridView.h +++ b/Source/PCGExCollectionsEditor/Public/Details/Collections/SPCGExCollectionGridView.h @@ -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();