This commit is contained in:
SandPoot
2024-01-05 17:07:54 -03:00
parent cb2251ea37
commit 51c1c2abc9
24 changed files with 46 additions and 26 deletions
+3 -7
View File
@@ -1,17 +1,13 @@
/datum/component/personal_crafting/Initialize()
if(ismob(parent))
RegisterSignal(parent, COMSIG_MOB_CLIENT_LOGIN, .proc/create_mob_button)
RegisterSignal(parent, COMSIG_MOB_HUD_CREATED, .proc/create_mob_button)
/datum/component/personal_crafting/proc/create_mob_button(mob/user, client/CL)
/datum/component/personal_crafting/proc/create_mob_button(mob/user)
var/datum/hud/H = user.hud_used
for(var/huds in H.static_inventory)
if(istype(huds, /atom/movable/screen/craft))
return
//We don't want to be stacking multiple crafting huds on relogs
var/atom/movable/screen/craft/C = new()
C.icon = H.ui_style
H.static_inventory += C
CL.screen += C
user.client.screen += C
RegisterSignal(C, COMSIG_CLICK, .proc/component_ui_interact)
/datum/component/personal_crafting