began the dialog system

This commit is contained in:
2022-11-27 23:29:56 +01:00
parent 29b5153434
commit ca57159c22
6 changed files with 73 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
using Godot;
using System;
using System.Runtime.CompilerServices;
public partial class dialog_object_area : Area2D
{
[Export]
public string dialogKey = "";
public bool areaActive = false;
public override void _Input(InputEvent @event)
{
if(areaActive && @event.IsActionPressed("ui_accept"))
{
EmitSignal("DialogDisplayEventHandler", dialogKey);
}
}
public void onAreaEntered()
{
areaActive = true;
}
public void onAreaExited()
{
areaActive = false;
}
}