You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
787 B
33 lines
787 B
using Godot;
|
|
|
|
namespace Babushka.scripts.CSharp.Common.NPC;
|
|
|
|
public partial class DialogicOverlayStarter : Node2D
|
|
{
|
|
[Export] private string[] _timelinesToPlay;
|
|
[Export] private int _timelineIndex = 0;
|
|
[Export] private bool _startOnReady = true;
|
|
|
|
[Signal] public delegate void DialogueEventHandler(string timelineName);
|
|
|
|
public override void _Ready()
|
|
{
|
|
if (_startOnReady)
|
|
ToggleDialogue();
|
|
}
|
|
|
|
public void ToggleDialogue()
|
|
{
|
|
ToggleDialogue(_timelinesToPlay[_timelineIndex]);
|
|
}
|
|
|
|
public void ToggleDialogue(int index)
|
|
{
|
|
ToggleDialogue(_timelinesToPlay[index]);
|
|
}
|
|
|
|
public void ToggleDialogue(string timelineName)
|
|
{
|
|
EmitSignal(SignalName.Dialogue, timelineName);
|
|
}
|
|
} |