forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from Kaostico/extra-vv-options
[MODULAR] Extra VV admin options
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters