23 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category=
"Weapon Widget")
24 void OnHitMarker(const AActor* ActorHit, const
float Damage, const UDamageType* DamageType, const FName HitBone, const FVector HitLocation, const
bool bKillingHit, const
bool bInjuredPart);
25 virtual
void HitMarker(const AActor* ActorHit, const
float Damage, const UDamageType* DamageType, const FName HitBone, const FVector HitLocation, const
bool bKillingHit, const
bool bInjuredPart) override;
26 virtual
void GunRecoil(const
float RecoilAmount) override;
29 UFUNCTION(BlueprintCallable, Category="Weapon Widget")
30 void SetCrosshairLocation();
31 void SetCrosshairRadius();
35 UFUNCTION(BlueprintCallable, Category="Weapon Widget")
36 void SetGunRecoil(const
float RecoilAmount);
38 virtual
void StartedAiming() override;
39 virtual
void StoppedAiming() override;
40 UFUNCTION(BlueprintImplementableEvent, Category="Weapon Widget")
41 void OnStartedAiming();
42 UFUNCTION(BlueprintImplementableEvent, Category="Weapon Widget")
43 void OnStoppedAiming();
45 virtual
void SetHolstered(const
bool bIsHolstered) override;
46 UFUNCTION(BlueprintImplementableEvent, Category="Weapon Widget")
47 void OnHolsteredSet(const
bool bIsHolstered);
49 virtual
void SetWeaponCrosshair(const
FCrosshairData& CrosshairType, const
float Spread) override;
51 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category="Weapon Widget")
52 void OnSetWeaponCrosshair(const
FCrosshairData& CrosshairType, const
float Spread);
57 virtual
bool Initialize() override;
59 virtual
void NativeConstruct() override;
62 void VisibilityChangedEvent(ESlateVisibility InVisibility);
65 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
66 float InterpSpeed = 12.0f;
67 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
68 float UpperBound = -80.0f;
69 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
70 float LowerBound = 25.0f;
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
73 float RecoilMultiplier = 20.0f;
74 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
75 float PlayerSpeedMultiplier = 0.15f;
76 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
77 float WeaponSpreadMultiplier = 0.15f;
79 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
80 float UpdateSpeed = 0.03f;
82 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
83 float CrosshairOpacityLow = 0.2f;
84 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
85 bool bShowDamageNumbers = false;
86 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Crosshair|
General")
87 bool bShowDamageHitDot = false;
89 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
90 UWidget* DamageVerticalBox =
nullptr;
91 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
92 UWidget* HitMarkerWidget =
nullptr;
93 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
94 UTextBlock* DamageAmount =
nullptr;
96 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
98 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
99 class UWidget* HitMarkers =
nullptr;
100 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
101 UWidget* CrosshairOverlay =
nullptr;
104 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
105 class USizeBox* ReticleSizeBox =
nullptr;
107 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
108 class UImage* OuterImage =
nullptr;
109 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget))
110 class UImage* OuterImageHorizontal =
nullptr;
112 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Crosshair|Status")
113 bool bHolstered = true;
114 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Crosshair|Status")
115 bool bAiming = false;
116 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Crosshair|Status")
117 int32 CrosshairStyle = 0;
118 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Crosshair|Status")
120 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Crosshair|Status")
121 float WeaponSpread = 0.0f;
123 void SetDamagePosition(const FVector&
Location) const;
124 void SetCrosshairOpacity() const;
126 void SetReticleSize(const
float Radius) const;
128 void SetHitMarkerVisibility(const
float Alpha) const;
129 float ProcessNumbers(const class UCanvasPanelSlot* CanvasSlot, const
bool bVertical) const;
131 float ComputeMaxScreenspaceSpreadRadius() const;
133 FTimerHandle HitMarkerTimerHandle;
134 FTimerHandle CrosshairUpdateTimerHandle;
137 bool bRecoilFire = false;