Euphe's custom chat box.

I decided to release the custom chat box I have been working on. It’s not a ground breaking thing, but I think someone might like it or use it for learning.

Let’s get to the point and see what it has got!
The chat box features:
1. Basic functionality:it draws text.

https://dl.dropboxusercontent.com/u/14273442/scrn1.png

2. Ability to browse the chat history:features a panel that lets you browse the full session chat log.

You are going to say that every chat box has this and it is nothing special. You are right. This is why I added something other chat boxes don’t have.

3. Complete customization:ever wanted an undersized pink eye-hurting and totally unusable chatbox? Even if not, you now can create one.
Just open the controls window, open the chat and use the provided sliders, check boxes and color mixers to turn your lovely chatbox into an abomination. Don’t even need to reopen the chat box to see the changes - it will change instantly. Even the amount of chat lines drawn will reactively change when chat history height or chat history spacing changes.

https://dl.dropboxusercontent.com/u/14273442/scrn2.png

Jokes away the chat box allows you to customize:

  • Whether to draw chat bubbles or not
  • Whether to draw borders or not
  • Whether to draw time stamps or not
  • Color of almost anything in your chat box
  • Everything related to position: padding, x and y margin, spacing and more.
  • Size of nearly anything

That allows you to make yourself the chatbox of your dreams.

The chat history log and chat box controls are available throught console commands:
chbox_history
chbox_controls

In case you fuck up the chatbox beyound recognition I have included a chbox_defaults command to reset it to the pretty neat default setting.

Known issues:

  • There is no multiline support for the chat box. That means that a long line won’t break in two.
  • The text in the chat box text input is not what is sent into the chat, it’s only a copy of the actual chat input. Changing text in that text entry via cutting/pasting will not change the text sent to the chat.
  • Font selection is 90% done, but there are no derma controls for it. You can still set fonts using chbox_toutput_font and chbox_tbar_font (for chat history and text bar),
  • After resetting to defaults it requires to open chat controls to apply the size and position settings.
  • Unknown bugs and mistakes can arise

These issues are unsolved because I am going away for a long time and I don’t know if I will ever fix them.

You can do pretty much anything with the code. I would really appreciate if you pointed out ways to fix any problems. You can also use the code to learn if you wish, it might be interesting (it’s uncommented thought so good luck with that).

You can download the addon here:
https://dl.dropboxusercontent.com/u/14273442/chatbox.rar

This is very good! Keep up the good work!

Can you add support to show ULX Ranks before a player name?
Possibly an icon next to the group and/or emote icons?

Most important thing I look for in a chatbox. Can you copy and paste?

Reminds me of DOS

From the chat history - you can’t.

[editline]19th August 2013[/editline]

This may be added in future if I decide to keep the project up, but after the more important features like copy-paste and multiline history.

[editline]19th August 2013[/editline]

DOS?

I’m getting all kinds of lua errors.

Consistent colours and a faded background behind text might work better than what you have, but its a good start

You can very easily add a faded background to the default skin and get a very neat look.

[editline]20th August 2013[/editline]

Please post them or pm them to me.

Does this work with Evolve chat commands? I’ve tried a different one and it just didn’t work at all.

I’d be curious to see some of the designs that people have come up with. Because the ones in the OP’s post are not selling me. xD

If evolve uses text sent via chat.Add then they will work as my chat box doesnt override it unlike most other chat boxes.

Well Evolve shows your commands under your chatbox when you type ! first. I’m not sure if that is text sent via chat.

So, if it doesn’t read chat.AddText, chat.AddText won’t appear in the chatbox, correct? Why not just say “no”?

Iirc, Evolve uses the StartChat hook, but this chatbox returns true to that so other hooks won’t run. This would mean it depends on which hook runs first. To get around that would mean implementing a completely different approach to opening the chatbox, though.

Now, I highly recommend you add something to catch chat.Addtext messages, you’d be surprised at just how many messages you’ll miss because of that. Normally you could miss OnPlayerChat by using it, but I see you’re messing with colours there, so it’d be simpler to keep that in (Although I do recommend integrating a chat tags system as it’d become incompatible with most)

You also mentioned client customisations for the chatbox position, so I also recommend an override for chat.GetChatBoxPos, just for compatibility. Most noticeable change from this would be that DarkRP’s “Players who can hear you” thing would be positioned correctly. This shouldn’t be too difficult, just return the x and y pos of the chatbox’s top-left corner

You should try and add a copy system, too. I recognise a full highlighting system can be difficult, but even just a simple right click>copy for a single full line would make the chatbox a lot more viable

It’s 4:30 AM, so I’m probably missing a load of other reasonably simple changes

Most people would use this for DarkRP. You should probably add the prefix as an option. (The OOC or Yell)