diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a6782ea..4297bdcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `UnityLocalisedLineProvider` no longer throws an exception if an asset table is provided but does not contain an asset for a line. - `DialogueRunner.CommandDispatcher` is now set up on first access, rather than in `Awake`. - This allows other objects to work with the command dispatcher (for example, registering new methods) in their `Awake` methods, even if their `Awake` methods run before `DialogueRunner`'s. +- `YarnCommand` and `YarnFunction` commands now allow including `.` characters in their names. ### Changed diff --git a/Editor/Analysis/Action.cs b/Editor/Analysis/Action.cs index 3c36a499..8d22803d 100644 --- a/Editor/Analysis/Action.cs +++ b/Editor/Analysis/Action.cs @@ -217,10 +217,9 @@ public Action(string name, ActionType type, IMethodSymbol methodSymbol) diagnostics.Add(Diagnostic.Create(Diagnostics.YS1001ActionMethodsMustBePublic, methodDeclaration.Identifier.GetLocation(), methodDeclaration.Identifier, MethodSymbol.DeclaredAccessibility)); } - // This is not a full validation of the naming rules of commands, - // but is good enough to catch the most common situations: - // whitespace and periods. - if (Name.Contains(".") || Name.Any(x => Char.IsWhiteSpace(x))) + // Commands are parsed as whitespace, so spaces in the command name + // would render the command un-callable. + if (Name.Any(x => Char.IsWhiteSpace(x))) { diagnostics.Add(Diagnostic.Create(Diagnostics.YS1002ActionMethodsMustHaveAValidName, methodDeclaration.Identifier.GetLocation(), this.Name)); } diff --git a/SourceGenerator/YarnSpinner.Unity.SourceCodeGenerator.dll b/SourceGenerator/YarnSpinner.Unity.SourceCodeGenerator.dll index a3f43aba..57a4cb24 100644 Binary files a/SourceGenerator/YarnSpinner.Unity.SourceCodeGenerator.dll and b/SourceGenerator/YarnSpinner.Unity.SourceCodeGenerator.dll differ