Setup player preview for equipment panel

This commit is contained in:
2026-05-31 15:33:43 +03:00
parent e70b1d757c
commit f59fa8d948
42 changed files with 823 additions and 318 deletions
@@ -6,6 +6,7 @@
#include "EquipmentPanelWidget.h"
#include "EquipmentSlotMenuWidget.h"
#include "EquipmentSlotWidget.h"
#include "NakedDesire/Global/PlayerPreviewCaptureSubsystem.h"
void UInventoryScreenWidget::NativeOnActivated()
{
@@ -35,6 +36,22 @@ void UInventoryScreenWidget::NativeOnActivated()
}
CloseMenu();
// Spin up the impostor scene-capture preview only while this screen is open.
if (UPlayerPreviewCaptureSubsystem* Preview = GetWorld()->GetSubsystem<UPlayerPreviewCaptureSubsystem>())
{
Preview->SetPreviewActive(true);
}
}
void UInventoryScreenWidget::NativeOnDeactivated()
{
Super::NativeOnDeactivated();
if (UPlayerPreviewCaptureSubsystem* Preview = GetWorld()->GetSubsystem<UPlayerPreviewCaptureSubsystem>())
{
Preview->SetPreviewActive(false);
}
}
void UInventoryScreenWidget::HandleSlotClicked(UEquipmentSlotWidget* SlotWidget)