npm run build
This compiles the web app and updates the /emojichat/lua/emojichat/cl_html.lua
lua file.
You will need to download node and NPM.
cd emojichat-html
npm install
npm start
This will do two things:
- Start a website on http://localhost:8080/
- Update the
/emojichat/lua/emojichat/cl_html.lua
lua file
Anytime the files in src
are changed, the website and lua file will both be updated.
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