Read metadata from node header in Yarn.Unity.DialogueUIBehaviour
Is your feature request related to a problem? Please describe.
I'm trying to implement modal and not modal dialogs (with modal dialogs blocking the input and hiding the HUD, for example). And I thought I could use the metadata in the header to define whether a node was modal or not and then act upon it in the UI but I cannot find a way to access that information from Yarn.Unity.DialogueUIBehaviour. I also have been looking at the code of the compiler and seems like the metadata is being set Compiler.cs#L97 but I haven't found any reference to StringInfo outside the Compiler.
Describe the solution you'd like I'd like to be able to define a node like this:
title: Modal
tags:
colorID: 0
modal: true
---
Oh, this is a modal dialog!
===
And then, being able to access the metadata in Yarn.Unity.DialogueUIBehaviour to block the input and hide the HUD.
I think one solution could be passing the metadata info to DialogueStarted as an argument, so we can prepare the UI for whatever it's in that node. Another option (but probably not as good) would be to include the metadata of the current node in each Yarn.Line, Yarn.OptionSet and Yarn.Command processed.
Describe alternatives you've considered
The alternative I'm considering right now is setting modal in the tags parameter and passing an instance of DialogueRunner to Yarn.Unity.DialogueUIBehaviour to get the tags of the node from there. However, it's kind of a hack and wouldn't let me do more interesting stuff (like defining values) to a specific key.
Additional context
I just considered another alternative, and that is creating two commands startmodal and endmodal to signal where to enable/disable modality during the dialog. It's kind of tedious because I have to mark all the dialogs with those commands but I think it's a better trade-off than passing the instance of DialogueRunner
Thanks for implementing this! 👏