Skip to content

Releases: YarnSpinnerTool/YarnSpinner-Rust

v0.6.0

14 Oct 21:07
f25cdd7

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.5.0...v0.6.0

v0.6.0-rc

14 Sep 13:37
dba6069

Choose a tag to compare

v0.6.0-rc Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v0.5.0...v0.6.0-rc

v0.5.0

27 Apr 19:22
87eb66e

Choose a tag to compare

What's Changed

Bevy version

This release supports Bevy 0.16

Bevy systems as Yarn functions

@alec-deason has kindly spearheaded a long-requested feature. Yarn functions can now be regular Bevy systems! This means that your functions can query the ECS directly.

Take this dialogue for example:

<<if get_player_money() < 3>>
Shopkeeper: Sorry, you don't have enough cash on hand
<<else>>
Shopkeeper: Pleasure doing business with you!
<<subtract_money 3>>
<<endif>>
===

the relevant function looks like this:

fn get_player_money(wallet: Single<Wallet, With<Player>>) -> usize {
  wallet.available_money()
}

and is registered like that:

dialogue_runner
  .library_mut()
  .add_function("get_player_money", commands.register_system(get_player_money));

Users that don't use Bevy are not affected by this. If you are interfacing deeply with the Yarn Spinner API, you should know that calls to Dialogue::continue_ should be replace with Dialogue::continue_with_world in Bevy contexts.

Function and Command unification

In Bevy, Yarn function and Yarn commands now work very similar under the hood. This means that some previous limitations, like having to provide In<()> to commands without params, no longer apply:

// before
fn refresh_health(_: In<()>, health: Single<&mut Health, With<Player>>) {
    *health = 100.0;
}

// now
fn refresh_health(health: Single<&mut Health, With<Player>>) {
    *health = 100.0;
}

no_std progress

There's some progress towards #[no_std], kindly implemented by @stargazing-dino. Let's see if we can get Yarn Spinner running on a Game Boy Advance one day!

Migration

Yarn functions and commands are now registered systems, so we need to pass their system id instead of their function pointers when creating them:

// before
dialogue_runner
    .commands_mut()
    .add_command("change_sprite", change_sprite);
dialogue_runner
   .library_mut()
   .add_function("has_enough_money", has_enough_money);

// now
dialogue_runner
    .commands_mut()
    .add_command("change_sprite", commands.register_system(change_sprite));
dialogue_runner
   .library_mut()
   .add_function("has_enough_money", commands.register_system(has_enough_money));

where commands is a good old mut commands: Commands.

New Contributors

Full Changelog: v0.4.0...v0.5.0

v0.5.0-rc.1

30 Mar 20:20
8ce32d7

Choose a tag to compare

v0.5.0-rc.1 Pre-release
Pre-release

What's Changed

Full Changelog: v0.4.0...v0.5.0-rc.1

v0.4.0

30 Mar 13:07
d1291d6

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.3.0...v0.4.0

v0.3.0

04 Jul 17:44
9103204

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.2.0...v0.3.0

v0.2.0

18 Feb 20:02
26ba881

Choose a tag to compare

What's Changed

Full Changelog: v0.1.0...v0.2.0

v0.1.0

18 Feb 18:03
1d6b975

Choose a tag to compare

Initial release