Hi there…
So… this is my first time dealing with RepNotify and Delegates in Cpp.
Firstly…
This is my binding for the Delegate in my PlayerController:
Inventory_Items is an ActorComponent, that is written in Cpp, holding my Inventory System.
The Event “Client_UpdateInventoryUI” is an RPC RunOnOwningClient, that simply takes all opened or hidden Inventory Widgets and updates their Grids via a ForEach Loop of the UI Ref Array (and fires a print String at Completion - Important for the problem…).
To the Code Part _>
the Header
#include "Net/UnrealNetwork.h"
#include....
[...]
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FUpdateContent);
[....]
class THEGAMENAME... UAC_InventorySystem
[...]
public:
UPROPERTY(BlueprintAssignable, Category="BDC Inventory")
FUpdateContent OnContentUpdate;
private:
UPROPERTY(ReplicatedUsing=OnRep_SelfContent, EditAnywhere, BlueprintGetter=GetContent, Category="Inventory Setup")
TArray<FStruct_InvContent> SelfContent;
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
And the CPP
#include...
[...]
void UAC_InventorySystem::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(UAC_InventorySystem, SelfContent);
}
void UAC_InventorySystem::OnRep_SelfContent()
{
OnContentUpdate.Broadcast();
}
The Component is replicating and auto activated…
I don´t know, what is not firing… the OnRep_ or the broadcast of the delegate… but I see no print String from the UI Update Event…
Can someone lead me into the right direction?