Basic Legacy Chat Rewrite for TextChatService

Ran a playtest recently with the GZARP playerbase and caught a handful of bugs, including:

  • Players are unable to type in the chat bar on mobile
  • Sending RichText symbols (<, >, etc.) shows up as the original escape forms in bubble chat (“<”, “>”, etc.)
  • The “w” in “/w” gets registered as a username search for “w”
  • Whispering to a player sometimes cuts off their username
  • Typing indicator is visible from way too far away

I’ve gotten the easy fixes out of the way and published an updated version, but I still need to do some more testing for mobile devices; they seem to be causing a lot of trouble.
If anyone else can figure out some of the mobile issues before I do, let me know and I’ll publish an updated version.

thats really good! but how do I make it use the new bubble chat and not your own custom one? I am only looking for the design of the chat, not change the bubble chat.

Speaking of the custom chat bubbles the whole text does not fully appear. For example, if you type in a single letter, the chat bubble will appear empty. That was a common thing with the old chat bubbles, But I Manually fixed that problem by increasing the width where it creates the TextLabel.

1 Like

Actually very good! Only a slight UI difference between the Legacy Chat and your rewrite
I made a few adjustments to more closely match the legacy chat, and also added a few settings to ChatConstants

1 Like

Could you please elaborate on the changes you have made?

1 Like

Legacy chat I believe had a bug relating to the sizing. Basically, when opening roblox, the size of the game window is not what it should be (it’s instead somewhat small for a short period of time). Depending on when the chat loads, it registers a size that isn’t the actual size of your screen, and would sometimes wrongly set the chat size has Tablet or Phone

This is how it detects the device type internally
image
image
(Settings module)

This is something I have fixed in my forked version of the legacy chat (however, I cannot tell you if the size settings in my forked version are the same as the default ones)

It’s possible that this bug doesn’t occur when in studio, since the game window doesn’t resize when play testing
The default size for Desktop has a scale of 0.3

1 Like

Added on to the README the changes I made, these specifically (for accuracy to Legacy Chat):

--[[
CHANGES MADE
ChatConstants.RemoveTranslationsEnabledMessage added, defaults to false
ChatConstants.UseCustomCommandsColor added, defaults to false
ChatConstants.ChatWindowLayoutOrder added, defaults to 6
ChatConstants.MessageFrameAutomaticSize added, defaults to Enum.AutomaticSize.Y
ChatConstants.MessageLabelAutomaticSize added, defaults to Enum.AutomaticSize.Y

MessageLog.registerMessageAddedCallback shouldn't error when Message.create returns nil
ChatConstants.DefaultChatWindowSizeScale set to (0.4, 0.33) from (0.4, 0.34)
]]

One thing this forgot is that ChatConstants.WindowResizeable defaults to false
And I made a mistake (ChatConstants.RemoveTranslationsEnabledMessage defaults to true), I’ll fix these with a simple update

I also included a command bar loader to save some time, this is the code (minus the comment which has instructions on using it)

local legacyChatRewrite = workspace["Basic Legacy Chat Rewrite"]
local whatGoesInChat = legacyChatRewrite["PUT ME IN CHAT AND UNGROUP"]
local whatGoesInScriptService = legacyChatRewrite["PUT ME IN SERVERSCRIPTSERVICE AND UNGROUP"]

for _, obj in whatGoesInChat:GetChildren() do
	obj:Clone().Parent = game.Chat
end

for _, obj in whatGoesInScriptService:GetChildren() do
	obj:Clone().Parent = game.ServerScriptService
end
1 Like

what command bar did you add?
???

the code snippet he provided above is supposed to be ran using command bar, he didn’t add a command bar to the chat.

This looks great! Mind if I overwrite the current model with your version?

Edit: Noticed this code snippet here where you were trying to override the system message color. This is unfortunately the correct way to do it; I did not set the system message color, Roblox just adds a RichText tag to all system messages to color them grey.

if not ChatConstants.UseCustomCommandsColor then
	-- hacky workaround
	-- i have no clue where the hell the color is set
	-- all i know is the setting for it is disabled and the color shall not be present
	
	scroller.ChildAdded:Connect(function(message)
		if not message:IsA("Frame") then
			return
		end
		
		local label = message:FindFirstChildOfClass("TextLabel")
		
		if string.find(label.Text, '<font color="#d4d4d4">') then
			local text = string.gsub(label.Text, '<font color="#d4d4d4">', '')
			text = string.gsub(text, '</font>', '', 1)
			
			label.Text = text
		end
	end)
end

Saezi covered this issue in this thread a little bit ago:

2 Likes

Did you get one of these?

2 Likes

Yeah I get that too. I don’t have any clue if this system does follow parental control settings, so I just ignore it.

this looks way better than the current chat UI.

does anyone know why roblox is actively downgrading their chat system? They just gave up on it? Less budget?

Yo man, first of all let me say THANK YOU!


I’m working on a classic game as well right now, and the sunsetting of LegacyChat really bummed me out. God bless you.

However, I’d like to kindly share with you that when I hover over the chatbox, I experience some major lag, that disappears when I remove my mouse from the box. Is this a known issue?

image

Here’s what I got in the dev console. I also lag heavily when I used dex, which is the world viewer integrated into the Adonis Admin system, and this only started once I added this

1 Like

Whatever Roblox is using to detect legacy chat was accidentally detecting my system as well. I restructured the LegacyChatLoader script and published a new version so that this shouldn’t happen anymore.

I couldn’t get this bug to happen for me. Try making sure you’re using the latest versions of both Adonis and Basic Legacy Chat Rewrite. If it still keeps happening, send me a place file and I can take a look.

1 Like

It’s all good now, I apologize for forgetting to let you know. Turns out it was the cursor replacement script I was using was clashing with the “hovering over chatbox” script.

And right, I’ll update the system anyway considering you updated it avoid that annoying pop-up.

:pray:

I really love this. This is the best thing ever. I hate textchatservice, thank you so much for making this.

I’ve updated my version of Basic Legacy Chat Rewrite to feature the new loader along with a few other changes to ChatConstants

Btw @Steven_Scripts , if you want to overwrite your model with my version, then you can do so!

It’s buggy when you zoom into the chat you can see the arrow and like a padding between it and it like twitches please fix that with the bubble chats.