Event subscriptions
Posted: Wed Dec 21, 2005 12:43
Recently, I encountered a problem with event (un)subscriptions (see here for more details).
So I thought about doing some minor modifications to the event unsubscription in the cegui event management. So I'll try here to explain what I'm about to do, so you can give me some advice.
In current version, when you unsubscribe some it is directly removed from the list, same when you subscribe, directly added.
#Subscription
What I want to do is let the subscription as it is, but adding the new connection at the front of the list (so an event added within another event process will not be directly fired).
#Unsubscription
I plane to add another list, the "to be removed events". So when removing an event, thanks to some boolean field, we may know if we are processing events or not, if so, the connection will not be removed directly but added to the new list. And finally, at the end of processings, the "to be removed" ones are actually removed.
So, could this reasonably be added in complete osmosis with the rest of cegui ?
So I thought about doing some minor modifications to the event unsubscription in the cegui event management. So I'll try here to explain what I'm about to do, so you can give me some advice.
In current version, when you unsubscribe some it is directly removed from the list, same when you subscribe, directly added.
#Subscription
What I want to do is let the subscription as it is, but adding the new connection at the front of the list (so an event added within another event process will not be directly fired).
#Unsubscription
I plane to add another list, the "to be removed events". So when removing an event, thanks to some boolean field, we may know if we are processing events or not, if so, the connection will not be removed directly but added to the new list. And finally, at the end of processings, the "to be removed" ones are actually removed.
So, could this reasonably be added in complete osmosis with the rest of cegui ?