From ba12eb935eec6bfa3605152ce1caf78a31b3d014 Mon Sep 17 00:00:00 2001 From: Kaostico Date: Tue, 24 Sep 2024 01:21:33 -0300 Subject: [PATCH] Ported extra vv options --- code/__DEFINES/~doppler_defines/vv.dm | 2 + .../administration/code/extra_vv.dm | 61 +++++++++++++++++++ tgstation.dme | 2 + 3 files changed, 65 insertions(+) create mode 100644 code/__DEFINES/~doppler_defines/vv.dm create mode 100644 modular_doppler/administration/code/extra_vv.dm diff --git a/code/__DEFINES/~doppler_defines/vv.dm b/code/__DEFINES/~doppler_defines/vv.dm new file mode 100644 index 0000000000000..bb0c3cde26b30 --- /dev/null +++ b/code/__DEFINES/~doppler_defines/vv.dm @@ -0,0 +1,2 @@ +#define VV_HK_SEND_CRYO "send_to_cryo" +#define VV_HK_LOAD_PREFS "load_prefs" diff --git a/modular_doppler/administration/code/extra_vv.dm b/modular_doppler/administration/code/extra_vv.dm new file mode 100644 index 0000000000000..6053bcb791fd6 --- /dev/null +++ b/modular_doppler/administration/code/extra_vv.dm @@ -0,0 +1,61 @@ +/** + * EXTRA MOB VV + */ +/mob/vv_get_dropdown() + . = ..() + VV_DROPDOWN_OPTION(VV_HK_SEND_CRYO, "Send to Cryogenic Storage") + VV_DROPDOWN_OPTION(VV_HK_LOAD_PREFS, "Load Prefs Onto Mob") + +/mob/vv_do_topic(list/href_list) + . = ..() + if(href_list[VV_HK_SEND_CRYO]) + vv_send_cryo() + + + if(href_list[VV_HK_LOAD_PREFS]) + vv_load_prefs() + +/** + * Sends said person to a cryopod. + */ +/mob/proc/vv_send_cryo() + if(!check_rights(R_SPAWN)) + return + + var/send_notice = tgui_alert(usr, "Add a paper notice about sending [name] into a cryopod?", "Leave a paper?", list("Yes", "No", "Cancel")) + if(send_notice != "Yes" && send_notice != "No") + return + + //log/message + to_chat(usr, "Put [src] in cryopod.") + log_admin("[key_name(usr)] has put [key_name(src)] into a cryopod.") + var/msg = span_notice("[key_name_admin(usr)] has put [key_name(src)] into a cryopod from [ADMIN_VERBOSEJMP(src)].") + message_admins(msg) + admin_ticket_log(src, msg) + + send_notice = send_notice == "Yes" + send_to_cryo(send_notice) + +/** + * Overrides someones mob with their loaded prefs. + */ +/mob/proc/vv_load_prefs() + if(!check_rights(R_ADMIN)) + return + + if(!client) + to_chat(usr, span_warning("No client found!")) + return + + if(!ishuman(src)) + to_chat(usr, span_warning("Mob is not human!")) + return + + var/notice = tgui_alert(usr, "Are you sure you want to load the clients current prefs onto their mob?", "Load Preferences", list("Yes", "No")) + if(notice != "Yes") + return + + client?.prefs?.apply_prefs_to(src) + var/msg = span_notice("[key_name_admin(usr)] has loaded [key_name(src)]'s preferences onto their current mob [ADMIN_VERBOSEJMP(src)].") + message_admins(msg) + admin_ticket_log(src, msg) diff --git a/tgstation.dme b/tgstation.dme index 09977718f4ce6..9e6266fcc7707 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -434,6 +434,7 @@ #include "code\__DEFINES\~doppler_defines\techweb_nodes.dm" #include "code\__DEFINES\~doppler_defines\text.dm" #include "code\__DEFINES\~doppler_defines\traits.dm" +#include "code\__DEFINES\~doppler_defines\vv.dm" #include "code\__DEFINES\~doppler_defines\wounds.dm" #include "code\__HELPERS\_auxtools_api.dm" #include "code\__HELPERS\_dreamluau.dm" @@ -6453,6 +6454,7 @@ #include "modular_doppler\accessable_storage\accessable_storage.dm" #include "modular_doppler\accessable_storage\item.dm" #include "modular_doppler\accessable_storage\strippable.dm" +#include "modular_doppler\administration\code\extra_vv.dm" #include "modular_doppler\administration\code\preferences.dm" #include "modular_doppler\administration\code\whitelisting.dm" #include "modular_doppler\advanced_reskin\code\advanced_reskin.dm"