CalloutInterfaceAPI 1.0.3
dotnet add package CalloutInterfaceAPI --version 1.0.3
NuGet\Install-Package CalloutInterfaceAPI -Version 1.0.3
<PackageReference Include="CalloutInterfaceAPI" Version="1.0.3" />
paket add CalloutInterfaceAPI --version 1.0.3
#r "nuget: CalloutInterfaceAPI, 1.0.3"
// Install CalloutInterfaceAPI as a Cake Addin #addin nuget:?package=CalloutInterfaceAPI&version=1.0.3 // Install CalloutInterfaceAPI as a Cake Tool #tool nuget:?package=CalloutInterfaceAPI&version=1.0.3
CalloutInterfaceAPI
CalloutInterfaceAPI is a library that makes interaction with the CalloutInterface plugin a breeze.
Getting Started
Rather than import and reference CalloutInterface.dll directly, the CalloutInterfaceAPI library serves as a safe interface between your callout pack and CalloutInterface. To get started, download the latest release and add CalloutInterfaceAPI.dll as a reference in your project. Then make sure to bundle the .dll with your project similar to how you would include RageNativeUI.dll (in the root Grand Theft Auto V folder).
You should NOT reference CalloutInterface directly.
</br>
Decorating your Callouts
One of the challenges of LSPDFR's callout system is that there is no separate description for callouts. Some callout developers understandably add unique identifiers to their callout names which can cause them to look odd in CalloutInterface. The solution is to extend LSPDFR's base CalloutInfoAttribute to add additional properties. This allows CalloutInterface to silently add your callouts to the MDT while the player is unavailable for calls. To support this functionality, you need to modify the decorators of your callouts:
Example
using CalloutInterfaceAPI;
using LSPD_First_Response.Mod.Callouts;
namespace ExampleNamespace
{
[CalloutInterface("Your callout name", CalloutProbability.Medium, "A very useful description", "Code 2", "LSPD")]
public class ExampleCallout : Callout
Note that the priority and agency are optional but you must provide a description. The description is what will show up in the CalloutInterface log, so it should be concise and reflect the general nature of your callout. It does not need to be unique.
</br>
Sending Messages
While your callout is active, you can send messages to the MDT. You cannot use color codes, but newlines \n
are supported. CalloutInterface uses a timer to prevent spamming of messages so you should not send multiple messages in a row.
Example
CalloutInterfaceAPI.Functions.SendMessage(this, "This is an example of a multi-line message.\nThis is the second line.\nPlease note, extremely long lines will be split up into chunks of no more than 60 characters. The rest of this is just gibberish to demonstrate what it looks like.");
</br>
Support
Please join my discord server and open a ticket for CalloutInterface and mention that you are a callout pack developer. I will add you to the CalloutInterfaceAPI channel.
Special Thanks
Thanks to Dylann24 and Charlie686 for being an early adopters and helping me test!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- RagePluginHook (>= 1.98.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.