* Begin trying to understand handle_chatmessage monstrosity
Rearrange some functionality to be more consistent with what the particular handle_chatmessage is *supposed* to be responsible for
Single responsibility principle doesn't apply not just to script files but even functions in this goddamned program apparently.
* Fix some oversights relating to "has presented evidence" logs
* Fix an edge case crash with negative evidence, idk why this didn't happen before.
* Completely refactor handle_chatmessage hell and split it up into single-responsibility-principle functions like a sane and organized coder would.
This will break any PRs that touch handle_chatmessage and will have to conform to the new standard, but it's very good in the long run.
Functions have also been meticulously commentated to make sure that everyone can understand at a glance what everything does.
This refactor is done to pave way for smooth viewport, making characters no longer randomly interrupt each other when speaking.
* Rename confusingly named "handle_chatbox" to "handle_ic_speaking"
Add a new function "handle_callwords"
* Parse blankposts in the packet unpacking phase
log_chatmessage is now an argument-based funciton instead of using m_chatmessage monstrosity
Commentate the heck out of log_chatmessage
Fix showname displaying logic being bonkers for log entries
Fix -1 char_id most likely crashing client, even tho they're supposed to be system messages
Fix [CHARID] being referenced instead of [OTHER_CHARID] in the pair display func
Fix chat message color being used for "has played a song" even though it shouldn't
* Move setting emote_mod from the objection thing to the packet unpacking thing
handle_emote_mod has become argumented
* Make display_pair_character take in only vars it needs
* Add functionality for message stacks (does not handle logging separately yet)
Currently segfaults at line 1823 if stacking behavior actually occurs. Plz help I'm poopie brain at this
* Make sense of pointers and dereference some pointers to prevent wacky errors
Replace _stack with _queue, and turn it into a QQueue
* Implement a minimum text delay queue timer so that each msg must stay on screen for a specified amount of time
Chat_arrow only shows up when the minimum text delay has expired
Check if target is muted in the enqueueing, as well as the validity of the character id, so we don't even bother adding it to the queue
Add a settings option to set text stay time (minimum amount of time to pass before displaying the next message).
TODO: Handle queued interjections in a cooler way
* Adjust default option for stay_time to be 200ms
Make the stay_time setting of 0 disable the queue system entirely
* Make interjections force-clear the message queue
Use interjections to instantly process those messages - objections are usually extremely important and must have everyone's immediate attention.
TODO: Add a settings option for interjection behavior
* Clear message queue when bg display packet is received
* Add an instant objection setting which, when enabled, will interrupt and skip the message queue on objections (effectively bypassing text_delay system)
* Stop using AOPacket for the queue and use QStringList instead (packet contents, we don't care for the header)
Implement objection threshold which works in a queue if instant objections are disabled (not exposed to the settings yet)
Modify packet contents directly instead of waiting for m_chatmessage shenanigans (we should deprecate this soon)
Rename isinstant_objection_enabled options check to be more consistent
* Make it so objections display as soon as the message is over if instant_objection is disabled
* Remove emote_mod = "1" thing that had no real purpose
Implement desynchronized logs settings option, which is false by default, meaning users' messages and display IC logs are going to be in sync.
Split up display and logging behavior, meaning IC logs will be saved with accurate timings on the .logs file, while display can be slower.
Remove dumb "System" showname thing cuz it was dumb
* Bring back minimum packet size safety check
* Make sure shouts are properly logged. I am very sorry for this horrible amount of code duplication though.
* fix compile errors
* fix html parsing error
* Rearrange the order of logging so IC messages go like this:
* shouts go first
* evidence goes second
* chat message goes last
* Fix No Interrupt coming back, go away you foolish beast
* fix borked options dialog
* Crank down "press enter delay" from 600ms to 200ms so it's not as harsh
Co-authored-by: in1tiate <radwoodward@vikings.grayson.edu>
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Implement scalable maximum clock count, right now it's at 5 clocks a theme can have max
Theme "clock_" starts from 1 instead of 0 since users don't know when stuff starts at index 0
TODO: testing lol
Theoretically fixes#313
The "FA" packet from the server invalidates the client's previous area
list so it makes sense for the arup information tied to that list to
be invalidated as well (especially seeing that the area and arup share
the same index). As we repopulate the client's area list, we do the
same for the arup list.
* initial commit
* The Quick-Fix is a secondary weapon for the Medic. It is a prototype Medi Gun with a group of three gauges on one side, a (cosmetic) ÜberCharge gauge on the other side, and what appears to be a blender for a body. The main gun is coupled with a medicinal reactor backpack with glowing portions that replaces Medic's default backpack.
* fixed settings dialog
* slightly less stupid custom objection default
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
* IC Log colors now defined independent of character
* Fix regression causing incorrect colors in the viewport
* fix goof that broke chat scrolling
* Only regenerate color vector when it's needed
On toggling shownames, regenerate_ic_chatlog() gets called to reprint
the entire chatlog with append_ic_text(). The issue is that
append_ic_text() uses QDateTime::currentDateTime() for the timestamp
when it's called. Therefore the fix is adding a new timestamp
parameter to the append_ic_text() which we supply from the datetime
provided by each chatlogpiece
I'm somewhat confused as to why this wasn't enabled to begin with, since all the necessary code is here.
Closes#306, and fixes the issue with realizations being cut off by other sounds.
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
* set no maximize flag on lobby
* set no maximize flag on courtroom
* set no maximize flag on charselect
* stop them from dragging the charselect
* stop them from dragging the courtroom
* stop them from dragging the lobby
Co-authored-by: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com>
Also included in this commit are changes to the music packet handler that change the text from "has played a song" to "has stopped the music" in the case that the special "stop song" track is played, as well as a condition stopping music categories from triggering a music packet when double-clicked.
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Remove qElapsedTimer method of blip earrape protection due to major inconsistency issues with this method (the same message would produce wildly different blip sounds - consistency is preferred)
More sophisticated blip earrape prevention is calculated in the chat ticker function itself, it also properly adjusts itself depending on the blip_rate used.
Implement clock setting w/o starting or stopping
Both of these should make it possible for the server to start/stop/pause/resume the clock with perfect synchronization to the true time.
Display ping in the application window title.
keepalive timer now fires every second instead of every minute
Remove meme clock starting on set_widgets()
implement get_ping() on w_courtroom
By converting the image to an 8-bits per channel image with alpha channel
we make sure the client won't fail painting a darker button,
and keep the transparency if the source image had.
* Allow changing audio device on the fly while in a server
* Use default audio device if device in config doesn't exist
* Automatically change audio device to default when current one is invalid
* Destroy Qt Multimedia support
It was decided that there was not enough attention being given to Qt
Multimedia support to justify its continued maintenance simply as a
libre alternative to BASS. While substantial changes to audio were being
made in 2.8, the Qt Multimedia support code fell behind in disrepair.
It's clear that there is no vested interest in implementing audio
features twice for the sake of licensing.
When it's time to switch to another audio library, it will be done
unilaterally.
* CI: Use BASS for Linux build
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
* Rewrite the IC Log code to drastically reduce code duplication and have both downward and upward mode in the same function
Regenerate the IC Log in set_widgets() function, making sure the maximum_blocks is accounted for and clearing the log to prepare for different log mode (upwards/downwards) if it's different from previous
Add placeholder text telling the user the direction in which the log will go
Remove useless first_message_sent global boolean, a remnant from a w e a k e r c o d e r m a n
* Add log_colors boolean to reduce color I/O happening in append_ic_text (optimization meme)
Clear the IC log when log_colors setting changes and reload theme is pressed
Fix https://github.com/AttorneyOnline/AO2-Client/issues/221
* Add configurable margin between IC log entries
Add configurable newline/singleline log mode
Options in settings for these
* Add optional timestamps
* Un-hardcode "played music" from the chatlogpiece and introduce the "action" argument so that "presented evidence" is fully supported now
Translate "has presented evidence"
Regenerate IC chatlog instead of clearing it, properly updating every element with the new configurations
* Go away *temp, code duplication making me shid and cry rn
Why is this not done in append_ic_text, or why isn't there a dedicated ic logging func aAAAaaaaAAAaa
Fix presenting evidence not being properly logged
Fix timestamp being UTC instead of local time (local time will not be as confusing)
* okok it was a joke a big ol bamboozle you got gnomed haha rick rolled beaned stickbugged
I did NOT copy paste code, no, I actually intended to fix copy pasted code all along. log_ic_text was always planned.
(Fix copypasted code for ic_chatlog_history and consolidate it into a single log_ic_text func)
* Consolidate blankposting into singular log entries of "no message" instead of spamming the logs repeatedly when someone decides to keep switching emotes
Return proper blankpost checking to 2.8.5 (chatmessage_is_empty bool makes sure the chatbox doesn't appear - branch broke that behavior by never setting it)
More robust blankpost checking, meaning that passing a competely empty "" string will also count as a blankpost
Fix screenshake not working with blankposting by moving it before the chatmessage_is_empty check in start_chack_ticking() stage of the message parsing
* Allow user to send blankposts without even having to input a single spacebar, but only if last m_chatmessage CID matches ours.
* Reviews are cool and good👌
allow sending no-text chat message to server without weird cid checks (let the server validate if they want to do STR_OR_EMPTY or just STR) - doesn't break existing behavior and lets servers introduce the new one if they want to
Treat all blank/whitespace messages as blankposting and not just single-whitespace.
Remove chatmessage_is_empty bool because why the fuck would you even need it if you have m_chatmessage[MESSAGE] already
Simplify chatlogpiece log entry to not be a *temp pointer by suggestion
* another useless bool destroyed
Make "additive" have a very awesome emergent behavior with blankposting - keep showing the chatbox+message while only changing the emotes. Works with preanims too!
* Fix not using custom chatbox's colors
Moved set_text_color_dropdown() to after current_char is actually updated
with the selected char. Otherwise set_text_color_dropdown will try to
update the colors with either nothing as character, or with the previously
selected character.
Use get_chat() so it actually gets the name of the custom chatbox
instead of using the same name as the character.
Remove the extra "c" since get_chat_color it's already called
with this "c" in place.
* Fix previous fix crashing the client on DRO servers
For some reason the client would work just fine
if set_text_color_dropdown() was called only once
after updating the character selected by the user.
But when joining a DRO server the client would crash
just before loading the music.
* Improve comment with where crash happens
* Fix get_chat_markdown to get the custom chatbox on misc of the char
instead of trying to find the character folder on misc
* Fix client using the current character colors on other people's messages
Also remove the comment explaining the crash if set_text_color_dropdown
is removed from set_widgets
* Fix loading custom colors loading after the message was added to the log
Add overrides to set_font for font name and size (this is to preserve the chat_size and chat_font char.ini arguments that were implemented way earlier)
Cease the baddening with set_font that was there before and condense it into a proper set_font function call
Implement set_font for custom showname shenanigans from the misc folder
- Don't hide spectator button anymore.
- Make the spectator button properly send the char switch packet.
- Fix the spectator button not properly loading the courtroom and music list etc.
When an `_off` emote button exists without an `_on` counterpart, the client will automatically generate the `_on` button and save it to disk.
Co-authored-by: Cents02 <Cents02@Cents0.me>
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
* YOU DO NOT BELONG IN THIS PR
GET OUT
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Co-authored-by: likeawindrammer <31085911+likeawindrammer@users.noreply.github.com>
Co-authored-by: Crystalwarrior <Varsash@Gmail.com>
It is only logical to say that the user, when not specifying any specific speedline or similar in the theme, then the current theme should be checked first rather than the default theme.
Co-authored-by: Cents02 <Cents02@Cents0.me>
* Fix#193
By making sure handle_chatmessage_3 calls start_chat_ticking
and thus do_screenshake only after either play_idle or play_talking is called
* Move call to start_chat_ticking to the end of handle_chatmessage_3
* Fix colors in ic logs not parsing HTML properly when log_goes_downwards=false and colorlog=true
* Restore KFO branding
* Reset the settings values when receiving the 'FL' packet. This allows enabling/disabling features at runtime, such as ARUP system.
* Revert "Restore KFO branding"
This reverts commit 7f19b6257a0d75ec1d392b9b8c02a384c8dba43d.
* Add alignment options for shownames
* Make shownames align to the left by default like before
* Use this branch as an opportunity to fix showname not being resized according to misc/ folder courtroom_design.ini
* Added apng support for animated background positioning.
* Adjusted the apng background position search.
* Fixed libbassopus.dylib path on MacOS preventing opus files from playing.
This occurs due to BASS not having any private variables of its own, so it was simply using the public variables loop_start and loop_end as reference - since those changed for any new song playing on another channel, the old looping points got replaced, and the seamless looping stops working.
The solution was easy - just make a loop_start/loop_end variable for every supported channel - so 4 variables in our case.
* Add a new "Custom Chatboxes" settings option to enable/disable char.ini setting custom chat box designs per-character
* Fix chat_arrow being incorrectly updated between character messages if the custom chatbox modified the chat arrow positioning/size in any way
* brackets matter
Not sure how to split this up, frankly. Some people have been more
involved in client/server/protocol development than others. I'll figure
this out eventually.
Make music not loop by default for backwards compatibility with old style on servers not supporting clientside music looping
Make the music loop when the packet containing loop data gives us "1", treating it as "looping=true".
base/misc/default/config.ini with properly defined "baseline" colors will have to be supplied with vanilla content later.
Remove hardcoded colors - user has no access to these unless config.ini is valid, yet when others speak using these ID's their text shows up just fine.
Either reimplement full on hardcoding madness (NOOOOOOOOOOOOOOOOOOOOOOOO NO NO NO NOOOOOOOOOOOOOOOO NOOOOO!!!!) or yeet.
I chose the sensible option :^)
Apparently this had never been staged, and while everyone was having
problems with the connect button, everything was working just fine for
me.
This enables the connect button a bit earlier in the handshake process
than in 2.6, since there are some older servers out there that don't
send FL (and so the connect button would never get enabled). This might
lead to race conditions, and sometimes the progress bar does hang,
but you can just cancel and reconnect - I haven't encountered a crash
so far.
Due to a countless number of changes made to the core that were not
fully understood, tested, or documented, it was decided to roll
everything back to the last known stable version (2.6.2).
Changes dropped include:
- Witness needed
- Shake
- Frame SFX
- Multiple custom objections
- Multithreaded thumbnail generation
- Looping
- Various translation additions
- "Mirror IC"
- Color in IC log
- An invocation of clang-format
Next time, work together and split your big fork into independently
testable feature branches.
{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Stroustrup, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All }
(this is the Visual Studio preset with only "BreakBeforeBraces" changed from Allman to Stroustrup)
"shownames" isn't a word, and what does "Custom shownames" even mean anyway?
"Show custom IC names" should do a better job at explaining what this option does.
Indentation fixed to 2 spaces per tab. Braces set to Stroustrup style.
Lines reflow at 80 characters. One-line method bodies are on the same
line as the signature. Space always after `//`. No indentation
on preprocessor macros. Includes are sorted lexicographically.
If you don't want to see this commit on blames, use the hidden
whitespace option on GitHub, or use `-w` in git-blame.
CR likely stands for "CentsRaidensnake." Like the Case Cafe mega-merge
before it, this was not a clean merge, and it had to be split up into
two parts: the actual changes, and the attempt it made to reformat the
entire code via clang-format.
This branch had a complicated set of changes that would be difficult to
describe in this commit message. It would be better described in a
proper changelog.
Fix a bug where IC view received focus as soon as you receive the BG image update (it made navigating using /area commands a pain in the ass)
Make music search behave better and not reset when server sends us music list update (todo: remember which elements were/weren't expanded)
(e.g. a 16:9 theme would not stretch a 4:3 bg and instead have a letterboxing effect. A 4:3 theme using a 16:9 BG will not stretch the BG but instead center it, making it look like the BG is 4:3 all along.)