-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A way to use Single Param Functions from code #14
Comments
Let's see, behind the curtain the function that calls it is and that is handled by this class which has a static handler: you have a bunch of overloaded emits here: Only major problem in using this is that it is in the private folder, so to use it outside, the class would need to be moved out. To summarize, you want to do something like //assuming e.g. this struct you want to emit (and it can be blueprint accessible type too)
USTRUCT()
struct FTestCppStruct
{
GENERATED_BODY()
UPROPERTY()
int32 Index;
UPROPERTY()
float SomeNumber;
UPROPERTY()
FString Name;
};
//...
//Set your struct variables
FTestCppStruct TestStruct;
TestStruct.Name = TEXT("George");
TestStruct.Index = 5;
TestStruct.SomeNumber = 5.123f;
FGESEmitData EmitData;
EmitData.bPinned = true; //or false
EmitData.Domain = TEXT("global.default");
EmitData.Event = TEXT("MyAwesomeEvent");
EmitData.WorldContext = WorldContextObject; //you need WCO from e.g. an actor or a world.
FGESHandler::DefaultHandler()->EmitEvent(EmitData, FTestCppStruct::StaticStruct(), &TestStruct); I'm going to spend a few minutes to expose this so it's usable |
going to combine it with the convenience receiver actor feature branch here: /~https://github.com/getnamo/global-event-system-ue4/tree/feature-base-component-receiver |
Thanks a lot, works like a charm! |
Merged to master with convenience actor component receivers (see /~https://github.com/getnamo/global-event-system-ue4/blob/master/Source/GlobalEventSystem/Public/GESBaseReceiverComponent.h & /~https://github.com/getnamo/global-event-system-ue4/tree/master/Content/GenericComponentReceivers). Now going to work on a bind to c++ lambda variant which should make the receiving side of c++ a bit easier. |
Early release /~https://github.com/getnamo/global-event-system-ue4/releases/tag/0.7.0e closing issue. Re-open a new issue if some bugs crop up |
For the start - I love this tool, both the concept execution. But I'd love use this system from code as well as BP. It was pretty easy to bind and emit an event withouth a param, but I'm trying to figure out - is there any straightforward way to use One Param version from C++?
The text was updated successfully, but these errors were encountered: