Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.3.0 - Yarn language v3 features #75

Open
wants to merge 47 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
15d2c07
update yarnspinner dlls to development/v3. need to fix script errors
dogboydog Nov 29, 2024
c030695
fix compilation errors porting yarnspinner v3 beta to Godot, fixes st…
dogboydog Dec 1, 2024
e23d57f
yarnspinner v3 sample compiling (plugin updates still remain)
dogboydog Dec 2, 2024
e78c444
fix some references to Start() to be _Ready()
dogboydog Dec 2, 2024
8595073
fix some missing exports. fix hanging async tasks
dogboydog Dec 5, 2024
40311c8
Start porting command/function C# source generator. Not working yet
dogboydog Dec 6, 2024
009494f
command/function registration source generation partially working
dogboydog Dec 6, 2024
0c2cf77
Fix some references to unity
dogboydog Dec 7, 2024
d7f94b0
semi-working updated space sample with line groups and <<once>> exam…
dogboydog Dec 7, 2024
fc1f68b
source generation is actually registering yarn commands and functions…
dogboydog Dec 7, 2024
333db52
upgrade visual novel and SQL samples to yarn 3. fix character layout …
dogboydog Dec 8, 2024
500f736
shadow lines and smart variables tested working in space sample
dogboydog Dec 8, 2024
a6b234a
add UI confirm with controller
dogboydog Dec 8, 2024
fc624c4
start to port code for variable storage code generation
dogboydog Dec 8, 2024
17a0c4a
Update space sample to use detour and node groups
dogboydog Dec 9, 2024
722918e
variable storage source generation from yarn project inspector working
dogboydog Dec 9, 2024
0f5c090
Add AddCommandHandlerCallable back to DialogueRunner
dogboydog Dec 9, 2024
3fa1a7d
fix backwards compatibility with v0.2 views by making AsyncDialogueVi…
dogboydog Dec 9, 2024
5b49c07
Add some more support for directly using GDScript nodes as views
dogboydog Dec 9, 2024
48d2a63
Add enum example, add enum support to project inspector
dogboydog Dec 10, 2024
a79e06d
example of int enum
dogboydog Dec 10, 2024
12dbdff
Updated MarkUpPalette / PaletteMarkerProcessor.cs tested working, upd…
dogboydog Dec 10, 2024
cef0d5b
fix namespace for generated command/function class, allows it to use …
dogboydog Dec 11, 2024
eae4d85
Merge branch 'develop' of github.com:YarnSpinnerTool/YarnSpinner-Godo…
dogboydog Dec 11, 2024
245fe6e
reference generated functions/commands in compilation to prevent 'ca…
dogboydog Dec 11, 2024
9c75f93
add auto generated SpaceYarnVariables
dogboydog Dec 12, 2024
721004a
Merge remote-tracking branch 'origin/development-v3' into development-v3
dogboydog Dec 12, 2024
7a64e3f
fix all warnings. Use yarncommand and yarnfunction attributes in Visu…
dogboydog Dec 12, 2024
4cb2f0c
Fix missing using statement if YARNSPINNER_DEBUG symbol is defined. a…
dogboydog Dec 12, 2024
7e6c50a
update CHANGELOG.md for 0.3.0
dogboydog Dec 14, 2024
2b5fc1f
use nuget for yarnspinner DLLs!
dogboydog Dec 17, 2024
df386db
restructure AsyncOptionItem to separate button from the main componen…
dogboydog Jan 5, 2025
2e8c6ac
update changelog
dogboydog Jan 6, 2025
8e21485
make fade effect optional in AsyncOptionsView.cs
dogboydog Jan 13, 2025
7e45eb2
fix YarnTask.WaitUntil not considering CancellationToken
dogboydog Jan 16, 2025
88b6eb3
remove n/a comment
dogboydog Jan 23, 2025
60996a8
v0.3 Fix lastLineText visibility when dialogue begins with an optio…
dogboydog Jan 23, 2025
c547337
fix version numbers in CHANGELOG.md
dogboydog Jan 23, 2025
c214050
test that GDscript commands that return nothing work
dogboydog Jan 24, 2025
57cd59b
clear lastSeenLine when dialogue ends in AsyncOptionsView.cs
dogboydog Jan 28, 2025
c9d1216
fix "useFadeEffect" not setting visible to false after fading control…
dogboydog Jan 31, 2025
fb1d8c2
add GlobalClass to DialogueRunner.cs and InMemoryVariableStorage.cs
dogboydog Feb 15, 2025
06521de
Fix #82 - check view for on_dialogue_complete_async, not the dialogue…
dogboydog Feb 16, 2025
6f687b9
resolve nullable warnings, provide SaliencySetter. check nullable war…
dogboydog Feb 19, 2025
c29f8c7
fix typo in comment, fail sample project if nullable warnings thrown
dogboydog Mar 9, 2025
53b2202
Merge branch 'develop' of github.com:YarnSpinnerTool/YarnSpinner-Godo…
dogboydog Mar 9, 2025
3d4cfac
mark yarn project compilation synchronous but skip compilation if the…
dogboydog Mar 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/continuous_build_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
strategy:
fail-fast: false
matrix:
godotVersion: ["4.1.4", "4.2.2", "4.3.0"]
targetFramework: ["net6.0", "net7.0"]
godotVersion: ["4.2.2", "4.3.0"]
targetFramework: ["net6.0", "net8.0"]
nullable: ["enable", "disable"]
name: Build
runs-on: ubuntu-latest

