I have an issue with instancing in nifty gui.
I have setup my game so that if a game is started (from my start menu) a Nifty GUI is created from scratched. When the game is ended I close and recreate Nifty and the NiftyJMEOverlay.
The problem is that old objects which subscribe to the old Nifty object via [java]nifty.subscribeAnnotations( this );[/java] is still triggering to nifty events setup through [java]@NiftyEventSubscriber( id = “console” )[/java] - even though they should be subscribing to a whole new nifty instance.
This results in events triggering equal to the number of games I have opened closed in one session…
Is the nifty object or its eventbus using a singleton internally?
I guess the obvious solution would be to only init my gui once, which would be a major rewrite, adding post init binding of the gui to a game instance.