began the dialog system
This commit is contained in:
26
src/scene-scripts/gui/dialog_object_area.cs
Normal file
26
src/scene-scripts/gui/dialog_object_area.cs
Normal 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;
|
||||
}
|
||||
}
|
8
src/signal_bus.cs
Normal file
8
src/signal_bus.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class signal_bus : Node
|
||||
{
|
||||
[Signal]
|
||||
public delegate void DialogDisplayEventHandler(string textKey);
|
||||
}
|
Reference in New Issue
Block a user