Draft: Port SRB2-Banpyura's chat features
Port of https://github.com/GLideKS/SRB2-Banpyura/pull/24, though this is an alteration of d84b773.
This would be an insane amount of GIFs or painful to show them all at once in a few or one, so I'm deciding to just not include any. Trying to make the pr body here at least well formatted at minimum as a result.
These have been added to a submenu due to the Chat section taking up the whole screen when added (thus I also decided to add the spam section into it). If asked, I will revert it. Currently unsure if being a submenu of Video Options is even a good idea or if I should move it elsewhere.
Letting the user know these exist is... Also an issue that I'm not sure how to resolve, nor whether or not that should result in this PR being a draft (even though it's a port of things that are finished), though guessing it just results in discussion being needed.
Console variables:
chatx(Range: -160 to 320),chaty(Range: -100 to 200)
Chat's x and y position. (These match vanilla positions by default.)
chatsnapx(V_SNAPTOLEFT,V_SNAPTORIGHT),chatsnapy(V_SNAPTOTOP,V_SNAPTOBOTTOM)
What side the chat will snap to. (Matches vanilla snapping (Bottom left) by default)
chat_showlimit
Feature ported from SRB2-edit, made into a toggle. Displays character count and maximum message length. Characters are counted when rendered.
chat_wipeonexit(On/Off, on by default)
If disabled, ESC (or whatever other way to exit the chat that results in a message not sending) will not clear chat input.
chatcursor(|,_)
Cursor to display in chat. Pipe by default (gets shifted to align).
Features ported over that are unrelated to console variables:
Workaround a dedicated server crash by not letting the dedicated console send a message over 200 characters in length.
CTRL modifiers have been added; it should be noted that all (CTRL+[V/C/X/A/Left/Right/Up/Down/Backspace|Del]) except the following function as they would anywhere else:
CTRL+W (Wipe chat input, basically a very fast CTRL+A+[Backspace|Del]- Added as it paired nicely with wipeonexit)
CTRL+R (Wipe chat display) (Windowed mode only)
CTRL+T (Teamtalk quicktoggle) (May be a little jarring in Console unless "Say-Team:" is changed to just Team:, but I'm unsure whether or not to make that decision and already was when making the original PR)
Shift selection, akin to the console. (CTRL+Shift for left/right arrow keys also works, also works for HOME and END too)
HOME and END support
HU_Responder(); has been cleaned up; a lot of the ifs have been swapped into switch statements. The only exclusions are the enter and escape keys specifically.
PageUp and PageDn are equivalant to CTRL+Up and CTRL+Down respectively.
Console Chat gets all these features as well! Minus ones heavily related to chat window display (CTRL+R, CTRL+Up, CTRL+Down, chat(snap)[x/y]).
Downstream changes:
CSAY authors are exposed in log; this was done in the original PR, though it used showcsays and caused issues as a result (normal CECHOs failing to print)
A warning from the dedicated crash workaround was resolved (Windows wants %i, Linux wants %li; Windows was only tested via crosscompilation but not actually ran).
cv_menucolor is not used for selection highlighting, instead the console's highlight color (palette index 77) is.