Git Product home page Git Product logo

legacy-bonchat's Introduction

THIS ADDON IS BEING REWRITTEN AND THIS VERSION IS NO LONGER BEING DEVELOPED

(this repository now serves as an archive)


gmod-bonchat

(WIP) A chatbox for Garry's Mod with markdown support, emoji support, ability to show images/videos, and some other stuff

Should work on any branch, but intended for usage on x86-64 Read this

Custom event messages:

Emoji searching:


How to Install:

You can subscribe to the addon on the Garry's Mod Steam workshop (will be available after the addon is released)

OR

  1. Download the zip and place it in your addons folder Steam\steamapps\common\GarrysMod\garrysmod\addons
  2. Extract the zip in the folder and make sure the addon's lua path is addons\gmod-bonchat\lua
  3. RECOMMENDED Make sure you are on the x86-64 branch of Garry's Mod (you can change this by right clicking the game in your library, going to Properties... -> BETAS -> select x86-64 - Chromium + 64-bit binaries)
  4. OPTIONAL Install the GModCEFCodecFix in order for things like videos to work (a guide can be found in the repository's README) (you should only have to install the codecs once and whenever GMod has an update, you change branches or verify integrity of game files)

To Do:

✅Finished ➖Working on ❌Not started

  • ➖ derma panels
    • ✅ frame
    • ✅ chatbox
    • ✅ browser
    • ➖ settings panel
      • ➖ url whitelist editing
      • ✅ hiding attachments
      • ❌ hiding duplicate message (antispam)
    • ✅ emojis panel
      • ✅ emoji searching
      • ✅ Twemoji
      • ✅ Silkicon
      • ✅ Steam
    • ➖ attachments panel
      • ✅ attachments
      • ❌ game asset attachments
    • ❌ chat room panel
      • ❌ room creating/joining/leaving
      • ❌ room private messaging
    • ❌ context popup
      • ❌ message context
      • ❌ attachment context
      • ❌ link context
      • ❌ emoji context
  • ➖ message sending
    • ✅ inline markdown support
    • ✅ emoji support
      • ✅ Twemoji
      • ✅ Silkicon
      • ✅ Steam
      • ✅ Discord
    • ➖ attachments
      • ➖ embed
      • ✅ image
      • ➖ video
      • ➖ audio
    • ❌ game asset attachments
      • ❌ model
      • ❌ texture
      • ❌ sound

Sending A Custom Message in GLua:

local msg = BonChat.Message()
msg:ShowTimestamp()
msg:AppendEntity(LocalPlayer())
msg:AppendText(": **some text** ")
msg:AppendColor(color_white)
msg:AppendEntity(game.GetWorld())
msg:AppendMarkdown(" **some text** ")
msg:AppendPlayer("Fake Player", Color(0, 255, 0))
BonChat.SendMessage(msg)

Output:

👉 See the wiki for more information


Acknowledgements

legacy-bonchat's People

Contributors

bonyoze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

legacy-bonchat's Issues

Please use the `x86-64` branch

The default branch of Garry's Mod uses Awesomium for showing HTML or any webpage content. However, Awesomium is very outdated and doesn't support many HTML5 features.

(Warning from the Valve Developer wiki)
Warning from the Valve Developer wiki

(Notes from the Garry's Mod wiki)
Notes from the Garry's Mod wiki

Being aware of this, I've tried my best to make BonChat accessible and look the same for both the default and x86-64 branch, but of course some stuff is just not possible to fix without switching to x86-64 which uses the more modern-friendly Chromium.

These are the known differences/bugs I'm aware of if you decide to use Awesomium with BonChat, from severe to barely a problem:

  • Compared to Chromium, Awesomium is slower and laggy I've made multiple adjustments to BonChat so it's less resource intensive and more optimized, yet with enough messages, or images present in the chatbox, Awesomium will quickly come to a crawl trying to load them all. There are convars available where you can limit the amount of messages, or disable any attachment loading to avoid this (you can also disable BonChat entirely if you prefer the default chatbox).
  • Loading content from websites will not work if the site is HTTPS and doesn't support TLS 1.0 (Awesomium only supports up to TLS 1.0 which is pretty bad since it's considered deprecated and a vulnerability) This will affect loading any message attachments and trying to view a webpage in the chatbox's browser panel (instead, the panel will not be used and you will just be prompted to open the page in the Steam overlay browser). I've fixed this with images by using GLua to try and do a http GET request, which doesn't have this limitation, if the content fails to load. But this will still fail in some cases such as with Discord where their Cloudflare has blocked any http requests from Garry's Mod due to api abuse. You will not be able embed content from their site (Chromium luckily supports TLS up to 1.3, and thus this isn't an issue when you try and paste a link into the chatbox, or try to click a link and open the webpage in the browser panel).
  • Some modern file formats such as .webp and .webm only have partial support in Awesomium and will fail to load Note: Chromium does support most popular file formats, BUT it does not come with the codecs for many of those formats (thanks to those popularly used formats being proprietary and distributing them with GMod would lead to legal issues). But .webp and .webm are open source so they can be used, so you should be able to send and view those without any problems. If you do want to be able to use codecs such as H.264 (MP4) and AAC, you can install them yourself: GModCEFCodecFix (Of course, other people will also have to install these codecs themselves too in order to see what you send).
  • Image clipboard pasting does not work I believe this is due to Awesomium not supporting the File constructor (but it still has FileReader support?)
  • Font may render differently/incorrectly This differs between users, but you might be able to fix this yourself by replacing it in your system fonts (BonChat uses "Verdana" same as the default chatbox. From my testing I actually like Awesomium's sharp font over Chromium's aliased font, so this bug is really a preference thing).
  • Some small quirks with the chatbox that are slightly different across branches These are mostly visual differences and don't affect the performance of the addon.

Hopefully this convinces you to NOT use Awesomium because it is garbage compared to Chromium. Please use the x86-64 branch.

Me while making this addon

(If you do manage to find a real fix for any of these and are able to provide instructions or code, I'd appreciate if you contact me so I can try and fix it)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.