diff --git a/code/__DEFINES/vv.dm b/code/__DEFINES/vv.dm index 0fece21cca3..83d61072b5a 100644 --- a/code/__DEFINES/vv.dm +++ b/code/__DEFINES/vv.dm @@ -73,6 +73,7 @@ #define VV_HK_EXPOSE "expose" #define VV_HK_CALLPROC "proc_call" #define VV_HK_MARK "mark" +#define VV_HK_ADDCOMPONENT "addcomponent" #define VV_HK_MODIFY_TRAITS "modtraits" // /atom @@ -120,7 +121,3 @@ // misc #define VV_HK_SPACEVINE_PURGE "spacevine_purge" - - - - diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index dc545c9f7b0..4b887f3eb43 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -29,6 +29,7 @@ VV_DROPDOWN_OPTION(VV_HK_MARK, "Mark Object") VV_DROPDOWN_OPTION(VV_HK_DELETE, "Delete") VV_DROPDOWN_OPTION(VV_HK_EXPOSE, "Show VV To Player") + VV_DROPDOWN_OPTION(VV_HK_ADDCOMPONENT, "Add 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! diff --git a/code/modules/admin/view_variables/topic_basic.dm b/code/modules/admin/view_variables/topic_basic.dm index 2a0f3d7302f..5a8c08f4cbe 100644 --- a/code/modules/admin/view_variables/topic_basic.dm +++ b/code/modules/admin/view_variables/topic_basic.dm @@ -47,5 +47,32 @@ usr.client.debug_variables(src) if(href_list[VV_HK_MARK]) usr.client.mark_datum(target) + if(href_list[VV_HK_ADDCOMPONENT]) + if(!check_rights(NONE)) + return + var/list/names = list() + var/list/componentsubtypes = subtypesof(/datum/component) + names += "---Components---" + names += componentsubtypes + names += "---Elements---" + names += subtypesof(/datum/element) + var/result = input(usr, "Choose a component/element to add","better know what ur fuckin doin pal") as null|anything in names + if(!usr || !result || result == "---Components---" || result == "---Elements---") + return + if(QDELETED(src)) + to_chat(usr, "That thing doesn't exist anymore!") + return + var/list/lst = get_callproc_args() + if(!lst) + return + var/datumname = "error" + if(result in componentsubtypes) + datumname = "component" + target.AddComponent(result, lst) + else + datumname = "element" + target.AddElement(result, lst) + log_admin("[key_name(usr)] has added [result] [datumname] to [key_name(src)].") + message_admins("[key_name_admin(usr)] has added [result] [datumname] to [key_name_admin(src)].") if(href_list[VV_HK_CALLPROC]) usr.client.callproc_datum(target)