Port DmIcon & Image components from TG #26623
Open
+521
−239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Does This PR Do
Ports DmIcon from tgstation/tgstation#82533 and early_assets subsystem for it
And Image components from TG (Didn't find PR)
Replacing base64 sprites generated during init with DmIcon in Stack Craft (GrayScale sprites still generates, but it's okay, instead of 300+ icon2base64 calls in Stack Craft, it comes out to about 14)
Replacing Assets with DmIcon in Prize Counter
Added DmIcon support to ImageButton and replaced with Image component
Why It's Good For The Game
The most modern, convenient and fastest way to add any image to the TGUI
So how do I add an image? VERY easy! You just need to pass icon and icon_state of the object to TGUI, and use them in DmIcon or ImageButton
No need to generate images anymore (Unless they are grayscale or built from overlays).
Images of changes
Nothing to show, result the same, maybe UI's shown a little faster, cause it doesn't need to wait images, they load async
But, can show icon2base64 overtime before and after
Testing
Very many times opened Ui's using DmIcon and normal Image with Assets (Before removing Assets from Prize Counter)
Also tested on Byond 516 with CPU slowdown 20x and in SmartFridge with test UI (Reverted but video bellow)
Smartfridge test UI
dreamseeker_Ex6OdZTnmf.mp4
I fixed all the problems I noticed, but maybe I missed some small things as usual.
Declaration
Changelog
NPFC