mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +01:00
Admin Verb Datums MkIII | Now with functional command bar (#82511)
This commit is contained in:
@@ -13,36 +13,19 @@
|
||||
// We also make SURE to fail loud, IE: if something stops the message from reaching the recipient, the sender HAS to know
|
||||
// If you "refactor" this to make it "cleaner" I will send you to hell
|
||||
|
||||
/// Allows right clicking mobs to send an admin PM to their client, forwards the selected mob's client to cmd_admin_pm
|
||||
/client/proc/cmd_admin_pm_context(mob/M in GLOB.mob_list)
|
||||
set category = null
|
||||
set name = "Admin PM Mob"
|
||||
if(!holder)
|
||||
to_chat(src,
|
||||
type = MESSAGE_TYPE_ADMINPM,
|
||||
html = span_danger("Error: Admin-PM-Context: Only administrators may use this command."),
|
||||
confidential = TRUE)
|
||||
return
|
||||
if(!ismob(M))
|
||||
to_chat(src,
|
||||
ADMIN_VERB_ONLY_CONTEXT_MENU(cmd_admin_pm_context, R_NONE, "Admin PM Mob", mob/target in world)
|
||||
if(!ismob(target))
|
||||
to_chat(
|
||||
src,
|
||||
type = MESSAGE_TYPE_ADMINPM,
|
||||
html = span_danger("Error: Admin-PM-Context: Target mob is not a mob, somehow."),
|
||||
confidential = TRUE)
|
||||
confidential = TRUE,
|
||||
)
|
||||
return
|
||||
cmd_admin_pm(M.client, null)
|
||||
user.cmd_admin_pm(target.client, null)
|
||||
BLACKBOX_LOG_ADMIN_VERB("Admin PM Mob")
|
||||
|
||||
/// Shows a list of clients we could send PMs to, then forwards our choice to cmd_admin_pm
|
||||
/client/proc/cmd_admin_pm_panel()
|
||||
set category = "Admin"
|
||||
set name = "Admin PM"
|
||||
if(!holder)
|
||||
to_chat(src,
|
||||
type = MESSAGE_TYPE_ADMINPM,
|
||||
html = span_danger("Error: Admin-PM-Panel: Only administrators may use this command."),
|
||||
confidential = TRUE)
|
||||
return
|
||||
|
||||
ADMIN_VERB(cmd_admin_pm_panel, R_NONE, "Admin PM", "Show a list of clients to PM", ADMIN_CATEGORY_MAIN)
|
||||
var/list/targets = list()
|
||||
for(var/client/client in GLOB.clients)
|
||||
var/nametag = ""
|
||||
@@ -62,7 +45,7 @@
|
||||
var/target = input(src,"To whom shall we send a message?", "Admin PM", null) as null|anything in sort_list(targets)
|
||||
if (isnull(target))
|
||||
return
|
||||
cmd_admin_pm(targets[target], null)
|
||||
user.cmd_admin_pm(targets[target], null)
|
||||
BLACKBOX_LOG_ADMIN_VERB("Admin PM")
|
||||
|
||||
/// Replys to some existing ahelp, reply to whom, which can be a client or ckey
|
||||
|
||||
Reference in New Issue
Block a user