Space Plunder
Loading...
Searching...
No Matches
WeaponSystemWidget.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Blueprint/UserWidget.h"
9#include "WeaponSystemWidget.generated.h"
10
11
12
13UCLASS()
14class WEAPONSYSTEM_API UWeaponSystemWidget : public UUserWidget, public IWeaponHUDInterface
15{
16 GENERATED_BODY()
17
18public:
19 explicit UWeaponSystemWidget(const FObjectInitializer& ObjectInitializer);
20
21 virtual void SetPlayerWeaponState(const FPlayerWeaponState& WeaponState) override;
22 virtual void SetAmmo(const int32 CurrentAmmo,const int32 TotalAmmo) override;
23 virtual void UpdateWeapons(const TArray<FWeaponData_T>& Weapons, const int32 CurrentWeaponIndex) override;
24 virtual void SetMaxNumberOfWeaponsDisplayed(const int32 Number) override{MaxNumberOfWeaponsDisplayed = Number;};
25 // virtual void GunRecoil(const float RecoilAmount) override;
26
27 UFUNCTION(BlueprintPure, BlueprintCallable, Category="Weapons")
28 int32 GetLastWeaponIndex() const{return LastWeaponIndex;};
29
30
31
32
33 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category="Weapon System")
34 void OnWeaponsChanged(const TArray<FWeaponData_T> & OutWeaponsInventory, const int32 CurrentWeapon);
35 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category="Weapon System")
36 void OnPlayerWeaponStateChanged(const FPlayerWeaponState& PlayerWeaponState);
37 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category="Weapon System")
38 void OnAmmoChanged(const int32 CurrentAmmo, const int32 TotalAmmo);
39
40 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Weapons")
41 int32 SpacerSize = 4;
42
43protected:
44 virtual bool Initialize() override;
45
46 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapon System")
47 class UTextBlock* CurrentAmmoTextBlock;
48 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapon System")
49 class UTextBlock* CurrentTotalAmmoTextBlock;
50 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapon System")
51 class UHorizontalBox* WeaponSlotsBox;
52
53 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Weapon System")
54 TArray<class UWeaponSlotWidget*> WeaponSlots;
55private:
56
57 UPROPERTY(EditAnywhere, Category="Weapon System")
58 TSubclassOf<class UWeaponSlotWidget> WeaponSlotClass;
59
60 int32 MaxNumberOfWeaponsDisplayed;
61 int32 LastWeaponIndex = 99;
62
63
64};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition WeaponHUDInterface.h:18
Definition WeaponSlotWidget.h:12
Definition WeaponSystemWidget.h:15
virtual void SetMaxNumberOfWeaponsDisplayed(const int32 Number) override
Definition WeaponSystemWidget.h:24
A struct that represents the state of a player's weapon.
Definition WeaponStructs.h:118
Struct representing data of a weapon that changes.
Definition WeaponStructs.h:861