Add QueueAction overload

This commit is contained in:
Sardelka 2022-07-14 18:50:15 +08:00
parent e4c03f8ccc
commit e40d4695ea
2 changed files with 11 additions and 2 deletions

View File

@ -361,7 +361,7 @@ namespace RageCoop.Client
/// <summary> /// <summary>
/// Queue an action to be executed on next tick, allowing you to call scripting API from another thread. /// Queue an action to be executed on next tick, allowing you to call scripting API from another thread.
/// </summary> /// </summary>
/// <param name="a"> The action to be executed, must return a bool indicating whether the action cane be removed after execution.</param> /// <param name="a"> An action to be executed with a return value indicating whether the action can be removed after execution.</param>
internal static void QueueAction(Func<bool> a) internal static void QueueAction(Func<bool> a)
{ {
lock (QueuedActions) lock (QueuedActions)

View File

@ -231,6 +231,15 @@ namespace RageCoop.Client.Scripting
{ {
Main.QueueAction(a); Main.QueueAction(a);
} }
/// <summary>
/// Queue an action to be executed on next tick, allowing you to call scripting API from another thread.
/// </summary>
/// <param name="a"> An action to be executed with a return value indicating whether the action can be removed after execution.</param>
public static void QueueAction(Func<bool> a)
{
Main.QueueAction(a);
}
/// <summary> /// <summary>
/// Disconnect from the server /// Disconnect from the server
/// </summary> /// </summary>