Git Product home page Git Product logo

speak's Introduction

Speak ๐Ÿ’ฌ CI

Speak is a drop-in replacement for the default chatbox in Garry's Mod, written in JavaScript and Lua.

image

Requirements

Development

First, make sure dependencies are up-to-date:

./scripts/update

Then, launch the Source Dedicated Server (SRCDS) instance:

./scripts/server

Ports

Service Port
Source Dedicated Server (SRCDS) 27015

Scripts

Name Description
cibuild Build addon for distribution.
console Attach to the SRCDS console. Detach with ctrl + d.
server Start SRCDS.
test Run tests.
update Update dependencies and static asset bundle.

speak's People

Contributors

rbreslow avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

speak's Issues

Improve garbage collection for AvatarSheet

If you switch back and forth between AvatarSheet and ModelSheet, HUDPaint hooks will accumulate.

] lua_run_cl PrintTable(hook.GetTable().HUDPaint)
DrawRecordingIcon	=	function: 0x01a35ad1d0
PlayerOptionDraw	=	function: 0x01a3491b18
speak.HUDPaint	=	function: 0x01a3802228
table: 0x01a3781e40	=	function: 0x01a382ec80
table: 0x01a547b778	=	function: 0x01a52b7098
] lua_run_cl PrintTable(hook.GetTable().HUDPaint)
DrawRecordingIcon	=	function: 0x01a35ad1d0
PlayerOptionDraw	=	function: 0x01a3491b18
speak.HUDPaint	=	function: 0x01a3802228
table: 0x01a3781e40	=	function: 0x01a382ec80
table: 0x01a4ea3428	=	function: 0x01a51224b0
table: 0x01a547b778	=	function: 0x01a52b7098

Apply consistent indentation/formatting

As a result of the project's LuaFormatter implementation not working, and the project's age, different files have different styles and levels of indentation, single quotes and double quotes, etc.

This issue is to get automatic code formatting working and ensure every file has a consistent style.

Backspace key doesn't work in chat box on macOS

Problem description

If you type in the chat box on macOS, and then try to use the backspace key to delete some characters, nothing happens.

Replication Steps

  • Type some gibberish in the chat box
  • Hit backspace
  • See that nothing happens

Expected Behavior or Output

  • Type some gibberish in the chat box
  • Hit backspace
  • See that gibberish is deleted

Enter does not work in combination with holding shift or spamming another key

I tried a solution like this:

      // when holding shift, or spamming a repeating key, we still want enter to
      // send the chat message
      if (e.keyCode === 13) {
        inputForm.submit();
        e.preventDefault()
      }

Problem is after submitting the form I'd get this:

[HTML] asset://html/?:1: Uncaught ReferenceError: speakJS is not defined

Support Windows development environment

Right now, the development environment only supports Linux/macOS. Since the majority of folks use Windows to manage game servers, we should add support for a Windows development environment.

Lag spike when calling speak.UpdateAvatars()

There is a noticeable lag spike/drop in FPS when calling speak.UpdateAvatars().

  • Optimize rendering of AvatarSheet and ModelSheet (may have something to do with the instantiation of many VGUI instances?)
  • speak.prefs:FireAllCallbacks() will call speak.UpdateAvatars() and then Think will as well. We should look into a way for the initial speak.prefs:FireAllCallbacks() to not trigger an avatar update.

Determine what to do with ChatText filters

Right now, we are just doing a blanket add of everything that comes from the GM:ChatText hook:

hook.Add("ChatText", "speak.chattext", function(_, _, text, _)
  chat.AddText(text)
end)

This gives us the benefit of retaining vanilla join messages, etc. However, it falls short when DarkRP does this:

https://github.com/FPtje/DarkRP/blob/fd95cf68e6a01a1b0522c4a989d4512fc0fb202d/gamemode/modules/chat/cl_chat.lua#L37

Which causes us to double print certain DarkRP-related chat messages. If DarkRP does this, then other gamemodes might do this as well.

Exsto simply ignores everything that isn't of type none:

https://github.com/prefanatic/exsto/blob/fcbf79c7f1ef5d84fe6fb57738ca3f4747ccd866/lua/exsto/plugins/more/sh_chat.lua#L197

Should we do that? Or, should we try to selectively add all of the regular messages? Will that conflict with custom join/leave messages of various admin mods?

Focus lost when closing settings menu

When I close the settings menu I expect the keyboard to refocus on the text input, it doesn't, so I have to manually click it in order to be able to press enter and close the chatbox.

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.