welp i got lazy
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
// Generates a holoform appearance
|
||||
// Equipment list is slot = path.
|
||||
/proc/generate_custom_holoform_from_prefs(datum/preferences/prefs, filter_type = HOLOFORM_FILTER_AI, list/equipment_by_slot, list/inhand_equipment)
|
||||
/proc/generate_custom_holoform_from_prefs(datum/preferences/prefs, list/equipment_by_slot, list/inhand_equipment, copy_job_first = FALSE)
|
||||
ASSERT(prefs)
|
||||
var/mob/living/carbon/human/dummy/mannequin = generate_or_wait_for_human_dummy(DUMMY_HUMAN_SLOT_HOLOFORM)
|
||||
prefs.copy_to(mannequin)
|
||||
if(copy_job_first)
|
||||
var/datum/job/highest = prefs.get_highest_job()
|
||||
if(highest && !istype(highest, /datum/job/ai) && !istype(highest, /datum/job/cyborg))
|
||||
highest.equip(mannequin, TRUE, preference_source = prefs)
|
||||
|
||||
if(length(equipment_by_slot))
|
||||
LAZYINITLIST(spawned)
|
||||
for(var/slot in equipment_by_slot)
|
||||
@@ -14,12 +19,11 @@
|
||||
for(var/path in inhand_equipment)
|
||||
var/obj/item/I = new path
|
||||
mannequin.equip_to_slot_if_possible(I, SLOT_IN_HANDS, TRUE, TRUE, TRUE, TRUE)
|
||||
var/icon/result = get_custom_holoform_icon(mannequin, filter_type)
|
||||
var/icon/result = getFlatIcon(mannequin)
|
||||
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_HOLOFORM)
|
||||
return result
|
||||
|
||||
/proc/get_custom_holoform_icon(atom/A, filter_type)
|
||||
var/icon/I = getFlatIcon(A)
|
||||
/proc/process_holoform_icon_filter(icon/I, filter_type)
|
||||
switch(filter_type)
|
||||
if(HOLOFORM_FILTER_AI)
|
||||
I = getHologramIcon(I)
|
||||
@@ -30,7 +34,7 @@
|
||||
return I
|
||||
|
||||
//Errors go to user.
|
||||
/proc/generate_custom_holoform_from_prefs_safe(datum/preferences/prefs, filter_type, list/equipment_by_slot, list/inhand_equipment, mob/user)
|
||||
/proc/generate_custom_holoform_from_prefs_safe(datum/preferences/prefs, list/equipment_by_slot, list/inhand_equipment, mob/user, copy_job_first = FALSE)
|
||||
if(user)
|
||||
if(user.prefs.last_custom_holoform < world.time + CUSTOM_HOLOFORM_DELAY)
|
||||
return
|
||||
@@ -59,10 +63,11 @@
|
||||
inhand_equipment -= slot
|
||||
to_chat(user, "<span class='boldwarning'>[path] is not an allowed path and has been removed.</span>")
|
||||
continue
|
||||
return generate_custom_holoform_from_prefs(prefs, filter_type, equipment_by_slot, inhand_equipment)
|
||||
return generate_custom_holoform_from_prefs(prefs, equipment_by_slot, inhand_equipment, copy_job_first)
|
||||
|
||||
//Prompts this client for custom holoform parameters.
|
||||
/proc/user_interface_custom_holoform(client/C)
|
||||
var/datum/preferences/target_prefs = C.prefs
|
||||
ASSERT(target_prefs)
|
||||
|
||||
//In the future, maybe add custom path allowances a la admin create outfit but for now..
|
||||
return generate_custom_holoform_from_prefs_safe(target_prefs, null, null, C.mob, TRUE)
|
||||
|
||||
Reference in New Issue
Block a user