LegacyChat ported to TextChatService

On the forum, you can click on my profile and there is a “Message” button

– UPDATE –

The initial file for this version had a bug,

– Fixed the system attempting to remove the speaker twice when leaving a channel
– Fixed some types having not being quite right

– Added a check to throw an error if using Chat:GetChatService() from the client
– Added a check for received messages that lack metadata (likely not sent through the lua chat system)
– Added checks for non-disabled parts of TextChatService that should be disabled (ie the chat window, default channels, etc)

– Added support for WinryVirtualKeyboard & Gamepad support
(This includes a modification to the ChatLocalization table, to make the base Textbox message show the proper keybind. Don’t reuse the old localization table
– Added ChatSettings.ChatHotKeyKeyboard & ChatSettings.ChatHotKeyGamepad, to customize the keybinds.
These can be changed at runtime, for example, to let players chose their prefered keybind. (Previous ChatSettings modules without those field still work)

– Added the FixDoubleRichTextSanitization FFlag, in the FFlags module, which fixes <, > and & appearing as > or whatever
– Fixed an oversight in the new filtering system leading to messages from bot speakers always displaying as “______”


@Shake_Official, you might like this one

2 Likes

Instantly put it into a place to try and yep, it works!

It’s nice to see another integration of the keyboard with an alternative Luau-exclusive API. I’ll look at including a proper WVK Luau API in the next release (One that, of course, takes into account the intricacies you’ve done to make your wrapper work).

2 Likes

I updated the files for version 3, there was a small issue where I did not write an if statement correctly, which caused any changes of the Settings module to trigger an update of the Textbox’s background text, and if that happened before the chat bar is created, it would lead to an error

That has been fixed, and updates to the Textbox’s background text don’t error anymore if the chat bar doesn’t exist yet

Hi, it really works fine now! Thanks for the update! :saluting_face:
image

1 Like

– UPDATE –

– Fixed messages from the team channel being stuck as the unfiltered placeholder
– Fixed the ChatBar breaking when existing custom states

– Added support for the legacy BubbleChat. To use it, set ChatSettings.BubbleChatEnabled = true, and TextChatService.BubbleChatConfiguration.Enabled = false


Smaller update because of the bugs I had to fix,

Somehow, the team channel not working has been a thing since the port I think, the other one was from improper testing. I might make beta versions for future release or something, so it can be tested in productionish. Testing using the local server in studio is a bit painful

2 Likes

This going to be pretty useful, i hope its done soon!

How am I supposed to enable bubble chat? There is logic detecting if both TCS and LC have their ChatBubble properties enabled, but LC’s won’t work.

There is logic for it, you’ll get a warning if both are enabled at the same time, and the legacy bubble chat is disabled if the new bubble chat is enabled

In the ChatSettings module, you need to change this

module.BubbleChatEnabled = PlayersService.BubbleChat

to this

module.BubbleChatEnabled = true

Then, set TextChatService.BubbleChatConfiguration.Enabled to false, in the explorer (or through the command bar if you want…)

Then it should work

1 Like

Pretty sure it’s been explained somewhere before, but I’ve forgotten: how does Roblox know that the “Chat” (root) ModuleScript is the real one that Roblox should use to initiate the ported Legacy Chat? I’m curious.

I can move it to any directory in ReplicatedStorage and it is used either way, so what I’ve concluded is most likely is that TextChatService is most likely getting communicated with to setup the system. I could be wrong though.

2 Likes

it’s actually very simple,

It doesn’t communicate with anything. So every other chat is disabled (LegacyChat is disabled because of TextChatService.ChatVersion, and TextChatService’s default gui is disabled)

The Chat module is required from within, if you look inside, it has two scripts, ChatScript and ChatServiceRunner, both of these are responsible for running the chat on the client and server (and they require the Chat module)

They use the newish RunContext property, to be able to run anywhere (as long as the client script is replicated to the client), including inside ReplicatedStorage. In the past, the Chat service would clone ChatScript and ChatServiceRunner to PlayerScripts (StarterPlayerScripts? idk) and ServerScriptService

Well, there is one connection, using StarterGui:SetCore("CoreGuiChatConnections", containerTable), which is how the Lua Chat System was able to communicate with core scripts, while being a lua script available to everyone

1 Like