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

@ -359,9 +359,9 @@ namespace RageCoop.Client
}
/// <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>
/// <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)
{
lock (QueuedActions)

View File

@ -231,6 +231,15 @@ namespace RageCoop.Client.Scripting
{
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>
/// Disconnect from the server
/// </summary>