Correct the editor help about loading editor-generated .cfg files

Somehow I forgot to test that it worked on 1.14.
This commit is contained in:
Steve Cotton 2020-12-30 17:01:42 +01:00 committed by Steve Cotton
parent 8b6def9678
commit a4711ebad9

View file

@ -303,18 +303,23 @@ Files created by the scenario editor omit the opening [scenario] and closing [/s
One workflow is to create a separate WML file, also with the .cfg extension, which uses the WML preprocessor to include the editor-created file. This separate file contains both the [scenario] tag and any hand-edited WML such as events. With this workflow, the add-ons file structure could look like this:
<header>text='If your add-on needs to support 1.14'</header>
<header>text='For Wesnoth 1.14'</header>
• _main.cfg:
◦ use “{./scenarios}” to include the “scenarios” directory
• maps/map_from_01.cfg
◦ this is the file created by the scenario editor
• scenarios/01_Forest.cfg
◦ inside the [scenario] element, use “map_file="~add-ons/NAME_OF_ADD_ON/maps/map_from_01.cfg"” to load that file
• scenarios/01_Forest.cfg, instead of the opening [scenario] tag put in these four lines:
◦ [scenario]
◦ {~add-ons/NAME_OF_ADD_ON/maps/map_from_01.cfg}
◦ [/scenario]
◦ [+scenario]
The first three of those lines insert the scenario-generated file inside a [scenario] tag. The + sign on the fourth line means that two scenario tags will be combined, with attributes in the second one overriding attributes in the first one.
<header>text='1.16 and later'</header>
If your add-on will only be used on 1.16 and later, theres a new feature to avoid repeating the add-ons name within the .cfg files:
If your add-on will only be used on 1.16 and later, there are new features to load .cfg files via map_file, and to avoid repeating the add-ons name within the .cfg files.
• _main.cfg:
◦ use “[binary_path]” to add add-ons directories to the binary path, which makes “map_file” search the “maps” directory.
@ -322,7 +327,7 @@ If your add-on will only be used on 1.16 and later, theres a new feature to a
• maps/map_from_01.cfg
◦ this is the file created by the scenario editor
• scenarios/01_Forest.cfg
◦ inside the [scenario] element, use “map_file="~add-ons/NAME_OF_ADDON/maps/map_from_01.cfg"” to load that file>>
◦ inside the [scenario] element, use “map_file="map_from_01.cfg"” to load that file>>
[/topic]
# wmllint: unbalanced-off
# wmllint: markcheck on