Stack crafting images (#89020)

## About The Pull Request
- Stack crafting got images, and a redesign, as it now uses the
ImageButtons component instead of the usual buttons
- Search will no longer stop the character when opening the stack
crafting menu
- Icon into SearchBar component now centered

## Why It's Good For The Game
Images greatly simplify interactions with interfaces, especially those
where it is desirable to see what you are doing (crafting)
So... better UI/UX :high:

## Demostration

![image](https://github.com/user-attachments/assets/0b2b1aab-06eb-4ed4-91f2-eae3b23aac96)

<details><summary> Video with almost all materials </summary>


https://github.com/user-attachments/assets/6e0e90b7-064a-48de-afe9-9e097abaa011

</details>

## Changelog

🆑
qol: Stack crafting UI got images
qol: Search in stack crafting UI will not take control from you, feel
free to craft on walk
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
This commit is contained in:
Aylong
2025-01-11 18:47:08 -08:00
committed by GitHub
co-authored by Jeremiah
parent cbd598083c
commit 1d112623a0
4 changed files with 122 additions and 61 deletions
+15 -6
View File
@@ -239,12 +239,21 @@
* * R - The stack recipe we are using to get a list of properties
*/
/obj/item/stack/proc/build_recipe(datum/stack_recipe/R)
return list(
"res_amount" = R.res_amount,
"max_res_amount" = R.max_res_amount,
"req_amount" = R.req_amount,
"ref" = text_ref(R),
)
var/list/data = list()
var/obj/result = R.result_type
data["ref"] = text_ref(R)
data["req_amount"] = R.req_amount
data["res_amount"] = R.res_amount
data["max_res_amount"] = R.max_res_amount
data["icon"] = result.icon
data["icon_state"] = result.icon_state
// DmIcon cannot paint images. So, if we have grayscale sprite, we need ready base64 image.
if(R.result_image)
data["image"] = R.result_image
return data
/**
* Checks if the recipe is valid to be used