From 78939aec9efd04d8d5751811efefcc8453ed2cd4 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Thu, 14 Sep 2017 18:34:55 -0400 Subject: [PATCH 1/6] NonPublicAdminEvents --- code/modules/admin/admin_verbs.dm | 1 + code/modules/admin/verbs/custom_event.dm | 43 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 004cf77a990..399248d2f7a 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -108,6 +108,7 @@ var/list/admin_verbs_event = list( /client/proc/toggle_random_events, /client/proc/toggle_ert_calling, /client/proc/cmd_admin_change_custom_event, + /client/proc/cmd_admin_custom_event_info, /datum/admins/proc/access_news_network, /*allows access of newscasters*/ /client/proc/cmd_admin_direct_narrate, /*send text directly to a player with no padding. Useful for narratives and fluff-text*/ /client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/ diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index 68d3301b11e..40f5bf8eefb 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -38,3 +38,46 @@ to_chat(src, "

A custom event is taking place. OOC Info:

") to_chat(src, "[html_encode(custom_event_msg)]") to_chat(src, "
") + +//admin event info to be view by admins + +/client/proc/cmd_admin_custom_event_info() + set category = "Event" + set name = "Change Custom Admin Event Info" + + if(!holder) + to_chat(src, "Only administrators may use this command.") + return + + var/input = input(usr, "Enter the description of the custom event. This is informations for admins only. Use it to notify other admins of event info but not players.", "Custom Event Info", custom_event_msg) as message|null + if(!input || input == "") + custom_event_msg = null + log_admin("[key_name(usr)] has cleared the custom admin event info text.") + message_admins("[key_name_admin(usr)] has cleared the custom admin event text.") + return + + log_admin("[key_name(usr)] has changed the custom admin event info text.") + message_admins("[key_name_admin(usr)] has changed the custom admin event info text.") + + custom_event_msg = input + + for(var/client/X in admins) + if(check_rights(R_EVENT,0,X.mob)) + to_chat(X, "

Custom Admin Event Info

") + to_chat(X, "

A custom event is starting. OOC Admin Info:

") + to_chat(X, "[html_encode(custom_event_msg)]") + to_chat(X,"
") + +/client/verb/cmd_view_custom_event_info() + set category = "Event" + set name = "Custom Event Admin Info" + + if(!custom_event_msg || custom_event_msg == "") + to_chat(src, "There currently is no known custom admin event taking place.") + to_chat(src, "Keep in mind: it is possible that an admin has not properly set this.") + return + + to_chat(src, "

Custom Event Info

") + to_chat(src, "

A custom event is taking place. OOC Info:

") + to_chat(src, "[html_encode(custom_event_msg)]") + to_chat(src, "
") From a4c516c94305f7ea4f0cd81e77dd2646792cbcf2 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Thu, 14 Sep 2017 19:04:13 -0400 Subject: [PATCH 2/6] tiger pointed outglaring errors --- code/_globalvars/game_modes.dm | 3 ++- code/modules/admin/admin_verbs.dm | 1 + code/modules/admin/verbs/custom_event.dm | 17 ++++++++++------- code/modules/client/client procs.dm | 2 ++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/code/_globalvars/game_modes.dm b/code/_globalvars/game_modes.dm index 16e54703cf4..6ea7cc1d8ed 100644 --- a/code/_globalvars/game_modes.dm +++ b/code/_globalvars/game_modes.dm @@ -4,4 +4,5 @@ var/secret_force_mode = "secret" // if this is anything but "secret", the secret var/wavesecret = 0 // meteor mode, delays wave progression, terrible name var/datum/station_state/start_state = null // Used in round-end report -var/custom_event_msg = null \ No newline at end of file +var/custom_event_msg = null +var/custom_event_admin_msg = null \ No newline at end of file diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 399248d2f7a..e89d333771e 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -109,6 +109,7 @@ var/list/admin_verbs_event = list( /client/proc/toggle_ert_calling, /client/proc/cmd_admin_change_custom_event, /client/proc/cmd_admin_custom_event_info, + /client/proc/cmd_view_custom_event_info, /datum/admins/proc/access_news_network, /*allows access of newscasters*/ /client/proc/cmd_admin_direct_narrate, /*send text directly to a player with no padding. Useful for narratives and fluff-text*/ /client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/ diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index 40f5bf8eefb..e72423b9405 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -51,7 +51,7 @@ var/input = input(usr, "Enter the description of the custom event. This is informations for admins only. Use it to notify other admins of event info but not players.", "Custom Event Info", custom_event_msg) as message|null if(!input || input == "") - custom_event_msg = null + custom_event_admin_msg = null log_admin("[key_name(usr)] has cleared the custom admin event info text.") message_admins("[key_name_admin(usr)] has cleared the custom admin event text.") return @@ -59,25 +59,28 @@ log_admin("[key_name(usr)] has changed the custom admin event info text.") message_admins("[key_name_admin(usr)] has changed the custom admin event info text.") - custom_event_msg = input + custom_event_admin_msg = input for(var/client/X in admins) if(check_rights(R_EVENT,0,X.mob)) to_chat(X, "

Custom Admin Event Info

") to_chat(X, "

A custom event is starting. OOC Admin Info:

") - to_chat(X, "[html_encode(custom_event_msg)]") + to_chat(X, "[html_encode(custom_event_admin_msg)]") to_chat(X,"
") -/client/verb/cmd_view_custom_event_info() +/client/proc/cmd_view_custom_event_info() set category = "Event" set name = "Custom Event Admin Info" - if(!custom_event_msg || custom_event_msg == "") + if(!holder) + to_chat(src, "Only administrators may use this command.") + return + + if(!custom_event_admin_msg || custom_event_admin_msg == "") to_chat(src, "There currently is no known custom admin event taking place.") - to_chat(src, "Keep in mind: it is possible that an admin has not properly set this.") return to_chat(src, "

Custom Event Info

") to_chat(src, "

A custom event is taking place. OOC Info:

") - to_chat(src, "[html_encode(custom_event_msg)]") + to_chat(src, "[html_encode(custom_event_admin_msg)]") to_chat(src, "
") diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 00402f2deb6..fd6dd8ad215 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -436,6 +436,8 @@ on_holder_add() add_admin_verbs() admin_memo_output("Show", 0, 1) + if(custom_event_admin_msg && custom_event_admin_msg != "") + cmd_view_custom_event_info() // Forcibly enable hardware-accelerated graphics, as we need them for the lighting overlays. // (but turn them off first, since sometimes BYOND doesn't turn them on properly otherwise) From 29a98fb8b2ef1cb0b645e801ec1db1df3bc3875d Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Fri, 15 Sep 2017 17:50:13 -0400 Subject: [PATCH 3/6] perm check --- code/modules/client/client procs.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index fd6dd8ad215..2720f8086d0 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -436,7 +436,7 @@ on_holder_add() add_admin_verbs() admin_memo_output("Show", 0, 1) - if(custom_event_admin_msg && custom_event_admin_msg != "") + if(custom_event_admin_msg && custom_event_admin_msg != "" && check_rights(R_EVENT)) cmd_view_custom_event_info() // Forcibly enable hardware-accelerated graphics, as we need them for the lighting overlays. From 548ca4c307615aa5c08d584169ad204c109dbaf7 Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Fri, 29 Sep 2017 19:06:18 -0400 Subject: [PATCH 4/6] fix tweak --- code/modules/admin/verbs/custom_event.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index e72423b9405..7568a9c69df 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -45,7 +45,7 @@ set category = "Event" set name = "Change Custom Admin Event Info" - if(!holder) + if(!holder && check_rights(R_EVENT)) to_chat(src, "Only administrators may use this command.") return @@ -72,7 +72,7 @@ set category = "Event" set name = "Custom Event Admin Info" - if(!holder) + if(!holder && check_rights(R_EVENT)) to_chat(src, "Only administrators may use this command.") return From a608d42d2226a9c52435d95f2a9fc6144c1416eb Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Fri, 29 Sep 2017 19:20:51 -0400 Subject: [PATCH 5/6] durrrr --- code/modules/admin/verbs/custom_event.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index 7568a9c69df..4c0a48c7071 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -45,7 +45,7 @@ set category = "Event" set name = "Change Custom Admin Event Info" - if(!holder && check_rights(R_EVENT)) + if(check_rights(R_EVENT)) to_chat(src, "Only administrators may use this command.") return @@ -72,7 +72,7 @@ set category = "Event" set name = "Custom Event Admin Info" - if(!holder && check_rights(R_EVENT)) + if(check_rights(R_EVENT)) to_chat(src, "Only administrators may use this command.") return From 80bda7038315189a31d938c8d0b4bc3d5e0edade Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Fri, 29 Sep 2017 23:57:19 -0400 Subject: [PATCH 6/6] i am stupid --- code/modules/admin/verbs/custom_event.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index 4c0a48c7071..546955136f7 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -45,7 +45,7 @@ set category = "Event" set name = "Change Custom Admin Event Info" - if(check_rights(R_EVENT)) + if(!check_rights(R_EVENT)) to_chat(src, "Only administrators may use this command.") return @@ -72,7 +72,7 @@ set category = "Event" set name = "Custom Event Admin Info" - if(check_rights(R_EVENT)) + if(!check_rights(R_EVENT)) to_chat(src, "Only administrators may use this command.") return