resourceBundle tag in nifty's XML stops preview

Self-explanatory.



If the tag:



|resourceBundle id=“options” filename=“gui/options” /|



exist, the preview won’t work. I wouldn’t mind if the text was ${whatever.that} was printed instead of the localized text, but it’s slightly annoying to have to remove the tag every time to check out modifications. :slight_smile:

I’m running into the same problem right now (newest version of the SDK). Is there anything one can do?

Can anybody explain that in normal terms? Nifty has access to the whole class path of the project, idk exactly whats the issue?

When you turn on Nifty previews, if the XML contains this, the preview won’t work:



[xml]

<resourceBundle id=“dialog” filename=“com/madjack/games/disenthral/gui/nifty/dialog” />

[/xml]

The dialog file contains the localized strings used in the nifty screen(s).



PS: “dialog” is the name I use here. It’s in no way the mandatory name. FYI.

I noticed a (maybe related) issue: If you want to define custom styles using style-files and you try to use them with <useStyles filename"file.xml" /> the preview won’t work either. I also don’t exactly know what path I have to put in there. I put all those xml and i18n files into the Interface-folder of the project, so it should work to just use the filename, right? Maybe the problem is that the preview can’t resolve the file-paths or something…

True. I forgot about that.

Just put it in your assets folder.

Edit: And all library assets should be found now, all libraries and whatever you add to your project is accessible for nifty.

What do you mean with “Just put it in your assets folder.”? Where put them in?

in your assets folder

What is it you’re talking about!? What files?



All my custom styles are in the assets folder. O_o Where else would I put them?

You have a folder called “com/madjack/games/disenthral/gui/nifty/” in your assets folder? I was talking about styles, like the black or grey style that come with the SDK. You can just exchange the library in your project settings if you want to use another style, no need to copy that to the assets folder.

And I was talking about custom style-files :slight_smile:

Yeah, those you put in your assets folder.

Oh! You’re talking about the resourceBundle file. Right.



It turns out Nifty only wants resource files to be relative to sources folder… Or something like that.



Short story is, if I put the dialog files in the Interface directory Nifty won’t be able to load them.



Maybe I could try to coerce it but I somehow doubt it would work…

Turns out I was wrong.



Using path inside that tag works. Why I feel another pact with the devil was made while I wasn’t looking I’ll never know. :stuck_out_tongue:

Doesn’t make sense, the source folder is gone when the application is released and the assets folder is on the class path.

Well, at least now the viewer doesn’t complain/ignore the tags, but spews nonsense about attribtes not allowed… sigh



Screw that. I’ve get better things to do than arm-wrestle with that on a screen that is working fine. :stuck_out_tongue: