diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index e909c23bb90..b775b948c87 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -11,6 +11,9 @@ #define isweakref(D) (istype(D, /datum/weakref)) +GLOBAL_VAR_INIT(magic_appearance_detecting_image, new /image) // appearances are awful to detect safely, but this seems to be the best way ~ninjanomnom +#define isappearance(thing) (!ispath(thing) && istype(GLOB.magic_appearance_detecting_image, thing)) + #define isgenerator(A) (istype(A, /generator)) //Turfs diff --git a/code/datums/armor/_armor.dm b/code/datums/armor/_armor.dm index c6dbf1d5fdd..bfd15af4189 100644 --- a/code/datums/armor/_armor.dm +++ b/code/datums/armor/_armor.dm @@ -62,6 +62,7 @@ GLOBAL_LIST_INIT(armor_by_type, generate_armor_type_cache()) return FALSE /datum/armor/vv_get_dropdown() + SHOULD_CALL_PARENT(FALSE) return list("", "MUST MODIFY ARMOR VALUES ON THE PARENT ATOM") /datum/armor/CanProcCall(procname) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index b8f26a89b3c..aeea8b22cba 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -4,7 +4,8 @@ /datum/proc/can_vv_get(var_name) return TRUE -/datum/proc/vv_edit_var(var_name, var_value) //called whenever a var is edited +/// Called when a var is edited with the new value to change to +/datum/proc/vv_edit_var(var_name, var_value) if(var_name == NAMEOF(src, vars)) return FALSE vars[var_name] = var_value @@ -20,9 +21,14 @@ /datum/proc/can_vv_mark() return TRUE -//please call . = ..() first and append to the result, that way parent items are always at the top and child items are further down -//add separaters by doing . += "---" +/** + * Gets all the dropdown options in the vv menu. + * When overriding, make sure to call . = ..() first and appent to the result, that way parent items are always at the top and child items are further down. + * Add seperators by doing VV_DROPDOWN_OPTION("", "---") + */ /datum/proc/vv_get_dropdown() + SHOULD_CALL_PARENT(TRUE) + . = list() VV_DROPDOWN_OPTION("", "---") VV_DROPDOWN_OPTION(VV_HK_CALLPROC, "Call Proc") @@ -35,9 +41,11 @@ VV_DROPDOWN_OPTION(VV_HK_MASS_REMOVECOMPONENT, "Mass Remove Component/Element") VV_DROPDOWN_OPTION(VV_HK_MODIFY_TRAITS, "Modify Traits") -//This proc is only called if everything topic-wise is verified. The only verifications that should happen here is things like permission checks! -//href_list is a reference, modifying it in these procs WILL change the rest of the proc in topic.dm of admin/view_variables! -//This proc is for "high level" actions like admin heal/set species/etc/etc. The low level debugging things should go in admin/view_variables/topic_basic.dm incase this runtimes. +/** + * This proc is only called if everything topic-wise is verified. The only verifications that should happen here is things like permission checks! + * href_list is a reference, modifying it in these procs WILL change the rest of the proc in topic.dm of admin/view_variables! + * This proc is for "high level" actions like admin heal/set species/etc/etc. The low level debugging things should go in admin/view_variables/topic_basic.dm incase this runtimes. + */ /datum/proc/vv_do_topic(list/href_list) if(!usr || !usr.client || !usr.client.holder || !check_rights(NONE)) return FALSE //This is VV, not to be called by anything else. diff --git a/code/modules/admin/view_variables/debug_variables.dm b/code/modules/admin/view_variables/debug_variables.dm index 230a0e46284..5196d83b124 100644 --- a/code/modules/admin/view_variables/debug_variables.dm +++ b/code/modules/admin/view_variables/debug_variables.dm @@ -41,6 +41,10 @@ item = "[name_part] = /icon ([value])" #endif + else if(isappearance(value)) + var/image/actually_an_appearance = value + item = "[name_part] = /appearance ([actually_an_appearance.icon])" + else if (isfile(value)) item = "[name_part] = '[value]'" @@ -55,6 +59,7 @@