I’m working on a game that is going to require a fairly complex UI system - a HUD, popup windows, menu overlay, social overlay, all of which should have different states and some of them might have draggable/resizable elements and may steal input from one-another based on the draw order.
I’m not currently aware of a way to define nifty layers of a screen in seperate xml files, so for lack of a desire to bloat a single nifty xml to 5000+ lines of code, I’d like to keep things neatly seperated in their own screens and nifty instances if possible, but do correct me if there’s some obvious easy way to do this.
Now, my problem is that when trying to initialize the seperate nifty instances, I get the following error:
WARNING: An event service by the name NiftyEventBusalready exists. Perhaps multiple threads tried to create a service about the same time? org.bushe.swing.event.EventServiceExistsException: An event service by the name NiftyEventBusalready exists. Perhaps multiple threads tried to create a service about the same time? at org.bushe.swing.event.EventServiceLocator.setEventService(EventServiceLocator.java:123) at de.lessvoid.nifty.Nifty.initalizeEventBus(Nifty.java:222) at de.lessvoid.nifty.Nifty.initialize(Nifty.java:202) at de.lessvoid.nifty.Nifty.<init>(Nifty.java:143) at com.jme3.niftygui.NiftyJmeDisplay.<init>(NiftyJmeDisplay.java:159)
This basically tells me that nifty has a hardcoded name for its event bus which makes me think i might have to dig into the sourcecode and get dirty with it. As a note, I have tried to use seperate viewports for each nifty display as suggested in another thread, made no difference.
I am having issues trying to access the online jmonkey docs so if someone could point out what would be the best course of action, and if it’s indeed possible to import other XMLs in the middle of a screen/layer definition, that would be much appreciated!