Files
Bubberstation/code/modules/asset_cache
Boviro 5d06e7af9a PaperworkWarden, or, giving the Warden a custom stamp (#2422)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->
Adds a stamp for the Warden role, and adds it to the Warden's locker
structure
<!-- Please make sure to actually test your PRs. If you have not tested
your PR mention it. -->

## Why It's Good For The Game

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->
The warden has a fair amount of paperwork that they can handle instead
of the Head of Security, and is sometimes expected to handle, like
search warrants. It seems understandable that they are given a stamp so
they can do so properly.

## Proof Of Testing

<!-- Compile and run your code locally. Make sure it works. This is the
place to show off your changes! We are not responsible for testing your
features. -->

![image](https://github.com/user-attachments/assets/8bbe7190-9638-452c-b14e-773ca3335d0f)

![image](https://github.com/user-attachments/assets/a888cc41-ac45-46ed-a364-dd2a4a8324d1)

![image](https://github.com/user-attachments/assets/1f1d34c3-3118-485f-a7ff-cda30ad1aa88)

![image](https://github.com/user-attachments/assets/0377eb85-7546-47bb-af4c-d1c0b59101cd)

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and its effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
add: gives the warden a stamp
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

<!-- By opening a pull request. You have read and understood the
repository rules located on the main README.md on this project. -->
2024-11-15 02:20:19 +00:00
..

Asset cache system

Framework for managing browser assets (javascript,css,images,etc)

This manages getting the asset to the client without doing unneeded re-sends, as well as utilizing any configured cdns.

There are two frameworks for using this system:

Asset datum:

Make a datum in asset_list_items.dm with your browser assets for your thing.

Checkout asset_list.dm for the helper subclasses

The simple subclass will most likely be of use for most cases.

Call get_asset_datum() with the type of the datum you created to get your asset cache datum

Call .send(client|usr) on that datum to send the asset to the client. Depending on the asset transport this may or may not block.

Call .get_url_mappings() to get an associated list with the urls your assets can be found at.

Manual backend:

See the documentation for /datum/asset_transport for the backend api the asset datums utilize.

The global variable SSassets.transport contains the currently configured transport.

Notes:

Because byond browse() calls use non-blocking queues, if your code uses output() (which bypasses all of these queues) to invoke javascript functions you will need to first have the javascript announce to the server it has loaded before trying to invoke js functions.

To make your code work with any CDNs configured by the server, you must make sure assets are referenced from the url returned by get_url_mappings() or by asset_transport's get_asset_url(). (TGUI also has helpers for this.) If this can not be easily done, you can bypass the cdn using legacy assets, see the simple asset datum for details.

CSS files that use url() can be made to use the CDN without needing to rewrite all url() calls in code by using the namespaced helper datum. See the documentation for /datum/asset/simple/namespaced for details.