1
0
Fork 0
Commit graph

9 commits

Author SHA1 Message Date
Florent Rougon
e0f721450a Docs/README.add-ons: document the '[addon=ADDON_ID]relative/path' syntax
The '[addon=ADDON_ID]relative/path' syntax can be used in resource paths
handled by the SimGear ResourceManager, when one wants to target a file
from a particular add-on (see FG commit 8c82fca4 and following ones).
This commit documents this feature.

Note: when the resource path is prepared by Nasal code, prefer using
      addons.Addon.resourcePath().
2018-01-18 09:56:58 +01:00
Florent Rougon
9556b901ee README.add-ons: minor change
The property-rule configuration file was probably a bad example, because
I believe the path has to be specified inside a PropertyList file (so
far). It can thus be done with the '[addon=ADDON_ID]relative/path'
syntax so as to ensure the file is found by
flightgear::addons::ResourceProvider, however in this particular case,
addons.Addon.resourcePath() is probably not going to be very useful.
2018-01-10 19:10:03 +01:00
Florent Rougon
acd54efff7 Docs/README.add-ons: add documentation for addons.Addon.resourcePath() 2018-01-10 14:13:25 +01:00
Florent Rougon
a57aed195e Add-ons: pass the addons.Addon ghost to main() instead of the base path
The addons.Addon instance (ghost) is much more interesting than its base
path. The base path is immediately accessible from the addons.Addon
instance using its 'basePath' attribute. The addons.Addon instance
allows main() to easily access essentially all of the add-on metadata,
including the add-on identifier, which makes it possible to write
main.nas without hardcoding the add-on id at all.

This is an incompatible change of course, so better do it now than
later.
2018-01-08 09:55:55 +01:00
Florent Rougon
72414d039a Docs/README.add-ons: update regarding /addon/authors and /addon/maintainers
With FlightGear commit 4d36082, the contents of /addon/authors (resp.
/addon/maintainers) in addon-metadata.xml files is now structured. It
may contain an arbitrary number of 'author' (resp. 'maintainer') child
nodes, each of which contains subnodes 'name', 'email' and 'url' ('name'
being mandatory, 'email' and 'url' being optional).

This commit updates Docs/README.add-ons regarding this change in the
syntax for addon-metadata.xml files, as well as the related
modifications to the add-on Nasal interface.
2018-01-03 00:18:00 +01:00
Florent Rougon
4393697753 Update Docs/README.add-ons: new fields and more details
Document new fields:

    authors
    maintainers
    license/{designation,file,url}
    url/{home-page,download,support,code-repository}
    tags

Add precisions concerning how fields are parsed, a bit more structure,
etc.

Mailing-list discussion:

  around https://sourceforge.net/p/flightgear/mailman/message/36155660/
2017-12-26 19:51:27 +01:00
Florent Rougon
2eb6e7b367 README.add-ons: adapt example to new header (with meta and file-type nodes) 2017-12-10 22:38:38 +01:00
Florent Rougon
33bc7eabb3 README.add-ons: use explicit node typing in the sample metadata file and more spacing
The explicit typing shouldn't change anything for the parsing code in
flightgear/src/Add-ons/AddonManager.cxx, because for each field, this
code knows the correct type and explicitly asks for it (and only once),
but external code might include addon-metadata.xml in some prop tree,
and then the explicit typing is likely to give better results.
2017-12-09 13:49:20 +01:00
Florent Rougon
c535306b3d Add-ons: simplify loading using the new API, set the 'loaded' flag
Also:
  - use the namespace __addon[ADDON_ID]__ when loading an add-on's
    main.nas file (previously, the namespace used was __addon[i]__ where
    i is 0 for the first registered add-on, 1 for the second one, etc.);
  - use logprint() instead of printlog(), because the former writes a
    more helpful source file and line number for the log call in
    fgfs.log (i.e., not always src/Scripting/NasalSys.cxx...);
  - remove the listener once it has been fired;
  - add documentation in Docs/README.add-ons.
2017-12-08 00:37:21 +01:00