Skip to content
This repository was archived by the owner on Apr 7, 2023. It is now read-only.

Chat Visibility Toggle #12

Closed
wants to merge 6 commits into from
Closed

Chat Visibility Toggle #12

wants to merge 6 commits into from

Conversation

TheStonedTurtle
Copy link

Added a /togglechat command to the default chat resource. Does not prevent player from sending messages, only prevents them from seeing them.

@minipunch
Copy link

This would be awesome!

@@ -83,6 +92,25 @@ AddEventHandler('chat:clear', function(name)
})
end)

AddEventHandler('chat:toggleChat',function()
chatVisibilityToggle = not chatVisibilityToggle

Copy link

@murfasa murfasa Aug 23, 2017

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.

Copy link

@murfasa murfasa left a 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.
Copy link
Author

@TheStonedTurtle TheStonedTurtle left a 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)

@JohnnyCrazy
Copy link
Contributor

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.
@TheStonedTurtle
Copy link
Author

@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.

@cutiestatic
Copy link

@TheStonedTurtle can you send me the whole download to this chat with the toggle on discord static#2247

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants