mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-14 04:02:31 +00:00
[MIRROR] fix crafting UI stuck (#9879)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
73db928ae2
commit
2b2c6be593
@@ -458,20 +458,7 @@
|
|||||||
return
|
return
|
||||||
switch(action)
|
switch(action)
|
||||||
if("make")
|
if("make")
|
||||||
var/datum/crafting_recipe/TR = locate(params["recipe"]) in GLOB.crafting_recipes
|
do_make(ui.user, locate(params["recipe"]) in GLOB.crafting_recipes)
|
||||||
busy = TRUE
|
|
||||||
tgui_interact(ui.user)
|
|
||||||
var/atom/movable/result = construct_item(ui.user, TR)
|
|
||||||
if(!istext(result)) //We made an item and didn't get a fail message
|
|
||||||
if(ismob(ui.user) && isitem(result)) //In case the user is actually possessing a non mob like a machine
|
|
||||||
ui.user.put_in_hands(result)
|
|
||||||
else
|
|
||||||
result.forceMove(ui.user.drop_location())
|
|
||||||
to_chat(ui.user, span_notice("[TR.name] constructed."))
|
|
||||||
TR.on_craft_completion(ui.user, result)
|
|
||||||
else
|
|
||||||
to_chat(ui.user, span_warning("Construction failed[result]"))
|
|
||||||
busy = FALSE
|
|
||||||
if("toggle_recipes")
|
if("toggle_recipes")
|
||||||
display_craftable_only = !display_craftable_only
|
display_craftable_only = !display_craftable_only
|
||||||
. = TRUE
|
. = TRUE
|
||||||
@@ -483,6 +470,21 @@
|
|||||||
cur_subcategory = params["subcategory"] || ""
|
cur_subcategory = params["subcategory"] || ""
|
||||||
. = TRUE
|
. = TRUE
|
||||||
|
|
||||||
|
/datum/component/personal_crafting/proc/do_make(mob/user, datum/crafting_recipe/TR)
|
||||||
|
busy = TRUE
|
||||||
|
tgui_interact(user)
|
||||||
|
var/atom/movable/result = construct_item(user, TR)
|
||||||
|
if(!istext(result)) //We made an item and didn't get a fail message
|
||||||
|
if(ismob(user) && isitem(result)) //In case the user is actually possessing a non mob like a machine
|
||||||
|
user.put_in_hands(result)
|
||||||
|
else
|
||||||
|
result.forceMove(user.drop_location())
|
||||||
|
to_chat(user, span_notice("[TR.name] constructed."))
|
||||||
|
TR.on_craft_completion(user, result)
|
||||||
|
else
|
||||||
|
to_chat(user, span_warning("Construction failed[result]"))
|
||||||
|
busy = FALSE
|
||||||
|
|
||||||
/datum/component/personal_crafting/proc/build_recipe_data(datum/crafting_recipe/R)
|
/datum/component/personal_crafting/proc/build_recipe_data(datum/crafting_recipe/R)
|
||||||
var/list/data = list()
|
var/list/data = list()
|
||||||
data["name"] = R.name
|
data["name"] = R.name
|
||||||
|
|||||||
Reference in New Issue
Block a user