Expand All @@ -39,6 +40,9 @@ jobs:
- name: Set Target Framework ${{ matrix.targetFramework }}
run: |
sed -i 's|<TargetFramework>.*<|<TargetFramework>'${{ matrix.targetFramework }}'<|g' YarnSpinner-Godot.csproj
- name: Set Nullable ${{ matrix.nullable }}
run: |
sed -i 's|<Nullable>.*<|<Nullable>'${{ matrix.nullable }}'<|g' YarnSpinner-Godot.csproj

- uses: chickensoft-games/setup-godot@v1
name: 🤖 Setup Godot
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

Generated/
## VisualStudio

.vs/
Expand Down
250 changes: 194 additions & 56 deletions CHANGELOG.md

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions Samples/Characters/Dialogue/CharacterSample.yarn
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
title: Barry
when: once
---
// This node can only ever be run once, and this is the only content for this
// character. The game won't show the 'interactable' indicator if the character
// has no content available.
Barry: Hi, I'm Barry! You can only talk to me this one time!
===
title: Larry
---
<<once>>
// Greet the player the first time.
Larry: Hi, I'm Larry! You can talk to me several times!
<<endonce>>

/// The number of times we have turned the switch on or off.
<<declare $times_interacted_with_switch = 0 as number>>

/// Whether the switch is currently turned on or off.
<<declare $switch_on = false as bool>>

<<if $switch_on>>
<<once>>
// Directly thank the player the first time
Larry: Hey, thanks for turning that switch on for me!
<<else>>
// Run general 'you did it' barks in other circumstances.
=> Larry: Sure is nice having that switch on!
=> Larry: Being on is a great thing for a switch to be!
=> Larry: Wow! Never knew how good a switch being turned on was.
<<endonce>>
<<elseif $times_interacted_with_switch > 0 and not $switch_on>>
// We've turned the switch on in the past, but it's not on now. Complain
// about it.
=> Larry: Don't be a jerk! Turn that switch back on!
=> Larry: Hey! Can you turn that switch back on?
=> Larry: Aw, I loved it when the switch was on.
<<else>>
// The switch isn't on.
<<once if $times_interacted_with_switch == 0>>
// We haven't turned the switch on before, so be really direct about it
Larry: Hey, can you turn that switch on for me?
<<else>>
// Be a bit more passive-aggressive about it the rest of the time.
=> Larry: Sure wish someone would turn that switch on.
=> Larry: Man, how amazing would it be for that switch to be on...
=> Larry: My only dream is for the switch to be on...
<<endonce>>
<<endif>>
===
title: Switch
---
// Toggle the switch on or off.
<<set $switch_on = !$switch_on>>

// Increment the number of times we've interacted with it.
<<set $times_interacted_with_switch += 1>>

// Play an animation that shows the switch turning on or off.
<<if $switch_on>>
<<turn_on Switch>>
<<else>>
<<turn_off Switch>>
<<endif>>
===
title: Garry
---


Garry: Emotions test!

<<face Garry smile>>
Garry: Smiling!

<<face Garry frown>>
Garry: Frowning!

<<face Garry neutral>>
Garry: Neutral!

Garry: Let's try animating it!

<<face Garry smile 0.2>>
Garry: Smiling!

<<face Garry frown 0.2>>
Garry: Frowning!

<<face Garry neutral 0.2>>
Garry: Neutral!


===
14 changes: 14 additions & 0 deletions Samples/Characters/Dialogue/CharacterSample.yarn.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[remap]

importer="yarnscript"
type="Resource"
uid="uid://bvucc8lvq2xbc"
path="res://.godot/imported/CharacterSample.yarn-ed78dc65c09d526de320ad4d21190854.tres"

[deps]

source_file="res://Samples/Characters/Dialogue/CharacterSample.yarn"
dest_files=["res://.godot/imported/CharacterSample.yarn-ed78dc65c09d526de320ad4d21190854.tres"]

[params]

11 changes: 11 additions & 0 deletions Samples/Characters/Dialogue/CharacterSample.yarnproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"projectFileVersion": 3,
"sourceFiles": [
"**/*.yarn"
],
"excludeFiles": [
"**/*~/*"
],
"localisation": {},
"baseLanguage": "en"
}
14 changes: 14 additions & 0 deletions Samples/Characters/Dialogue/CharacterSample.yarnproject.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[remap]

importer="yarnproject"
type="Resource"
uid="uid://b3qu6dw2x8nls"
path="res://.godot/imported/CharacterSample.yarnproject-c10833699b5605472ed6a79ae0501e1a.tres"

[deps]

