Discord-for-TTT2 / dttt

Discord Integration for TTT2!
GNU General Public License v3.0
0 stars 0 forks source link

[FEAT] Add Config UI #3

Closed G4PLS closed 4 months ago

G4PLS commented 5 months ago

Optional:

vertiKarl commented 5 months ago

Repositories for inspiration: ttt2mg - Adds a custom F1 menu entry for admins ttt2-role_debugger - Adds a custom F1 menu entry for users (though it is admin only? and broken) ttt2-super-soda - Adds a regular Server addons Tab (what TTT2 recommends) ttt2-air-to-surface-missile - Adds an entry in the ulx addons tab (which also gets added to the F1 menu by TTT2)

Would probably use something like ttt2mg as dttt is a base which a lot of addons could depend on (like ttt2mg). It also adds a menu in the user side F1 menu to enable/disable popups. We could use that to let users setup their Discord id locally!!

vertiKarl commented 5 months ago

The relevant api docs: CLGAMEMODEMENU - Seems to be the actual class used to instantiate menus in the F1 menu, as seen in ttt2mg for example. To add UI the script seems to be required to be located inside /lua/terrortown/menus/gamemode

To group it inside the "server addons" f1 menu, we should instead put the file inside /lua/terrortown/menus/gamemode/server_addons

To add actual buttons, sliders and so on, we need to use vgui.CreateTTT2Form() which is defined here

and finally. I found the API reference for menu items: https://api-docs.ttt2.neoxult.de/class/PANEL

vertiKarl commented 4 months ago

For the muted/deafened icons I'd recommend checking out this addon: ttt2-advanced_spectator as it adds stuff to the HUD.