diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index c98998de755..d8fd3ca4bd0 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -585,21 +585,35 @@ if(incapacitated()) return var/input - switch(tgui_alert(usr,"Would you like to select a hologram based on a crew member, an animal, or switch to a unique avatar?",,list("Crew Member","Unique","Animal"))) - if("Crew Member") - var/list/personnel_list = list() + switch(tgui_alert(usr,"Would you like to select a hologram based on a custom character, an animal, or switch to a unique avatar?",,list("Custom Character","Unique","Animal"))) + if("Custom Character") + switch(tgui_alert(usr,"Would you like to base it off of your current character loadout, or a member on station?",,list("My Character","Station Member"))) + if("Station Member") + var/list/personnel_list = list() - for(var/datum/data/record/t in GLOB.data_core.locked)//Look in data core locked. - personnel_list["[t.fields["name"]]: [t.fields["rank"]]"] = t.fields["image"]//Pull names, rank, and image. + for(var/datum/data/record/record_datum in GLOB.data_core.locked)//Look in data core locked. + personnel_list["[record_datum.fields["name"]]: [record_datum.fields["rank"]]"] = record_datum.fields["image"]//Pull names, rank, and image. - if(personnel_list.len) - input = input("Select a crew member:") as null|anything in sort_list(personnel_list) - var/icon/character_icon = personnel_list[input] - if(character_icon) - qdel(holo_icon)//Clear old icon so we're not storing it in memory. - holo_icon = getHologramIcon(icon(character_icon)) - else - tgui_alert(usr,"No suitable records found. Aborting.") + if(personnel_list.len) + input = input("Select a crew member:") as null|anything in sort_list(personnel_list) + var/icon/character_icon = personnel_list[input] + if(character_icon) + qdel(holo_icon)//Clear old icon so we're not storing it in memory. + holo_icon = getHologramIcon(icon(character_icon)) + else + tgui_alert(usr,"No suitable records found. Aborting.") + if("My Character") + switch(tgui_alert(usr,"WARNING: Your AI hologram will take the appearance of your currently selected character ([usr.client.prefs?.read_preference(/datum/preference/name/real_name)]). Are you sure you want to proceed?",,list("Yes","No"))) + if("Yes") + var/mob/living/carbon/human/dummy/ai_dummy = new + var/mutable_appearance/appearance = usr.client.prefs.render_new_preview_appearance(ai_dummy) + var/icon/character_icon = getHologramIcon(getFlatIcon(appearance)) + if(character_icon) + qdel(holo_icon) + qdel(ai_dummy) + holo_icon = character_icon + if("No") + return FALSE if("Animal") var/list/icon_list = list(