Setup player preview for equipment panel

This commit is contained in:
2026-05-31 15:33:43 +03:00
parent 4218b36ac9
commit 56cc2fce98
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)
@@ -28,6 +28,7 @@ class NAKEDDESIRE_API UInventoryScreenWidget : public UCommonActivatableWidget
protected:
virtual void NativeOnActivated() override;
virtual void NativeOnDeactivated() override;
private:
void HandleSlotClicked(UEquipmentSlotWidget* SlotWidget);