2024-05-19 15:59:41 +00:00
|
|
|
|
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Rokojori
|
|
|
|
|
{
|
2025-11-26 14:23:59 +00:00
|
|
|
[Tool][GlobalClass, Icon("res://addons/rokojori_action_library/Icons/ActionReference.svg")]
|
2025-01-08 18:46:17 +00:00
|
|
|
public partial class ActionReference : Action
|
2024-05-19 15:59:41 +00:00
|
|
|
{
|
|
|
|
|
[Export]
|
2025-01-08 18:46:17 +00:00
|
|
|
public Action referencedAction;
|
2024-05-19 15:59:41 +00:00
|
|
|
|
2025-12-18 10:29:54 +00:00
|
|
|
[ExportToolButton( "Set Reference Name" )]
|
|
|
|
|
public Callable setReferencedNameButton => Callable.From(
|
|
|
|
|
()=>
|
|
|
|
|
{
|
|
|
|
|
if ( referencedAction == null )
|
|
|
|
|
{
|
|
|
|
|
this.Name = "* (nothing)";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.Name = "* " + referencedAction.Name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2025-01-08 18:46:17 +00:00
|
|
|
protected override void _OnTrigger()
|
2024-05-19 15:59:41 +00:00
|
|
|
{
|
2025-01-08 18:46:17 +00:00
|
|
|
Action.Trigger( referencedAction );
|
2024-05-19 15:59:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|