diff --git a/code/modules/mob/living/silicon/pai/pai_shell.dm b/code/modules/mob/living/silicon/pai/pai_shell.dm index ca65a416691c..4c477316b940 100644 --- a/code/modules/mob/living/silicon/pai/pai_shell.dm +++ b/code/modules/mob/living/silicon/pai/pai_shell.dm @@ -72,11 +72,18 @@ holoform = FALSE set_resting(resting) + +//Sets a new holochassis skin based on a pAI's choice + /mob/living/silicon/pai/proc/choose_chassis() - if(!isturf(loc) && loc != card) - to_chat(src, "You can not change your holochassis composite while not on the ground or in your card!") - return FALSE - var/choice = input(src, "What would you like to use for your holochassis composite?") as null|anything in sortList(possible_chassis) + var/list/skins = list() + for(var/holochassis_option in possible_chassis) + var/image/item_image = image(icon = src.icon, icon_state = holochassis_option) + skins += list("[holochassis_option]" = item_image) + sortList(skins) + + var/atom/anchor = get_atom_on_turf(src) + var/choice = show_radial_menu(src, anchor, skins, custom_check = CALLBACK(src, .proc/check_menu, anchor), radius = 40, require_near = TRUE) if(!choice) return FALSE chassis = choice @@ -85,6 +92,18 @@ update_resting() to_chat(src, "You switch your holochassis projection composite to [chassis].") +//Checks if we are allowed to interact with a radial menu + +/mob/living/silicon/pai/proc/check_menu(atom/anchor) + if(incapacitated()) + return FALSE + if(get_turf(src) != get_turf(anchor)) + return FALSE + if(!isturf(loc) && loc != card) + to_chat(src, "You can not change your holochassis composite while not on the ground or in your card!") + return FALSE + return TRUE + /mob/living/silicon/pai/update_resting() . = ..() if(resting)