LordAshes-ChatService icon

ChatService

Dependency plugin to add services to the chat.

Last updated 3 months ago
Total downloads 3798
Total rating 1 
Categories Integration Tweaks Tools Networked
Dependency string LordAshes-ChatService-2.0.0
Dependants 8 other mods depend on this mod

This mod requires the following mods to function

bbepisTaleSpire-BepInExPack-5.4.10 icon
bbepisTaleSpire-BepInExPack

Unified BepInEx all-in-one modding pack - plugin framework, detour library

Preferred version: 5.4.10
brcoding-SetInjectionFlagPlugin-2.3.0 icon
brcoding-SetInjectionFlagPlugin

Allows players to flag mods are installed

Preferred version: 2.3.0
LordAshes-FileAccessPlugin-1.3.1 icon
LordAshes-FileAccessPlugin

Provides standardized methods for accessing both local file and url resources. Automatically handles searching local folders for assets.

Preferred version: 1.3.1

README

Chat Service Plugin

This unofficial TaleSpire plugin is a dependency plugin for creating local chat service functionality. The plugin allows registering of key words with corresponding handlders to create functionality such as whispers or dice rolling functionality.

Change Log

2.0.0: Fix after BR HF Integration update 1.2.0: Added ChatMessageService class for proper subscription and sending handling and AssetData support. 1.1.2: Corrected documentation. No plugin change. 1.1.1: Fixed soft dependency check to avoid exception when soft dependency is not found 1.1.1: Corrected dependency list to include FileAccessPlugin 1.1.0: Added optional deselect action to the character radial menu to deselect the mini and returns the chat box input back to speaking a player (and not creature). Can be turned on or off in the R2ModMan settings for plugin. If on, requires RadialUI plugin. If off, RadialUI plugin is not needed.

1.0.1: Added source in the handler to distinguish messages from gm, player or creature.

1.0.1: Fixed bug when using multiple hanlders and one returns a null.

1.0.0: Initial release

Install

Use R2ModMan or similar installer to install this plugin.

Optional Dependency

Chat Service Plugin has a soft dependency on Radial UI plugin. If the deselect option is turned on in the settings then Radial UI plugin is required. If the deselect option is turned off then Radial UI plugin is not required.

Usage

Reference this dependency plugin in the parent plugin and then use the following syntax to add a chat service:

handlers.Add(serviceKey, handler)

Where the service key is a string that must appear at the beginning of the chat message in order to trip the corresponding handler.

Where hander is a function that takes in two string, the message content and the sender, and a source which is a ChatSource enumeration indicating if the source if a GM message, player message or creature message. The hanlder returns a string, the modified message or null. Returning null prevents the message from being displayed.

An example of adding a inline handler for "/w" function would be:

handlers.Add("/w ", (chatMessage, sender, source)=> { Debug.Log(sender+" whispered "+chatMessage); });```

### Usage programatically

You can also use this function for sending messages to other clients without having the request triggered
by the user from the chat. This can be done by using the core TS function:

``ChatManager.SendChatMessage(message, sender)``

Where *message* is the content to be sent and should include the handling prefix.
Where *sender* is the NGuid of either a creature mini (CreatureId) or player (PlayerId).

For example, to use the above hander for "/w" assuming it is a whisper message to the GM:

``ChatManager.SendChatMessage("/w I pickpocket the person I am speaking to", LocalPlayer.Id.Value)``

Available versions

Please note that the install buttons only work if you have compatible client software installed, such as the Thunderstore Mod Manager. Otherwise use the zip download links instead.

Upload date Version number Downloads Download link  
2022-4-27 2.0.0 1277 Version 2.0.0 Install
2022-2-12 1.2.0 1310 Version 1.2.0 Install
2022-2-7 1.1.2 205 Version 1.1.2 Install
2021-12-13 1.1.1 718 Version 1.1.1 Install
2021-10-22 1.1.0 191 Version 1.1.0 Install
2021-10-11 1.0.1 61 Version 1.0.1 Install
2021-10-11 1.0.0 36 Version 1.0.0 Install