From e5ee36c182ac6e25d9db381bc04028a726338874 Mon Sep 17 00:00:00 2001 From: Linzolle Date: Fri, 12 Aug 2022 14:11:03 -0700 Subject: [PATCH 1/2] add radial menu to organ manip --- code/modules/surgery/organ_manipulation.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 4104f0ce7f..695eda7d47 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -114,11 +114,13 @@ to_chat(user, "There are no removable organs in [target]'s [parse_zone(target_zone)]!") return -1 else + var/list/choices = list() for(var/obj/item/organ/O in organs) O.on_find(user) organs -= O organs[O.name] = O - I = input("Remove which organ?", "Surgery", null, null) as null|anything in organs + choices[O.name] = image(icon = O.icon, icon_state = O.icon_state) + I = show_radial_menu(user, target, choices, require_near = TRUE, tooltips = TRUE) if(I && user && target && user.Adjacent(target) && user.get_active_held_item() == tool) I = organs[I] if(!I) From ee3ced89efb11a062d28601b1696709c114350ae Mon Sep 17 00:00:00 2001 From: Linzolle Date: Fri, 12 Aug 2022 14:27:12 -0700 Subject: [PATCH 2/2] less list instantiation man good --- code/modules/surgery/organ_manipulation.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 695eda7d47..fb18d6d155 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -114,13 +114,11 @@ to_chat(user, "There are no removable organs in [target]'s [parse_zone(target_zone)]!") return -1 else - var/list/choices = list() for(var/obj/item/organ/O in organs) O.on_find(user) organs -= O organs[O.name] = O - choices[O.name] = image(icon = O.icon, icon_state = O.icon_state) - I = show_radial_menu(user, target, choices, require_near = TRUE, tooltips = TRUE) + I = show_radial_menu(user, target, organs, require_near = TRUE, tooltips = TRUE) if(I && user && target && user.Adjacent(target) && user.get_active_held_item() == tool) I = organs[I] if(!I)