aboutsummaryrefslogtreecommitdiff
path: root/include/aolayer.h
AgeCommit message (Collapse)Author
2024-05-15Ported to CMake, ...TrickyLeifa
* Ported the project to CMake * Android and Mac support dropped for the time being. * Tests, BASS and Discord-RPC are now options * Restructured and reformated the project. * Merged `include` and `src` * Renamed `resource` to `data` * Renamed various files * External libraries headers are no longer included in `src` * Replaced header guards with #pragma once * Multiple refactors (keywords, headers) * Added Qt6 compatibility * Removed various unused functions and headers * Reworked AOPacket * When content is passed to AOPacket, it should be ensured that the content is already decoded. * Encoding/decoding are now static methods. * Fixed various memory leaks * Removed animation code for AOImage * AOImage is always using static images * Simplified ChatLogPiece
2022-01-08Fix build failure in GitLab CI (#630)oldmud0
error: use of deleted function 'std::atomic<bool>::atomic(const std::atomic<bool>&)'
2022-01-08Fix more race conditions in AOLayer loadingoldmud0
- Uninitialized exit_loop variable - Previous load task should stop completely before starting new load task
2022-01-05Fix MSVC builds freezing due to AOLayer concurrency issueoldmud0
Variables accessed across threads should be atomic. Also gave AOLayer its own thread pool and switched some lock calls to use QMutexLocker semantics.
2021-08-13asynchronously load animations for bigly performant gainzin1tiate
2021-08-11wait for thread to finish before starting new onein1tiate
2021-08-11more accurate commentin1tiate
2021-08-11preload next frame before ticking overin1tiate
2021-06-06Merge branch 'master' into feature/mountingoldmud0
2021-06-05Finish mounting featureoldmud0
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-04-24Deprecate tick_ms and use actual milliseconds rather than arbitrary 60ms ↵Crystalwarrior
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-20don't set a mask on elements affected by offsets (#524)in1tiate
2021-02-14fix bg not resizing on reload themein1tiate
2021-02-13Animated Themes. Subthemes. Custom default_theme. Overhaul asset paths. Fix ↵Crystalwarrior
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-09Fix expanded_desk_mods (2-5) being nonfunctional (#451)in1tiate
Also fix backgrounds appearing off to the left if they are less wide than the viewport. i am in agony Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2021-01-29Fix music_display not stretching properly, reconsolidate ForegroundLayer ↵in1tiate
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-19Implement sticker logic with animated image support (#414)Crystalwarrior
* 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-19Consolidate AOScene, AOMovie, and AOCharMovie into one class, add support ↵in1tiate
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>