Adventure Kit  4.16
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
AAdvKitInventoryItem Class Reference

Base item class that defines objects that the character can use and store in its inventory. Items can be equipped and unequipped. More...

#include <AdvKitInventoryItem.h>

Inheritance diagram for AAdvKitInventoryItem:
AAdvKitInventorySimpleCombinable AAdvKitWeapon AAdvKitWeaponTracing

Public Member Functions

 AAdvKitInventoryItem (const FObjectInitializer &ObjectInitializer)
 
virtual void BeginPlay () override
 
virtual void Tick (float DeltaSeconds) override
 
virtual void EndPlay (const EEndPlayReason::Type EndPlayReason) override
 
bool CanBeCombinedWith (class AAdvKitInventoryItem *With)
 
virtual bool CanBeCombinedWith_Implementation (class AAdvKitInventoryItem *With)
 
class AAdvKitInventoryItemCombinedWith (class AAdvKitInventoryItem *With)
 
virtual class AAdvKitInventoryItemCombinedWith_Implementation (class AAdvKitInventoryItem *With)
 
void OwnerDied ()
 
virtual void OwnerDied_Implementation ()
 
void Drop (FVector Velocity=FVector::ZeroVector)
 
virtual void Drop_Implementation (FVector Velocity=FVector::ZeroVector)
 
EAdvKitInventoryState GetItemState ()
 
virtual void Equip (bool bInstant=false)
 
virtual void Uneqiup (bool bInstant=false)
 
bool CanEquip (bool bInstant=false)
 
virtual bool CanEquip_Implementation (bool bInstant=false)
 
bool CanUneqiup (bool bInstant=false)
 
virtual bool CanUneqiup_Implementation (bool bInstant=false)
 

Static Public Member Functions

static UTexture2D * GetInventoryIconTexture (TSubclassOf< AAdvKitInventoryItem > InventoryClass)
 

Public Attributes

FText ItemName
 
FText ItemDescription
 
UTexture2D * Icon
 
TSubclassOf< class AAdvKitPickupDroppedPickupClass
 
bool bDropOnDeath
 
bool bUseAimOffset
 
float EquipTime
 
UAnimMontage * EquipMontage
 
float UneqiupTime
 
UAnimMontage * UneqiupMontage
 
FName AttachmentSocketName
 
FTimerHandle EquipTimerHandle
 

Protected Member Functions

void AttachToCharacter ()
 
virtual void AttachToCharacter_Implementation ()
 
void DetachFromCharacter ()
 
virtual void DetachFromCharacter_Implementation ()
 
void SetItemState (EAdvKitInventoryState NewState, bool bInstant=false)
 
virtual void OnRep_ItemState (FRepAdvKitInventoryState PreviousRepItemState)
 
virtual void Equipped (bool bInstant=false)
 
virtual void Uneqiupped (bool bInstant=false)
 
void UneqiupServer (bool bInstant=false)
 
virtual void UneqiupServer_Implementation (bool bInstant=false)
 
void EquipServer (bool bInstant=false)
 
virtual void EquipServer_Implementation (bool bInstant=false)
 
void OnEquip (bool bInstant=false)
 
virtual void OnEquip_Implementation (bool bInstant=false)
 
void OnEquipped (bool bInstant=false)
 
virtual void OnEquipped_Implementation (bool bInstant=false)
 
void OnUneqiup (bool bInstant=false)
 
virtual void OnUneqiup_Implementation (bool bInstant=false)
 
void OnUneqiupped (bool bInstant=false)
 
virtual void OnUneqiupped_Implementation (bool bInstant=false)
 

Protected Attributes

FRepAdvKitInventoryState RepItemState
 

Detailed Description

Base item class that defines objects that the character can use and store in its inventory. Items can be equipped and unequipped.

Constructor & Destructor Documentation

AAdvKitInventoryItem::AAdvKitInventoryItem ( const FObjectInitializer &  ObjectInitializer)

Constructor

Member Function Documentation

void AAdvKitInventoryItem::AttachToCharacter ( )
protected

Attaches this item to the character (e.g. a weapon to the hand). Called when item is being equipped.

bool AAdvKitInventoryItem::CanBeCombinedWith ( class AAdvKitInventoryItem With)

Can this item be combined with another?

Parameters
WithThe other item to combine with.
Returns
True if combinable.
bool AAdvKitInventoryItem::CanEquip ( bool  bInstant = false)

Check if the item can be equipped.

Parameters
bInstantCan it be equipped instantly.
Returns
True if item can be equipped.
bool AAdvKitInventoryItem::CanUneqiup ( bool  bInstant = false)

Check if the item can be unequipped.

Parameters
bInstantCan it be unequipped instantly.
Returns
True if item can be unequipped.
class AAdvKitInventoryItem* AAdvKitInventoryItem::CombinedWith ( class AAdvKitInventoryItem With)

Combine this item with another.

