gladstoriesengine: ^0.3.2 copied to clipboard
The library for the Glad Stories Engine. This is an interactive fiction engine which can be used for editing and running your stories.
- getCurrentNode now returns String? instead of String. This was changed due to possibility to throw an exception when the nodes array is accessed by the index. By default index is init with 0, but nodes array can be empty. If getCurrentNode() is called then it should return null (String?).
- Page() constructor requires nodes and next properties. If you want to create an empty Page with empty nodes and next then use Page.empty() constructor.
var page = Page();
var page = Page.empty();
- Added types for Stream historyChanges
Null safety enabled. Story constructor expeects currentPage to be not null. You can use the same Page reference as for root property.
Updated rxdart to latest version 0.25.0
- Added default image resolver BackgroundImage. By default it resolves all images to "images/background/..." path.
- toMarkdownString method now expects you to provide a path to root folder were all your images are stored:
Images will be resolved if used standard BackgroundImage like this:
- Added getNextNodeTexts method that returns a list of available next options as texts.
- Added goToNextPageByText method that finds PageNext by input text and goes to it.
Black and white images are used for markdown export.
- Added new API methods.
- toJson method was refactored and now returns a Map<String, dynamic> instead of String.
- fromJson method was refactored and now expected Map<String, dynamic> instead of String.
- convertToMarkDown converts history of the Story into the Markdown document.
- toMarkdownString returns a Markdown string with images, meta data. Can be used for embedding into sites.
Engine no longer uses jsonEncode/jsonDecode when working with toJson/fromJson methods. It is up to users of the API to convert strings to/from JSON.
Story.fromJson("SOME JSON STRING");
Story.fromJson(jsonEncode("SOME JSON STRING"));
- Made imageResolver a required field in the constructor.
- Added DartDocs.
- Fixed various linter issues.
- No functional changes.
- Removed accidentally added file.
- Fixed issue when story could not be initialized without parameters.
- Added type annotations for several methods.
- Improved test coverage to 75%.
- Page.hasNext logic is moved to Page.hasNextNode.
- Page.hasNext now returns true/false depending on emptiness of next list.
- Added example.
- Formatted the dart files.
Fixed issues in Story constructor.
History list is initialized with an empty list.
_logCurrentPassageToHistory ignores imageResolver calls if it is null.
Page.fromMap returns empty Page is map is null or has no keys.
Added unit tests.
- Added ImageResolver as an argument for fromJson method
- Initial version