diff --git a/CHANGELOG.md b/CHANGELOG.md index 402e788..4d670e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [0.2.8] 2024-05-24 +* Fix Yarn commands not supporting methods with optional arguments (by @spirifoxy) +* Update Visual Novel sample to make use of this fix + ## [0.2.7] 2024-05-11 * Add an explicit dependency on System.Text.Json v8.0.1 to fix compiler warnings and incompatibility with DotNet SDK versions below 8. The symptom in 0.2.6 was failing to create a .yarnproject file from the editor. diff --git a/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn b/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn index 3b633dc..d21ad55 100644 --- a/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn +++ b/Samples/VisualNovel/Dialogue/VNExampleDialogue.yarn @@ -9,7 +9,7 @@ position: 0,0 // the node name must be specified - in this case VisualNovelManager <> // start playing audioclip "ambient_birds" at 50% volume, loop forever -<> +<> A VISUAL NOVEL EXAMPLE #line:07ee50d @@ -23,7 +23,7 @@ Eve: Finally, a quiet day at the office. Maybe I'll be able to get some work don // animate Adam into new position in right-half + center, within 0.5 seconds <> -<> +<> Adam: Hey Eve! I have a question! #line:07f4eac Eve: Oh no... #line:0721506 @@ -49,7 +49,7 @@ Eve: Oh no... #line:0721506 Eve: Ok, now to finally write that visual novel. #line:0794753 <> -<> +<> Eve: I can finally write my epic romance about - #line:0c39b43 <> <> @@ -59,7 +59,7 @@ Eve: Wait... where's my laptop? It's not here. #line:04432b5 <> Eve: Adam! Have you seen my laptop??? #line:0a21105 -<> +<> <> <> Eve: ADDDDAAAMMMMMMM!!! #line:062467b diff --git a/addons/YarnSpinner-Godot/Runtime/Commands/ActionManager.cs b/addons/YarnSpinner-Godot/Runtime/Commands/ActionManager.cs index dcb6406..8a31e24 100644 --- a/addons/YarnSpinner-Godot/Runtime/Commands/ActionManager.cs +++ b/addons/YarnSpinner-Godot/Runtime/Commands/ActionManager.cs @@ -413,7 +413,7 @@ public static object[] ParseArgs( } for (int i = count; i < finalArgs.Length; i++) { - finalArgs[i] = Type.Missing; + finalArgs[i] = (parameters[i].HasDefaultValue ? parameters[i].DefaultValue : Type.Missing) ?? Type.Missing; } return finalArgs; } diff --git a/addons/YarnSpinner-Godot/plugin.cfg b/addons/YarnSpinner-Godot/plugin.cfg index b9bc975..3a1bfd3 100644 --- a/addons/YarnSpinner-Godot/plugin.cfg +++ b/addons/YarnSpinner-Godot/plugin.cfg @@ -3,5 +3,5 @@ name="YarnSpinner-Godot" description="Yarn language based dialogue system plugin for Godot" author="dogboydog" -version="0.2.7" +version="0.2.8" script="YarnSpinnerPlugin.cs"