BadgerCode / emojichat

Adds support for unicode emojis in the Garry's Mod chatbox
MIT License
8 stars 2 forks source link

Chatbox basic tech debt #4

Open BadgerCode opened 6 years ago

BadgerCode commented 6 years ago

The chat code could do with being tidied up

  1. Overriding chat. functions is weird. Is this the best way to do it?

  2. The PlayerBindPress hook may not needed if chat.Open is overriden. chat.Open should provide what text entry mode shoud be used. Fixed in d8cb270f4088fd9fe9e69ce9f8bb02960b72a6a2

  3. The code should be split up some more. Some possible boundaries:

    • Chat overrides/Hooks
    • GUI initialisation
    • GUI events/callbacks
    • Web interface interaction functions (changes to these will require an update to the HTML component)
  4. There could be some better logic to detect when a timestamp should be added (always & at the start?)

BadgerCode commented 6 years ago
  1. is resolved in #18
BadgerCode commented 6 years ago
  1. Seems fine
BadgerCode commented 6 years ago

With 4:

  1. Hooking into GM:OnPlayerChat probably won't work
    • Gamemodes can override this
    • We need to call the base gamemmode to get things like Console, *DEAD*, (TEAM)
      • The base gamemode doesn't really provide any means to prefix a message
  2. We could assume that (ignoring colours), a player followed by one or more text items is a chat message.
    • This could trigger for custom chat.AddTexts
  3. We could always add timestamps, for every chat message
    • Might make chat lines long
      • We could make timestamps display differently
        • On hover (don't think this works)
        • In small text, below messages
    • People might not want them for non-chat messages (server messages)
  4. Remove timestamps