Good job on this, looks a whole lot more sleek and modern. TextChatCommands seem very easy to implement, and could even be grouped by Folders or maybe even adopted by command frameworks.
I feel it is a little unfortunate that TextSources didn’t get chat tag support and instead the developer must manually concatenate it in a callback - writing RichText without some builder API is a pain. I enjoyed the simplicity of Speaker:SetExtraData() for chat tags.
There’s some issues with it. You can’t send a message after messing with it, I have the channels set manually and speaker is added on player added.
Edit: Player color is also not shown.
So, to make our own chat GUI we just have to hook up the API functions/events to a ScreenGUI?
I’m kind of confused on what each linked resource does because their documentation is primarily composed of just inherited properties and repetitive info
Then you can create your own text box to send messages:
local textBox: TextBox = createTextBox()
local chatInputBarConfiguration: ChatInputBarConfiguration = TextChatService:FindFirstChildOfClass("ChatInputBarConfiguration")
textBox.FocusLost:Connect(function(wasEnterPressed: boolean)
local targetChannel = chatInputBarConfiguration.TargetTextChannel
if targetChannel then
targetChannel:SendAsync(textBox.Text)
end
end)
Rendering messages takes a little more work, but you can do that by listening to events like in this pseudo-code:
local chatWindow: Frame = createChatWindow()
TextChatService.MessageReceived:Connect(function(textChatMessage: TextChatMessage)
renderTextLabel(chatWindow, textChatMessage)
end)
For help with something specific like this, feel free to ping me in a new thread in the Help and Feedback section since there will likely have to be some back-and-forth with this request!
Insanely awesome update - I love that Roblox is getting away from forking default scripts and instead allowing for seamless integration. This is a great display of futureproofing, and I’m really excited to see the subsequent updates to this. This provides a really cool flexibility that actually makes subsequent updates (hopefully) roll as “new features/developer options for the chat system” versus “global chat system changes”.
Here’s hoping the Animate script gets some love soon
This update is really nice and I was able to update my public script accordingly without any issues. However, it is still annoying there is no ability to hide a message until I have fully “processed” it as a developer.
Under recommendation from @be_nj in this reply to my controller, I store everything required, such as prefix, name color, and so on, as an attribute to the player. In my script, all I do is read this attribute as a script, as with in this code snippet:
function PlayerMessageHandler:Success(message, properties)
local player: Player = Players:GetPlayerByUserId(message.TextSource.UserId)
if not Util.AssignmentOptions:CheckIsPlayerValid(player) then
return properties
end
local prefixText = player:GetAttribute("ChatData_PrefixText")
local prefixColor = player:GetAttribute("ChatData_PrefixColor")
local nameColor = player:GetAttribute("ChatData_NameColor")
local chatColor = player:GetAttribute("ChatData_ChatColor")
properties.PrefixText = string.format(
Configuration.PlayerMessage.NameFormat,
message.PrefixText
)
if typeof(nameColor) == "string" then
properties.PrefixText = string.format(
Configuration.PlayerMessage.NameColorFormat,
nameColor,
properties.PrefixText
)
end
if typeof(prefixText) == "string" and typeof(prefixColor) == "string" then
properties.PrefixText = string.format(
Configuration.PlayerMessage.PrefixFormat,
prefixColor,
prefixText,
properties.PrefixText
)
end
if typeof(chatColor) == "string" then
properties.Text = string.format(
Configuration.PlayerMessage.TextFormat,
chatColor,
message.Text
)
end
return properties
end
The line Util.AssignmentOptions:CheckIsPlayerValid(player) does not yield as this is all it is:
function AssignmentOptions:CheckIsPlayerValid(player: Player)
return typeof(player) == "Instance" and player:IsDescendantOf(Players)
end
The “delay” can still be seen in this video (ignore the music, I didn’t feel like muting it okay).Edit: The delay is no longer visible thanks to a bug being pointed out by @be_nj in this reply.
Are there any plans to add the ability to hide a message? Since it’s a UIListLayout, even the ability to make the TextLabel.Visible to false would be nice, however, we don’t even have that small amount of control.
It sounds like both of these ideas are converging on the same thought! Being able to hide particular messages with the default UI is something we are considering through the TextChatMessageProperties API.
Right now there is not a way to hide messages within the default UI. Of course you can decide to hide or filter messages based on proximity or TextChatMessageStatus with a custom UI but we’d like to enable this in the default case as well.
How do channels work? When this was in beta I could not see a way to have elective always-available channels that players could switch between on the fly (e.g. general versus roleplay-specific chat) because there was no documentation. Still cannot find anything of the sort. Was this feature dropped? I guess I can allow players to form chat groups (custom channels), but there’s no nice way to present this within the UI of the chat window, or to allow them to swap channels in a self-contained way. If there is I couldn’t figure it out.
Also it seems there’s no way to let players resize this chat? This is important in my game because roleplay involves a lot of chat history.
It’s great to see the new in-experience text chat system and new UI looks much better and the fact you get more customization with it. Good job and well done to everyone who worked on this new in-experience text chat system. I will definitely find some time to check out the documentation. Thank you for this release!