Skip to content

Commit

Permalink
Merge pull request #93 from Kaostico/extra-vv-options
Browse files Browse the repository at this point in the history
[MODULAR] Extra VV admin options
  • Loading branch information
carpotoxin authored Sep 24, 2024
2 parents f177afb + ba12eb9 commit 62e04a6
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/~doppler_defines/vv.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define VV_HK_SEND_CRYO "send_to_cryo"
#define VV_HK_LOAD_PREFS "load_prefs"
61 changes: 61 additions & 0 deletions modular_doppler/administration/code/extra_vv.dm
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 62e04a6

Please sign in to comment.