diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 285bc8ea8ac..86bc426af60 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1453,3 +1453,10 @@ var/global/enabled_spooking = 0 to_world(FONT_LARGE(EXAMINE_BLOCK_ODYSSEY(SPAN_NOTICE("The scenario canonicity has been changed to [SPAN_BOLD(canonicity)] by an administrator.")))) log_and_message_admins("has set the Odyssey canonicity to [canonicity]", usr) feedback_add_details("admin_verb","SEOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + +/datum/admins/proc/open_narrate_panel() + set category = "Special Verbs.Narration/Messaging" + set name = "Narrate Panel" + + var/datum/tgui_module/narrate_panel/NP = new /datum/tgui_module/narrate_panel(usr) + NP.ui_interact(usr) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 080c60966ce..528a490c641 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -106,7 +106,8 @@ GLOBAL_LIST_INIT(admin_verbs_admin, list( /client/proc/toggle_aooc, /client/proc/force_away_mission, /client/proc/alooc, - /client/proc/create_portal + /client/proc/create_portal, + /datum/admins/proc/open_narrate_panel )) GLOBAL_LIST_INIT(admin_verbs_ban, list( @@ -430,6 +431,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list( /client/proc/force_away_mission, /client/proc/profiler_start, /client/proc/create_portal, + /datum/admins/proc/open_narrate_panel )) GLOBAL_LIST_INIT(admin_verbs_mod, list( diff --git a/code/modules/nano/modules/narrate_panel.dm b/code/modules/nano/modules/narrate_panel.dm index 03bc127bc02..6f91eea21eb 100644 --- a/code/modules/nano/modules/narrate_panel.dm +++ b/code/modules/nano/modules/narrate_panel.dm @@ -16,49 +16,50 @@ if(.) return - var/mob/abstract/ghost/ghost = ui.user - if(!istype(ghost)) + var/mob/abstract/ghost/narrate_user = ui.user + var/is_admin = check_rights(R_ADMIN, user = ui.user) + if(!istype(narrate_user) && !is_admin) return FALSE if(action == "narrate") var/narrate_text = sanitizeSafe(params["narrate_text"]) if(!length(narrate_text)) - to_chat(ghost, SPAN_WARNING("No text was supplied!")) + to_chat(narrate_user, SPAN_WARNING("No text was supplied!")) return FALSE var/narrate_style = params["narrate_style"] if(!narrate_style) - to_chat(ghost, SPAN_WARNING("No text style was supplied!")) + to_chat(narrate_user, SPAN_WARNING("No text style was supplied!")) return FALSE var/narrate_size = text2num(params["narrate_size"]) if(!isnum(narrate_size)) - to_chat(ghost, SPAN_WARNING("No text size was supplied!")) + to_chat(narrate_user, SPAN_WARNING("No text size was supplied!")) return FALSE var/narrate_range = text2num(params["narrate_range"]) if(!isnum(narrate_range)) - to_chat(ghost, SPAN_WARNING("No narrate range was supplied!")) + to_chat(narrate_user, SPAN_WARNING("No narrate range was supplied!")) return FALSE var/narrate_location = params["narrate_location"] if(!narrate_location) - to_chat(ghost, SPAN_WARNING("No narrate location was supplied!")) + to_chat(narrate_user, SPAN_WARNING("No narrate location was supplied!")) return FALSE var/list/mobs_to_message = list() switch(narrate_location) if("View") - for(var/mob/M in get_hearers_in_view(narrate_range, ghost)) + for(var/mob/M in get_hearers_in_view(narrate_range, narrate_user)) mobs_to_message |= M if("Range") - for(var/mob/M in get_hearers_in_range(narrate_range, ghost)) + for(var/mob/M in get_hearers_in_range(narrate_range, narrate_user)) mobs_to_message |= M if("Z-Level") for(var/mob/M in GLOB.player_list) - if(GET_Z(M) == ghost.z) + if(GET_Z(M) == narrate_user.z) mobs_to_message |= M if("Global") diff --git a/html/changelogs/mattatlas-adminstorynarrate.yml b/html/changelogs/mattatlas-adminstorynarrate.yml new file mode 100644 index 00000000000..2f6da3b52de --- /dev/null +++ b/html/changelogs/mattatlas-adminstorynarrate.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - admin: "Added the Storyteller narrate panel for admins."