Adds buttons in the UI for specific components (#61622)

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
Watermelon914
2021-09-25 03:50:15 -07:00
committed by GitHub
co-authored by Watermelon914
parent b463e0417e
commit 390f60f571
5 changed files with 65 additions and 16 deletions
@@ -17,13 +17,17 @@
var/port_limit = 10
ui_buttons = list(
"edit" = "action"
)
/obj/item/integrated_circuit/module
var/obj/item/circuit_component/module/attached_module
/obj/item/integrated_circuit/module/ui_host(mob/user)
. = ..()
if(. == src)
return attached_module
if(attached_module)
return attached_module.ui_host()
return ..()
/obj/item/integrated_circuit/module/set_display_name(new_name)
. = ..()
@@ -296,6 +300,9 @@
#undef WITHIN_RANGE
/obj/item/circuit_component/module/ui_perform_action(mob/user, action)
interact(user)
/obj/item/circuit_component/module/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)