Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.83 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.83 KB

Libraries used

Build for release

npm run build

This compiles the web app and updates the /emojichat/lua/emojichat/cl_html.lua lua file.

Local development

You will need to download node and NPM.

First time setup

cd emojichat-html
npm install

View the chatbox

npm start

This will do two things:

Anytime the files in src are changed, the website and lua file will both be updated.


JS Console commands

Set background to black This will make it easier to see the chat (in-game, the background is transparent).

document.getElementsByTagName("body")[0].style.background = "black"

Active mode (full UI- input, chat log, etc.)

// emojiChat.setActive(chat mode, JSON list of players, JSON active player)
emojiChat.setActive(1, "[{\"name\": \"Badger\"}]", "{\"name\": \"Badger\"}") // Opens global chat
emojiChat.setActive(2, "[{\"name\": \"Badger\"}]", "{\"name\": \"Badger\"}") // Opens team chat
emojiChat.setActive(3, "[{\"name\": \"Badger\"}]", "{\"name\": \"Badger\"}") // Opens console input

Inactive mode (minimal UI)

emojiChat.setInactive()

Add a message

emojiChat.addOutput("[{\"colour\":{\"r\":130.0,\"b\":130.0,\"a\":255.0,\"g\":130.0},\"text\":\"[12:30:22] \"},{\"colour\":{\"r\":0.0,\"b\":0.0,\"a\":255.0,\"g\":200.0},\"text\":\"Badger\"},{\"colour\":{\"r\":255.0,\"b\":255.0,\"a\":255.0,\"g\":255.0},\"text\":\": A very cool message! :fox_face:\"}]")

Set when messages fade out

emojiChat.setFadeTime(12) // 12 seconds