Commit Graph

3302 Commits

Author SHA1 Message Date
Pasha Stetsenko
0a9eaf3801 feat: Arguments of a UserDefinedCommand are now accessible (#2224)
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.
2022-12-21 11:06:56 +00:00
Pasha Stetsenko
e302f8e171 docs: Add "teh" as a flag word in spellchecker (#2226)
This prevents the same typo happening again.
Followup for #2225.
2022-12-21 10:59:20 +01:00
Lukas Klingsbo
ff7f36d0f6 docs: Teh -> the (#2225) 2022-12-20 22:25:30 +00:00
Pasha Stetsenko
a99c930381 docs: Description of jenny package (#2102)
Adding preliminary description for the jenny project
2022-12-16 07:57:06 +01:00
Lukas Klingsbo
5151170c73 docs: images barell file should be cache.dart (#2222) 2022-12-14 14:09:46 +00:00
Pasha Stetsenko
43eacdd1f5 feat: Added escape sequence \- in yarn language (#2220)
Escape sequence \- allows to escape an option arrow "->" at the start of a line.
2022-12-14 10:23:12 +01:00
Lukas Klingsbo
7a945d960c fix: Re-use paint object in ImageParticle (#2210)
Since it is very bad to create paint-objects in the render loop this PR moves out the paint object and lets the user set the paint object manually.
2022-12-02 22:26:02 +01:00
Pasha Stetsenko
c6827a45df test: Add missing tests in Jenny (#2208)
Added multiple tests, to ensure 100% coverage.
Few small bugs resolved.
2022-11-30 10:05:22 +01:00
Lukas Klingsbo
acfd418d88 fix: Depend on test: any for flame_test (#2207)
Since our docs couldn't build with the added restriction on the test version.
2022-11-28 22:07:23 +00:00
Lukas Klingsbo
f3a82d881b ci: Try using other PAT for docs build (#2206) 2022-11-28 21:27:40 +00:00
Lukas Klingsbo
7b806f0597 ci: Try triggering doc action from curl (#2205) 2022-11-28 21:15:08 +00:00
Lukas Klingsbo
c398d61368 ci: Add repository line for docs build dispatch (#2204) 2022-11-28 20:57:46 +00:00
Lukas Klingsbo
8a6cf0b67d ci: Use external action for remote doc build (#2203) 2022-11-28 17:33:01 -03:00
Lukas Klingsbo
d18bdd8e29 ci: Use curl instead of GH to dispatch job request for docs (#2202) 2022-11-28 21:11:01 +01:00
Lukas Klingsbo
e4686c7675 ci: Try to build docs with only GH_TOKEN set to PAT (#2201) 2022-11-28 19:58:47 +00:00
Lukas Klingsbo
f17862e99e ci: Try adding GH_TOKEN too (#2200) 2022-11-28 19:44:02 +00:00
Juan Rodriguez
78fabce028 ci: Build flame-docs-site on push (#2199)
Instead of the curl command, it uses the gh cli tool.
2022-11-28 20:23:16 +01:00
Pasha Stetsenko
f4f62ab5e1 test: Added tests for all binary operators in Jenny (#2196)
Refactor some of the operator handling logic (some logic moved from the parser into the operator classes themselves).
    Added many tests.
    Fixed up some corner cases, like division by zero.
2022-11-28 17:33:57 +01:00
Pasha Stetsenko
9364a0dd32 feat: Add support for user-defined functions in jenny (#2194)
User-defined functions allow the user to extends the functionality of a Yarn script with custom functions.
v1.5.0 1.5.0
2022-11-27 22:31:09 +00:00
Lukas Klingsbo
b003372a74 chore(release): Publish Flame v1.5.0 (and all bridge packages) (#2197)
* chore(release): publish packages

 - flame@1.5.0
 - flame_bloc@1.8.1
 - flame_forge2d@0.12.4
 - flame_lottie@0.1.1
 - flame_rive@1.5.3
 - flame_svg@1.7.0
 - flame_test@1.9.0
 - flame_tiled@1.9.0
 - flame_isolate@0.1.1
 - flame_audio@1.3.3
 - flame_flare@1.5.1
 - flame_oxygen@0.1.7
 - flame_fire_atlas@1.3.2

* Depend on version of test
2022-11-27 19:22:37 -03:00
pastordougdev
576ceaac17 feat: Add maintainState property to Route (#2161)
Add a boolean property to the Route component named maintainState. When true (by default), the current behavior remains where the state of the child Component is retained. If maintainState is set to false, the child Component of the Route will be rebuilt when the Route is pushed onto the stack again.
2022-11-27 22:13:42 +01:00
Luke Pighetti
e7f0890666 feat: add onCancelled to ButtonComponent and HudButtonComponent (#2193)
Adds onCancelled to ButtonComponent and HudButtonComponent
2022-11-27 18:04:00 +00:00
Renan
60a5830d3e refactor: Game render box cleanup (#1691)
Cleanup on the relationship between he game render box and the game instance.

The render objects receive new build contexts on rebuild (possible bug fix).
Game is attached if it is added to the render object even after the render object creation (possible bug fix).
When loading, GameWidget now builds a SizedBox.shirink() when there is no loader specified.
2022-11-27 17:30:15 +01:00
Pasha Stetsenko
82d35b8a5d feat: Support for builtin functions in jenny (#2192)
This PR implements all Yarn builtin functions:

    bool()
    ceil()
    dec()
    decimal()
    dice()
    floor()
    inc()
    int()
    number()
    plural()
    random()
    random_range()
    round()
    round_places()
    string()
    visit_count()
    visited()

The plural() function is locale-dependent.
2022-11-26 14:02:06 +00:00
Erick
bd7f51f5b6 feat: Adding ComponentNotifier API (#1889)
This adds a proposal for a new API for flame, the ComponentNotifier.

This API offers the user change notifiers classes that are tied to FlameGame and its components so the user can be notified when a component is added, removed or updated.

This will enable users to:

    Take the benefit of reactive programming inside the game
    Have a simple way of watching certain states from the game, on Flutter Widgets

One important note here is that this proposal does not mean to replace integrations like flame_bloc, but rather provider an simple and out of the box solution, without any need of additional packages, since change notifiers are provided by flutter itself.

Opening this as draft for now to get feedback on the implementation, will write tests and docs once we have the final implementation.
2022-11-26 13:44:12 +00:00
Lukas Klingsbo
51a896b2c8 feat: clampLength for Vector2 extension (#2190)
With this method you can clamp the length of a vector, instead fitting it in a box like clamp and clampScalar does.
2022-11-25 14:36:18 +00:00
Pasha Stetsenko
e289f118ee feat: Added CameraComponent.withFixedResolution() constructor (#2176)
This PR adds new constructor for CameraComponent which simulates the old-style FixedResolutionViewport.
2022-11-25 11:18:54 +00:00
Pasha Stetsenko
00f0e330b4 fix: Remove whitespace before a command in dialogue option (#2187)
Previously, a line such as -> Choice 1 <<if $condition>> would generate text "Choice 1 " (with an extra space at the end), this is now fixed.

Also added several tests from the Yarn integration testing suite.
2022-11-24 20:16:38 +00:00
Pasha Stetsenko
9e677e7dc7 feat: Add command <<local>> (#2185)
The <<local>> command can be used to introduce local variables -- those whose scope is limited to the node in which the command was used. The syntax of the command is similar to that of <<declare>>.
2022-11-24 21:08:24 +01:00
Pasha Stetsenko
f887545b12 feat(jenny): Added support for markup attributes (#2183)
Markup allows inserting additional information into the text, without affecting dialogue views who cannot handle that information. See https://docs.yarnspinner.dev/getting-started/writing-in-yarn/markup
2022-11-24 08:13:59 +01:00
Lukas Klingsbo
1536e87d74 docs: Fix component diagram text styling (#2182) 2022-11-23 07:30:50 -03:00
pgirald
7a1e2e8b65 fix: SpeedController advance() should execute after its effect's onStart() (#2173)
SpeedEffectController always completes inmediatly when it is inside a SequenceEffect. That happens because SpeedEffectController's advance() method executes before it's MeasurableEffect's onStart() method, that is, before it's parent effect is initialized (see #2096).
2022-11-22 22:00:02 +00:00
tozu
3a73d1456c feat: Lottie bridge package (#2157)
This PR adds support for Lottie animations to flame
2022-11-22 21:42:15 +00:00
Lukas Klingsbo
98e295cfa5 chore(release): Publish flame_isolate v0.1.0 (#2179)
- flame_isolate@0.1.0
2022-11-22 21:31:11 +00:00
DevKage
4020d68b4a fix: Refresh vertices on size change of RectangleComponent (#2167) 2022-11-22 22:10:46 +01:00
Pasha Stetsenko
c9c9881cca fix: Fix coordinate system calculation in FixedAspectRationViewport (#2175)
Make sure FixedAspectRationViewport gets correct size & position upon game resize;
    Added tests
2022-11-20 19:39:20 +01:00
Pasha Stetsenko
93dc432547 fix!: Correct coordinate system for a circular viewport (#2174) 2022-11-20 19:11:47 +01:00
Munsterlander
9870eadaad docs: Fix bad links in docs as well as minor updates (#2170)
Closes: #2169

As discussed, a quick fix to some bad links and while I was in Flame Isolate, fixed some bad grammar.
2022-11-16 16:11:36 +01:00
Pasha Stetsenko
ffb36a89ef feat(jenny): Support user-defined commands (#2168)
This PR adds support for user-defined commands, as described in https://github.com/YarnSpinnerTool/YarnSpinner/blob/main/Documentation/Yarn-Spec.md#generic-commands.

A yarn command can be bound to a Dart function with up to 3 arguments, and Yarn runtime will ensure that the arguments are correctly parsed and converted into proper types.

In addition there was some cleanup of the tokenizer code, fixing some corner cases and making sure that the FSM flow is easier to follow.
2022-11-14 20:17:42 +03:00
Dipak Prajapati
29db304d36 fix: Remove flutter from jenny (#2162) 2022-11-11 09:04:06 +01:00
Lukas Klingsbo
be73867d13 ci: Make the spell check mandatory (#2159) 2022-11-09 22:52:16 +01:00
Pasha Stetsenko
2b306d9ee9 feat(jenny): Added the <<set>> command (#2155)
The <<set>> command is used to modify existing variables.
2022-11-09 22:33:46 +01:00
Pasha Stetsenko
8d592f1741 feat(jenny): Implement the <<declare>> command (#2154)
The <<declare>> command is used to introduce global variables in Yarn. They are the starting point for working with expressions.

In addition, the tokenizer no longer suppresses newline tokens on empty lines.
2022-11-08 21:15:32 +01:00
Pasha Stetsenko
ea015b4e96 chore: License for flame_spine (#2151)
Add license file for the flame_spine package; following the discussion in http://esotericsoftware.com/forum/Flame-runtime-18211 (thanks to @spydon for starting that conversation).
2022-11-07 21:03:38 +00:00
Pasha Stetsenko
4542966901 chore: Remove all .gitignore files but one (#2150)
The root level .gitignore file already works for all sub-repositories, so they are all actually unnecessary.
This PR leaves only the gitignore at the root of the repo, removing all others.
2022-11-06 21:22:19 +00:00
Pasha Stetsenko
f6432c6f4f test(jenny): Add testScenario() test method (#2147)
Add testScenario() method for jenny, allowing to test different dialogues more easily. This is the same system as used by YarnSpinner, so that we can verify that language features are working the same way.

Some of the testplans from YarnSpinner were ported, though many of them are marked as skip=true. This gives us an opportunity to try TDD.
2022-11-06 21:40:27 +01:00
Pasha Stetsenko
cbfa789e75 chore: Fix some spelling mistakes (#2148)
Fix all* typos reported by CSpell, and add some more words into the dictionaries.

(Except for two in the flame_isolate/example package).
2022-11-06 14:06:44 +00:00
Pasha Stetsenko
9c25e631e2 feat(jenny): Trim whitespace at the end of dialogue lines (#2149)
The whitespace will now be trimmed at the end of expressions like

Line1 #foo
Line2 // bar
Line3\s+
2022-11-06 14:56:02 +01:00
Pasha Stetsenko
5ba6ff21a6 feat: DialogueRunner for jenny (#2113)
The DialogueRunner is the engine that actually runs the dialogue.

Note: documentation will be added in PR #2102.
2022-11-05 11:38:15 +00:00
Pasha Stetsenko
b313d6302d feat(jenny): Support commands outside of nodes (#2145)
Adding tokens for startHeader/endHeader, so that we could more easily differentiate between the main file and a node header. Allow commands within the main file (such as the <<declare>> statement).
2022-11-05 11:27:32 +00:00