Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TGUI Say: Upgrades chat input with modern features #67116

Merged
merged 121 commits into from
Jun 17, 2022

Conversation

jlsnow301
Copy link
Member

@jlsnow301 jlsnow301 commented May 19, 2022

About The Pull Request

  • Creates a super streamlined tgui-say package that's independent of TGUI
  • Extensive, separate logging courtesy of @Iamgoofball
  • Ports typing indicators influenced by @Kapu1178
  • Adds forced speech mechanics
  • User prefs to disable typing indicators and tgui-say themes
Feature previews

window autoexpands on entry
auto expand

five message history: use arrows up/down
chat history

light mode
lightmode

change channels by TAB/button OR typing department into me/radio
channels

quick radio hotkey "Y"
radio hotkey

thinking (window open) and typing indicators with inactivity detection
note: indicators can be turned off, do not show up for "secret" channels like OOC and binary
typing indicators

forced speech: getting hurt can purge input
forced speech

Why It's Good For The Game

Finally we shirk off the most tenacious part of this 1996 UI with a sleek and modern replacement that's CUSTOMIZABLE

Changelog

🆑 jlsnow301 KubeRoot stylemistake Iamgoofball Kapu1178
add: Adds the TGUI say modal to replace speech input boxes. Many features!
add: You can switch output channel within the TGUI say modal by clicking the channel button or keying TAB.
add: Added 5-message chat history to the say window. Use arrow keys to scroll recent messages.
add: The say window auto-expands! It adds up to two extra lines and scrolls beyond that.
add: The common radio hotkey - "Y". No need to type ; in radio channel. Help maint!
add: Radio subchannel helpers - Typing subchannels like ":e " will show labels.
add: Getting hurt while speaking has a chance to force you to speak. You read that correc-AUGH
add: Typing indicators! Having an IC channel open will show thinking/typing icons activity.
add: Typing indicators are a preference. Go incognito if you want!
add: Themes for TGUI Say! There is currently a light mode. More to come.
refactor: Sorts other TGUI inputs into their own folder and cleans up their code. Remember, TGUI Inputs can be disabled in UI prefs if you're not a fan.
refactor: Refactors a lot of human defense code, report bugs if you encounter them.
refactor: Refactors admin centcom reports into typescript. You must send the report to save the text.
/:cl:

@tgstation-server tgstation-server added Code Improvement Code is now easier to copy paste. Feature Exposes new bugs in interesting ways UI We make the game less playable, but with round edges labels May 19, 2022
@Kapu1178
Copy link
Contributor

Oh boy replacing the single most important and already functional part of the game with an external dependancy that many players have issues with randomly breaking.

@SoSMaster9000

This comment was marked as spam.

@optimumtact
Copy link
Member

Oh boy replacing the single most important and already functional part of the game with an external dependancy that many players have issues with randomly breaking.

"many players"

@optimumtact optimumtact reopened this May 19, 2022
Copy link
Member

@MrStonedOne MrStonedOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to be entirely client side to get my sign off.

There must be no delay on an nz <-> us connection from hitting t in hotkey mode, and being able to type something to say. ie, if you hit t and start typing what you want to say without looking at the screen.

it is possible to do this all client side, but this requires creating a client side window manager that can bind to that key press client side (possible, client side macrosets can target .output and use that to send a message to a browser javascript function) and handle presenting windows.

we have long needed more use of javascript for advance client side functionality, but nobody wants to spend the time to make it and instead wants to make shitty server side solutions to non issues.

the input dialog is functional i do not give a shit how ugly or old it looks, this is a SECONDARY concern to its ability to do the basic functional shit.

@tralezab
Copy link
Contributor

clears throat, still has small and tiny voice nonetheless I agree with mso and would greatly appreciate the advantages of client side window manager

@Kapu1178
Copy link
Contributor

This has to be entirely client side to get my sign off.

There must be no delay on an nz <-> us connection from hitting t in hotkey mode, and being able to type something to say. ie, if you hit t and start typing what you want to say without looking at the screen.

it is possible to do this all client side, but this requires creating a client side window manager that can bind to that key press client side (possible, client side macrosets can target .output and use that to send a message to a browser javascript function) and handle presenting windows.

we have long needed more use of javascript for advance client side functionality, but nobody wants to spend the time to make it and instead wants to make shitty server side solutions to non issues.

the input dialog is functional i do not give a shit how ugly or old it looks, this is a SECONDARY concern to its ability to do the basic functional shit.

I know deep inside TGUI's core is byond winset() calls. Beestation and soon Goonstation use a byond skin with verbs attached to all the functions to create a completely client side input. I'm sure there's a way to wrap this into a "pretty" TGUI bundle.

BeeStation/BeeStation-Hornet#5417

