Boris Koenig wrote:
> Thanks for the answers so far, I was already playing around with the
> gui.nas file, will have to look into it in more detail in order to
> see how to get the positioning part done, though.
Essentially, you can just set x and y properties on the top level gui
object. There is a "Widget" helper class in there that can take some
of the tedium out of handling the raw property interface. See the
code for the fuel/weight dialog (gui.showWeightDialog()), which uses
> I will get back to the original replies within the next days, but a
> quick question: is there any way to make FlightGear re-initialize the
> Nasal loading routines ?
Not currently. Adding it wouldn't be difficult, but the interaction
issues can be very complicated. Existing Nasal code (loaded via the
aircraft XML or other configuration) might be holding references to
values in the the pre-existing modules. If those get used, you can
end up in a situation where the "old" and "new" versions of the file
are in use simultaneously. Likewise, think of timers registered by
the "old" version that get run after the new one is loaded.
But if you are careful about things and/or willing to troubleshoot
this kind of issue, there's no reason it couldn't be done. Take a
look at NasalSys::init() in src/Scripting/NasalSys.cxx. You'll want
to extract the loop at the end (where it loads the files) and make it
available as a fgCommand binding like "nasal-reload" or somesuch.
You'll want to delete the pre-existing modules first, of course (by
doing something like "globals.gui = nil;", either in Nasal or using
the extension API).
Flightgear-devel mailing list