Adding a New Source
Adding a New Source
The first thing you'll need to do is add a new source through which the user can toggle whether to enable your new content. There are two ways to do this.
If you are editing the data files by hand with a text/XML editor, then you can add your new source within an augmentation file (see the wiki for syntax). For example, you can add the XML element below to an augmentation file named "mysetting.aug".
Code:
<source
id="mysetting"
name="Setting Name"
parent="Settings"
description="insert text here">
</source>
The above code will define a source for the new setting and position it as a child of the "Savage Settings" source entry (it has the id "Settings"). Toggling the setting on/off is as simple as checking the box next to it.
To utilize your source, you must then associate a source requirement for each thing that should only appear when the source is enabled. This can be done in the Editor via the "Sources" option at the bottom of the configurable list for each thing. If you're writing your things by hand, you can use the "usesource" element.
If you are only using the integrated Editor to add your content, you can add a new source entirely via the things you define. Sources can be defined dynamically in the Editor and you can also assign a parent relationship for a source. You can use the following steps.
1. Using the "Sources" option at the bottom of the configurable list for a thing, select the "-New Source-" option at the top of the list.
2. Once you click "OK" to assign the sources, a new window appears to specify your new source.
3. Enter the unique id for your new source (e.g. "mysetting").
4. Enter the unique id of the parent source to use ("Settings").
5. Assign a name to your source for display to the user (e.g. "My Setting").
6. Click "OK" to save the source info.
7. Save the thing and then save your data file.
8. Switch to Hero Lab and use the "Quick Reload" feature to recompile and reload the data files.
Once you've reloaded the data files after adding your source, it will be fully available. You can toggle it on an off on the Configure Hero form. For subsequent things, it will appear in the list of available sources for easy selection. You only need to specify the name and the parent id a single time and reload the data files for Hero Lab to know about your new source and handle it properly.