From 5bc7c5a44875b230e594d2ead6b3cd0c08bea498 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 30 Dec 2020 02:21:30 +0000 Subject: [PATCH] revert --- code/__HELPERS/custom_holoforms.dm | 8 ++++++ .../mob/living/silicon/custom_holoform.dm | 27 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/code/__HELPERS/custom_holoforms.dm b/code/__HELPERS/custom_holoforms.dm index 34b31cc1c7..2733a97e14 100644 --- a/code/__HELPERS/custom_holoforms.dm +++ b/code/__HELPERS/custom_holoforms.dm @@ -72,3 +72,11 @@ 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(target_prefs, null, null, TRUE, TRUE) + +//Errors go to user. +/proc/generate_custom_holoform_from_prefs_safe(datum/preferences/prefs, mob/user) + if(user) + if(user.client.prefs.last_custom_holoform > world.time - CUSTOM_HOLOFORM_DELAY) + to_chat(user, "You are attempting to set your custom holoform too fast!") + return + return generate_custom_holoform_from_prefs(prefs, null, null, TRUE, TRUE) diff --git a/code/modules/mob/living/silicon/custom_holoform.dm b/code/modules/mob/living/silicon/custom_holoform.dm index e4f7f6780b..e7070e4576 100644 --- a/code/modules/mob/living/silicon/custom_holoform.dm +++ b/code/modules/mob/living/silicon/custom_holoform.dm @@ -1,3 +1,30 @@ +/mob/living/silicon/verb/clear_custom_holoform() + set name = "Clear Custom Holoform" + set desc = "Clear your current custom holoform" + set category = "OOC" + if(!client.prefs) + to_chat(src, "No preferences datum on your client, contact an admin/coder!") + return + client.prefs.custom_holoform_icon = null + client.prefs.cached_holoform_icons = null + to_chat(src, "Holoform removed.") + +/mob/living/silicon/verb/set_custom_holoform() + set name = "Set Custom Holoform" + set desc = "Set your custom holoform using your current preferences slot and a specified set of gear." + if(!client.prefs) + to_chat(src, "No preferences datum on your client, contact an admin/coder!") + return + if(client.prefs.last_custom_holoform > world.time - CUSTOM_HOLOFORM_DELAY) + to_chat(src, "You are attempting to change custom holoforms too fast!") + + var/icon/new_holoform = user_interface_custom_holoform(client) + if(new_holoform) + client.prefs.custom_holoform_icon = new_holoform + client.prefs.cached_holoform_icons = null + client.prefs.last_custom_holoform = world.time + to_chat(src, "Holoform set.") + /mob/living/silicon/proc/attempt_set_custom_holoform() if(!client.prefs) to_chat(src, "No preferences datum on your client, contact an admin/coder!")