Migration to Yarnspinner 2.5.0#275
Conversation
- YarnSpinner.Compiler/Declaration.cs - YarnSpinner.Compiler/DeclarationVisitor.cs - YarnSpinner.Compiler/StringTableManager.cs - YarnSpinner.Compiler/Utility.cs
- validate_unique_inferred_variable seems to break the tests and was removed in the 3.0
- YarnSpinner.Tests/ErrorHandlingTests.cs - YarnSpinner.Tests/ProjectTests.cs - YarnSpinner.Tests/TagTests.cs
|
@janhohenheim I need help here. In here, they used 2 fields to store callbacks. I don't think I can do that using a closure in rust, especially because they need a mutable reference of the dialogue. I had considered storing all the set variables and allowing a TestPlan function to be called by providing an FnOnce closure. That should work, but I’m not sure if you have any better ideas? |
|
I'll check when the jam is over in 2 days :) |
|
@janhohenheim Another question here. In the Project.cs, they used a C# Matcher to find the files matching the given pattern. However in the test file, they match One idea to solve this will be to add a few functions, like
Any though on this ? PS: I will work on the API to use Project in core or bevy_plugin in another PR. |
|
I've added serde feature to tests (only test-without-bevy) for now. I've also added the |
|
@janhohenheim In 2023 you created the issue YarnSpinnerTool/YarnSpinner#362 which was fixed. But did you solve it beforehand in YarnSpinnerRust ? Do I need to port the bug fix ? |
|
Okay, I have time now, sorry for the delay :D I'll take a look when I'm home later |
Why wouldn't a
IMO best to use a regular glob there, their syntax looks a bit weird 🤔 We should be fine with just doing
Probably not 🤔 not sure, but I don't think so? Could try if that bug is present in Thanks again for this lovely, lovely work you're doing ❤️ It's tremendously generous of you to work on this upgrade! |
It was not solved, you implemented the test in |
|
In the end, I didn’t use a callback, it was a bit of a hassle. The function |
|
@janhohenheim This should be good for review |
|
Heck yeah, on it. I'll mostly check the API and functionality and trust you on the implementation details :) |
There was a problem hiding this comment.
This looks excellent, thanks! Tested it and it runs well, including web :) I will not go into details about the specific changes since they're ports, but I get most of them and they make sense.
format is the same as format_invariant, right? If so it's definitely useful for production, but also completely fine to leave out for now.
Am I correct in seeing that the Yarn Spinner Project Files are not hooked into Bevy right now? If so, that's completely fine since porting to v3 will presumably touch them again anyways. I assume we can make them a nice and tidy Asset later :)
Are there any big user-facing breaking changes? I don't think so, since you have provided a nice deprecation on add_tags_to_lines. We don't have a changelog rn because of my laziness, but I think it's fine to not enumerate all changes here, since it seems self-evident how to migrate if you look at the signatures.
Again, a thousand thanks! Will merge after I hear back from you :)
I'm not sure, format invariant will just convert to string whereas format is more like the classical format
Not yet, because I think it needs a bit more discussion. Currently, it loads all yarn files at start into the dialogue manager, but with project we may use the more classical
None that I'm aware of. Also
Just looked at the files we need to port this morning, and it's really something. The oldest commit is from 2021 😢. |
From what I remember the changes are :
|
|
Sheesh that's old! |
As there are a lot of changes and I'm not familiar with the non-bevy crates, I'll start the migration to the last v2 supported version.
Git diff: YarnSpinnerTool/YarnSpinner@da39c71...v2.5.0
I've looked at the git diff, and this is the files with changes (except doc changes) among the Compiler and Runtime. LanguageServer and tests were ignored.
Compiler
Runtime
YarnSpinner/Library.cs=> NullPointerException, useless in rustYarnSpinner/VirtualMachine.cs=> No need refactoringTest
YarnSpinner.Tests/TypeTests.cs=> test for validate_unique_inferred_variable (removed in 3.0)