Currently the Flame section opens up when you press jenny due to a
script that we have looking for `index.html`, this PR renames those
pages to be in line with the rest of the docs.
Thanks for reporting it @incendial
Remove last broad cSpell bypass regex and fix all violations
This bypassed all code blocks within markdown files
(I didn't notice this one before because it was just for markdowns; it explains some weirdness I was seeing)
Now the only remaining restriction is about colors, which I like
Also removed all usages of cSpell:disable in favor of word-specific bypasses
Allow functions and commands to be removed from storage, or function and/or command storage to be cleared.
This is useful if different parts of the game have different implementations of a command or a function. Currently registering a function or command with the same name fails (i.e. it is not overwritten). Removing the function or command allows it to be replaced.
Allow variables to be removed from variable storage, or variable storage to be cleared.
It's not usual to do this, but could be useful in large games where each scene may have its own set of variables. They can be cleared between scenes. Another use-case is for implementing a 'save game' feature. The variables can be cleared, and a new set of variables loaded in from a save game.
It's important to note that Jenny uses variable storage to retain the node visit counts (the number of times the player has visited each node). This has been taken into account in the clear method, which allows the user to retain the node visit counts.
Allow characters to be removed from character storage, or character
storage to be cleared.
This is useful in large games where each scene may have different sets
of characters. They can be cleared between scenes, and new characters
loaded.
Allows direct access to the variables in the VariableStorage class in jenny (via YarnProject.variables.variables).
This enables a user to implement a save game feature to save the variables and later restore them.
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.