2024-05-04 08:26:16 +00:00
|
|
|
|
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Rokojori
|
|
|
|
|
{
|
2026-04-27 08:15:59 +00:00
|
|
|
/** <summary>
|
2024-05-12 17:03:20 +00:00
|
|
|
|
|
|
|
|
<title>
|
2025-01-08 18:46:17 +00:00
|
|
|
Executes multiple actions (Action) at once.
|
2024-05-12 17:03:20 +00:00
|
|
|
</title>
|
|
|
|
|
|
|
|
|
|
<description>
|
2025-01-08 18:46:17 +00:00
|
|
|
The ActionList, which is an Action itself, executes all actions stored in the member 'actions' and also child nodes
|
|
|
|
|
that extend Action, when 'triggerDirectChildren' is checked.
|
2024-05-12 17:03:20 +00:00
|
|
|
|
|
|
|
|
</description>
|
|
|
|
|
|
|
|
|
|
</summary>
|
|
|
|
|
*/
|
2025-01-21 20:58:56 +00:00
|
|
|
|
2025-04-06 05:48:27 +00:00
|
|
|
[Tool]
|
2025-01-08 18:46:17 +00:00
|
|
|
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/ActionList.svg") ]
|
2026-04-27 08:15:59 +00:00
|
|
|
[RokojoriActionCoreExport]
|
2025-01-08 18:46:17 +00:00
|
|
|
public partial class ActionList : Action
|
2024-05-12 17:03:20 +00:00
|
|
|
{
|
|
|
|
|
|
2026-05-02 10:32:42 +00:00
|
|
|
/** <summary>Actions to execute</summary> */
|
2024-05-04 08:26:16 +00:00
|
|
|
[Export]
|
2025-02-12 16:48:15 +00:00
|
|
|
public Action[] actions = new Action[ 0 ];
|
2024-05-12 17:03:20 +00:00
|
|
|
|
2026-04-27 08:15:59 +00:00
|
|
|
/** <summary>Whether to execute Action child nodes</summary>*/
|
2024-05-12 17:03:20 +00:00
|
|
|
[Export]
|
2024-05-04 08:26:16 +00:00
|
|
|
public bool triggerDirectChildren = true;
|
|
|
|
|
|
2025-01-08 18:46:17 +00:00
|
|
|
protected override void _OnTrigger()
|
2024-05-04 08:26:16 +00:00
|
|
|
{
|
2026-05-02 10:32:42 +00:00
|
|
|
Action.TriggerAllActions( actions, this, triggerDirectChildren );
|
2024-05-04 08:26:16 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|