In Sphinx, there is a concept of a "domain", which enables documenting library object such as classes and functions, and then referencing them from any other place in the documentation. This PR adds such a domain for the Dart language.
With the new approach, a class/function can be documented using the following directive:
```{dartdoc}
📦 flame
:symbol: GameWidget
:file: src/game/game_widget/game_widget.dart
```
The documentation will then be automatically extracted from the referenced file using the dartdoc_json tool (published as a separate package), and then rendered inside the page. The screenshot below shows an example of how DialogueRunner class from Jenny would be rendered:
<image>
Once a symbol has been documented using the dartdoc directive, it can be referenced from other places in the documentation as
{ref}`DialogueRunner`
The new command allows pre-declaring the characters that will be seen in the yarn scripts, and provides a place to store any additional information associated with each character.
The DialogueLine.character property now returns a Character object, instead of a String.
This PR adds missing documentation for all built-in functions available in Jenny.
In addition:
The bool() function now behaves the same way as the conversion of arguments for an invocation of a user-defined function;
Consequently, static sets trueValues/falseValues moved from CommandStorage class into the YarnProject;
Added some tests for several other functions.
The functionality of the <<visit Target>> command is that the dialogue runner will temporarily suspend execution of the current node and start executing Target, but then once that finishes it will resume executing the original node.
Previously, onDialogueChoice was returning a never-completing future, which is both more error-prone, and prevents a use-case where a dialogue view would perform some async action without ultimately making a selection.
The onNodeFinish event is a counterpart to onNodeStart.
This also fixes a small bug where node visit count was not properly incremented if the node was exited via a <<stop>>.
The DialogueRunner.runNode() method renamed into startDialogue().
Class UserDefinedCommand now exposes argumentString and arguments properties, allowing them to be queried in a DialogueView;
Make sure the arguments of a user-defined command are computed only once per invocation;
Added documentation for user-defined commands;
addDialogueCommand renamed into addOrphanedCommand.
This PR expands the functionality of RenderableTileMap to include support for more than just simple TileLayer layers. Adding support for:
ImageLayer rendering (note that tiled.dart was loading non-tile layers in the incorrect order until 0.8.4)
layer parallaxX / parallaxY
layer opacity
map backgroundColor
tiled dependency
This PR relies on changes and bug fixes in tiled.dart 0.8.4
Migration notes
The entire contact callback process has been redefined to mimic Flame's CollisionCallbacks.
In order to simplify the migration to this new code, the following steps should facilitate doing so:
Remove lines of code that used addContactCallback, removeContactCallback, clearContactCallback.
Remove subclasses of ContactCallbacks<Type1, Type2>.
2.1. Include with ContactCallback in your BodyComponent class signature.
2.2. Override the contact method that you are interested in, and check that other is Type2, then perform the logic.
The above is just a suggested migration approach. There are other code alternatives or patterns you might want to follow. In addition, you can define your own custom contact logic by providing a ContactListener to your Forge2DGame.
For more information check the examples, Flame documentation, or the class documentation of ContactCallbacks and WorldContactListener.