Re: [SOLVED] Possibility to listen to events within a plugin
Posted: Sun Aug 10, 2014 8:19 am
Hi Pako,
I have never been to Dresden yet, but I heard from many people that it's a very nice old city, I hope you had a good time in Germany
As for the EventListener; it works very similar to LogListener, but hands over the whole event object, not only a string.
You can use it like this:
I have never been to Dresden yet, but I heard from many people that it's a very nice old city, I hope you had a good time in Germany
As for the EventListener; it works very similar to LogListener, but hands over the whole event object, not only a string.
You can use it like this:
Code: Select all
class LogWrapper:
def AddEventListener(self):
if self not in eg.log.eventListeners:
eg.log.AddEventListener(self)
def LogEvent(self, event):
print event.suffix
def StopEventListener(self):
if self in eg.log.eventListeners:
eg.log.RemoveEventListener(self)
eg.globals.LogWrapper=LogWrapper()
eg.globals.LogWrapper.AddEventListener()