use your custom character as an AI hologram (#62101)

don't mind the slightly different sprites, not included in the PR

adds a new option to the change hologram command in AI commands, allowing you to now select a "custom character" option. this option allows you to either use another station member as a hologram, or use the currently selected character slot as a hologram (will use the preview of the highest job priority. set to assistant to have your loadout used as appearance.)
This commit is contained in:
magatsuchi
2021-10-16 22:20:29 +01:00
committed by GitHub
parent 492dc31d63
commit 05eab1bd26
+27 -13
View File
@@ -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(