source_file="res://Samples/Characters/Dialogue/CharacterSample.yarnproject"
dest_files=["res://.godot/imported/CharacterSample.yarnproject-c10833699b5605472ed6a79ae0501e1a.tres"]

[params]

25 changes: 25 additions & 0 deletions Samples/Characters/Dialogue/YarnVariables.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace MyGame;

using YarnSpinnerGodot;

[System.CodeDom.Compiler.GeneratedCode("YarnSpinner", "3.0.0.0")]
public partial class YarnVariables : YarnSpinnerGodot.InMemoryVariableStorage, YarnSpinnerGodot.IGeneratedVariableStorage {
// Accessor for Number $times_interacted_with_switch
/// <summary>
/// The number of times we have turned the switch on or off.
/// </summary>
public float TimesInteractedWithSwitch {
get => this.GetValueOrDefault<float>("$times_interacted_with_switch");
set => this.SetValue<float>("$times_interacted_with_switch", value);
}

// Accessor for Bool $switch_on
/// <summary>
/// Whether the switch is currently turned on or off.
/// </summary>
public bool SwitchOn {
get => this.GetValueOrDefault<bool>("$switch_on");
set => this.SetValue<bool>("$switch_on", value);
}

}
9 changes: 8 additions & 1 deletion Samples/GDScriptIntegration/CrossLanguageScriptingExample.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@
extends Control
@export var dialogue_runner: Node
@export var logo: Control
@export var yarn_project: YarnProject
@export var yarn_project: Resource

func _ready() -> void:
dialogue_runner.AddCommandHandlerCallable("show_logo", show_logo)
dialogue_runner.AddCommandHandlerCallable("log", log)
dialogue_runner.onDialogueComplete.connect(on_dialogue_complete)
var var_name : String = "$myVariableSetFromGDScript"
dialogue_runner.variableStorage.SetValue( var_name, "Yay!")
var var_value = dialogue_runner.variableStorage.GetVariantValue(var_name)
print("Value of %s: %s" % [var_name, var_value])

func log(message: String) -> void:
# Example command that does not use `await`, to test
# that no errors are thrown if nothing is returned from a command in GDScript.
print(message)

func show_logo(logo_path) -> void:
"""
Async handler for the <<show_logo logo_path>> command.
Expand Down
18 changes: 12 additions & 6 deletions Samples/GDScriptIntegration/Dialogue/GDScriptIntegration.yarn
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@
tags:
---
<<declare $myVariableSetFromGDScript to "" as string>>
<<log "Starting GDScriptIntegration sample!">>
Gary: So, can I use [fx type="wave"]GDScript[/fx] with YarnSpinner? #my_metadata #line:02fa0cd
Derrick: Many features can be used with GDScript. For example, you can make a custom view like the one in this scene. #line:09c1c2c
Derrick: You can also interact with DialogueRunner and variable storage nodes with cross-language scripting. #line:0b086af
Derrick: And you can also write commands in GDScript by using AddCommandHandlerCallable. Your GDScript commands can even use 'await'. Look: #line:0c22e97
Derrick: And you can also write commands in GDScript by using AddCommandHandlerCallable. Your GDScript commands can even use 'await'. Look! #line:0c22e97
<<show_logo "res://addons/YarnSpinner-Godot/Editor/Icons/YarnSpinnerLogo.png">>
Derrick: Do you know about options, too? You can make an "OptionsListView" with GDScript, too.
-> Yes
Derrick: Nice.
Derrick: Do you know about options, too? You can make an "OptionsListView" with GDScript, too. #line:0cc7452
-> Yes #line:0cd81c1
Derrick: Nice. #line:0b3ca20
<<jump GDScriptIntegrationFinish>>
-> No
Derrick: Well, you can prompt the player to pick an option.
-> No #line:0f03ac3
Derrick: Well, you can prompt the player to pick an option. #line:01e20f4
<<jump GDScriptIntegrationFinish>>
===

title: GDScriptIntegrationFinish
---
Gary: {$myVariableSetFromGDScript} That's cool. I will look at the GDScriptIntegration sample code to learn about this. #line:020bb2b
Derrick: Awesome. Which language do you think you will end up using YarnSpinner for Godot with? #line:0166369
-> GDScript #line:07cc6d2
Derrick: That's cool. #line:0862705
-> C\# #line:0eb6bfe
Derrick: That's cool. #shadow:0862705
===
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[remap]

importer="yarnproject"
type="Resource"
uid="uid://c0qdj0h48fu6a"
path="res://.godot/imported/GDScriptIntegration.yarnproject-3447483eda8ff87e2d80c8bc61bf66c1.tres"

[deps]

source_file="res://Samples/GDScriptIntegration/Dialogue/GDScriptIntegration.yarnproject"
dest_files=["res://.godot/imported/GDScriptIntegration.yarnproject-3447483eda8ff87e2d80c8bc61bf66c1.tres"]

[params]

14 changes: 0 additions & 14 deletions Samples/GDScriptIntegration/GDScriptIntegration.yarnproject.import

This file was deleted.

Loading