Setup player preview for equipment panel
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user