diff --git a/code/_helpers/icons.dm b/code/_helpers/icons.dm index 2a07f2d496d..173b04febd8 100644 --- a/code/_helpers/icons.dm +++ b/code/_helpers/icons.dm @@ -870,14 +870,6 @@ proc/ColorTone(rgb, tone) if(4) I.pixel_y++ overlays += I//And finally add the overlay. -/proc/getHologramIcon(icon/A, safety=1)//If safety is on, a new icon is not created. - var/icon/flat_icon = safety ? A : new(A)//Has to be a new icon to not constantly change the same icon. - flat_icon.ColorTone(rgb(125,180,225))//Let's make it bluish. - flat_icon.ChangeOpacity(0.5)//Make it half transparent. - var/icon/alpha_mask = new('icons/effects/effects.dmi', "scanline")//Scanline effect. - flat_icon.AddAlphaMask(alpha_mask)//Finally, let's mix in a distortion effect. - return flat_icon - //For photo camera. /proc/build_composite_icon(atom/A) var/icon/composite = icon(A.icon, A.icon_state, A.dir, 1) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index a6ce5f9680a..c546fd7a1ea 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -384,7 +384,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ /obj/effect/overlay/hologram/proc/assume_form(var/atom/A) if(isAI(A)) var/mob/living/silicon/ai/AI = A - icon = AI.holo_icon + appearance = AI.holo_icon.appearance else appearance = A.appearance mouse_opacity = 0 //So you can't click on it. diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 542be07bf9e..8e1809a030e 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -54,7 +54,7 @@ var/list/ai_verbs_default = list( var/carded // Holopad and holograms - var/icon/holo_icon + var/mob/holo_icon // an abstract mob used to store icon info var/hologram_follow = TRUE //This is used for the AI eye, to determine if a holopad's hologram should follow it or not // Equipment @@ -136,7 +136,7 @@ var/list/ai_verbs_default = list( canmove = FALSE density = TRUE - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1")) + set_hologram_unique(icon('icons/mob/AI.dmi', "default")) if(L && istype(L, /datum/ai_laws)) laws = L @@ -203,6 +203,7 @@ var/list/ai_verbs_default = list( QDEL_NULL(ai_radio) QDEL_NULL(psupply) QDEL_NULL(ai_camera) + QDEL_NULL(holo_icon) ai_list -= src destroy_eyeobj() return ..() @@ -626,6 +627,7 @@ var/list/ai_verbs_default = list( return //I am the icon meister. Bow fefore me. //>fefore +// now im the icon meister and it's performant lick my nuts fefore - geeves /mob/living/silicon/ai/proc/ai_hologram_change() set name = "Change Hologram" set desc = "Change the default hologram available to AI to something else." @@ -635,64 +637,37 @@ var/list/ai_verbs_default = list( return var/input - if(alert("Would you like to select a hologram based on a crew member or switch to unique avatar?",,"Crew Member","Unique")=="Crew Member") - - var/personnel_list[] = list() - var/current_mobs = list() - - for(var/mob/living/carbon/human/H in human_mob_list) - current_mobs[H.real_name] = H - for(var/datum/record/general/t in SSrecords.records_locked)//Look in data core locked. - personnel_list["[t.name]: [t.rank]"] = t.photo_front //Pull names, rank, and image. - if(current_mobs[t.name]) - personnel_list["[t.name]: [t.rank]"] = list("mob" = current_mobs[t.name], "image" = t.photo_front) - - if(personnel_list.len) - input = input("Select a crew member:") as null|anything in personnel_list - var/selection = personnel_list[input] - var/icon/character_icon - if(selection && istype(selection, /list)) - var/mob/living/carbon/human/H = selection["mob"] - if (H.near_camera()) - character_icon = new('icons/mob/human.dmi', "blank") - for(var/renderdir in cardinal) - character_icon.Insert(getHologramIcon(getFlatIcon(H, renderdir)), dir = renderdir) - else - character_icon = getHologramIcon(icon(selection["image"])) - if(selection && istype(selection, /icon)) - character_icon = getHologramIcon(icon(selection)) - if(character_icon) - qdel(holo_icon) // Clear old icon so we're not storing it in memory. - holo_icon = character_icon + if(alert(usr, "Would you like to select a hologram based on a humanoids within camera view or switch to a unique avatar?",,"Humanoids","Unique") == "Humanoids") + var/list/selectable_humans = list() + for(var/mob/living/carbon/human/H in view(usr.client)) + if(H.near_camera()) + selectable_humans[H.name] = H + if(length(selectable_humans)) + var/chosen_human = input(usr, "Select the humanoid whose form you wish to emulate.", "Hologram Select") as null|anything in selectable_humans + if(!chosen_human) + return + var/mob/living/carbon/human/H = selectable_humans[chosen_human] + holo_icon.appearance = H.appearance else - alert("No suitable records found. Aborting.") - + to_chat(usr, SPAN_WARNING("There are no humanoids within camera view to base your hologram on.")) else - var/icon_list[] = list( - "default", - "floating face", - "carp", - "custom" - ) - input = input("Please select a hologram:") as null|anything in icon_list + input = input("Please select a hologram:") as null|anything in list("default", "floating face", "carp", "custom") if(input) - qdel(holo_icon) - switch(input) - if("default") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1")) - if("floating face") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo2")) - if("carp") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo4")) - if("custom") - if(custom_sprite) - var/datum/custom_synth/sprite = robot_custom_icons[name] - if(istype(sprite) && sprite.synthckey == ckey && sprite.aiholoicon) - holo_icon = getHologramIcon(icon("icons/mob/custom_synths/customhologram.dmi","[sprite.aiholoicon]")) - else - to_chat(src, "You do not have a custom sprite!") - return - return + if(input == "custom") + if(custom_sprite) + var/datum/custom_synth/sprite = robot_custom_icons[name] + if(istype(sprite) && sprite.synthckey == ckey && sprite.aiholoicon) + set_hologram_unique(icon("icons/mob/custom_synths/customhologram.dmi", "[sprite.aiholoicon]")) + else + to_chat(src, SPAN_WARNING("You do not have a custom sprite!")) + else + set_hologram_unique(icon('icons/mob/AI.dmi', input)) + +/mob/living/silicon/ai/proc/set_hologram_unique(var/icon/I) + QDEL_NULL(holo_icon) + holo_icon = new /mob/abstract(src) + holo_icon.invisibility = 0 + holo_icon.icon = I //Toggles the luminosity and applies it by re-entereing the camera. /mob/living/silicon/ai/proc/toggle_camera_light() diff --git a/html/changelogs/geeves-ai_holo_icon.yml b/html/changelogs/geeves-ai_holo_icon.yml new file mode 100644 index 00000000000..8efa098f18c --- /dev/null +++ b/html/changelogs/geeves-ai_holo_icon.yml @@ -0,0 +1,7 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "AI holograms are now visible again." + - tweak: "AI can now set their holograms to be any humanoid within camera view." \ No newline at end of file diff --git a/icons/mob/AI.dmi b/icons/mob/AI.dmi index f364c4ddbd7..24543a22e31 100644 Binary files a/icons/mob/AI.dmi and b/icons/mob/AI.dmi differ