Parameters
WithThe other item to combine with.
Returns
The result of the combination.
void AAdvKitInventoryItem::DetachFromCharacter ( )
protected

Detaches this item from the character (e.g. a weapon frmo the hand). Called when item is being unequipped.

void AAdvKitInventoryItem::Drop ( FVector  Velocity = FVector::ZeroVector)

Drop this item (spawns pickup if configured).

Parameters
VelocityIn which direction to drop the pickup.
void AAdvKitInventoryItem::Equip ( bool  bInstant = false)
virtual

Tell the item to equip.

Parameters
bInstantTrue to equip instantly, otherwise regular equipment time and animations
void AAdvKitInventoryItem::Equipped ( bool  bInstant = false)
protectedvirtual

Callback when the item was equipped (either by timer or instant)

Parameters
bInstantTrue if the equip was instant
void AAdvKitInventoryItem::EquipServer ( bool  bInstant = false)
protected

Server callback to tell the item to equip.

Parameters
bInstantTrue to equip instantly, otherwise regular equipment time and animations
UTexture2D * AAdvKitInventoryItem::GetInventoryIconTexture ( TSubclassOf< AAdvKitInventoryItem InventoryClass)
static

Get the icon texture of an inventory item class without the need to instantiate it.

Parameters
InventoryClassClass of the inventory item to get the icon from.
Returns
Icon texture of the inventory item.
EAdvKitInventoryState AAdvKitInventoryItem::GetItemState ( )

Getter for the inventory item state.

Returns
State struct of the item.
void AAdvKitInventoryItem::OnEquip ( bool  bInstant = false)
protected

State Callbacks Event called when item starts to equip.

Parameters
bInstantWhether equipping is instant or not
void AAdvKitInventoryItem::OnEquipped ( bool  bInstant = false)
protected

Event called when item finished equipping.

Parameters
bInstantWhether equipping was instant or not
void AAdvKitInventoryItem::OnRep_ItemState ( FRepAdvKitInventoryState  PreviousRepItemState)
protectedvirtual

Callback when item state changed remotely.

Parameters
PreviousRepItemStateState value before the change.
void AAdvKitInventoryItem::OnUneqiup ( bool  bInstant = false)
protected

Event called when item starts to unequip.

Parameters
bInstantWhether unequipping is instant or not
void AAdvKitInventoryItem::OnUneqiupped ( bool  bInstant = false)
protected

Event called when item finished unequipping.

Parameters
bInstantWhether unequipping was instant or not
void AAdvKitInventoryItem::OwnerDied ( )

Event called when the owning character died.

void AAdvKitInventoryItem::SetItemState ( EAdvKitInventoryState  NewState,
bool  bInstant = false 
)
protected

Set a new item state

Parameters
NewStateThe new state to set
bInstantWhether to change states instant or do the regular transitions
void AAdvKitInventoryItem::Uneqiup ( bool  bInstant = false)
virtual

Tell the item to unequip.

Parameters
bInstantTrue to unequip instantly, otherwise regular unequipment time and animations

Reimplemented in AAdvKitWeapon.

void AAdvKitInventoryItem::Uneqiupped ( bool  bInstant = false)
protectedvirtual

Callback when the item was unequipped (either by timer or instant)

Parameters
bInstantTrue if the unequip was instant
void AAdvKitInventoryItem::UneqiupServer ( bool  bInstant = false)
protected

Server callback to tell the item to unequip.

Parameters
bInstantTrue to equip instantly, otherwise regular unequipment time and animations

Member Data Documentation

FName AAdvKitInventoryItem::AttachmentSocketName

Name of the socket on the character mesh to attach the inventory to when equipping.

bool AAdvKitInventoryItem::bDropOnDeath

Flag to drop item when owner died

bool AAdvKitInventoryItem::bUseAimOffset

Whether or not this item needs aim offsets (e.g. guns for targeting)

TSubclassOf<class AAdvKitPickup> AAdvKitInventoryItem::DroppedPickupClass

Pickup that is dropped when this item is dropped by the owning character.

UAnimMontage* AAdvKitInventoryItem::EquipMontage

Montage to play on the character when equipping this item.

float AAdvKitInventoryItem::EquipTime

How long does it equip this item (in Seconds)

FTimerHandle AAdvKitInventoryItem::EquipTimerHandle

Timer to fire when equipping is done.

UTexture2D* AAdvKitInventoryItem::Icon

Icon to draw for this inventory item.

FText AAdvKitInventoryItem::ItemDescription

Flavor text for the item.

FText AAdvKitInventoryItem::ItemName

Name of this inventory item.

FRepAdvKitInventoryState AAdvKitInventoryItem::RepItemState
protected

State Handling Replicated state of the item.

UAnimMontage* AAdvKitInventoryItem::UneqiupMontage

Montage to play on the character when unequipping this item.

float AAdvKitInventoryItem::UneqiupTime

How long does it take to unequip this item (in Seconds)


The documentation for this class was generated from the following files: