Request: Allow custom event types #315
drew-512
started this conversation in
Feature Requests
Replies: 1 comment 4 replies
-
I haven't tried, so you can tell me if I'm wrong, but can't you just create a struct that implement IGestureEvent? And then, you could have some code that fires the event on the UIBlock. Something like: public struct MyCustomGesture : IGestureEvent // missing IEquatable<MyCustomGesture> cuz I'm lazy
{
public UIBlock Target { get; set; }
public UIBlock Receiver { get; set; }
public int ID { get; set; }
public Interaction.Update Interaction { get; set; }
}
// Register to the gesture
UIBlock.AddGestureHandler<MyCustomGesture>(evt => { });
// Fire the gesture
UIBlock.FireGestureEvent(new MyCustomGesture()); Sorry if I misunderstood 😃 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, Nova has a flexible and potent event handling system that appears to be flexible due the nature of
IEvent
. However, there appears no way to inject one's own event struct and have it travel like other events up the hierarchy, etc.Request: allow developers to define their own event types and inject them into UIBlocks such that Nova processes handles them as other events. This would be quite useful -- and the functionality is basically already there and ready to go but private / protected. This pattern of making everything private is counterproductive to devs trying to leverage the advantage of Nova but do not want to maintain mods on the Nova codebase for requests such as this possible. So it would be great to start being more relaxed with that -- consider how many pieces of software have become bis specifically because they can be easily extended.
Thanks and keep up the great work! :D
Beta Was this translation helpful? Give feedback.
All reactions