Commit Graph

114 Commits

Author SHA1 Message Date
Crystalwarrior
7246965e00 Adopt better method for setting custom pos using the pos dropdown
Make it actually work properly
2021-02-17 15:47:54 +03:00
Crystalwarrior
b5f581eb5b Revert bad "fix" of the sound names for WTCE courtroom_sounds.ini
Make pos dropdown ui editable for a custom pos
Keep track of the custom pos index
On switching from the custom pos, remove the entry at that index
Fix regression causing the "sort by name" lobby server list header disappearing
Expose column 0 for the # in the lobby server list header
("too ugly" just use lobby_stylesheets.css and pretty it up)
2021-02-17 15:15:40 +03:00
Crystalwarrior
5063880530 Patch a segfault by play_frame_effect being wacky
Split behavior for courtroom resizing into its own function
Use that function to optimize character changing screen
Fix reload theme breaking the background positioning
Fix changing character breaking the background positioning
Fix excessive set_widgets() calls that caused unnecessary lag
Fix unnecessary set_size_and_pos calls that didn't need to be there
Only call size_and_pos on the chatbox in the initialize_chatbox func
Remove checks for a boolean that will always be true
Simplify two functions that copy-paste code called set_size_and_pos into a single one
Fix "disable custom chat" setting not being used when setting chat sizes and pos
2021-02-16 11:04:07 +03:00
Crystalwarrior
fe00c6b7de
Animated Themes. Subthemes. Custom default_theme. Overhaul asset paths. Fix a ton of asset resolution bugs. (#466)
* Remove get_static_image_suffix (webp, gif etc. can be non-animated)
Replace QList<QString> with QStringList

* forgot to remove static image from aoimage

* Simplify get_theme_path, get_custom_theme_path and get_default_theme_path all into a single get_theme_path func
Add a default_theme variable which defines the currently recognized default theme
Add a new "get_asset_path" that will be used to simplify asset resolution considerably

* Simplify AOImage set_image function to use get_asset_path
Begin working on the subtheme system

* Add p_default_theme for get_asset_path
Implement get_asset_path for AOButton

* Condense aolayer path lookups into the get_asset_path function

* Get rid of get_font_name due to underuse (and it just does the same thing as get_design_element anyway)
Get rid of get_char_shouts (use chat= instead)
Use get_subtheme() instead of subtheme (because get_subtheme() can perform overrides based on the user's settings)
Make get_color() use get_asset_path()
Make get_design_element() use get_asset_path()

* Adapt a whole bunch of text_file_functions to the get_asset_path method, fixing an enormous amount of invalid path resolutions
Unfortunately I have to keep backwards compatibility for the backwards ass config.ini method for the chat markup (new way is chat_config.ini)
Get rid of get_theme_effects and implement the stacking behavior into get_effects instead

* Program doesn't run, color lists stop generating for some reason
Also implement safety checks for the asset path generator

* Fix a really tricky issue that popped up regarding char_color_rgb_list not being generated, causing segfaults

* Address the sfx player path resolution being really, really stupid and resolve major inconsistencies (such as the bug where objection sfx wouldn't be playing despite the default theme or default misc folder having them)

* Fix sfx path resolution being funky (apparently D:/Qt/Projects/AO2-Client/bin/base/themes/default//objection.wav is a valid qt5 path...)

* Implement:
get_asset_paths - Return an untested list of universal paths from the provided args
get_asset_path - Loop through the list of provided asset paths and return the first valid file
get_image_path - Loop through the list of provided asset paths, apply get_image_suffix and return the first valid image file
get_sfx_path - Loop through the list of provided asset paths, apply get_sfx_suffix and return the first valid sound file
get_asset - return an asset (must contain file extension) from the get_asset_path() applied on the get_asset_paths()
get_image - return an image with get_image_suffix() applied on the get_image_path() for the get_asset_paths()
get_sfx - return a sfx from provided args with the uniquely constructed asset path list for sounds

Rename old get_sfx to get_court_sfx for better clarity of its function
This replaces previous asset stuff I implemented, as I think this is a better solution lol

* Add a new get_config_value that obtains a value from the config that matches identifier
Adjust all calls to get_asset() to actually look for a config identifier value instead, so even if a config.ini is found if it doesn't contain the identifier we want we keep looking

* Fix effects.ini sounds not working
Remove debug text

* Make it so even if you miss the required asset, and don't have a missingno, the viewport still doesn't freeze up due to waiting on Objections etc. due to signals.

* Implement default_theme option for courtroom_design.ini, allowing you to make themes that inherit from other themes that are not default.

* move sounds folder lower in sfx pathlist

* fix realization sfx not being fetched from config

* Make aosfxplayer actually use get_sfx I made
Move sounds folder path check last in get_sfx

* I thought this would fix QSettings::value: Empty key passed but I guess not, that annoying error will keep pestering us :(((

* Remove silly .png exception for SplashLayer
Fix static image Objections freezing the viewport due to done(); signal that never arrives

* Make WTCE cooler by including a stop method for witness testimony indicator, and add support for custom WTCE

* Reduce code duplication for get_sfx

* Fix the program hanging/entering an infinite loop/segfaults/a number of nasty issues due to done(); signal being sent as soon as playback begins if the image is invalid.
This is done by removing the file_exists check, and letting the rest of the functionality handle this case - the system is robust enough and treats an invalid image as a static image.

* Fix segfaults with AOLayers by sanity checking using max_frames
Fix "Pixmap is null" console spam

* You'll hate me for this.
Make it possible to have fully animated AOButton and AOImage

* Add a settings option to toggle animated themes on or off

* Add a setting for animated theme elements
Add a "static image" toggle for get_image_suffix

* Fix custom chat and generally the chat boxes not having consistent behaivor with subthemes
Add a settings option for subthemes
Have AOImage keep track of its last valid path

* Add SubTheme (ST) packet. Pass subtheme as arg0, and "1" if you want the client's theme to be reloaded.
ST packet sets ao_app->subtheme no matter what. It will not reload theme unless the user has their subtheme set to "server".
Fix showname widths by rearranging font metrics to do its calculations *after* the showname font is set, and not before (making it lag behind the correct display size by 1 msg)

Co-authored-by: in1tiate <radwoodward@vikings.grayson.edu>
2021-02-13 11:52:12 +03:00
Crystalwarrior
b78479f4cc
Update the Settings screen - reload theme, restore defaults (#463)
* Add a Reload Theme button to the settings screen (works with both lobby and courtroom)

* Move all value updates on elements to "update_values" func in the settings screen
Add a "restore to defaults" option that allows you to restore all the configuration to its default values.
Set up a .temp settings file that allows you to undo the effects of restoring default options.

* wtf why didn't this error
2021-02-11 19:53:47 +03:00
Crystalwarrior
2135d84ff9 make instant text instant again 2021-02-09 03:24:04 +03:00
in1tiate
5cafb011f5
Fix music_display not stretching properly, reconsolidate ForegroundLayer into InterjectionLayer, rename InterjectionLayer to SplashLayer (#436)
* more intelligent separation

* separation 2 electric boogaloo

* rename InterjectionLayer to SplashLayer

* remove redundant layer type

* comments and cleanup

* fix incorrect use of continuous

* remove nonfunctional check

* fix additive not coloring correctly

Co-authored-by: Crystalwarrior <varsash@gmail.com>
2021-01-29 20:41:53 +03:00
in1tiate
639d4738db
Improvements to the way the position dropdown is handled (#428)
* it works

* woops

* oops 2 electric boogaloo

* fix "SP" packet not working properly
2021-01-28 22:38:15 +01:00
Crystalwarrior
d1e7b2920b Refactor "text scrawl" to "text crawl" (sounds more simple to understand than scrawl tbh) 2021-01-27 20:05:06 +03:00
Crystalwarrior
423fe3d3fe Add the setting for the text scrawl 2021-01-27 19:18:43 +03:00
Crystalwarrior
b040449f7f Redesign the text display speed delay to be more modular by introducing a "base display speed" variable 2021-01-27 18:20:56 +03:00
in1tiate
c13e6b7ab0
Allow effects to decide whether they go over or under the chatbox (#424)
Also re-adds pair ordering following viewport refactor.
2021-01-22 22:43:01 -06:00
Crystalwarrior
1b016ddf91 Merge branch 'master' into feature/timerclock
# Conflicts:
#	include/courtroom.h
2021-01-19 16:04:58 +03:00
Crystalwarrior
0926f3c158
Implement sticker logic with animated image support (#414)
* Implement sticker logic with animated image support (will probably be remade in a much better way for AOLayers)

* port to aolayer

Co-authored-by: in1tiate <radwoodward@vikings.grayson.edu>
2021-01-19 16:02:28 +03:00
in1tiate
894b2b2a0e
Consolidate AOScene, AOMovie, and AOCharMovie into one class, add support for (c) animations, implement emote continuity, add scaling overrides to all layer types, allow for stretch-to-fill images, allow for additional effect configuration (#302)
* Rewrite AOScene and remove the need for AOMovie and AOCharMovie by consolidation

* Rename AOScene to AOLayer, apply suggestions to improve functionality

* Implement suggested change to allocation

* Switch from pointer to field, fix ui_vp_player_char not resetting play_once

* Use the variable gif_name instead of the string "gif_name"
 Oops.

* Total rewrite of AOLayer (again)

* Add support for (c) animations, do some housekeeping

* allow themes to override misc chatboxes

* add support for pulling InterfaceLayer elements from theme/misc

* mistakes were made

* move all frame fx functionality to CharLayer subclass

* virtual functions are cool mkay

* remove evidence of my incompetence

* allow themes to override font design inis under theme/misc

* Proper support for theme/misc chatbox, fixes

* Fix chatbox dimensions not updating and inline color causing missingnos

* rename chat markdown to chat markup

* add missing misc overrides

* quick hotfix for chatblank and misc overrides

* Fix oversight with backgrounds causing them to be culled

* Same as last commit but for FG layer

* amend comment to explain impossible shenanigans

* Adjust ForegroundLayer to take charname rather than miscname, allow for checking in char folder

* fix an incredibly embarrassing pathing bug

* add scaling overrides for all layer types, parent orphaned viewport elements to the viewport

* stupid fix because themes use "custom.png" as a button

* switch to .append()

* Revert "Merge branch 'aoscene_rewrite' of https://github.com/AttorneyOnline/AO2-Client into aoscene_rewrite"

This reverts commit bdeb1bff7639d522031aab3c133a83b0e2a291df, reversing
changes made to 125ee63b97a6f6c156e69525d88fddc625e7a978.

* switch to .append() (again)

* move function call to fix showname length calculation error

* fix nonlooping character animations being broken Again

* unparent elements from the viewport and do fancy masking arithmetic instead

* use override keyword

* move scaling override to char.ini, allow stretching, restructure effect property loading

* fix some redundancy

* unparent chat_arrow from chatbox to prevent accidental masking

* at no point do we want a frozen gif to display

* overhaul how wtce is handled

* oops

* also let sounds be pulled from theme miscs

* i should probably compile before i push

* actually make it work

* don't check a default bg

* readd 1x1 stretch thing

* actually the 1x1 thing was a bad idea

* Add missing parenthesis

* Use load_image instead of play

play is a nonexistent method now

* Remote shout_message and usages because it does nothing

* Remove multiple redefinitions

* Add in missing brackets and indent to fix build

I have know idea what this does but it brings fear

* fix build error

* fix chat arrow and remove duped code

* remove more duped code and fix misc themes

* only update chat_arrow when needed

* consolidate log_chatmessage and display_log_chatmessage

Co-authored-by: scatterflower <marisaposs@gameboyprinter.moe>
Co-authored-by: Skye Deving <76892045+skyedeving@users.noreply.github.com>
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2021-01-19 14:32:11 +03:00
in1tiate
d41ec17fe7
Add a new "char_list" QTreeWidget that allows for categorizing characters (#399)
* initial commit

* use a "category" value instead

* add filtering and taken indicator

* hide serverlist header

* set the items to disabled in place of the [X] text

Co-authored-by: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com>
2021-01-18 23:10:45 +03:00
oldmud0
2f3ca8613d
Merge pull request #400 from AttorneyOnline/bugfix/blanklogs
Fix blankposts not showing up in logs
2021-01-18 12:35:19 -06:00
Crystalwarrior
7877739146 Simplify the logic behind last message = blankpost detection
I need to stop overcomplicating things.
2021-01-18 18:54:11 +03:00
Crystalwarrior
ea94644cf5 Attempt a theoretically safer method of tracking last displayed message 2021-01-18 17:56:21 +03:00
Crystalwarrior
147892bae9
Overhaul sound lists to introduce aliases, rethink editing behavior (#389)
* Resolve https://github.com/AttorneyOnline/AO2-Client/issues/275 by adding a "Nothing" option to play no SFX even when playing a preanimation that behaves similar to the Default option

* Overhaul sound list:
* Allow aliases. .ini file syntax is "filename = alias".
* Do not allow editing the .ini files from the client anymore.
* The sound list dropdown is still editable, but all it does is play your custom sfx without adding it to any files.
* Overhaul get_char_sfx

* Fix aliases not working properly with a rather tricky solution

* save character soundlist in base and drop the character_ from the filename

Co-authored-by: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com>
2021-01-13 23:34:20 +01:00
Crystalwarrior
96fcb75c4c Make sure blankposts are properly displayed unless repeats, playing nice with view desync 2021-01-12 13:46:39 +03:00
Crystalwarrior
f96bd6cc3c Didn't notice I removed this from the mergening when I resolved merge conflicts, oops 2021-01-12 11:59:07 +03:00
Crystalwarrior
49c3dcdee5 Merge branch 'master' into feature/timerclock
# Conflicts:
#	include/courtroom.h
2021-01-12 11:55:08 +03:00
Crystalwarrior
2d1de1fb54
Desynchronize viewport from the IC chat log so that users have a smooth viewing experience as an option (#385)
* 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>
2021-01-12 11:24:11 +03:00
Crystalwarrior
45c78ea5ca Add "id" variable to the clock functions and properly parse the ID
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
2021-01-11 17:38:08 +03:00
oldmud0
62532f0b64
Trivial comment change 2021-01-10 10:41:34 -06:00
Skye Deving
4f2ac31456 Add arup_clear() and clear arup when fetching new areas
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.
2021-01-10 06:38:26 -06:00
Crystalwarrior
1ad8f3bf24 Merge branch 'master' into feature/timerclock
# Conflicts:
#	include/courtroom.h
#	src/courtroom.cpp
2021-01-10 14:27:27 +03:00
in1tiate
3a207dccf0 i barely had to modify this 2021-01-09 15:13:19 -06:00
oldmud0
41c134b1be
Merge pull request #387 from AttorneyOnline/feature/immediate
Rename noninterrupting bonanza to consistent and short "immediate" instead
2021-01-09 12:35:09 -06:00
in1tiate
3993ba47e5
Add desk_mods 2 -5 for more flexibility in emotes (#353) 2021-01-09 12:32:24 -06:00
Crystalwarrior
5b34df1c5a Rename noninterrupting_preanim and all its associated bullshit with more cooler and nicer bro immediate
In themes, pre_no_interrupt old-style name is still supported if we cannot find "immediate"
Resolves https://github.com/AttorneyOnline/AO2-Client/issues/64
2021-01-09 18:43:24 +03:00
in1tiate
15c3d607c6
Log objections IC, overhaul custom objections context menu, add more configuration options per-character (#356)
* 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>
2021-01-09 18:17:12 +03:00
in1tiate
079c45e298
Define IC Log colors independent of character, define message colors according to character (#323)
* 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
2021-01-09 18:09:18 +03:00
oldmud0
de3533fbf2 Rework timer and ping logic
The timer's time as received by the server is clarified to be the actual
numerical time, in milliseconds, to be shown on the clock.
2021-01-09 01:18:19 -06:00
oldmud0
9486f44770
Merge pull request #369 from skyedeving/fix-showname-toggle
Fix timestamps when toggling showname
2021-01-05 21:07:48 -06:00
Skye Deving
5abc685b47 Sort case evidence numerically before adding in
inventories get displayed lexigraphically too but it is assumed to not
matter
2021-01-04 19:58:30 -06:00
Skye Deving
8aaba6633e Change default parameter to be QDateTime::currentDateTime()
Print debug message if provided timestamp is invalid
2021-01-04 19:21:11 -06:00
Skye Deving
6570bcf066 Fix timestamps when toggling showname
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
2021-01-04 13:45:18 -06:00
oldmud0
4eb45ef2b0
Merge pull request #305 from Crystalwarrior/bugfix/blip-accuracy
More accurate/consistent blip rate functionality + punctuation slowdown fixes
2020-11-10 14:07:45 -06:00
in1tiate
fe3224d7e8
Add vertical offset feature (#333) 2020-11-10 08:43:18 -06:00
in1tiate
5aee23d56b
Add context menu entry to stop music (#301)
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>
2020-11-09 14:47:51 -06:00
in1tiate
48f8d8aa27 add variable check for evidence presenting 2020-09-19 04:12:40 -05:00
Crystalwarrior
c392bb3415 Revert the meme of instant text.
Instant text using }}} is not only meme-worthy in how limited it is in practice, it also makes the blip ticker completely confused how and when to play the blips (to make instant text possible, the entire system needs rewriting (again)
2020-09-11 23:39:32 +03:00
Crystalwarrior
8cc067dee4 More accurate/consistent blip rate functionality inspired by https://youtu.be/Min0hkwO43g 2020-09-11 22:17:13 +03:00
Crystalwarrior
6c62980ffc forgot to ctrl+s header definitions fuck 2020-08-25 12:58:48 +03:00
Crystalwarrior
ee3bad44c7 Implement clock pausing
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.
2020-08-25 12:48:09 +03:00
Crystalwarrior
7e9c5726e0 Introduce the timer packet - "TI".
This timer will start the clock accounting for latency! Cool, right?
Remove useless qDebug() for music looping
2020-08-25 12:21:10 +03:00
Crystalwarrior
febfbeafc1 Actually make use of the completely useless CHECK and CH keepalive timer and use them to determine the client's ping.
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
2020-08-25 12:18:49 +03:00
Crystalwarrior
f27f210efe Proof of concept complete. The timer will now take int msecs to start, and will properly display the time remaining until target time in hh:mm:ss.zzz
Clock can be defined in courtroom_config.ini and its font set in courtroom_fonts.ini
Pause and resume functions will not work as expected atm.
2020-08-21 18:01:24 +03:00