LegacyChat ported to TextChatService

– 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

2 Likes

In very brief testing, I’ve noticed in Studio that if I have the chat closed and re-run… Set StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false) works as intended.

However, if the chat was open then this does nothing.

I am not able to replicate, could you provide more details or a video?

found out that this doesn’t have support for game.Chat:SetBubbleChatSettings({}) yet :sob: nobody mentioned it yet so im just throwing it out there so it’s known
image

1 Like

Oh, I’ll have to look into that

Forgot that existed when adding back the legacy bubble chat. Although, was that one for the legacy bubble chat? I can’t see reference to it inside the script, and I’m struggling to find information online

1 Like

i think it’s for the reworked bubble chat, this one The Big Bubble Chat Rework
i’m not sure if that’s considered legacy bubble chat or not though… i did depend on it though so i gotta figure out how i can get it working again :sob:

1 Like

Ok, I figured out how it works! But sadly it only works with the true LegacyChat
So, to get it to work, Players.BubbleChat must be enabled, and that is achieved with game.Players:SetChatStyle(Enum.ChatStyle.Bubble) (or .ClassicAndBubble I think)
This has to be done on the server side (or in the command bar maybe, didn’t test). Once that is done SetBubbleChatSettings() will start working (it has to be called after Players.BubbleChat is set to true though)

Problem is, this only works when TextChatService.ChatVersion is set to LegacyChat. So basically, tomorrow, can’t use it… Unless I missed something

So only option is probably to customize TextChatService.BubbleChatConfiguration, and a reimplementation of SetBubbleChatSettings() would have to do the same

Bad news because last time I tried playing with TextChatService.BubbleChatConfiguration, a couple of settings didn’t seem to work?

2 Likes

ouhhh… i’m cooked for a little while i guess :sob:
i’ll just work around it by raising the bubble chat height using the bubble chat configuration for now, but hopefully there’s some way to reimplement even a little bit of the old behavior in the future

1 Like

– UPDATE –

– Fixed messages not appearing if a user’s local clock is desynced, and ChatSettings.ShowUnfilteredMessagePlaceholder was false
That was achieved by reworking bits of the ChatChannel and MessageLogDisplay Modules, to improve how they handle the ordering of messages, and implementing compensation for desync between the server’s clock and the client’s clock

Technical details

The server now sends his clock along side messages, and the client offsets the .Time value of the messages with the difference between the server’s clock and the client’s clock. This also allows for os.clock() to be used instead of os.time()

– Moved FFlag.UserHandleChatHotKeyWithContextActionService to ChatSettings.UseContextActionService, and made it true by default. This new setting can be modified at runtime. If you are using an old ChatSettings module, it defaults to false.
Making it true by default was to get the same behaviour as TextChatService, where it favours the physical location of keys (For example, on my keyboard, “é” is where “/” would be on an english keyboard, so my key to open the chat would be “é” instead of “/”)


I’ve opted for a more gradual release of version on this one. New versions will be marked as stable and published to the creator store once I’ve confirmed that they don’t have significant issues

1 Like

what would the equivalent of Chat:Chat(partOrCharacter, message, color) be using the legacy bubble chat? i tried using the TextChatService DisplayBubble but that just makes a new chat bubble rather than a legacy one (who could have guessed, lol)

DisplayBubble is the alternative, but I did not consider the legacy bubble chat when porting it…
If you change the settings to get the old bubble chat, and use Chat:Chat() (and I mean Chat = Game:GetService("Chat"), it works, but the new bubble chat overlaps it for some reason?

Or you can manually trigger this function, in this module


image

Or you can wait for me to implement it in the port, for the next version, probably as a Chat:ChatLegacyBubble() or some name like that