[Ignore this] Typo in Nifty

To any Nifty-experts out there:

After a while not doing stuff in jME, I got back to do something with Nifty, and (of course) I doesn’t work.

I’m trying to make a ListBox (“listBox”), and place it in the middle of the screen.
At the first try, it didn’t work.
I added a few controls, and it still didn’t work.
Added a panel, same result,

Afterwards, I wondered if the order is wrong. I changed the order, and now the controls showed up.
This sounds like a typical nifty-knows-whats-wrong-but-wont-tell-you-problem. Here’s the XML:

<?xml version="1.0" encoding="UTF-8"?>
<nifty xmlns="http://nifty-gui.lessvoid.com/nifty-gui" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://raw.githubusercontent.com/void256/nifty-gui/1.4/nifty-core/src/main/resources/nifty.xsd https://raw.githubusercontent.com/void256/nifty-gui/1.4/nifty-core/src/main/resources/nifty.xsd">
    
    <useStyles filename="nifty-default-styles.xml" />
    <useControls filename="nifty-default-controls.xml" />
    
    <screen id="start" controller="nl.mrcave.console.NiftyState">
        
        <layer id="foreground" childLayout="center">
            
            <panel id="mainPanel" width="80%" height="80%" childLayout="center">
                
                <panel id="some panel" childLayout="horizontal" width="100%" height="100%">
                    <control id="text" name="label" text="Some text"/>
                </panel>
                
                <contol id="chatlist" name="listBox" displayItems="12"/>
                
                <!-- Where I placed the panel before -->
                
            </panel>
            
        </layer>
        
    </screen>
    
</nifty>

Here’s the code relevant to Nifty (called from an AppState):

    NiftyJmeDisplay fakeNifty = new NiftyJmeDisplay(this.app.getAssetManager(), this.app.getInputManager(), this.app.getAudioRenderer(), this.app.getGuiViewPort());
    nifty = fakeNifty.getNifty();
    nifty.fromXml("Interface/console.xml", "start", this);
    this.app.getGuiViewPort().addProcessor(fakeNifty);

IGNORE THIS POST.

IT WAS JUST ME BEING STUPID

I MISSPELLED “CONTOL”
(dammit XML, why dont you have spelling check)

Someone could make a nifty XSD
So one could detect the wrong things

1 Like

Don’t worry. Glad you found your mistake :wink:

From nifty.jar in the jMonkeyEngine download.

The problem was that the sdk nifty template didn’t include it. I posted a PR some time ago and it got merged, but there was no release aince then yet.

mmmm… what it’s all about ?
are you trying to communicate ?

If you look closely at his extract you see the XSD being defined. Actually twice. This could be the problem.

@anon54790888 Can you try to remove the duplicate address in xsi:schemaLocation and see what happens? Do you have auto-complete then?

Maybe the SDK still uses it’s old nifty xsd instead of the user-defined, but you never know.
I’ll be working on a new SDK release though :slight_smile: