# Active Line Metadata

Game Creator / Dialogue / **Active Line Metadata**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

Returns the metadata value of the current active line of the Dialogue component

!!! note
    The value of the metadata key must be '1' or 'true' to return true. Otherwise returns false

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;
using VisualScript.Runtime;

namespace GameCreator.Runtime.Dialogue
{
    [Get]

    [Title("Active Line Metadata")]
    [Category("Game Creator/Dialogue/Active Line Metadata")]

    [Description("Returns the metadata value of the current active line of the Dialogue component")]
    [Image(typeof(IconBubbleSolid), ColorTheme.Type.TextLight, typeof(BadgeHash))]

    [Note("The value of the metadata key must be '1' or 'true' to return true. Otherwise returns false")]

    [Serializable]
    public class TypeBoolDialogueActiveLineMetadata : TypeBool
    {
        [SerializeField] private GetGameObject m_Dialogue = new GetGameObject(
            new TypeGameObjectDialogue()
        );

        [SerializeField] private GetString m_Metadata = new GetString("my-metadata");

        public override bool Get(Args args)
        {
            Dialogue dialogue = this.m_Dialogue.Get<Dialogue>(args);
            if (dialogue == null) return false;

            string metadata = this.m_Metadata.Get(args);
            return dialogue.CurrentNode != null &&
                   dialogue.CurrentNode.TryGetMetadata(metadata, out string value) &&
                   (value == "1" || value == "true");
        }

        public override string ToString()
        {
            return $"Active {this.m_Dialogue}[{this.m_Metadata}]";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
```

