paulloz / godot-ink

Ink integration for Godot Engine.
MIT License
586 stars 41 forks source link

TagsForContentAtPath function doesn't work in GDScript. #92

Open DeadManIV opened 4 months ago

DeadManIV commented 4 months ago

Describe the bug TagsForContentAtPath function doesn't work in GDScript. I think it's supposed to, cos this issue shows it working: https://github.com/paulloz/godot-ink/issues/38 I receive the error:

Invalid call. Nonexistent function 'TagsForContentAtPath' in base 'Resource (InkStory)'.

To Reproduce Call the function "TagsForContentAtPath" on an InkStory object in a GDScript file.

Environment

Additional context Have had no other issues so far, using Ink in GDScript

DeadManIV commented 4 months ago

My C# is pretty rusty but I fixed it by adding some code to InkStory.interop.cs:

/// <summary>
/// This method is here for GDScript compatibility. Use <see cref="TagsForContentAtPath" /> instead.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Godot.Collections.Array<string> GetTagsForContentAtPath(string path)
{
    var tags = new Godot.Collections.Array<string>(TagsForContentAtPath(path));

    return tags;
}
paulloz commented 3 months ago

Thank you for the report, I'll fix this in the next release 👍