Download LyraStarterGame/Source/LyraGame/Equipment/LyraQuickBarComponent.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.71 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Equipment/LyraQuickBarComponent.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Equipment/LyraQuickBarComponent.h
-
curl -L -o LyraQuickBarComponent.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Equipment/LyraQuickBarComponent.h
2.71 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class AActor; | |
| class ULyraEquipmentInstance; | |
| class ULyraEquipmentManagerComponent; | |
| class UObject; | |
| struct FFrame; | |
| UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent)) | |
| class ULyraQuickBarComponent : public UControllerComponent | |
| { | |
| GENERATED_BODY() | |
| public: | |
| ULyraQuickBarComponent(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); | |
| UFUNCTION(BlueprintCallable, Category="Lyra") | |
| void CycleActiveSlotForward(); | |
| UFUNCTION(BlueprintCallable, Category="Lyra") | |
| void CycleActiveSlotBackward(); | |
| UFUNCTION(Server, Reliable, BlueprintCallable, Category="Lyra") | |
| void SetActiveSlotIndex(int32 NewIndex); | |
| UFUNCTION(BlueprintCallable, BlueprintPure=false) | |
| TArray<ULyraInventoryItemInstance*> GetSlots() const | |
| { | |
| return Slots; | |
| } | |
| UFUNCTION(BlueprintCallable, BlueprintPure=false) | |
| int32 GetActiveSlotIndex() const { return ActiveSlotIndex; } | |
| UFUNCTION(BlueprintCallable, BlueprintPure = false) | |
| ULyraInventoryItemInstance* GetActiveSlotItem() const; | |
| UFUNCTION(BlueprintCallable, BlueprintPure=false) | |
| int32 GetNextFreeItemSlot() const; | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly) | |
| void AddItemToSlot(int32 SlotIndex, ULyraInventoryItemInstance* Item); | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly) | |
| ULyraInventoryItemInstance* RemoveItemFromSlot(int32 SlotIndex); | |
| virtual void BeginPlay() override; | |
| private: | |
| void UnequipItemInSlot(); | |
| void EquipItemInSlot(); | |
| ULyraEquipmentManagerComponent* FindEquipmentManager() const; | |
| protected: | |
| UPROPERTY() | |
| int32 NumSlots = 3; | |
| UFUNCTION() | |
| void OnRep_Slots(); | |
| UFUNCTION() | |
| void OnRep_ActiveSlotIndex(); | |
| private: | |
| UPROPERTY(ReplicatedUsing=OnRep_Slots) | |
| TArray<TObjectPtr<ULyraInventoryItemInstance>> Slots; | |
| UPROPERTY(ReplicatedUsing=OnRep_ActiveSlotIndex) | |
| int32 ActiveSlotIndex = -1; | |
| UPROPERTY() | |
| TObjectPtr<ULyraEquipmentInstance> EquippedItem; | |
| }; | |
| USTRUCT(BlueprintType) | |
| struct FLyraQuickBarSlotsChangedMessage | |
| { | |
| GENERATED_BODY() | |
| UPROPERTY(BlueprintReadOnly, Category=Inventory) | |
| TObjectPtr<AActor> Owner = nullptr; | |
| UPROPERTY(BlueprintReadOnly, Category = Inventory) | |
| TArray<TObjectPtr<ULyraInventoryItemInstance>> Slots; | |
| }; | |
| USTRUCT(BlueprintType) | |
| struct FLyraQuickBarActiveIndexChangedMessage | |
| { | |
| GENERATED_BODY() | |
| UPROPERTY(BlueprintReadOnly, Category=Inventory) | |
| TObjectPtr<AActor> Owner = nullptr; | |
| UPROPERTY(BlueprintReadOnly, Category=Inventory) | |
| int32 ActiveIndex = 0; | |
| }; | |