mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-27 10:02:12 +00:00
* 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 🆑 fix: inserting a material sheet into an lathes should show the correct animation color /🆑 * Dynamic material colors applied for insertion animation into lathes --------- Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
23 lines
832 B
Plaintext
23 lines
832 B
Plaintext
/**
|
|
* 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
|