Space Plunder
Loading...
Searching...
No Matches
WeaponSlotWidget.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"
8#include "WeaponSlotWidget.generated.h"
9
10UCLASS()
11class WEAPONSYSTEM_API UWeaponSlotWidget : public UUserWidget
12{
13 GENERATED_BODY()
14
15
16
17public:
18 UFUNCTION(BlueprintCallable, Category="Weapons")
19 void SetWeaponSelected(bool bSelected = true, bool bPlayAnim = true);
20 UFUNCTION(BlueprintCallable, Category="Weapons")
21 void SetWeaponHolstered(bool bHolstered = false);
22 UFUNCTION(BlueprintPure, Category="Weapons")
23 bool GetIsWeaponSelected() const {return bWeaponSelected;};
24
25 UFUNCTION(BlueprintCallable, Category="Weapons")
26 void SetWeaponThumbnail(UTexture2D* WeaponThumbnail);
27 UFUNCTION(BlueprintCallable, Category="Weapons")
28 void SetWeaponFireMode(const EWeaponFireMode FireMode);
29 UFUNCTION(BlueprintCallable, Category="Weapons")
30 void SetWeapon(const FString& WeaponID);
31
32 UFUNCTION(BlueprintCallable, Category="Weapons")
33 void SetWeaponName(const FString& WeaponName);
34 UFUNCTION(BlueprintCallable, Category="Weapons")
35 void SetWeaponAmmo(int32 CurrentAmmo, int32 TotalAmmo);
36
37 //- BP Functions //
38 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category="Weapons")
39 void OnWeaponSelected(const bool bSelected, const bool bPlayAnim = true);
40 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category="Weapons")
41 void OnWeaponFireModeChanged(const EWeaponFireMode FireMode);
42
43 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category="Weapons")
44 void OnAmmoChanged(const int32 CurrentAmmo, const int32 TotalAmmo);
45 UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category="Weapons")
46 void OnWeaponHolstered(const bool bHolstered = false);
47
48
49protected:
50 virtual void NativeConstruct() override;
51 virtual bool Initialize() override;
52
53 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Weapons")
54 class UMaterialInterface* WeaponThumbnailMaterial;
55
56
57 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapons")
58 class UImage* WeaponThumbnailImage;
59 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapons")
60 class UImage* AmmoThumbnailImage;
61 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapons")
62 class UImage* DisabledGlow;
63
64
65 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapons")
66 class UTextBlock* CurrentAmmoTextBlock;
67 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapons")
68 class UTextBlock* TotalAmmoTextBlock;
69 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapons")
70 class UTextBlock* WeaponNameTextBlock;
71 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (BindWidget), Category="Weapons")
72 class UTextBlock* EmptyTextBlock;
73
74 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Weapons")
75 bool bWeaponSelected = false;
76
77};
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
EWeaponFireMode
Enum class representing the different fire modes for a weapon.
Definition WeaponStructs.h:99
Definition WeaponSlotWidget.h:12