Chat creation.

I need a push in the right direction.
I have tried making a chatbox and it went quite well, except that I had to click ENTER once again after typing a message to disable screen clicker and I had some issue with FinishChat that didn’t even want to work unless I closed chatbox (the custom one) manually and pushed ENTER afterwards.

So… yeah, all I need is a general knowledge on this topic, perhaps list of hooks I should use or few examples.

Thanks in advance!

I’ve never worked with the chat box myself, but taking a second and looking at the gamemode hooks it seems like you’d want to use these.

For when the player opens and closes the interface.

For updating and displaying chat

I am not sure what else you’d need. Good luck with your script.

NOTE: I’d just browse the Gamemode Hooks and search for anything containing say or chat.

I know that you wanted to help, but didn’t I mention that FinishChat isn’t working well with my chatbox?
Ergo, even if I am finished typing a message and press enter, I still see the cursor until I click enter again.

Obviously not the best solution, but you could just simulate a second enter instantly after they press the first enter?

Yeah I get that you’re having issues with the script and the FinishChat hook, but you still did ask for “general knowledge on [the] topic [and] a list of hooks” almost word for word.

Can you post the code you’re using to close your chat?
My first thought is to add a timer. Just timer.Simple( 0.1 function() close end )

That’s not the point.
I am using VGUI for chatbox and DTextEntry for text input, when I run OnEnter and close the chatbox, I still have to hit enter again.

My old gmod chatbox I updated for the beta.

And then the one from source tribe.

self.TextEntry.OnKeyCodeTyped = function( entry, code )
if ( code == KEY_ENTER ) then

		local text = entry:GetValue()

		if ( text && #text > 0 ) then

			RunConsoleCommand( teamchat && "say_team" || "say", entry.command && "!"..text || text )





[lua]function PANEL:OnKeyCodeTyped( key )
if key == KEY_ENTER then
timer.Simple( 0.1, function() self:Close() end)

Yeah I get that you may be using VGUI or what ever, but use a timer and it may solve your issue. Look through the code of any free chat box and that appears to be what a majority of them have done.

That’s helpful, really, but I am using a VGUI.