Commit Graph

116 Commits

Author SHA1 Message Date
Alex Noir
1e49b38db7 Back up old effects ini 2022-07-30 21:05:21 +03:00
Salanto
4fa86c0174
Add option to disable music streaming. (#829)
* Add option to disable streamintg

This one gets a unique message to prevent people forgetting they disable it and the wondering why streaming broke.

* Fix code order

* Fixes the music channel still playing audio when a new stream was blocked.

* Update tooltip

* Update tooltip to reflect the current way the feature works.
2022-07-30 18:42:55 +02:00
Crystalwarrior
cf91cc03f8
Add settings option for "sfx_on_idle" which allows you to play a custom SFX alongside an Idle emote (#744)
* Add an "sfx_on_idle" FL packet flag, UNFORTUNATELY servers have to go out of their way to support this feature due to clients below 2.10 fucking spamming sfx for 2.10 otherwise

* Revert feature flag, implement a method that works regardless of server instead

* Revert "Revert feature flag, implement a method that works regardless of server instead"

This reverts commit c14b4fb2a1bbf2796db4a26e83609ba743826655.

* Stop using FL packet, but make SFX on Idle a client-side setting to reduce confusion and reliance on servers for a client feature to a minimum.

This reverts commit 687e64e37839b77923c93d13f971ee6750bd4330.

* Update src/aooptionsdialog.cpp

Co-authored-by: stonedDiscord <Tukz@gmx.de>
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2022-07-30 14:55:58 +02:00
Crystalwarrior
d9bdb7e6bc
Fix get_effect_property ignoring the provided effect folder and using the char.ini instead. Makes it consistent with get_effect behavior (#828) 2022-07-30 14:38:37 +02:00
Crystalwarrior
f896475de4
Stop iniswapping from modifying the char.ini file (#712)
* Stop iniswapping from modifying the char.ini (which can potentially remove comments such as credits, charmaker notes, etc.)
* Fix iniswaps.ini and soundlist.ini not using vpath
* Deprecate get_char_name, making "name=" part in the char.ini no longer a thing
* Fix iniswap and emote dropdowns not getting properly updated when theme is reloaded
* Prevent reload theme from resetting your emote to the first one
* Fallback soundlist.ini

Co-authored-by: stonedDiscord <Tukz@gmx.de>
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2022-07-29 19:45:42 -05:00
Crystalwarrior
3c3002122e
Add settings option for Evidence double-click that can be turned off (single-click evidence view) and more (#749)
* Add 'evidence_one_click_view' courtroom_design.ini function, which allows you to treat every click as if it's a double-click (meaning every click will bring evidence overlay)
Fix name not being set to read only when evidence is initialized
If evidence is double-clicked and overlay is visible, trigger "on_x_clicked" behavior
Make sure evidence is selected when double-click is called
Stop hovering from changing name text if overlay is visible
Simplify on_evidence_x_clicked "modified" check by simply checking if "ui_evidence_ok" is visible

* Fix pressing "cancel" when trying to switch between evidence still acting the same as "discard"

* Remove unnecessary ic message input focus setters for evidence, make only the Present button set focus on ic message input

* Fix second page ignoring the evidence_one_click_view setting because of a wrong ID being used for the double-click call

* Make evidence_switch() have everything required to properly switch between private/global

* Make evidence cursor start at the top when looking at evidence description

* Change it from theme setting to settings option

* Make evidence double click default option to "true" due to it being the default for years

Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
2022-07-29 18:36:58 +03:00
Crystalwarrior
f40b3d162d
Code to support effects ini version 2 (#813)
* Code to support effects ini version 2

* Update theme commit

* Get it to actually work properly

* Rework effect loading code

* Added auto-migration to new format
* Reorganised code for improved readability and clarity
* Add functional checks for operation to not run into missing file issues

* Minor logic fix

* Add debug message

* Trim any empty items from the list

* Add mandatory culling

* See https://discord.com/channels/278529040497770496/323377366997008394/998661402669617233

* Reworked implementation

* Resolve warning of temporary container allocation

* Unbreak what I broke last commit

* Also make it a QStringLiteral to cheat clazy.

* Set default layer

* Ignore that for realization, that one covers the screen.

* Document migration regex

* This should clarify the ambiguity of its functionality and reason why it exists.

Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
Co-authored-by: TrickyLeifa <date.epoch@gmail.com>
2022-07-27 21:43:50 +02:00
Crystalwarrior
f8c2b1a2f0
Part 2 of #713: merge get_real_suffixed_path into get_real_path (#717)
* Fix get_real_suffixed_path existing, causing the previous PR to not function on suffixed... anything
Fix suffixes ignoring a case where a suffixed path is already provided, causing that pre-suffixed filepath to fail to find anything

* Fix image paths being used as sound effects and vice versa
Better check for sfx and image absolute paths which double-checks the absolute path we got is *actually a valid file format*

Co-authored-by: stonedDiscord <Tukz@gmx.de>
Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
2022-07-26 00:54:11 +03:00
Crystalwarrior
ad578eb0bd
Suppress application volume when alt-tabbed (#730)
* Suppress application volume when alt-tabbed
Add a "suppress_audio" slider setting, 50% by default, which decides how much audio remains when the client is not in focus
Add a "muted" setting for blip, music, and sfx players
Add update_audio_volume func

* change "suppress" to "how much audio is suppressed" instead of "how much audio remains"

* Fix last commit just flipping the behavior and being ultra wacky

* Fix evidence present sound ignoring audio suppression settings

Co-authored-by: stonedDiscord <Tukz@gmx.de>
Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
2022-07-23 18:18:45 +03:00
Crystalwarrior
c8914c9302
Add effect layering under the character, flippable effects and more (#701)
* Fix effect offsets only applying after the effect already plays
Add "_layer" property which can be "behind", "character" or default "chat". This deprecates the "under_chatbox" property

* Add a "sticky" effect property which is the same as "stickyeffects" setting being enabled but just for that 1 effect

* Clang is tidy, clang is caring

* make character layer actually stack over the character but under the desk
add new "over" layer which is over everything in the viewport but under the chat box

* Switch "ignore_offset" to "respect_offset" so effects only respect character offsets if explicitly told to

* Appease clang tidy... mostly. I don't understand the last thing it's talking about.

* Appease clang tidy further

* Remove "effect_done" due to it overwriting the AOLayers behavior
Add "loop" effect property so you set up in the ini if the effect should loop rather than it using the file's loop settings
Add "max_duration" effect property
Add "cull" effect property which decides whether to clear the effect or not when it's done (if loop is false)

* Fix effects not allowed to have underscores (_) in them without breaking

* Change the way effects.ini looks and is parsed to be more sane and doable.
However, since order may or may not matter, you can optionally include index:name and it orders it properly.

* Appeal to clang

* Fix a dumb way I created QSettings in get_effects

* Fix effect properties being broken due to optional index

* Fix get_effect_property not getting the current theme properties if a misc theme exists

* If sound list has a sound effect selected, if pre is not checked, don't play effect sound and prefer the sfx we chose instead.

* Fix \f not using the theme's realization effect

* Add missing curly bracket

* Yolo

Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
Co-authored-by: stonedDiscord <Tukz@gmx.de>
2022-07-18 15:45:47 +03:00
Rosemary Witchaven
e587c76eb0
correct spelling of "deprecated" (#803) 2022-07-16 15:47:56 +02:00
Leifa♥
7b4b297a22
Added penalty effects (#786)
Themes can be configured to play an SFX and/or effect when the HP bar increases or decreases. Effects can be any defined effect, or a built-in effect such as "screenshake" or "flash".

Resolves AttorneyOnline/AO2-Client#743
2022-06-23 18:58:17 -05:00
stonedDiscord
06db93bd0d
save and load server description in favorites (#783) 2022-06-06 20:03:00 +02:00
Salanto
f0a5e48f5c
Dual-Stack AO2 Client to handle both TCP and Websocket connections seemlessly (#696)
* Replace TCP Serversocket with Websocket

* Have TCP sockets live harmoniously with WS

"like 5 lines" yeah probably lost a bet.

* Update .gitlab-ci.yml

* hack to fix favorites

* Add support for websockets in the favorites list (serverlist.txt)
Make "add_favorite_server" remember the socket type

* Preserve old serverlist style

This will keep new entries compatible with 2.9 and prior clients. Makes parsing the list easier too.

* Add lookup table and correct write code to use lowercase

* I have no idea what a lookup table is, but this looks close enough

* Fix lookup table

* Otherwise backend selection behaviour is inverted

* clang-tidy had one job

* Yet it did not do it.

Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>

* const p_data

* Switch serverlist.txt to an ini format

* Fixes an Omni bug where : would split the servername
* Utilises internally QSettings properly for low parsing effort and clear structure
* Automatically migrates the legacy serverlist.txt to favorite_servers.ini
* Pleases my OCD

* Replace sample serverlist.

Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Co-authored-by: stonedDiscord <Tukz@gmx.de>
Co-authored-by: Alex Noir <Varsash@gmail.com>
2022-06-06 19:14:44 +02:00
Salanto
b69f9f17f4
Load serverlist.txt with UTF-8 Coded (#741)
Fixes #738
The values are correctly written, so this should fix it.
2022-04-05 21:35:09 +03:00
Rosemary Witchaven
68d0b838cf
Add two ways of controlling judge buttons that aren't hardcoded nonsense (networked and local) (#537)
* add both network and local ways to show judge buttons on pos other than jud

* hide judge buttons when pos_removing to a non-judge position

* alter packet header

* Only use pos jud hardcoding if no design.ini

if design.ini does not define judges= then we fall back to pos jud garbage

* Fix judge buttons being disabled if default_side pos is judge (logic poopy)
Fix positions.isEmpty() returning False cuz a split of an empty string returns the list with an empty string by default

* Expand JD packet to be able to send -1, 0 and 1. If -1 is received, fall back on client-sided judge button behavior. If 0 or 1 is received, treat it as "absolute override" and adhere to that packet.

* alter check for empty qstringlist to support old qt versions

* heehoo

* trigger client side behavior when jd -1 is sent

* less confusing variable names

* remove useless code, trim some fat

Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>

* use an enum dammit! & warn on malformed auth

* use an enum dammit! pt. 2

* appease clang, rewrite ugly judge controls function

* please squash this its so bad

Co-authored-by: Crystalwarrior <Varsash@Gmail.com>
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2022-03-29 17:37:02 +03:00
stonedDiscord
e0c67124a6
Midi music (#614)
* add bassmidi everywhere but CI

* hello CI please don't ban me from github

* add lib and open midi files with the lib

* overlooked windows CI

* yes, overwrite everything

* add tracker support

* add file formats that bass supports

* forgot .mid smh

* load all plugins in one function
2022-03-25 15:58:59 +03:00
Crystalwarrior
df1c8ccd83
Add blip rate of 0 which only plays a single blip sound per message (#659)
* Add blip rate of 0 which only plays a single blip sound per message

* don't have copy-pasted code I GUESS
2022-03-19 15:31:38 -05:00
oldmud0
3ec3d3a121 Fix wrong precedence order for effects
This was causing the realization.png UI button to be loaded instead of the effect.
2022-01-08 12:51:49 -06:00
oldmud0
c80a019574
Merge pull request #619 from AttorneyOnline/feature/http-ms
Switch to HTTP-based server list
2022-01-07 20:17:02 -06:00
oldmud0
6e1e847750
Add and refine debug log messages (#625)
Since these are going to be visible to the user now, at least let's properly format them and make them somewhat helpful.
2021-12-30 20:44:59 -06:00
oldmud0
ee76c2ce61 Merge branch 'master' into feature/http-ms
# Conflicts:
#	src/networkmanager.cpp
2021-12-30 20:31:44 -06:00
oldmud0
ecfe6f2542 Change master chat in courtroom to debug log
Since the MS chat has been disabled for quite some time now (and we aren't planning on bringing it back since Discord, Guilded etc. have better chat features), I decided to go ahead and change the pane into a debug log to keep it useful and avoid creating a gaping hole in themes.

Though, maybe it is worth removing the whole switcher and keeping the debug log hidden away where it can't scare people.
2021-12-25 19:17:27 -06:00
oldmud0
2eed786c77 Split logging option into text and demo
Apparently, people don't like logging demos because it takes up too
much space. It's possible to enable NTFS compression for demo files
(or the entire demos folder), though.
2021-12-23 17:29:17 -06:00
oldmud0
b0e9f8dbe5 Merge branch 'master' into feature/http-ms 2021-12-18 22:34:04 -06:00
oldmud0
f1107aeac5 Finish out feature
- Add periodic timer for heartbeat
- Add option to settings for opting out from heartbeat/player metrics
- Change base URL to permanent URL
2021-12-18 20:29:55 -06:00
in1tiate
101a5e506f Fix all files being allowed past the suffix check for images 2021-11-15 16:48:46 -06:00
Rosemary Witchaven
c163aab671
Allow user to configure log timestamp format (#590)
* user configurable timestamp format

* fix label making the entire settings window move jankily

* add a dropdown for sane timestamp formats

* streamline adding options to log timestamp format
2021-09-22 18:59:59 -05:00
in1tiate
2d3cab82c8 Fix custom objections not playing sounds 2021-07-22 12:26:57 -05:00
oldmud0
9ecd7c453c Merge branch 'master' into feature/mounting 2021-06-06 23:23:33 -05:00
oldmud0
037d96a5d9 Use intuitive behavior for loading assets with ambiguous extensions 2021-06-05 20:28:55 -05:00
oldmud0
d27501313c Finish mounting feature
To pull this one off, a new class called VPath was created that denotes
"virtual" paths that can exist anywhere among the list of mount points.
It is functionally identical to QString, except that implicit conversion
between QString and VPath is not allowed. This makes it easy to spot
errors in path resolution at compile time, since get_real_path must be
called to resolve a VPath into an absolute path that can be passed into
a Qt function as a QString.

Other functions, such as the get_*_suffix functions, also return an
absolute path QString for convenience.

As for the rest of the functions that return a VPath, you will need to
call get_real_path yourself.

Finally, a path resolution cache was added to try to avoid blowing
up what is already a massive lookup cost for assets. The cache
is invalidated when the mount path list is changed.

Currently, this cache isn't bounded. Might need to write an LRU cache
if issues arise.
2021-06-05 14:58:40 -05:00
in1tiate
167aae750f account for both theme and misc pathing which are different because this program is well made and does not make me want to pull my hair out 2021-05-16 00:41:41 -05:00
oldmud0
75da07d190
Merge pull request #545 from MangosArentLiterature/default-shownames
Add default shownames
2021-04-29 00:53:57 -05:00
oldmud0
1d809726a9
Merge pull request #542 from AttorneyOnline/fix/aolayer-crap
Fix AOLayer-related regressions, deprecate BS no one uses and return sane behavior
2021-04-29 00:44:50 -05:00
MangosArentLiterature
99d083d114 Add default shownames
Adds a new setting to config.ini to set a default showname. This works similarly to default username, but for IC shownames, setting the client's showname automatically. Like default username, this has a 30 character limit.

* Adds a new option to config.ini, default_showname.
* Adds this setting to the options dialog.
* Adds get_default_showname() for retrieving this showname.
* Sets the showname box to this value upon joining a server.
2021-04-28 00:43:06 -05:00
in1tiate
0ced99c966 check for effects without path in p_misc 2021-04-26 12:14:16 -05:00
Crystalwarrior
433b7f3315 Deprecate tick_ms and use actual milliseconds rather than arbitrary 60ms ticks for char.ini [Time]
Fix an extremely weird case where CharLayer::Play() was not called even on the CharLayer class (I don't understand why inheritance was straight up just ignored)
Fix using preanims with static images just breaking everything
Deprecate weird insanity [Time] with the % sign BS (What was this for again? Literally no one used this nor was aware of it)
Fix text_stay_time timer firing even if we're immediate
Just in case, stop the text delay timer when start_chat_ticking is called
2021-04-24 01:44:52 +03:00
oldmud0
6e3435ddba Add setting for default scaling method 2021-04-23 16:09:25 -05:00
Crystalwarrior
0a1a47c920
Expand .css power by giving object names to all AO UI elements (#534)
* Fix ic chatlog placeholder text not being translated
* Fix inconsistent/nonsensical path resolution for the backwards-compatibility misc/default/config.ini vs themes/current_theme/misc/default/config.ini

Co-authored-by: in1tiate <32779090+in1tiate@users.noreply.github.com>
2021-04-23 14:20:31 -05:00
Crystalwarrior
31abe0c848
Fix get_court_sfx using latin1 instead of utf-8 (#540)
Co-authored-by: in1tiate <32779090+in1tiate@users.noreply.github.com>
2021-04-23 14:17:45 -05:00
in1tiate
66f2369af2
Fix Cyrillic characters not being read correctly from QSettings inis (#535)
* set ini codecs to utf8

* fix color config reading in Latin1 rather than Utf8
2021-04-23 02:18:56 -05:00
in1tiate
6b267e8fdc fix demo server not being added if serverlist.txt is absent 2021-03-30 11:00:13 -05:00
oldmud0
7d20de77d2 Fix files not being written as UTF-8 2021-03-03 16:23:06 -06:00
Crystalwarrior
63128fea13 Stop supporting the DRO way (we will make a .bat file or utility that does it for you automatically instead!)
Add an option to enable/disable stickers
Make stickers actually respect the custom chatbox setting properly
2021-02-16 11:20:54 +03:00
in1tiate
36a1e26069 fix borked chatbox themes 2021-02-13 07:48:42 -06: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
aea0e2ef80 Fix backwards compatibility with the stopmusic
Hide ~stop.mp3 and the stop category
Add an option to make it so when you double-click a category, it expands/collapses it without sending the stop-music command
Make right click stop music backwards compatible
2021-02-09 03:00:51 +03:00
oldmud0
580313cbcd
Merge pull request #429 from AttorneyOnline/fix/continuous-bg
Fix continuous playback being nonfunctional on non-CharLayer elements, and allow users to toggle the feature
2021-01-27 18:10:52 -06: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