@MrStonedOne
Copy link
Member

MrStonedOne commented May 19, 2022

i do not want us to have bees shitty snowflake solution. (but wouldn't block it)

this comes up often enough that we need a full on client side manager, a well designed framework that could handle all generic usecases of "we need code living on the client to handle running client commands at the right time", like, say, something smart enough to know the state of the connection because it observes winget(null.url) to see if it suddenly went null, something we could put better reconnect logic into, something that is not fucking tgui chat which is what we use for this now.

@Kapu1178
Copy link
Contributor

i do not want us to have bees shitty snowflake solution. (but wouldn't block it)

this comes up often enough that we need a full on client side manager, a well designed framework that could handle all generic usecases of "we need code living on the client to handle running client commands at the right time", like, say, something smart enough to know the state of the connection because it observes winget(null.url) to see if it suddenly went null, something we could put better reconnect logic into, something that is not fucking tgui chat which is what we use for this now.

Oh absolutely, Bee's solution isn't the best at all but it's sure as hell the most functional. I was more providing it purely for the reference of how it could potentially replicated, but in a more generalized fashion.

@Mothblocks
Copy link
Member

Mothblocks commented May 19, 2022

I've echoed my concerns on this before several times, and in several PRs.

Pressing T MUST instantly open up Say. There is no world in which I would accept a PR that does not do that.

@Jolly-66
Copy link
Contributor

Weren't we against this due to TGUI having the tendency to just, die sometimes?

@stylemistake
Copy link
Member

stylemistake commented May 19, 2022

You used a normal tgui pipeline here instead of /datum/tgui_window, in almost every way similar to tgui_input (ui_data, ui_interact, all that), with external assets and with all the same problems, so...

You will have to scrap it and redo it completely.

Also see MSO's comment, but the main priority:

  • Has to use /tgui/window
  • No external assets, everything inlined.
  • Has to be statically declared in skin.dmf, always in background, initialized like stat/chat.
  • Opens and closes immediately on pressing T using Byond macros

Reference image, this is how I think it should look.

say-panel

jlsnow301 and others added 2 commits May 20, 2022 22:25
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
@LukasBeedellCodestuff
Copy link
Contributor

This isn't just a re-skin of the chat window and has HUGE balance applications. When you're hit the textbox closes and your character says "ergh, argh ect" meaning you can't call for help over coms. This is huge and I don't think should exist at all. The fact that the whole text box closes is moronic and a huge buff for antags as now there is 0 way to call for help when you're being hit.

@jlsnow301
Copy link
Member Author

This isn't just a re-skin of the chat window and has HUGE balance applications. When you're hit the textbox closes and your character says "ergh, argh ect" meaning you can't call for help over coms.

This is in the changelog and pr desc. Forced speech will not ever be removed from this pr for the following reasons:

  • It's hilarious

@LukasBeedellCodestuff
Copy link
Contributor

I saw that it was written there but can you justify the balance implications of having people unable to speak whilst they're being hit?

@jlsnow301
Copy link
Member Author

I saw that it was written there but can you justify the balance implications of having people unable to speak whilst they're being hit?

Yes: it's funny
My only rule is not taking fun from the game

@Iamgoofball
Copy link
Contributor

@LukasBeedellCodestuff It was a long time feature we had that was only removed because hotkey mode became prevalent, and it's being re-added now that the technical hurdle has been cleared.

@Mothblocks
Copy link
Member

I think it's a good idea to add a cooldown on glorfing later so that it's primarily for ambushes, and not sustained attacks

@jlsnow301
Copy link
Member Author

I think it's a good idea to add a cooldown on glorfing later so that it's primarily for ambushes, and not sustained attacks

as an easier alternative: there is currently a small debounce timer on it that prevents it from firing too often, which can very easily be extended

@Simplehorror
Copy link
Contributor

This isn't just a re-skin of the chat window and has HUGE balance applications. When you're hit the textbox closes and your character says "ergh, argh ect" meaning you can't call for help over coms. This is huge and I don't think should exist at all. The fact that the whole text box closes is moronic and a huge buff for antags as now there is 0 way to call for help when you're being hit.

use old gui

@PowerfulBacon
Copy link
Contributor

I hate to admit it, but this is a rare TG W. Looks amazing too. Good job.

@jlsnow301
Copy link
Member Author

I hate to admit it, but this is a rare TG W. Looks amazing too. Good job.

Really means a lot from one of my role model coders, thank you Bacon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Improvement Code is now easier to copy paste. Config Update Time to bother the headadmins for three months to get your config applied Feature Exposes new bugs in interesting ways Sprites A bikeshed full of soulless bikes. Tools We pretend to be a real development community UI We make the game less playable, but with round edges
Projects
None yet
Development

Successfully merging this pull request may close these issues.