2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CommonUserWidget.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "UObject/ObjectPtr.h"
|
|
|
|
#include "UObject/UObjectGlobals.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
#include "LyraReticleWidgetBase.generated.h"
|
|
|
|
|
|
|
|
class ULyraInventoryItemInstance;
|
2022-09-13 07:18:28 +00:00
|
|
|
class ULyraWeaponInstance;
|
|
|
|
class UObject;
|
|
|
|
struct FFrame;
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
UCLASS(Abstract)
|
|
|
|
class ULyraReticleWidgetBase : public UCommonUserWidget
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
ULyraReticleWidgetBase(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintImplementableEvent)
|
|
|
|
void OnWeaponInitialized();
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void InitializeFromWeapon(ULyraWeaponInstance* InWeapon);
|
|
|
|
|
|
|
|
/** Returns the current weapon's diametrical spread angle, in degrees */
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintPure)
|
|
|
|
float ComputeSpreadAngle() const;
|
|
|
|
|
|
|
|
/** Returns the current weapon's maximum spread radius in screenspace units (pixels) */
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintPure)
|
|
|
|
float ComputeMaxScreenspaceSpreadRadius() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the current weapon is at 'first shot accuracy'
|
|
|
|
* (the weapon allows it and it is at min spread)
|
|
|
|
*/
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintPure)
|
|
|
|
bool HasFirstShotAccuracy() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
UPROPERTY(BlueprintReadOnly)
|
|
|
|
TObjectPtr<ULyraWeaponInstance> WeaponInstance;
|
|
|
|
|
|
|
|
UPROPERTY(BlueprintReadOnly)
|
|
|
|
TObjectPtr<ULyraInventoryItemInstance> InventoryInstance;
|
|
|
|
};
|