mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
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  <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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user