-
Notifications
You must be signed in to change notification settings - Fork 876
Conversation
/togglechat
|
This would be awesome! |
resources/[system]/chat/cl_chat.lua
Outdated
| @@ -83,6 +92,25 @@ AddEventHandler('chat:clear', function(name) | |||
| }) | |||
| end) | |||
|
|
|||
| AddEventHandler('chat:toggleChat',function() | |||
| chatVisibilityToggle = not chatVisibilityToggle | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add TriggerEvent('chat:clear') so it clears everything beforehand. Tested and it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Also added the chat:clear as requested by murfasa
Passing True will make sure they can see the chat. Passing False will make sure the chat is hidden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the TriggerEvent('chat:clear') as suggested by @murfasa
Added the ability for other resources to toggle the chat visibility to a certain state. (true=Visible , false=Hidden)
|
I'm not a fan of discarding all the chat messages which are sent while the chat is "disabled". Hiding the chat window on JS/CSS/HTML-side would be preferred, since then the user can still read the old chat messages when he reenables his chat. What's your opinion on this @blattersturm ? |
Using JS/HTML/CSS. Could probably be cleaned up.
|
@JohnnyCrazy, I've rewrote this to use JS/CSS/HTML like you suggested to retain chat history. It could probably be cleaned up some as well since I'm no JS pro. |
|
@TheStonedTurtle can you send me the whole download to this chat with the toggle on discord static#2247 |
Added a
/togglechatcommand to the default chat resource. Does not prevent player from sending messages, only prevents them from seeing them.