From 89a99d78d1df326f082ab3796fa6f28b24592c70 Mon Sep 17 00:00:00 2001 From: TalkingCactus Date: Sun, 9 Apr 2017 05:53:44 -0400 Subject: [PATCH] Adminhelp prompts will now be larger to allow you to proofread large responses and PMs (#345) * bigger box * even bigger well not really, but it's better anyway * fuck i didn't tick these * bigger /me input double emote size as well, stop complaining about cutoffs and don't make me regret this * cleanup --- code/__DEFINES/citadel_defines.dm | 6 +++++- code/modules/admin/topic.dm | 15 +++++++++++++++ code/modules/admin/verbs/adminhelp.dm | 8 ++++---- code/modules/admin/verbs/adminpm.dm | 11 ++++++----- code/modules/mob/say.dm | 7 +++---- 5 files changed, 33 insertions(+), 14 deletions(-) diff --git a/code/__DEFINES/citadel_defines.dm b/code/__DEFINES/citadel_defines.dm index 4c07b1e243..7e8f2d4add 100644 --- a/code/__DEFINES/citadel_defines.dm +++ b/code/__DEFINES/citadel_defines.dm @@ -78,4 +78,8 @@ #define TICKET_ACTIVE "Yes" //Individual logging define -#define INDIVIDUAL_LOOC_LOG "LOOC log" \ No newline at end of file +#define INDIVIDUAL_LOOC_LOG "LOOC log" + +#define ADMIN_MARKREAD(client) "(MARK READ)"//marks an adminhelp as read and under investigation +#define ADMIN_IC(client) "(IC)"//marks and adminhelp as an IC issue +#define ADMIN_REJECT(client) "(REJT)"//Rejects an adminhelp for being unclear or otherwise unhelpful. resets their adminhelp timer \ No newline at end of file diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index a28dfc0dfa..5d701d0384 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -45,6 +45,21 @@ log_admin_private("[key_name(usr)] marked [C.key]'s admin help as an IC issue.") spamcooldown = world.time + 150 // 15 seconds + else if(href_list["markedread"]) + if(world.time && spamcooldown > world.time) + to_chat(usr, "Please wait [max(round((spamcooldown - world.time)*0.1, 0.1), 0)] seconds.") + return + var/client/C = locate(href_list["markedread"]) in clients + if(!C) + return + + var/msg = "Your Adminhelp has been marked as read and is under investigation." + to_chat(C, msg) + + message_admins("[key_name_admin(usr)] marked [C.key]'s admin help as read and under investigation.") + log_admin_private("[key_name(usr)] marked [C.key]'s admin help as read and under investigation.") + spamcooldown = world.time + 150 // 15 seconds + else if(href_list["stickyban"]) stickyban(href_list["stickyban"],href_list) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index d2d85eaab3..57349209de 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -76,7 +76,7 @@ src.verbs |= /client/verb/adminhelp adminhelptimerid = 0 -/client/verb/adminhelp(msg as text) +/client/verb/adminhelp(msg as message) set category = "Admin" set name = "Adminhelp" @@ -94,7 +94,8 @@ //clean the input msg if(!msg) return - msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN)) + var/list/replace_chars = list("\n"=" ","\t"=" ") + msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN),replace_chars) if(!msg) return var/original_msg = msg @@ -107,8 +108,7 @@ if(!mob) return //this doesn't happen - var/ref_client = "\ref[src]" - msg = "HELP: [key_name(src)] [ADMIN_QUE(mob)] [ADMIN_PP(mob)] [ADMIN_VV(mob)] [ADMIN_SM(mob)] [ADMIN_FLW(mob)] [ADMIN_TP(mob)] [ADMIN_SMITE(mob)] (REJT) (IC): [msg]" + msg = "HELP: [key_name(src)] [ADMIN_QUE(mob)] [ADMIN_PP(mob)] [ADMIN_VV(mob)] [ADMIN_SM(mob)] [ADMIN_FLW(mob)] [ADMIN_TP(mob)] [ADMIN_SMITE(mob)] [ADMIN_REJECT(src)] [ADMIN_IC(src)] [ADMIN_MARKREAD(src)]: [msg]" //send this msg to all admins diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 8bc398ea01..b1a609d51f 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -51,8 +51,9 @@ to_chat(src, "Error: Admin-PM: Client not found.") return message_admins("[key_name_admin(src)] has started replying to [key_name(C, 0, 0)]'s admin help.") - var/msg = input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as text|null - if (!msg) + var/list/replace_chars = list("\n"=" ","\t"=" ") + var/msg = copytext(sanitize((input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as message|null), replace_chars), 1, MAX_MESSAGE_LEN) + if (!msg|| msg == " ")//if they hit enter and didn't hit cancel, don't send it message_admins("[key_name_admin(src)] has cancelled their reply to [key_name(C, 0, 0)]'s admin help.") return cmd_admin_pm(whom, msg) @@ -79,7 +80,7 @@ if(!ircreplyamount) //to prevent people from spamming irc return if(!msg) - msg = input(src,"Message:", "Private message to Administrator") as text|null + msg = input(src,"Message:", "Private message to Administrator") as message|null if(!msg) return @@ -98,7 +99,7 @@ //get message text, limit it's length.and clean/escape html if(!msg) - msg = input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as text|null + msg = input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as message|null if(!msg) return @@ -163,7 +164,7 @@ spawn() //so we don't hold the caller proc up var/sender = src var/sendername = key - var/reply = input(C, msg,"Admin PM from-[sendername]", "") as text|null //show message and await a reply + var/reply = input(C, msg,"Admin PM from-[sendername]", "") as message|null //show message and await a reply if(C && reply) if(sender) C.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 065fe5d3f5..f1f178c35d 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -15,16 +15,15 @@ return say(message) //only carbons actually whisper, everything else just talks -/mob/verb/me_verb(message as text) +/mob/verb/me_verb() set name = "Me" set category = "IC" if(say_disabled) //This is here to try to identify lag problems to_chat(usr, "Speech is currently admin-disabled.") return - - message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) - + var/list/replace_chars = list("\n"=" ","\t"=" ") + var/message = copytext(sanitize((input(src,"New lines are handled as spaces","Emote", "") as message|null), replace_chars), 1, (MAX_MESSAGE_LEN*2)) usr.emote("me",1,message) /mob/proc/say_dead(var/message)