-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] Dynamic material colors applied for insertion animation into…
… lathes (#1412) * Dynamic material colors applied for insertion animation into lathes (#81692) ## About The Pull Request So you've noticed that when we insert say uranium into a techfab it shows us the proper green sheet getting consumed as the animation but when you insert that same uranium into an autolathe is shows us a blue sheet animation instead? Yup not realistic, this is because the autolathe has only 2 animation types one for inserting iron & the other for glass. Every material type would have to share these 2 animations making it look bland. Now the material color is blended on the icon itself allowing for the right color to be applied on the insertion animation Plus this also trims the sizes of our dmi files so it's a win overall https://github.com/tgstation/tgstation/assets/110812394/bb643691-8d3b-4822-8371-346c2d5e5be3 ## Changelog :cl: fix: inserting a material sheet into an lathes should show the correct animation color /:cl: * Dynamic material colors applied for insertion animation into lathes --------- Co-authored-by: SyncIt21 <[email protected]>
- Loading branch information
1 parent
a062f16
commit 7ad868a
Showing
7 changed files
with
52 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Creates a mutable appearance with the material color applied for its insertion animation into an autolathe or techfab | ||
* Arguments | ||
* | ||
* * color - the material color that will be applied | ||
*/ | ||
/proc/material_insertion_animation(color) | ||
RETURN_TYPE(/mutable_appearance) | ||
|
||
var/static/list/mutable_appearance/apps = list() | ||
|
||
var/mutable_appearance/cached_app = apps[color] | ||
if(isnull(cached_app)) | ||
var/icon/modified_icon = icon('icons/obj/machines/research.dmi', "material_insertion") | ||
|
||
//assuming most of the icon is white we find what ratio to scale the intensity of each part roughly | ||
var/list/rgb_list = rgb2num(color) | ||
modified_icon.SetIntensity(rgb_list[1] / 255, rgb_list[2] / 255, rgb_list[3] / 255) | ||
cached_app = mutable_appearance(modified_icon, "material_insertion") | ||
|
||
apps[color] = cached_app | ||
return cached_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters