Skip to content

Commit

Permalink
🚿
Browse files Browse the repository at this point in the history
  • Loading branch information
paulloz committed Feb 12, 2024
1 parent 2b286a3 commit c1e1dba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
18 changes: 9 additions & 9 deletions addons/GodotInk/Src/InkStory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public void RemoveVariableObserver(Callable callable, string specificVariableNam
/// <summary>
/// An ink file can provide a fallback functions for when when an EXTERNAL has been left
/// unbound by the client, and the fallback function will be called instead. Useful when
/// testing a story in playmode, when it's not possible to write a client-side C# external
/// testing a story in play mode, when it's not possible to write a client-side C# external
/// function, but you don't want it to fail to run.
/// </summary>
public bool AllowExternalFunctionFallbacks => runtimeStory.allowExternalFunctionFallbacks;
Expand Down Expand Up @@ -506,7 +506,7 @@ public void BindExternalFunction<T1, T2, T3, T4>(string funcName, Func<T1, T2, T
/// Bind a C# Action to an ink EXTERNAL function declaration.
/// </summary>
/// <param name="funcName">EXTERNAL ink function name to bind to.</param>
/// <param name="act">The C# action to bind.</param>
/// <param name="action">The C# action to bind.</param>
/// <param name="lookaheadSafe">The ink engine often evaluates further
/// than you might expect beyond the current line just in case it sees
/// glue that will cause the two lines to become one. In this case it's
Expand All @@ -525,7 +525,7 @@ public void BindExternalFunction(string funcName, Action action, bool lookaheadS
/// Bind a C# Action to an ink EXTERNAL function declaration.
/// </summary>
/// <param name="funcName">EXTERNAL ink function name to bind to.</param>
/// <param name="act">The C# action to bind.</param>
/// <param name="action">The C# action to bind.</param>
/// <param name="lookaheadSafe">The ink engine often evaluates further
/// than you might expect beyond the current line just in case it sees
/// glue that will cause the two lines to become one. In this case it's
Expand All @@ -544,7 +544,7 @@ public void BindExternalFunction<T>(string funcName, Action<T> action, bool look
/// Bind a C# Action to an ink EXTERNAL function declaration.
/// </summary>
/// <param name="funcName">EXTERNAL ink function name to bind to.</param>
/// <param name="act">The C# action to bind.</param>
/// <param name="action">The C# action to bind.</param>
/// <param name="lookaheadSafe">The ink engine often evaluates further
/// than you might expect beyond the current line just in case it sees
/// glue that will cause the two lines to become one. In this case it's
Expand All @@ -563,7 +563,7 @@ public void BindExternalFunction<T1, T2>(string funcName, Action<T1, T2> action,
/// Bind a C# Action to an ink EXTERNAL function declaration.
/// </summary>
/// <param name="funcName">EXTERNAL ink function name to bind to.</param>
/// <param name="act">The C# action to bind.</param>
/// <param name="action">The C# action to bind.</param>
/// <param name="lookaheadSafe">The ink engine often evaluates further
/// than you might expect beyond the current line just in case it sees
/// glue that will cause the two lines to become one. In this case it's
Expand All @@ -582,7 +582,7 @@ public void BindExternalFunction<T1, T2, T3>(string funcName, Action<T1, T2, T3>
/// Bind a C# Action to an ink EXTERNAL function declaration.
/// </summary>
/// <param name="funcName">EXTERNAL ink function name to bind to.</param>
/// <param name="act">The C# action to bind.</param>
/// <param name="action">The C# action to bind.</param>
/// <param name="lookaheadSafe">The ink engine often evaluates further
/// than you might expect beyond the current line just in case it sees
/// glue that will cause the two lines to become one. In this case it's
Expand Down Expand Up @@ -637,7 +637,7 @@ public void Warning(string message)
/// <summary>
/// Save the current story state a JSON string.
/// </summary>
/// <returns>The current state seialized into a JSON string.</returns>
/// <returns>The current state serialized into a JSON string.</returns>
public string SaveState()
{
return runtimeStory.state.ToJson();
Expand Down Expand Up @@ -684,9 +684,9 @@ private void OnMadeChoice(Ink.Runtime.Choice choice)

public override PropertyList _GetPropertyList()
{
PropertyList properties = base._GetPropertyList() ?? new();
PropertyList properties = base._GetPropertyList() ?? new PropertyList();

properties.Add(new()
properties.Add(new Godot.Collections.Dictionary()
{
{ "name", PropertyName.RawStory },
{ "type", Variant.From(Variant.Type.Object) },
Expand Down
5 changes: 4 additions & 1 deletion addons/GodotInk/Src/InkStoryImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public partial class InkStoryImporter : EditorImportPlugin

public override string[] _GetRecognizedExtensions() => new string[] { "ink" };

public override string _GetResourceType() => "Resource";
public override string _GetResourceType() => nameof(Resource);

public override string _GetSaveExtension() => "res";

Expand Down Expand Up @@ -116,6 +116,9 @@ private static void InkCompilerErrorHandler(string message, ErrorType errorType)
case ErrorType.Error:
GD.PushError(message);
throw new InvalidInkException();
case ErrorType.Author:
default:
break;
}
}

Expand Down
12 changes: 6 additions & 6 deletions addons/GodotInk/Src/MarshalUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public static Variant ToVariant(object? obj)
}

/// <summary>
/// Convert from a collection of Godot Variants to a collection of ink variables. The
/// Convert from a collection of ink variables to a collection of Godot Variants. The
/// collection doesn't need to be homogeneous in type.
/// </summary>
/// <param name="objects">The collection of Godot Variants to convert.</param>
/// <returns>The collection of converted ink variables.</returns>
/// <param name="objects">The collection of ink variables to convert.</param>
/// <returns>The collection of converted Godot Variants.</returns>
/// <exception cref="ArgumentException"></exception>
public static Variant[] ToVariants(IReadOnlyList<object?> objects)
{
Expand All @@ -76,11 +76,11 @@ public static Variant[] ToVariants(IReadOnlyList<object?> objects)
}

/// <summary>
/// Convert from a collection of ink variables to a collection of Godot Variants. The
/// Convert from a collection of Godot Variants to a collection of ink variables. The
/// collection doesn't need to be homogeneous in type.
/// </summary>
/// <param name="objects">The collection of ink variables to convert.</param>
/// <returns>The collection of converted Godot Variants.</returns>
/// <param name="variants">The collection of Godot Variants to convert.</param>
/// <returns>The collection of converted ink variables.</returns>
/// <exception cref="ArgumentException"></exception>
public static object?[] FromVariants(IReadOnlyList<Variant> variants)
{
Expand Down

0 comments on commit c1e1dba

Please # to comment.