LordAshes-ChatService icon

ChatService

Dependency plugin to add services to the chat.

Last updated 2 weeks ago
Total downloads 6360
Total rating 2 
Categories Integration Tweaks Tools Networked
Dependency string LordAshes-ChatService-2.2.2
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.4.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.4.1
HolloFox_TS-RadialUIPlugin-2.2.3 icon
HolloFox_TS-RadialUIPlugin

This is a developer tool based package used to help devs easily configure UI Radial Menus.

Preferred version: 2.2.3

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.2.2: Mini does not say chat messages that are chat service handlers
2.2.1: Improved logs and handler processing
2.2.0: Improved speaker setting code to eliminate exception at start
2.1.1: Made method for checking if a chat key is registered
2.1.0: Added custom header messages
2.1.0: Improved patching to not replace code so that it works with updates like the chat ! roll
2.1.0: Removed legacy code and legacy access
2.0.2: Fix bug with diagnostic configuration setting
2.0.1: Added configurable diagnostic log level
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:

chatMessgeServiceHandlers.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:

chatMessgeServiceHandlers.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)``

### Custom Headers

Messages whose content contains text in square brackets is treated as custom header messages. The message
must start with an opening square bracket, have some text, have an ending square bracket, and finally have
some content. Such messages will replace the usual character or player name in the chat message header with
the contents between the square brackets and limit the message content to the contents after the ending
square. For example:

[Bilbo]Is it time to eat yet?

Would create a chat message whose header would be "Bilbo" and message content would be "Is it time to eat yet?"
regardless of who sent the message.

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-11-16 2.2.2 469 Version 2.2.2 Install
2022-11-16 2.2.1 26 Version 2.2.1 Install
2022-11-9 2.2.0 276 Version 2.2.0 Install
2022-11-9 2.1.1 40 Version 2.1.1 Install
2022-11-9 2.1.0 8 Version 2.1.0 Install
2022-11-5 2.0.2 196 Version 2.0.2 Install
2022-11-5 2.0.1 10 Version 2.0.1 Install
2022-4-27 2.0.0 2719 Version 2.0.0 Install
2022-2-12 1.2.0 1325 Version 1.2.0 Install
2022-2-7 1.1.2 219 Version 1.1.2 Install
2021-12-13 1.1.1 734 Version 1.1.1 Install
2021-10-22 1.1.0 210 Version 1.1.0 Install
2021-10-11 1.0.1 81 Version 1.0.1 Install
2021-10-11 1.0.0 47 Version 1.0.0 Install