From 66e719846a61eb843bff2ed18d149c91a1d0b3ee Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:29:19 +0300 Subject: [PATCH] [MIRROR] Admin Verb Datums MkIII | Now with functional command bar (#2902) * [MIRROR] Admin Verb Datums MkIII | Now with functional command bar (#1950) * Admin Verb Datums MkIII | Now with functional command bar * Update subsystems.dm * EASY FIXES The rest of these are.....uhhhhhhhhh * Update fix_air.dm * Converts our verbs to macros * Update tools.dm --------- Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> * mc resolve * admin verb added --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Co-authored-by: Iajret --- .vscode/settings.json | 2 + code/__DEFINES/_protect.dm | 3 +- code/__DEFINES/admin.dm | 3 +- code/__DEFINES/admin_verb.dm | 92 ++ code/__DEFINES/subsystems.dm | 3 +- code/__HELPERS/hallucinations.dm | 8 +- code/_onclick/hud/movable_screen_objects.dm | 26 +- code/controllers/admin.dm | 25 +- code/controllers/subsystem/admin_verbs.dm | 150 +++ code/controllers/subsystem/explosions.dm | 17 +- code/controllers/subsystem/mapping.dm | 26 +- code/controllers/subsystem/weather.dm | 12 +- code/datums/brain_damage/imaginary_friend.dm | 4 +- code/datums/components/puzzgrid.dm | 13 +- code/datums/keybinding/admin.dm | 12 +- code/datums/station_traits/admin_panel.dm | 8 +- code/game/atom/atom_vv.dm | 8 +- code/game/objects/objs.dm | 4 +- code/modules/admin/admin.dm | 45 +- code/modules/admin/admin_fax_panel.dm | 31 +- code/modules/admin/admin_investigate.dm | 15 +- code/modules/admin/admin_pda_message.dm | 10 +- code/modules/admin/admin_verbs.dm | 967 ++++-------------- code/modules/admin/callproc/callproc.dm | 40 +- code/modules/admin/force_event.dm | 10 +- code/modules/admin/known_alts.dm | 7 +- code/modules/admin/outfit_manager.dm | 30 +- code/modules/admin/painting_manager.dm | 11 +- code/modules/admin/permissionedit.dm | 10 +- code/modules/admin/stickyban.dm | 9 +- code/modules/admin/tag.dm | 21 +- code/modules/admin/topic.dm | 126 +-- code/modules/admin/trophy_manager.dm | 11 +- .../admin/verb_datums/_admin_verb_datum.dm | 27 + .../admin/verb_datums/_admin_verb_holder.dm | 0 code/modules/admin/verbs/SDQL2/SDQL_2.dm | 15 +- code/modules/admin/verbs/admin.dm | 83 +- code/modules/admin/verbs/admin_newscaster.dm | 15 +- code/modules/admin/verbs/adminevents.dm | 320 ++---- code/modules/admin/verbs/adminfun.dm | 155 +-- code/modules/admin/verbs/admingame.dm | 301 +++--- code/modules/admin/verbs/adminjump.dm | 172 ++-- code/modules/admin/verbs/adminpm.dm | 35 +- code/modules/admin/verbs/adminsay.dm | 32 +- code/modules/admin/verbs/atmosdebug.dm | 24 +- code/modules/admin/verbs/beakerpanel.dm | 11 +- code/modules/admin/verbs/borgpanel.dm | 21 +- .../admin/verbs/change_shuttle_events.dm | 23 +- code/modules/admin/verbs/cinematic.dm | 18 +- code/modules/admin/verbs/commandreport.dm | 27 +- code/modules/admin/verbs/config_helpers.dm | 21 +- code/modules/admin/verbs/deadsay.dm | 35 +- code/modules/admin/verbs/debug.dm | 540 ++++------ code/modules/admin/verbs/diagnostics.dm | 58 +- code/modules/admin/verbs/ert.dm | 18 +- code/modules/admin/verbs/fix_air.dm | 35 +- code/modules/admin/verbs/fov.dm | 12 +- code/modules/admin/verbs/fps.dm | 19 +- code/modules/admin/verbs/getlogs.dm | 18 +- .../admin/verbs/ghost_pool_protection.dm | 9 +- code/modules/admin/verbs/lawpanel.dm | 18 +- code/modules/admin/verbs/lua/lua_editor.dm | 10 +- code/modules/admin/verbs/machine_upgrade.dm | 16 +- code/modules/admin/verbs/manipulate_organs.dm | 29 +- code/modules/admin/verbs/map_export.dm | 29 +- .../admin/verbs/map_template_loadverb.dm | 46 +- code/modules/admin/verbs/mapping.dm | 274 ++--- code/modules/admin/verbs/maprotation.dm | 49 +- code/modules/admin/verbs/panicbunker.dm | 26 +- .../admin/verbs/player_ticket_history.dm | 9 +- code/modules/admin/verbs/playsound.dm | 112 +- code/modules/admin/verbs/possess.dm | 28 +- .../admin/verbs/reestablish_db_connection.dm | 20 +- code/modules/admin/verbs/requests.dm | 9 +- code/modules/admin/verbs/secrets.dm | 23 +- code/modules/admin/verbs/selectequipment.dm | 14 +- code/modules/admin/verbs/server.dm | 275 ++--- code/modules/admin/verbs/shuttlepanel.dm | 12 +- code/modules/admin/verbs/spawnobjasmob.dm | 83 +- code/modules/admin/verbs/special_verbs.dm | 43 + .../admin/view_variables/mark_datum.dm | 6 +- .../modules/admin/view_variables/tag_datum.dm | 6 +- .../admin/view_variables/topic_basic.dm | 3 +- .../admin/view_variables/view_variables.dm | 4 + .../antagonists/traitor/balance_helper.dm | 10 +- .../pipes/pipe_spritesheet_helper.dm | 5 +- code/modules/cargo/centcom_podlauncher.dm | 7 +- code/modules/client/client_procs.dm | 74 +- code/modules/client/verbs/ooc.dm | 25 +- code/modules/explorer_drone/manager.dm | 9 +- code/modules/fishing/admin.dm | 12 +- code/modules/logging/log_holder.dm | 6 +- .../modules/mob/dead/observer/observer_say.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 4 +- code/modules/mob/living/living_say.dm | 4 +- code/modules/mob/mob.dm | 40 +- .../procedural_mapping/mapGenerator.dm | 34 +- .../reagents/chemistry/chem_wiki_render.dm | 19 +- code/modules/requests/request_manager.dm | 23 +- code/modules/tgui_input/say_modal/speech.dm | 2 +- code/modules/transport/admin.dm | 53 +- code/modules/wiremod/core/admin_panel.dm | 10 +- code/modules/wiremod/core/duplicator.dm | 20 +- .../master_files/code/modules/admin/admin.dm | 5 +- modular_nova/modules/admin/code/aooc.dm | 4 +- modular_nova/modules/admin/code/fix_chat.dm | 3 +- modular_nova/modules/admin/code/loud_say.dm | 16 +- .../modules/admin/code/player_ranks.dm | 35 +- modular_nova/modules/admin/code/sooc.dm | 4 +- .../automapper/code/area_spawn_subsystem.dm | 6 +- .../modules/bsa_overhaul/code/admin_verb.dm | 8 +- .../decay_subsystem/code/spawn_nest.dm | 8 +- .../delam_emergency_stop/code/admin_scram.dm | 26 +- .../modules/events/code/event_spawner_menu.dm | 8 +- .../modules/ices_events/code/ICES_tgui.dm | 10 +- .../code/interaction_datum.dm | 8 +- .../code/liquid_systems/liquid_controller.dm | 7 +- modular_nova/modules/liquids/code/tools.dm | 30 +- .../modules/lorecaster/code/story_manager.dm | 7 +- .../oneclickantag/code/oneclickantag.dm | 10 +- .../opposing_force/code/admin_procs.dm | 12 +- .../modules/panicbunker/code/panicbunker.dm | 11 +- .../pollution/code/admin_spawn_pollution.dm | 14 +- .../modules/server_overflow/code/chat_link.dm | 16 +- .../code/title_screen_controls.dm | 48 +- tff_modular/modules/blooper/bark.dm | 4 +- tgstation.dme | 5 + 127 files changed, 2013 insertions(+), 3600 deletions(-) create mode 100644 code/__DEFINES/admin_verb.dm create mode 100644 code/controllers/subsystem/admin_verbs.dm create mode 100644 code/modules/admin/verb_datums/_admin_verb_datum.dm create mode 100644 code/modules/admin/verb_datums/_admin_verb_holder.dm create mode 100644 code/modules/admin/verbs/special_verbs.dm diff --git a/.vscode/settings.json b/.vscode/settings.json index d7c1bfc1d1e..0ef2ce67760 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,6 +13,8 @@ }, "files.eol": "\n", "files.insertFinalNewline": true, + "files.trimTrailingWhitespace": true, + "editor.insertSpaces": false, "git.branchProtection": ["master"], "gitlens.advanced.blame.customArguments": ["-w"], "tgstationTestExplorer.project.resultsType": "json", diff --git a/code/__DEFINES/_protect.dm b/code/__DEFINES/_protect.dm index 9152cfcb570..a1202ebaf32 100644 --- a/code/__DEFINES/_protect.dm +++ b/code/__DEFINES/_protect.dm @@ -11,7 +11,7 @@ return FALSE;\ }\ ##Path/Read(savefile/savefile){\ - qdel(src);\ + del(src);\ }\ ##Path/Write(savefile/savefile){\ return;\ @@ -19,3 +19,4 @@ #else #define GENERAL_PROTECT_DATUM(Path) #endif +// we del instead of qdel because for security reasons we must ensure the datum does not exist if Read is called. qdel will not enforce this. diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index c7274638e79..19b76a4c991 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -26,6 +26,8 @@ #define BANTYPE_ANY_JOB 9 //Admin Permissions +/// Used for signifying that all admins can use this regardless of actual permissions +#define R_NONE NONE #define R_BUILD (1<<0) #define R_ADMIN (1<<1) #define R_BAN (1<<2) @@ -177,4 +179,3 @@ GLOBAL_VAR_INIT(ghost_role_flags, ALL) /// Used in logging uses of admin verbs (and sometimes some non-admin or debug verbs) to the blackbox /// Only pass it a string key, the verb being used. #define BLACKBOX_LOG_ADMIN_VERB(the_verb) SSblackbox.record_feedback("tally", "admin_verb", 1, the_verb) - diff --git a/code/__DEFINES/admin_verb.dm b/code/__DEFINES/admin_verb.dm new file mode 100644 index 00000000000..cbf856bf436 --- /dev/null +++ b/code/__DEFINES/admin_verb.dm @@ -0,0 +1,92 @@ +/client/CanProcCall(procname) + if(findtext(procname, "__avd_") == 1) + message_admins("[key_name_admin(usr)] attempted to directly call admin verb '[procname]'.") + log_admin("[key_name(usr)] attempted to directly call admin verb '[procname]'.") + return FALSE + return ..() + +/** + * This is the only macro you should use to define admin verbs. + * It will define the verb and the verb holder for you. + * Using it is very simple: + * ADMIN_VERB(verb_path, R_PERM, "Name", "Description", "Admin.Category", args...) + * This sets up all of the above and also acts as syntatic sugar as a verb delcaration for the verb itself. + * Note that the verb args have an injected `client/user` argument that is the user that called the verb. + * Do not use usr in your verb; technically you can but I'll kill you. + */ +#define _ADMIN_VERB(verb_path_name, verb_permissions, verb_name, verb_desc, verb_category, show_in_context_menu, verb_args...) \ +/datum/admin_verb/##verb_path_name \ +{ \ + name = ##verb_name; \ + description = ##verb_desc; \ + category = ##verb_category; \ + permissions = ##verb_permissions; \ + verb_path = /client/proc/__avd_##verb_path_name; \ +}; \ +/client/proc/__avd_##verb_path_name(##verb_args) \ +{ \ + set name = ##verb_name; \ + set desc = ##verb_desc; \ + set hidden = FALSE; /* this is explicitly needed as the proc begins with an underscore */ \ + set popup_menu = ##show_in_context_menu; \ + set category = ##verb_category; \ + var/list/_verb_args = list(usr, /datum/admin_verb/##verb_path_name); \ + _verb_args += args; \ + SSadmin_verbs.dynamic_invoke_verb(arglist(_verb_args)); \ +}; \ +/datum/admin_verb/##verb_path_name/__avd_do_verb(client/user, ##verb_args) + +#define ADMIN_VERB(verb_path_name, verb_permissions, verb_name, verb_desc, verb_category, verb_args...) \ +_ADMIN_VERB(verb_path_name, verb_permissions, verb_name, verb_desc, verb_category, FALSE, ##verb_args) + +#define ADMIN_VERB_ONLY_CONTEXT_MENU(verb_path_name, verb_permissions, verb_name, verb_args...) \ +_ADMIN_VERB(verb_path_name, verb_permissions, verb_name, ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, TRUE, ##verb_args) + +#define ADMIN_VERB_AND_CONTEXT_MENU(verb_path_name, verb_permissions, verb_name, verb_desc, verb_category, verb_args...) \ +_ADMIN_VERB(verb_path_name, verb_permissions, verb_name, verb_desc, verb_category, TRUE, ##verb_args) + +/// Used to define a special check to determine if the admin verb should exist at all. Useful for verbs such as play sound which require configuration. +#define ADMIN_VERB_CUSTOM_EXIST_CHECK(verb_path_name) \ +/datum/admin_verb/##verb_path_name/__avd_check_should_exist() + +/// Used to define the visibility flag of the verb. If the admin does not have this flag enabled they will not see the verb. +#define ADMIN_VERB_VISIBILITY(verb_path_name, verb_visibility) /datum/admin_verb/##verb_path_name/visibility_flag = ##verb_visibility + +// These are put here to prevent the "procedure override precedes definition" error. +/datum/admin_verb/proc/__avd_get_verb_path() + CRASH("__avd_get_verb_path not defined. use the macro") +/datum/admin_verb/proc/__avd_do_verb(...) + CRASH("__avd_do_verb not defined. use the macro") +/datum/admin_verb/proc/__avd_check_should_exist() + return TRUE + +/* + * This is an example of how to use the above macro: + * ``` + * ADMIN_VERB(name_of_verb, R_ADMIN, "Verb Name", "Verb Desc", "Verb Category", mob/target in world) + * to_chat(user, "Hello!") + * ``` + * Note the implied `client/user` argument that is injected into the verb. + * Also note that byond is shit and you cannot multi-line the macro call. + */ + +/// Use this to mark your verb as not having a description. Should ONLY be used if you are also hiding the verb! +#define ADMIN_VERB_NO_DESCRIPTION "" +/// Used to verbs you do not want to show up in the master verb panel. +#define ADMIN_CATEGORY_HIDDEN null + +// Admin verb categories +#define ADMIN_CATEGORY_MAIN "Admin" +#define ADMIN_CATEGORY_EVENTS "Admin.Events" +#define ADMIN_CATEGORY_FUN "Admin.Fun" +#define ADMIN_CATEGORY_GAME "Admin.Game" + +// Special categories that are seperated +#define ADMIN_CATEGORY_DEBUG "Debug" +#define ADMIN_CATEGORY_SERVER "Server" +#define ADMIN_CATEGORY_OBJECT "Object" +#define ADMIN_CATEGORY_MAPPING "Mapping" +#define ADMIN_CATEGORY_PROFILE "Profile" + +// Visibility flags +#define ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG "Map-Debug" diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index c4a96d3db97..f667fa8e2df 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -136,8 +136,9 @@ #define INIT_ORDER_DBCORE 95 #define INIT_ORDER_BLACKBOX 94 #define INIT_ORDER_SERVER_MAINT 93 +#define INIT_ORDER_PLAYER_RANKS 86 // NOVA EDIT ADDITION - Player Ranks Subsystem #define INIT_ORDER_INPUT 85 -#define INIT_ORDER_PLAYER_RANKS 84 // NOVA EDIT - Player Ranks Subsystem +#define INIT_ORDER_ADMIN_VERBS 84 // needs to be pretty high, admins cant do much without it #define INIT_ORDER_SOUNDS 83 #define INIT_ORDER_INSTRUMENTS 82 #define INIT_ORDER_GREYSCALE 81 diff --git a/code/__HELPERS/hallucinations.dm b/code/__HELPERS/hallucinations.dm index 525114cea28..1eeab08d876 100644 --- a/code/__HELPERS/hallucinations.dm +++ b/code/__HELPERS/hallucinations.dm @@ -113,11 +113,7 @@ GLOBAL_LIST_INIT(random_hallucination_weighted_list, generate_hallucination_weig to_chat(usr, span_boldnotice("The total weight of the hallucination weighted list is [total_weight].")) return total_weight -/// Debug verb for getting the weight of each distinct type within the random_hallucination_weighted_list -/client/proc/debug_hallucination_weighted_list_per_type() - set name = "Show Hallucination Weights" - set category = "Debug" - +ADMIN_VERB(debug_hallucination_weighted_list_per_type, R_DEBUG, "Show Hallucination Weights", "View the weight of each hallucination subtype in the random weighted list.", ADMIN_CATEGORY_DEBUG) var/header = "Type Weight Percent" var/total_weight = debug_hallucination_weighted_list() @@ -153,7 +149,7 @@ GLOBAL_LIST_INIT(random_hallucination_weighted_list, generate_hallucination_weig var/page_style = "" var/page_contents = "[page_style][header][jointext(assoc_to_keys(all_weights), "")]
" - var/datum/browser/popup = new(mob, "hallucinationdebug", "Hallucination Weights", 600, 400) + var/datum/browser/popup = new(user.mob, "hallucinationdebug", "Hallucination Weights", 600, 400) popup.set_content(page_contents) popup.open() diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index b1f40f76294..e0a6c6873bd 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -44,40 +44,30 @@ offset[2] += y_off return offset_to_screen_loc(offset[1], offset[2], our_client?.view) -//Debug procs -/client/proc/test_movable_UI() - set category = "Debug" - set name = "Spawn Movable UI Object" - - var/atom/movable/screen/movable/M = new() +ADMIN_VERB(test_movable_UI, R_DEBUG, "Spawn Movable UI Object", "Spawn a movable UI object for testing.", ADMIN_CATEGORY_DEBUG) + var/atom/movable/screen/movable/M = new M.name = "Movable UI Object" M.icon_state = "block" M.maptext = MAPTEXT("Movable") M.maptext_width = 64 - var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") as text|null + var/screen_l = input(user, "Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") as text|null if(!screen_l) return M.screen_loc = screen_l + user.screen += M - screen += M - - -/client/proc/test_snap_UI() - set category = "Debug" - set name = "Spawn Snap UI Object" - - var/atom/movable/screen/movable/snap/S = new() +ADMIN_VERB(test_snap_ui, R_DEBUG, "Spawn Snap UI Object", "Spawn a snap UI object for testing.", ADMIN_CATEGORY_DEBUG) + var/atom/movable/screen/movable/snap/S = new S.name = "Snap UI Object" S.icon_state = "block" S.maptext = MAPTEXT("Snap") S.maptext_width = 64 - var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") as text|null + var/screen_l = input(user,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") as text|null if(!screen_l) return S.screen_loc = screen_l - - screen += S + user.screen += S diff --git a/code/controllers/admin.dm b/code/controllers/admin.dm index 421712d5ad4..5056e3804ef 100644 --- a/code/controllers/admin.dm +++ b/code/controllers/admin.dm @@ -44,15 +44,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick) usr.client.debug_variables(target) message_admins("Admin [key_name_admin(usr)] is debugging the [target] [class].") - -// Debug verbs. -/client/proc/restart_controller(controller in list("Master", "Failsafe")) - set category = "Debug" - set name = "Restart Controller" - set desc = "Restart one of the various periodic loop controllers for the game (be careful!)" - - if(!holder) - return +ADMIN_VERB(restart_controller, R_DEBUG, "Restart Controller", "Restart one of the various periodic loop controllers for the game (be careful!)", ADMIN_CATEGORY_DEBUG, controller in list("Master", "Failsafe")) switch(controller) if("Master") Recreate_MC() @@ -61,16 +53,9 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick) new /datum/controller/failsafe() BLACKBOX_LOG_ADMIN_VERB("Restart Failsafe Controller") - message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.") - -/client/proc/debug_controller() - set category = "Debug" - set name = "Debug Controller" - set desc = "Debug the various periodic loop controllers for the game (be careful!)" - - if(!holder) - return + message_admins("Admin [key_name_admin(user)] has restarted the [controller] controller.") +ADMIN_VERB(debug_controller, R_DEBUG, "Debug Controller", "Debug the various periodic loop controllers for the game (be careful!)", ADMIN_CATEGORY_DEBUG) var/list/controllers = list() var/list/controller_choices = list() @@ -85,7 +70,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick) if (!istype(controller)) return - debug_variables(controller) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/debug_variables, controller) BLACKBOX_LOG_ADMIN_VERB("Debug Controller") - message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.") + message_admins("Admin [key_name_admin(user)] is debugging the [controller] controller.") diff --git a/code/controllers/subsystem/admin_verbs.dm b/code/controllers/subsystem/admin_verbs.dm new file mode 100644 index 00000000000..9496b95d998 --- /dev/null +++ b/code/controllers/subsystem/admin_verbs.dm @@ -0,0 +1,150 @@ +GENERAL_PROTECT_DATUM(/datum/controller/subsystem/admin_verbs) + +SUBSYSTEM_DEF(admin_verbs) + name = "Admin Verbs" + flags = SS_NO_FIRE + init_order = INIT_ORDER_ADMIN_VERBS + /// A list of all admin verbs indexed by their type. + var/list/datum/admin_verb/admin_verbs_by_type = list() + /// A list of all admin verbs indexed by their visibility flag. + var/list/list/datum/admin_verb/admin_verbs_by_visibility_flag = list() + /// A map of all assosciated admins and their visibility flags. + var/list/admin_visibility_flags = list() + /// A list of all admins that are pending initialization of this SS. + var/list/admins_pending_subsytem_init = list() + +/datum/controller/subsystem/admin_verbs/Initialize() + setup_verb_list() + process_pending_admins() + return SS_INIT_SUCCESS + +/datum/controller/subsystem/admin_verbs/Recover() + admin_verbs_by_type = SSadmin_verbs.admin_verbs_by_type + +/datum/controller/subsystem/admin_verbs/stat_entry(msg) + return "[..()] | V: [length(admin_verbs_by_type)]" + +/datum/controller/subsystem/admin_verbs/proc/process_pending_admins() + var/list/pending_admins = admins_pending_subsytem_init + admins_pending_subsytem_init = null + for(var/admin_ckey in pending_admins) + assosciate_admin(GLOB.directory[admin_ckey]) + +/datum/controller/subsystem/admin_verbs/proc/setup_verb_list() + if(length(admin_verbs_by_type)) + CRASH("Attempting to setup admin verbs twice!") + for(var/datum/admin_verb/verb_type as anything in subtypesof(/datum/admin_verb)) + var/datum/admin_verb/verb_singleton = new verb_type + if(!verb_singleton.__avd_check_should_exist()) + qdel(verb_singleton, force = TRUE) + continue + + admin_verbs_by_type[verb_type] = verb_singleton + if(verb_singleton.visibility_flag) + if(!(verb_singleton.visibility_flag in admin_verbs_by_visibility_flag)) + admin_verbs_by_visibility_flag[verb_singleton.visibility_flag] = list() + admin_verbs_by_visibility_flag[verb_singleton.visibility_flag] |= list(verb_singleton) + +/datum/controller/subsystem/admin_verbs/proc/get_valid_verbs_for_admin(client/admin) + if(isnull(admin.holder)) + CRASH("Why are we checking a non-admin for their valid... ahem... admin verbs?") + + var/list/has_permission = list() + for(var/permission_flag in GLOB.bitflags) + if(admin.holder.check_for_rights(permission_flag)) + has_permission["[permission_flag]"] = TRUE + + var/list/valid_verbs = list() + for(var/datum/admin_verb/verb_type as anything in admin_verbs_by_type) + var/datum/admin_verb/verb_singleton = admin_verbs_by_type[verb_type] + if(!verify_visibility(admin, verb_singleton)) + continue + + var/verb_permissions = verb_singleton.permissions + if(verb_permissions == R_NONE) + valid_verbs |= list(verb_singleton) + else for(var/permission_flag in bitfield_to_list(verb_permissions)) + if(!has_permission["[permission_flag]"]) + continue + valid_verbs |= list(verb_singleton) + + return valid_verbs + +/datum/controller/subsystem/admin_verbs/proc/verify_visibility(client/admin, datum/admin_verb/verb_singleton) + var/needed_flag = verb_singleton.visibility_flag + return !needed_flag || (needed_flag in admin_visibility_flags[admin.ckey]) + +/datum/controller/subsystem/admin_verbs/proc/update_visibility_flag(client/admin, flag, state) + if(state) + admin_visibility_flags[admin.ckey] |= list(flag) + assosciate_admin(admin) + return + + admin_visibility_flags[admin.ckey] -= list(flag) + // they lost the flag, iterate over verbs with that flag and yoink em + for(var/datum/admin_verb/verb_singleton as anything in admin_verbs_by_visibility_flag[flag]) + verb_singleton.unassign_from_client(admin) + admin.init_verbs() + +/datum/controller/subsystem/admin_verbs/proc/dynamic_invoke_verb(client/admin, datum/admin_verb/verb_type, ...) + if(IsAdminAdvancedProcCall()) + message_admins("PERMISSION ELEVATION: [key_name_admin(admin)] attempted to dynamically invoke admin verb '[verb_type]'.") + return + + if(ismob(admin)) + var/mob/mob = admin + admin = mob.client + + if(!ispath(verb_type, /datum/admin_verb) || verb_type == /datum/admin_verb) + CRASH("Attempted to dynamically invoke admin verb with invalid typepath '[verb_type]'.") + if(isnull(admin.holder)) + CRASH("Attempted to dynamically invoke admin verb '[verb_type]' with a non-admin.") + + var/list/verb_args = args.Copy() + verb_args.Cut(2, 3) + var/datum/admin_verb/verb_singleton = admin_verbs_by_type[verb_type] // this cannot be typed because we need to use `:` + if(isnull(verb_singleton)) + CRASH("Attempted to dynamically invoke admin verb '[verb_type]' that doesn't exist.") + + if(!admin.holder.check_for_rights(verb_singleton.permissions)) + to_chat(admin, span_adminnotice("You lack the permissions to do this.")) + return + + var/old_usr = usr + usr = admin.mob + // THE MACRO ENSURES THIS EXISTS. IF IT EVER DOESNT EXIST SOMEONE DIDNT USE THE DAMN MACRO! + verb_singleton.__avd_do_verb(arglist(verb_args)) + usr = old_usr + SSblackbox.record_feedback("tally", "dynamic_admin_verb_invocation", 1, "[verb_type]") + +/** + * Assosciates and/or resyncs an admin with their accessible admin verbs. + */ +/datum/controller/subsystem/admin_verbs/proc/assosciate_admin(client/admin) + if(IsAdminAdvancedProcCall()) + return + + if(!isnull(admins_pending_subsytem_init)) // if the list exists we are still initializing + to_chat(admin, span_big(span_green("Admin Verbs are still initializing. Please wait and you will be automatically assigned your verbs when it is complete."))) + admins_pending_subsytem_init |= list(admin.ckey) + return + + // refresh their verbs + admin_visibility_flags[admin.ckey] ||= list() + for(var/datum/admin_verb/verb_singleton as anything in get_valid_verbs_for_admin(admin)) + verb_singleton.assign_to_client(admin) + admin.init_verbs() + +/** + * Unassosciates an admin from their admin verbs. + * Goes over all admin verbs because we don't know which ones are assigned to the admin's mob without a bunch of extra bookkeeping. + * This might be a performance issue in the future if we have a lot of admin verbs. + */ +/datum/controller/subsystem/admin_verbs/proc/deassosciate_admin(client/admin) + if(IsAdminAdvancedProcCall()) + return + + UnregisterSignal(admin, COMSIG_CLIENT_MOB_LOGIN) + for(var/datum/admin_verb/verb_type as anything in admin_verbs_by_type) + admin_verbs_by_type[verb_type].unassign_from_client(admin) + admin_visibility_flags -= list(admin.ckey) diff --git a/code/controllers/subsystem/explosions.dm b/code/controllers/subsystem/explosions.dm index ec6a00badcb..6cd4fb54d2a 100644 --- a/code/controllers/subsystem/explosions.dm +++ b/code/controllers/subsystem/explosions.dm @@ -87,12 +87,9 @@ SUBSYSTEM_DEF(explosions) throwturf -= T held_throwturf -= T -/client/proc/check_bomb_impacts() - set name = "Check Bomb Impact" - set category = "Debug" - - var/newmode = tgui_alert(usr, "Use reactionary explosions?","Check Bomb Impact", list("Yes", "No")) - var/turf/epicenter = get_turf(mob) +ADMIN_VERB(check_bomb_impacts, R_DEBUG, "Check Bomb Impact", "See what the effect of a bomb would be.", ADMIN_CATEGORY_DEBUG) + var/newmode = tgui_alert(user, "Use reactionary explosions?","Check Bomb Impact", list("Yes", "No")) + var/turf/epicenter = get_turf(user.mob) if(!epicenter) return @@ -100,7 +97,7 @@ SUBSYSTEM_DEF(explosions) var/heavy = 0 var/light = 0 var/list/choices = list("Small Bomb","Medium Bomb","Big Bomb","Custom Bomb") - var/choice = tgui_input_list(usr, "Pick the bomb size", "Bomb Size?", choices) + var/choice = tgui_input_list(user, "Pick the bomb size", "Bomb Size?", choices) switch(choice) if(null) return 0 @@ -117,9 +114,9 @@ SUBSYSTEM_DEF(explosions) heavy = 5 light = 7 if("Custom Bomb") - dev = input("Devastation range (Tiles):") as num - heavy = input("Heavy impact range (Tiles):") as num - light = input("Light impact range (Tiles):") as num + dev = input(user, "Devastation range (Tiles):") as num + heavy = input(user, "Heavy impact range (Tiles):") as num + light = input(user, "Light impact range (Tiles):") as num var/max_range = max(dev, heavy, light) var/x0 = epicenter.x diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index 7dd40a87a50..ca753a05321 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -651,46 +651,38 @@ GLOBAL_LIST_EMPTY(the_station_areas) holodeck_templates[holo_template.template_id] = holo_template -//Manual loading of away missions. -/client/proc/admin_away() - set name = "Load Away Mission" - set category = "Admin.Events" - - if(!holder || !check_rights(R_FUN)) - return - - +ADMIN_VERB(load_away_mission, R_FUN, "Load Away Mission", "Load a specific away mission for the station.", ADMIN_CATEGORY_EVENTS) if(!GLOB.the_gateway) - if(tgui_alert(usr, "There's no home gateway on the station. You sure you want to continue ?", "Uh oh", list("Yes", "No")) != "Yes") + if(tgui_alert(user, "There's no home gateway on the station. You sure you want to continue ?", "Uh oh", list("Yes", "No")) != "Yes") return var/list/possible_options = GLOB.potentialRandomZlevels + "Custom" var/away_name var/datum/space_level/away_level var/secret = FALSE - if(tgui_alert(usr, "Do you want your mission secret? (This will prevent ghosts from looking at your map in any way other than through a living player's eyes.)", "Are you $$$ekret?", list("Yes", "No")) == "Yes") + if(tgui_alert(user, "Do you want your mission secret? (This will prevent ghosts from looking at your map in any way other than through a living player's eyes.)", "Are you $$$ekret?", list("Yes", "No")) == "Yes") secret = TRUE - var/answer = input("What kind?","Away") as null|anything in possible_options + var/answer = input(user, "What kind?","Away") as null|anything in possible_options switch(answer) if("Custom") - var/mapfile = input("Pick file:", "File") as null|file + var/mapfile = input(user, "Pick file:", "File") as null|file if(!mapfile) return away_name = "[mapfile] custom" - to_chat(usr,span_notice("Loading [away_name]...")) + to_chat(user,span_notice("Loading [away_name]...")) var/datum/map_template/template = new(mapfile, "Away Mission") away_level = template.load_new_z(secret) else if(answer in GLOB.potentialRandomZlevels) away_name = answer - to_chat(usr,span_notice("Loading [away_name]...")) + to_chat(user,span_notice("Loading [away_name]...")) var/datum/map_template/template = new(away_name, "Away Mission") away_level = template.load_new_z(secret) else return - message_admins("Admin [key_name_admin(usr)] has loaded [away_name] away mission.") - log_admin("Admin [key_name(usr)] has loaded [away_name] away mission.") + message_admins("Admin [key_name_admin(user)] has loaded [away_name] away mission.") + log_admin("Admin [key_name(user)] has loaded [away_name] away mission.") if(!away_level) message_admins("Loading [away_name] failed!") return diff --git a/code/controllers/subsystem/weather.dm b/code/controllers/subsystem/weather.dm index 78c99f47903..b8496a623eb 100644 --- a/code/controllers/subsystem/weather.dm +++ b/code/controllers/subsystem/weather.dm @@ -86,15 +86,9 @@ SUBSYSTEM_DEF(weather) /datum/controller/subsystem/weather/proc/get_weather_by_type(type) return locate(type) in processing -/** - * Calls end() on all current weather effects that are currently processing in the weather subsystem. - */ -/client/proc/stop_weather() - set category = "Debug" - set name = "Stop All Active Weather" - - log_admin("[key_name(src)] stopped all currently active weather.") - message_admins("[key_name_admin(src)] stopped all currently active weather.") +ADMIN_VERB(stop_weather, R_DEBUG|R_ADMIN, "Stop All Active Weather", "Stop all currently active weather.", ADMIN_CATEGORY_DEBUG) + log_admin("[key_name(user)] stopped all currently active weather.") + message_admins("[key_name_admin(user)] stopped all currently active weather.") for(var/datum/weather/current_weather as anything in SSweather.processing) if(current_weather in SSweather.processing) current_weather.end() diff --git a/code/datums/brain_damage/imaginary_friend.dm b/code/datums/brain_damage/imaginary_friend.dm index 18ca8172968..e3891392d1a 100644 --- a/code/datums/brain_damage/imaginary_friend.dm +++ b/code/datums/brain_damage/imaginary_friend.dm @@ -217,11 +217,11 @@ message = capitalize(message) if(message_mods[RADIO_EXTENSION] == MODE_ADMIN) - client?.cmd_admin_say(message) + SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/cmd_admin_say, message) return if(message_mods[RADIO_EXTENSION] == MODE_DEADMIN) - client?.dsay(message) + SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/dsay, message) return if(check_emote(message, forced)) diff --git a/code/datums/components/puzzgrid.dm b/code/datums/components/puzzgrid.dm index e91bcdb3002..d7e264f651f 100644 --- a/code/datums/components/puzzgrid.dm +++ b/code/datums/components/puzzgrid.dm @@ -280,12 +280,7 @@ var/list/answers = list() var/description -/// Debug verb for validating that all puzzgrids can be created successfully. -/// Locked behind a verb because it's fairly slow and memory intensive. -/client/proc/validate_puzzgrids() - set name = "Validate Puzzgrid Config" - set category = "Debug" - +ADMIN_VERB(validate_puzzgrids, R_DEBUG, "Validate Puzzgrid Config", "Validate the puzzgrid config to ensure it's set up correctly.", ADMIN_CATEGORY_DEBUG) var/line_number = 0 for (var/line in world.file2list(PUZZGRID_CONFIG)) @@ -296,16 +291,16 @@ var/line_json_decoded = safe_json_decode(line) if (isnull(line_json_decoded)) - to_chat(src, span_warning("Line [line_number] in puzzgrids.txt is not a JSON: [line]")) + to_chat(user, span_warning("Line [line_number] in puzzgrids.txt is not a JSON: [line]")) continue var/datum/puzzgrid/puzzgrid = new var/populate_result = puzzgrid.populate(line_json_decoded) if (populate_result != TRUE) - to_chat(src, span_warning("Line [line_number] in puzzgrids.txt is not formatted correctly: [populate_result]")) + to_chat(user, span_warning("Line [line_number] in puzzgrids.txt is not formatted correctly: [populate_result]")) - to_chat(src, span_notice("Validated. If you did not see any errors, you're in the clear.")) + to_chat(user, span_notice("Validated. If you did not see any errors, you're in the clear.")) #undef PUZZGRID_CONFIG #undef PUZZGRID_GROUP_COUNT diff --git a/code/datums/keybinding/admin.dm b/code/datums/keybinding/admin.dm index 80936aa41e7..1e94f71e58a 100644 --- a/code/datums/keybinding/admin.dm +++ b/code/datums/keybinding/admin.dm @@ -23,7 +23,7 @@ . = ..() if(.) return - user.admin_ghost() + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/admin_ghost) return TRUE /datum/keybinding/admin/player_panel_new @@ -51,7 +51,7 @@ . = ..() if(.) return - user.togglebuildmodeself() + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/build_mode_self) return TRUE /datum/keybinding/admin/stealthmode @@ -65,7 +65,7 @@ . = ..() if(.) return - user.stealth() + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/stealth) return TRUE /datum/keybinding/admin/invisimin @@ -79,7 +79,7 @@ . = ..() if(.) return - user.invisimin() + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/invisimin) return TRUE /datum/keybinding/admin/deadsay @@ -107,7 +107,7 @@ . = ..() if(.) return - user.deadmin() + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/deadmin) return TRUE /datum/keybinding/admin/readmin @@ -135,5 +135,5 @@ . = ..() if(.) return - user.holder?.display_tags() + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/display_tags) return TRUE diff --git a/code/datums/station_traits/admin_panel.dm b/code/datums/station_traits/admin_panel.dm index 02eca48b54f..67669027c54 100644 --- a/code/datums/station_traits/admin_panel.dm +++ b/code/datums/station_traits/admin_panel.dm @@ -1,10 +1,6 @@ -/// Opens the station traits admin panel -/datum/admins/proc/station_traits_panel() - set name = "Modify Station Traits" - set category = "Admin.Events" - +ADMIN_VERB(station_traits_panel, R_FUN, "Modify Station Traits", "Modify the station traits for the next round.", ADMIN_CATEGORY_EVENTS) var/static/datum/station_traits_panel/station_traits_panel = new - station_traits_panel.ui_interact(usr) + station_traits_panel.ui_interact(user.mob) /datum/station_traits_panel var/static/list/future_traits diff --git a/code/game/atom/atom_vv.dm b/code/game/atom/atom_vv.dm index 8830a4af2f4..10a6cbff24a 100644 --- a/code/game/atom/atom_vv.dm +++ b/code/game/atom/atom_vv.dm @@ -67,14 +67,10 @@ message_admins(span_notice("[key_name(usr)] has added [amount] units of [chosen_id] to [src]")) if(href_list[VV_HK_TRIGGER_EXPLOSION]) - if(!check_rights(R_FUN)) - return - usr.client.cmd_admin_explosion(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/admin_explosion, src) if(href_list[VV_HK_TRIGGER_EMP]) - if(!check_rights(R_FUN)) - return - usr.client.cmd_admin_emp(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/admin_emp, src) if(href_list[VV_HK_SHOW_HIDDENPRINTS]) if(!check_rights(R_ADMIN)) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 71bc78fa4c4..b6946dffc9a 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -147,9 +147,7 @@ GLOBAL_LIST_EMPTY(objects_by_id_tag) return if(href_list[VV_HK_OSAY]) - if(!check_rights(R_FUN, FALSE)) - return - usr.client.object_say(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/object_say, src) if(href_list[VV_HK_MASS_DEL_TYPE]) if(!check_rights(R_DEBUG|R_SERVER)) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 99aa63325ad..10b9a58b870 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -48,14 +48,9 @@ ////////////////////////////////////////////////////////////////////////////////////////////////ADMIN HELPER PROCS -/datum/admins/proc/spawn_atom(object as text) - set category = "Debug" - set desc = "(atom path) Spawn an atom" - set name = "Spawn" - - if(!check_rights(R_SPAWN) || !object) +ADMIN_VERB(spawn_atom, R_SPAWN, "Spawn", "Spawn an atom.", ADMIN_CATEGORY_DEBUG, object as text) + if(!object) return - var/list/preparsed = splittext(object,":") var/path = preparsed[1] var/amount = 1 @@ -65,7 +60,7 @@ var/chosen = pick_closest_path(path) if(!chosen) return - var/turf/T = get_turf(usr) + var/turf/T = get_turf(user.mob) if(ispath(chosen, /turf)) T.ChangeTurf(chosen) @@ -74,21 +69,14 @@ var/atom/A = new chosen(T) A.flags_1 |= ADMIN_SPAWNED_1 - log_admin("[key_name(usr)] spawned [amount] x [chosen] at [AREACOORD(usr)]") + log_admin("[key_name(user)] spawned [amount] x [chosen] at [AREACOORD(user.mob)]") BLACKBOX_LOG_ADMIN_VERB("Spawn Atom") -/datum/admins/proc/podspawn_atom(object as text) - set category = "Debug" - set desc = "(atom path) Spawn an atom via supply drop" - set name = "Podspawn" - - if(!check_rights(R_SPAWN)) - return - +ADMIN_VERB(spawn_atom_pod, R_SPAWN, "PodSpawn", "Spawn an atom via supply drop.", ADMIN_CATEGORY_DEBUG, object as text) var/chosen = pick_closest_path(object) if(!chosen) return - var/turf/target_turf = get_turf(usr) + var/turf/target_turf = get_turf(user.mob) if(ispath(chosen, /turf)) target_turf.ChangeTurf(chosen) @@ -101,25 +89,18 @@ var/atom/A = new chosen(pod) A.flags_1 |= ADMIN_SPAWNED_1 - log_admin("[key_name(usr)] pod-spawned [chosen] at [AREACOORD(usr)]") + log_admin("[key_name(user)] pod-spawned [chosen] at [AREACOORD(user.mob)]") BLACKBOX_LOG_ADMIN_VERB("Podspawn Atom") -/datum/admins/proc/spawn_cargo(object as text) - set category = "Debug" - set desc = "(atom path) Spawn a cargo crate" - set name = "Spawn Cargo" - - if(!check_rights(R_SPAWN)) - return - +ADMIN_VERB(spawn_cargo, R_SPAWN, "Spawn Cargo", "Spawn a cargo crate.", ADMIN_CATEGORY_DEBUG, object as text) var/chosen = pick_closest_path(object, make_types_fancy(subtypesof(/datum/supply_pack))) if(!chosen) return var/datum/supply_pack/S = new chosen S.admin_spawned = TRUE - S.generate(get_turf(usr)) + S.generate(get_turf(user.mob)) - log_admin("[key_name(usr)] spawned cargo pack [chosen] at [AREACOORD(usr)]") + log_admin("[key_name(user)] spawned cargo pack [chosen] at [AREACOORD(user.mob)]") BLACKBOX_LOG_ADMIN_VERB("Spawn Cargo") /datum/admins/proc/dynamic_mode_options(mob/user) @@ -246,10 +227,8 @@ log_admin(logged_message) message_admins(logged_message) -/datum/admins/proc/create_or_modify_area() - set category = "Debug" - set name = "Create or modify area" - create_area(usr) +ADMIN_VERB(create_or_modify_area, R_DEBUG, "Create Or Modify Area", "Create of modify an area. wow.", ADMIN_CATEGORY_DEBUG) + create_area(user.mob) //Kicks all the clients currently in the lobby. The second parameter (kick_only_afk) determins if an is_afk() check is ran, or if all clients are kicked //defaults to kicking everyone (afk + non afk clients in the lobby) diff --git a/code/modules/admin/admin_fax_panel.dm b/code/modules/admin/admin_fax_panel.dm index fe1f03d7d7e..8874b6f38eb 100644 --- a/code/modules/admin/admin_fax_panel.dm +++ b/code/modules/admin/admin_fax_panel.dm @@ -1,15 +1,6 @@ -/** - * If client have R_ADMIN flag, opens an admin fax panel. - */ -/client/proc/fax_panel() - set category = "Admin.Events" - set name = "Fax Panel" - - if(!check_rights(R_ADMIN)) - return - - var/datum/fax_panel_interface/ui = new(usr) - ui.ui_interact(usr) +ADMIN_VERB(fax_panel, R_ADMIN, "Fax Panel", "View and respond to faxes sent to CC.", ADMIN_CATEGORY_EVENTS) + var/datum/fax_panel_interface/ui = new /datum/fax_panel_interface(user.mob) + ui.ui_interact(user.mob) /// Admin Fax Panel. Tool for sending fax messages faster. /datum/fax_panel_interface @@ -97,15 +88,15 @@ switch(action) if("follow") - if(!isobserver(usr)) - usr.client?.admin_ghost() + if(!isobserver(ui.user)) + SSadmin_verbs.dynamic_invoke_verb(ui.user, /datum/admin_verb/admin_ghost) - usr.client?.admin_follow(action_fax) + ui.user.client?.admin_follow(action_fax) if("preview") // see saved variant if(!fax_paper) return - fax_paper.ui_interact(usr) + fax_paper.ui_interact(ui.user) if("save") // save paper if(params["paperName"]) @@ -129,7 +120,7 @@ if(stamp) fax_paper.add_stamp(stamp_class, params["stampX"], params["stampY"], params["stampAngle"], stamp) - fax_paper.update_static_data(usr) // OK, it's work, and update UI. + fax_paper.update_static_data(ui.user) // OK, it's work, and update UI. if("send") //copy @@ -137,9 +128,9 @@ our_fax.name = fax_paper.name //send action_fax.receive(our_fax, sending_fax_name) - message_admins("[key_name_admin(usr)] has sent a custom fax message to [action_fax.name][ADMIN_FLW(action_fax)][ADMIN_SHOW_PAPER(fax_paper)].") - log_admin("[key_name(usr)] has sent a custom fax message to [action_fax.name]") + message_admins("[key_name_admin(ui.user)] has sent a custom fax message to [action_fax.name][ADMIN_FLW(action_fax)][ADMIN_SHOW_PAPER(fax_paper)].") + log_admin("[key_name(ui.user)] has sent a custom fax message to [action_fax.name]") if("createPaper") - var/obj/item/paper/our_paper = fax_paper.copy(/obj/item/paper, usr.loc) + var/obj/item/paper/our_paper = fax_paper.copy(/obj/item/paper, ui.user.loc) our_paper.name = fax_paper.name diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 94ea182891f..edc3525bf2f 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -10,13 +10,8 @@ WRITE_FILE(F, "[time_stamp(format = "YYYY-MM-DD hh:mm:ss")] [REF(src)] ([x],[y],[z]) || [source] [message]
") -/client/proc/investigate_show() - set name = "Investigate" - set category = "Admin.Game" - if(!holder) - return - - var/list/investigates = list( +ADMIN_VERB(investigate_show, R_NONE, "Investigate", "Browse various detailed logs.", ADMIN_CATEGORY_GAME) + var/static/list/investigates = list( INVESTIGATE_ACCESSCHANGES, INVESTIGATE_ATMOS, INVESTIGATE_BOTANY, @@ -48,7 +43,7 @@ var/list/combined = sort_list(logs_present) + sort_list(logs_missing) - var/selected = tgui_input_list(src, "Investigate what?", "Investigation", combined) + var/selected = tgui_input_list(user, "Investigate what?", "Investigation", combined) if(isnull(selected)) return if(!(selected in combined) || selected == "---") @@ -62,6 +57,6 @@ var/F = file("[GLOB.log_directory]/[selected].html") if(!fexists(F)) - to_chat(src, span_danger("No [selected] logfile was found."), confidential = TRUE) + to_chat(user, span_danger("No [selected] logfile was found."), confidential = TRUE) return - src << browse(F,"window=investigate[selected];size=800x300") + user << browse(F,"window=investigate[selected];size=800x300") diff --git a/code/modules/admin/admin_pda_message.dm b/code/modules/admin/admin_pda_message.dm index 44ca86f893e..c1c4fef0b57 100644 --- a/code/modules/admin/admin_pda_message.dm +++ b/code/modules/admin/admin_pda_message.dm @@ -1,12 +1,6 @@ -///Allows an admin to send messages on PDA -/client/proc/message_pda() - set name = "PDA Message" - set category = "Admin.Events" - if(!holder || !check_rights(R_ADMIN)) - return - - holder.message_pda() +ADMIN_VERB(message_pda, R_ADMIN, "PDA Message", "Send a message to a user's PDA.", ADMIN_CATEGORY_EVENTS) + user.holder.message_pda() ///Opens up the PDA Message Panel /datum/admins/proc/message_pda() diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 73951cfddbc..352ccab297a 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -1,506 +1,103 @@ -//admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless -//the procs are cause you can't put the comments in the GLOB var define -GLOBAL_LIST_INIT(admin_verbs_default, world.AVerbsDefault()) -GLOBAL_PROTECT(admin_verbs_default) -/world/proc/AVerbsDefault() - return list( - /client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/ - /client/proc/cmd_admin_pm_panel, /*admin-pm list*/ - /client/proc/cmd_admin_say, /*admin-only ooc chat*/ - /client/proc/deadmin, /*destroys our own admin datum so we can play as a regular player*/ - /client/proc/debugstatpanel, - /client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/ - /client/proc/dsay, /*talk in deadchat using our ckey/fakekey*/ - /client/proc/fix_air, /*resets air in designated radius to its default atmos composition*/ - /client/proc/hide_verbs, /*hides all our adminverbs*/ - /client/proc/investigate_show, /*various admintools for investigation. Such as a singulo grief-log*/ - /client/proc/mark_datum_mapview, - /client/proc/reestablish_db_connection, /*reattempt a connection to the database*/ - /client/proc/reload_admins, - /client/proc/requests, - /client/proc/secrets, - /client/proc/stop_sounds, - /client/proc/tag_datum_mapview, - - /client/proc/addbunkerbypass, /*NOVA EDIT ADDITION - PANICBUNKER*/ - /client/proc/cmd_loud_admin_say, /*admin-only chat except its annoying - NOVA EDIT ADDITION - ADMIN*/ - /client/proc/remove_liquid, /*NOVA EDIT ADDITION*/ - /client/proc/revokebunkerbypass, /*NOVA EDIT ADDITION - PANICBUNKER*/ - ) -GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin()) -GLOBAL_PROTECT(admin_verbs_admin) -/world/proc/AVerbsAdmin() - return list( -// Admin datums - /datum/admins/proc/access_news_network, /*allows access of newscasters*/ - /datum/admins/proc/announce, /*priority announce something to all clients.*/ - /datum/admins/proc/display_tags, - /datum/admins/proc/fishing_calculator, - /datum/admins/proc/known_alts_panel, - /datum/admins/proc/show_lag_switch_panel, - /datum/admins/proc/open_borgopanel, - /datum/admins/proc/open_shuttlepanel, /* Opens shuttle manipulator UI */ - /datum/admins/proc/paintings_manager, - /datum/admins/proc/set_admin_notice, /*announcement all clients see when joining the server.*/ - /datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/ - /datum/admins/proc/toggleenter, /*toggles whether people can join the current game*/ - /datum/admins/proc/toggleguests, /*toggles whether guests can join the current game*/ - /datum/admins/proc/toggleooc, /*toggles ooc on/off for everyone*/ - /datum/admins/proc/toggleoocdead, /*toggles ooc on/off for everyone who is dead*/ - /datum/admins/proc/trophy_manager, - /datum/admins/proc/view_all_circuits, - /datum/verbs/menu/Admin/verb/playerpanel, /* It isn't /datum/admin but it fits no less */ - /datum/admins/proc/change_shuttle_events, //allows us to change the shuttle events - /datum/admins/proc/reset_tram, //tram related admin actions -// Client procs - /client/proc/admin_call_shuttle, /*allows us to call the emergency shuttle*/ - /client/proc/admin_cancel_shuttle, /*allows us to cancel the emergency shuttle, sending it back to centcom*/ - /client/proc/admin_disable_shuttle, /*allows us to disable the emergency shuttle admin-wise so that it cannot be called*/ - /client/proc/admin_enable_shuttle, /*undoes the above*/ - /client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/ - /client/proc/admin_hostile_environment, /*Allows admins to prevent the emergency shuttle from leaving, also lets admins clear hostile environments if theres one stuck*/ - /client/proc/centcom_podlauncher,/*Open a window to launch a Supplypod and configure it or it's contents*/ - /client/proc/check_ai_laws, /*shows AI and borg laws*/ - /client/proc/check_antagonists, /*shows all antags*/ - /client/proc/cmd_admin_check_contents, /*displays the contents of an instance*/ - /client/proc/cmd_admin_check_player_exp, /* shows players by playtime */ - /client/proc/cmd_admin_create_centcom_report, - /client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/ - /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_headset_message, /*send a message to somebody through their headset as CentCom*/ - /client/proc/cmd_admin_local_narrate, /*sends text to all mobs within view of atom*/ - /client/proc/cmd_admin_subtle_message, /*send a message to somebody as a 'voice in their head'*/ - /client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/ - /client/proc/cmd_change_command_name, - /client/proc/create_mob_worm, - /client/proc/fax_panel, /*send a paper to fax*/ - /client/proc/force_load_lazy_template, - /client/proc/game_panel, /*game panel, allows to change game-mode etc*/ - /client/proc/Getmob, /*teleports a mob to our location*/ - /client/proc/Getkey, /*teleports a mob with a certain ckey to our location*/ - /client/proc/getserverlogs, /*for accessing server logs*/ - /client/proc/getcurrentlogs, /*for accessing server logs for the current round*/ - /client/proc/ghost_pool_protection, /*opens a menu for toggling ghost roles*/ - /client/proc/invisimin, /*allows our mob to go invisible/visible*/ - /client/proc/jumptoarea, - /client/proc/jumptokey, /*allows us to jump to the location of a mob with a certain ckey*/ - /client/proc/jumptomob, /*allows us to jump to a specific mob*/ - /client/proc/jumptoturf, /*allows us to jump to a specific turf*/ - /client/proc/jumptocoord, /*we ghost and jump to a coordinate*/ - /client/proc/list_bombers, - /client/proc/list_dna, - /client/proc/list_fingerprints, - /client/proc/list_law_changes, - /client/proc/list_signalers, - /client/proc/manage_sect, /*manage chaplain religious sect*/ - /client/proc/message_pda, /*send a message to somebody on PDA*/ - /client/proc/respawn_character, - /client/proc/show_manifest, - /client/proc/toggle_AI_interact, /*toggle admin ability to interact with machines as an AI*/ - /client/proc/toggle_combo_hud, /* toggle display of the combination pizza antag and taco sci/med/eng hud */ - /client/proc/toggle_view_range, /*changes how far we can see*/ - /client/proc/cmd_admin_law_panel, - /client/proc/log_viewer_new, - /client/proc/player_ticket_history, - /datum/admins/proc/toggleaooc, /*Toggle Antag OOC - NOVA EDIT ADDITION*/ - /datum/admins/proc/toggledchat, /*NOVA EDIT ADDITION*/ - /datum/admins/proc/togglesooc, /*Toggle Security OOC - NOVA EDIT ADDITION*/ - /client/proc/admin_open_event_spawners_menu, /*EVENTS - NOVA EDIT ADDITION*/ - /client/proc/request_help, /*NOVA EDIT ADDITION*/ - /client/proc/view_opfors, /*OPFOR - NOVA EDIT ADDITION*/ - /client/proc/lorecaster_story_manager, /* NOVA EDIT ADDITION */ - ) -GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel, /client/proc/ban_panel, /client/proc/stickybanpanel, /client/proc/library_control)) -GLOBAL_PROTECT(admin_verbs_ban) -GLOBAL_LIST_INIT(admin_verbs_sounds, list(/client/proc/play_local_sound, /client/proc/play_direct_mob_sound, /client/proc/play_sound, /client/proc/set_round_end_sound)) -GLOBAL_PROTECT(admin_verbs_sounds) -GLOBAL_LIST_INIT(admin_verbs_fun, list( -// Admin datums - /datum/admins/proc/station_traits_panel, -// Client procs - /client/proc/admin_away, - /client/proc/add_marked_mob_ability, - /client/proc/admin_change_sec_level, - /client/proc/cinematic, - /client/proc/cmd_admin_add_freeform_ai_law, - /client/proc/cmd_admin_gib_self, - /client/proc/cmd_select_equipment, - /client/proc/command_report_footnote, - /client/proc/delay_command_report, - /client/proc/drop_bomb, - /client/proc/drop_dynex_bomb, - /client/proc/forceEvent, - /client/proc/mass_zombie_cure, - /client/proc/mass_zombie_infection, - /client/proc/object_say, - /client/proc/polymorph_all, - /client/proc/remove_marked_mob_ability, - /client/proc/reset_ooc, - /client/proc/run_weather, - /client/proc/set_dynex_scale, - /client/proc/set_ooc, - /client/proc/show_tip, - /client/proc/smite, - /client/proc/summon_ert, - /client/proc/toggle_nuke, - /client/proc/toggle_random_events, - /client/proc/admin_change_title_screen, /*NOVA EDIT ADDITION*/ - /client/proc/change_title_screen_html, /*NOVA EDIT ADDITION*/ - /client/proc/change_title_screen_notice, /*NOVA EDIT ADDITION*/ - /client/proc/fix_say, /*NOVA EDIT ADDITION*/ - /client/proc/one_click_antag, /*ONE CLICK ANTAG - NOVA EDIT ADDITION*/ - /client/proc/request_more_opfor, /*NOVA EDIT ADDITION*/ - /client/proc/spawn_liquid, /*NOVA EDIT ADDITION*/ - /client/proc/spawn_mob_spawner, /*NOVA EDIT ADDITION*/ - /client/proc/spawn_pollution, /*NOVA EDIT ADDITION*/ - /client/proc/intensity_credits_panel, /*NOVA EDIT ADDITION*/ - /client/proc/toggle_bsa, /*NOVA EDIT ADDITION*/ - /client/proc/try_stop_delam, /*NOVA EDIT ADDITION*/ - /client/proc/toggle_delam_suppression, /*NOVA EDIT ADDITION*/ - )) -GLOBAL_PROTECT(admin_verbs_fun) -GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom, /datum/admins/proc/podspawn_atom, /datum/admins/proc/spawn_cargo, /datum/admins/proc/spawn_objasmob, /client/proc/respawn_character, /datum/admins/proc/beaker_panel)) -GLOBAL_PROTECT(admin_verbs_spawn) -GLOBAL_LIST_INIT(admin_verbs_server, world.AVerbsServer()) -GLOBAL_PROTECT(admin_verbs_server) -/world/proc/AVerbsServer() - return list( -// Admin datums - /datum/admins/proc/delay, - /datum/admins/proc/delay_round_end, - /datum/admins/proc/end_round, - /datum/admins/proc/restart, - /datum/admins/proc/startnow, - /datum/admins/proc/toggleaban, - /datum/admins/proc/toggleAI, -// Client procs - /client/proc/adminchangemap, - /client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/ - /client/proc/cmd_debug_del_all, - /client/proc/cmd_debug_force_del_all, - /client/proc/cmd_debug_hard_del_all, - /client/proc/everyone_random, - /client/proc/forcerandomrotate, - /client/proc/generate_job_config, - /client/proc/panicbunker, - /client/proc/toggle_cdn, - /client/proc/toggle_hub, - /client/proc/toggle_interviews, - /client/proc/toggle_random_events, - ) -GLOBAL_LIST_INIT(admin_verbs_debug, world.AVerbsDebug()) -GLOBAL_PROTECT(admin_verbs_debug) -/world/proc/AVerbsDebug() - return list( - #ifdef TESTING /* Keep these at the top to not make the list look fugly */ - /client/proc/check_missing_sprites, - #endif - /proc/machine_upgrade, - /datum/admins/proc/create_or_modify_area, - /client/proc/adventure_manager, - /client/proc/atmos_control, - /client/proc/callproc, - /client/proc/callproc_datum, - /client/proc/check_bomb_impacts, - /client/proc/check_timer_sources, - /client/proc/clear_dynamic_transit, - /client/proc/cmd_admin_debug_traitor_objectives, - /client/proc/cmd_admin_delete, - /client/proc/cmd_admin_list_open_jobs, - /client/proc/cmd_admin_toggle_fov, - /client/proc/cmd_debug_del_all, - /client/proc/cmd_debug_force_del_all, - /client/proc/cmd_debug_hard_del_all, - /client/proc/cmd_debug_make_powernets, - /client/proc/cmd_debug_mob_lists, - /client/proc/cmd_display_del_log, - /client/proc/cmd_display_init_log, - /client/proc/cmd_display_overlay_log, - /client/proc/Debug2, - /client/proc/debug_controller, - /client/proc/debug_hallucination_weighted_list_per_type, - /client/proc/debug_huds, - /client/proc/debugNatureMapGenerator, - /client/proc/debug_plane_masters, - /client/proc/debug_spell_requirements, - /client/proc/display_sendmaps, - /client/proc/enable_mapping_verbs, - /client/proc/generate_wikichem_list, - /client/proc/get_dynex_power, /*debug verbs for dynex explosions.*/ - /client/proc/get_dynex_range, /*debug verbs for dynex explosions.*/ - /client/proc/jump_to_ruin, - /client/proc/load_circuit, - /client/proc/map_export, - /client/proc/map_template_load, - /client/proc/map_template_upload, - /client/proc/modify_goals, - /client/proc/open_colorblind_test, - /client/proc/open_lua_editor, - /client/proc/outfit_manager, - /client/proc/populate_world, - /client/proc/pump_random_event, - /client/proc/print_cards, - /client/proc/reestablish_tts_connection, - /client/proc/reload_cards, - /client/proc/reload_configuration, - /client/proc/restart_controller, - /client/proc/run_empty_query, - /client/proc/SDQL2_query, - /client/proc/set_dynex_scale, - /client/proc/spawn_debug_full_crew, - /client/proc/test_cardpack_distribution, - /client/proc/test_movable_UI, - /client/proc/test_snap_UI, - /client/proc/toggle_cdn, - /client/proc/toggle_medal_disable, - /client/proc/unload_ctf, - /client/proc/validate_cards, - /client/proc/validate_puzzgrids, - /client/proc/GeneratePipeSpritesheet, - /client/proc/view_runtimes, - /client/proc/stop_weather, - /client/proc/reload_interactions, /*NOVA EDIT ADDITION*/ - /client/proc/test_area_spawner, /*AUTOMAPPER - NOVA EDIT ADDITION*/ - /client/proc/toggle_liquid_debug, /*NOVA EDIT ADDITION*/ - - /datum/admins/proc/delay, /*FLUFFY FRONTIER ADDITION - EVENTMAKER QOL*/ - /datum/admins/proc/end_round, /*FLUFFY FRONTIER ADDITION - EVENTMAKER QOL*/ - /client/proc/adminchangemap, /*FLUFFY FRONTIER ADDITION - EVENTMAKER QOL*/ - ) -GLOBAL_LIST_INIT(admin_verbs_possess, list(/proc/possess, GLOBAL_PROC_REF(release))) -GLOBAL_PROTECT(admin_verbs_possess) -/// NOVA EDIT BEGIN - Player Rank Manager - ORIGINAL: GLOBAL_LIST_INIT(admin_verbs_permissions, list(/client/proc/edit_admin_permissions)) -GLOBAL_LIST_INIT(admin_verbs_permissions, list( - /client/proc/edit_admin_permissions, - /client/proc/manage_player_ranks, - /client/proc/migrate_player_ranks, - )) -/// NOVA EDIT END -GLOBAL_PROTECT(admin_verbs_permissions) -GLOBAL_LIST_INIT(admin_verbs_poll, list(/client/proc/poll_panel)) -GLOBAL_PROTECT(admin_verbs_poll) - /client/proc/add_admin_verbs() - if(holder) - control_freak = CONTROL_FREAK_SKIN | CONTROL_FREAK_MACROS - - var/rights = holder.rank_flags() - add_verb(src, GLOB.admin_verbs_default) - if(rights & R_BUILD) - add_verb(src, /client/proc/togglebuildmodeself) - if(rights & R_ADMIN) - add_verb(src, GLOB.admin_verbs_admin) - if(rights & R_BAN) - add_verb(src, GLOB.admin_verbs_ban) - if(rights & R_FUN) - add_verb(src, GLOB.admin_verbs_fun) - if(rights & R_SERVER) - add_verb(src, GLOB.admin_verbs_server) - if(rights & R_DEBUG) - add_verb(src, GLOB.admin_verbs_debug) - if(rights & R_POSSESS) - add_verb(src, GLOB.admin_verbs_possess) - if(rights & R_PERMISSIONS) - add_verb(src, GLOB.admin_verbs_permissions) - if(rights & R_STEALTH) - add_verb(src, /client/proc/stealth) - if(rights & R_POLL) - add_verb(src, GLOB.admin_verbs_poll) - if(rights & R_SOUND) - add_verb(src, GLOB.admin_verbs_sounds) - if(CONFIG_GET(string/invoke_youtubedl)) - add_verb(src, /client/proc/play_web_sound) - if(rights & R_SPAWN) - add_verb(src, GLOB.admin_verbs_spawn) -#ifdef MAP_TEST - remove_verb(src, /client/proc/enable_mapping_verbs) - add_verb(src, list(/client/proc/disable_mapping_verbs, GLOB.admin_verbs_debug_mapping)) -#endif + control_freak = CONTROL_FREAK_SKIN | CONTROL_FREAK_MACROS + SSadmin_verbs.assosciate_admin(src) /client/proc/remove_admin_verbs() - remove_verb(src, list( - GLOB.admin_verbs_default, - /client/proc/togglebuildmodeself, - GLOB.admin_verbs_admin, - GLOB.admin_verbs_ban, - GLOB.admin_verbs_fun, - GLOB.admin_verbs_server, - GLOB.admin_verbs_debug, - GLOB.admin_verbs_possess, - GLOB.admin_verbs_permissions, - /client/proc/stealth, - GLOB.admin_verbs_poll, - GLOB.admin_verbs_sounds, - /client/proc/play_web_sound, - GLOB.admin_verbs_spawn, - /*Debug verbs added by "show debug verbs"*/ - GLOB.admin_verbs_debug_mapping, - /client/proc/disable_mapping_verbs, - /client/proc/readmin - )) - -/client/proc/hide_verbs() - set name = "Adminverbs - Hide All" - set category = "Admin" - - remove_admin_verbs() - add_verb(src, /client/proc/show_verbs) - - to_chat(src, span_interface("Almost all of your adminverbs have been hidden."), confidential = TRUE) - BLACKBOX_LOG_ADMIN_VERB("Hide All Adminverbs") - return - -/client/proc/show_verbs() - set name = "Adminverbs - Show" - set category = "Admin" - - remove_verb(src, /client/proc/show_verbs) - add_admin_verbs() - - to_chat(src, span_interface("All of your adminverbs are now visible."), confidential = TRUE) - BLACKBOX_LOG_ADMIN_VERB("Show Adminverbs") - + control_freak = initial(control_freak) + SSadmin_verbs.deassosciate_admin(src) +ADMIN_VERB(hide_verbs, R_NONE, "Adminverbs - Hide All", "Hide most of your admin verbs.", ADMIN_CATEGORY_MAIN) + user.remove_admin_verbs() + add_verb(user, /client/proc/show_verbs) + to_chat(user, span_interface("Almost all of your adminverbs have been hidden."), confidential = TRUE) + BLACKBOX_LOG_ADMIN_VERB("Hide All Adminverbs") -/client/proc/admin_ghost() - set category = "Admin.Game" - set name = "Aghost" - if(!holder) - return +ADMIN_VERB(admin_ghost, R_ADMIN, "AGhost", "Become a ghost without DNR.", ADMIN_CATEGORY_GAME) . = TRUE - if(isobserver(mob)) + if(isobserver(user.mob)) //re-enter - var/mob/dead/observer/ghost = mob + var/mob/dead/observer/ghost = user.mob if(!ghost.mind || !ghost.mind.current) //won't do anything if there is no body return FALSE if(!ghost.can_reenter_corpse) - log_admin("[key_name(usr)] re-entered corpse") - message_admins("[key_name_admin(usr)] re-entered corpse") + log_admin("[key_name(user)] re-entered corpse") + message_admins("[key_name_admin(user)] re-entered corpse") ghost.can_reenter_corpse = 1 //force re-entering even when otherwise not possible ghost.reenter_corpse() BLACKBOX_LOG_ADMIN_VERB("Admin Reenter") - else if(isnewplayer(mob)) - to_chat(src, "Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.", confidential = TRUE) + else if(isnewplayer(user.mob)) + to_chat(user, "Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.", confidential = TRUE) return FALSE else //ghostize - log_admin("[key_name(usr)] admin ghosted.") - message_admins("[key_name_admin(usr)] admin ghosted.") - var/mob/body = mob + log_admin("[key_name(user)] admin ghosted.") + message_admins("[key_name_admin(user)] admin ghosted.") + var/mob/body = user.mob body.ghostize(TRUE) - init_verbs() + user.init_verbs() if(body && !body.key) - body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus + body.key = "@[user.key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus BLACKBOX_LOG_ADMIN_VERB("Admin Ghost") -/client/proc/invisimin() - set name = "Invisimin" - set category = "Admin.Game" - set desc = "Toggles ghost-like invisibility (Don't abuse this)" - - if(isnull(holder) || isnull(mob)) +ADMIN_VERB(invisimin, R_ADMIN, "Inisimin", "Toggles ghost-like invisibility.", ADMIN_CATEGORY_GAME) + if(HAS_TRAIT(user.mob, TRAIT_INVISIMIN)) + REMOVE_TRAIT(user.mob, TRAIT_INVISIMIN, ADMIN_TRAIT) + user.mob.add_to_all_human_data_huds() + user.mob.RemoveInvisibility(INVISIBILITY_SOURCE_INVISIMIN) + to_chat(user, span_adminnotice(span_bold("Invisimin off. Invisibility reset.")), confidential = TRUE) return - if(HAS_TRAIT(mob, TRAIT_INVISIMIN)) - REMOVE_TRAIT(mob, TRAIT_INVISIMIN, ADMIN_TRAIT) - mob.add_to_all_human_data_huds() - mob.RemoveInvisibility(INVISIBILITY_SOURCE_INVISIMIN) - to_chat(mob, span_adminnotice(span_bold("Invisimin off. Invisibility reset.")), confidential = TRUE) - return + ADD_TRAIT(user.mob, TRAIT_INVISIMIN, ADMIN_TRAIT) + user.mob.remove_from_all_data_huds() + user.mob.SetInvisibility(INVISIBILITY_OBSERVER, INVISIBILITY_SOURCE_INVISIMIN, INVISIBILITY_PRIORITY_ADMIN) + to_chat(user, span_adminnotice(span_bold("Invisimin on. You are now as invisible as a ghost.")), confidential = TRUE) - ADD_TRAIT(mob, TRAIT_INVISIMIN, ADMIN_TRAIT) - mob.remove_from_all_data_huds() - mob.SetInvisibility(INVISIBILITY_OBSERVER, INVISIBILITY_SOURCE_INVISIMIN, INVISIBILITY_PRIORITY_ADMIN) - to_chat(mob, span_adminnotice(span_bold("Invisimin on. You are now as invisible as a ghost.")), confidential = TRUE) - -/client/proc/check_antagonists() - set name = "Check Antagonists" - set category = "Admin.Game" - if(holder) - holder.check_antagonists() - log_admin("[key_name(usr)] checked antagonists.") //for tsar~ - if(!isobserver(usr) && SSticker.HasRoundStarted()) - message_admins("[key_name_admin(usr)] checked antagonists.") +ADMIN_VERB(check_antagonists, R_ADMIN, "Check Antagonists", "See all antagonists for the round.", ADMIN_CATEGORY_GAME) + user.holder.check_antagonists() + log_admin("[key_name(user)] checked antagonists.") + if(!isobserver(user.mob) && SSticker.HasRoundStarted()) + message_admins("[key_name_admin(user)] checked antagonists.") BLACKBOX_LOG_ADMIN_VERB("Check Antagonists") -/client/proc/list_bombers() - set name = "List Bombers" - set category = "Admin.Game" - if(!holder) - return - holder.list_bombers() +ADMIN_VERB(list_bombers, R_ADMIN, "List Bombers", "Look at all bombs and their likely culprit.", ADMIN_CATEGORY_GAME) + user.holder.list_bombers() BLACKBOX_LOG_ADMIN_VERB("List Bombers") -/client/proc/list_signalers() - set name = "List Signalers" - set category = "Admin.Game" - if(!holder) - return - holder.list_signalers() +ADMIN_VERB(list_signalers, R_ADMIN, "List Signalers", "View all signalers.", ADMIN_CATEGORY_GAME) + user.holder.list_signalers() BLACKBOX_LOG_ADMIN_VERB("List Signalers") -/client/proc/list_law_changes() - set name = "List Law Changes" - set category = "Debug" - if(!holder) - return - holder.list_law_changes() +ADMIN_VERB(list_law_changes, R_ADMIN, "List Law Changes", "View all AI law changes.", ADMIN_CATEGORY_DEBUG) + user.holder.list_law_changes() BLACKBOX_LOG_ADMIN_VERB("List Law Changes") -/client/proc/show_manifest() - set name = "Show Manifest" - set category = "Debug" - if(!holder) - return - holder.show_manifest() +ADMIN_VERB(show_manifest, R_ADMIN, "Show Manifest", "View the shift's Manifest.", ADMIN_CATEGORY_DEBUG) + user.holder.show_manifest() BLACKBOX_LOG_ADMIN_VERB("Show Manifest") -/client/proc/list_dna() - set name = "List DNA" - set category = "Debug" - if(!holder) - return - holder.list_dna() +ADMIN_VERB(list_dna, R_ADMIN, "List DNA", "View DNA.", ADMIN_CATEGORY_DEBUG) + user.holder.list_dna() BLACKBOX_LOG_ADMIN_VERB("List DNA") -/client/proc/list_fingerprints() - set name = "List Fingerprints" - set category = "Debug" - if(!holder) - return - holder.list_fingerprints() +ADMIN_VERB(list_fingerprints, R_ADMIN, "List Fingerprints", "View fingerprints.", ADMIN_CATEGORY_DEBUG) + user.holder.list_fingerprints() BLACKBOX_LOG_ADMIN_VERB("List Fingerprints") -/client/proc/ban_panel() - set name = "Banning Panel" - set category = "Admin" - if(!check_rights(R_BAN)) - return - holder.ban_panel() +ADMIN_VERB(ban_panel, R_BAN, "Banning Panel", "Ban players here.", ADMIN_CATEGORY_MAIN) + user.holder.ban_panel() BLACKBOX_LOG_ADMIN_VERB("Banning Panel") -/client/proc/unban_panel() - set name = "Unbanning Panel" - set category = "Admin" - if(!check_rights(R_BAN)) - return - holder.unban_panel() +ADMIN_VERB(unban_panel, R_BAN, "Unbanning Panel", "Unban players here.", ADMIN_CATEGORY_MAIN) + user.holder.unban_panel() BLACKBOX_LOG_ADMIN_VERB("Unbanning Panel") -/client/proc/game_panel() - set name = "Game Panel" - set category = "Admin.Game" - if(holder) - holder.Game() +ADMIN_VERB(game_panel, R_ADMIN, "Game Panel", "Look at the state of the game.", ADMIN_CATEGORY_GAME) + user.holder.Game() BLACKBOX_LOG_ADMIN_VERB("Game Panel") -/client/proc/poll_panel() - set name = "Server Poll Management" - set category = "Admin" - if(!check_rights(R_POLL)) - return - holder.poll_list_panel() +ADMIN_VERB(poll_panel, R_POLL, "Server Poll Management", "View and manage polls.", ADMIN_CATEGORY_MAIN) + user.holder.poll_list_panel() BLACKBOX_LOG_ADMIN_VERB("Server Poll Management") /// Returns this client's stealthed ckey @@ -536,16 +133,11 @@ GLOBAL_PROTECT(admin_verbs_poll) /client/proc/createStealthKey() GLOB.stealthminID["[ckey]"] = generateStealthCkey() -/client/proc/stealth() - set category = "Admin" - set name = "Stealth Mode" - if(!holder) - return - - if(holder.fakekey) - disable_stealth_mode() +ADMIN_VERB(stealth, R_STEALTH, "Stealth Mode", "Toggle stealth.", ADMIN_CATEGORY_MAIN) + if(user.holder.fakekey) + user.disable_stealth_mode() else - enable_stealth_mode() + user.enable_stealth_mode() BLACKBOX_LOG_ADMIN_VERB("Stealth Mode") @@ -590,117 +182,86 @@ GLOBAL_PROTECT(admin_verbs_poll) #undef STEALTH_MODE_TRAIT -/client/proc/drop_bomb() - set category = "Admin.Fun" - set name = "Drop Bomb" - set desc = "Cause an explosion of varying strength at your location." - +ADMIN_VERB(drop_bomb, R_FUN, "Drop Bomb", "Cause an explosion of varying strength at your location", ADMIN_CATEGORY_FUN) var/list/choices = list("Small Bomb (1, 2, 3, 3)", "Medium Bomb (2, 3, 4, 4)", "Big Bomb (3, 5, 7, 5)", "Maxcap", "Custom Bomb") - var/choice = tgui_input_list(src, "What size explosion would you like to produce? NOTE: You can do all this rapidly and in an IC manner (using cruise missiles!) with the Config/Launch Supplypod verb. WARNING: These ignore the maxcap", "Drop Bomb", choices) + var/choice = tgui_input_list(user, "What size explosion would you like to produce? NOTE: You can do all this rapidly and in an IC manner (using cruise missiles!) with the Config/Launch Supplypod verb. WARNING: These ignore the maxcap", "Drop Bomb", choices) if(isnull(choice)) return - var/turf/epicenter = mob.loc + var/turf/epicenter = user.mob.loc switch(choice) if("Small Bomb (1, 2, 3, 3)") - explosion(epicenter, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 3, flash_range = 3, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) + explosion(epicenter, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 3, flash_range = 3, adminlog = TRUE, ignorecap = TRUE, explosion_cause = user.mob) if("Medium Bomb (2, 3, 4, 4)") - explosion(epicenter, devastation_range = 2, heavy_impact_range = 3, light_impact_range = 4, flash_range = 4, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) + explosion(epicenter, devastation_range = 2, heavy_impact_range = 3, light_impact_range = 4, flash_range = 4, adminlog = TRUE, ignorecap = TRUE, explosion_cause = user.mob) if("Big Bomb (3, 5, 7, 5)") - explosion(epicenter, devastation_range = 3, heavy_impact_range = 5, light_impact_range = 7, flash_range = 5, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) + explosion(epicenter, devastation_range = 3, heavy_impact_range = 5, light_impact_range = 7, flash_range = 5, adminlog = TRUE, ignorecap = TRUE, explosion_cause = user.mob) if("Maxcap") - explosion(epicenter, devastation_range = GLOB.MAX_EX_DEVESTATION_RANGE, heavy_impact_range = GLOB.MAX_EX_HEAVY_RANGE, light_impact_range = GLOB.MAX_EX_LIGHT_RANGE, flash_range = GLOB.MAX_EX_FLASH_RANGE, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) + explosion(epicenter, devastation_range = GLOB.MAX_EX_DEVESTATION_RANGE, heavy_impact_range = GLOB.MAX_EX_HEAVY_RANGE, light_impact_range = GLOB.MAX_EX_LIGHT_RANGE, flash_range = GLOB.MAX_EX_FLASH_RANGE, adminlog = TRUE, ignorecap = TRUE, explosion_cause = user.mob) if("Custom Bomb") - var/range_devastation = input("Devastation range (in tiles):") as null|num + var/range_devastation = input(user, "Devastation range (in tiles):") as null|num if(range_devastation == null) return - var/range_heavy = input("Heavy impact range (in tiles):") as null|num + var/range_heavy = input(user, "Heavy impact range (in tiles):") as null|num if(range_heavy == null) return - var/range_light = input("Light impact range (in tiles):") as null|num + var/range_light = input(user, "Light impact range (in tiles):") as null|num if(range_light == null) return - var/range_flash = input("Flash range (in tiles):") as null|num + var/range_flash = input(user, "Flash range (in tiles):") as null|num if(range_flash == null) return if(range_devastation > GLOB.MAX_EX_DEVESTATION_RANGE || range_heavy > GLOB.MAX_EX_HEAVY_RANGE || range_light > GLOB.MAX_EX_LIGHT_RANGE || range_flash > GLOB.MAX_EX_FLASH_RANGE) - if(tgui_alert(usr, "Bomb is bigger than the maxcap. Continue?",,list("Yes","No")) != "Yes") + if(tgui_alert(user, "Bomb is bigger than the maxcap. Continue?",,list("Yes","No")) != "Yes") return - epicenter = mob.loc //We need to reupdate as they may have moved again - explosion(epicenter, devastation_range = range_devastation, heavy_impact_range = range_heavy, light_impact_range = range_light, flash_range = range_flash, adminlog = TRUE, ignorecap = TRUE, explosion_cause = mob) - message_admins("[ADMIN_LOOKUPFLW(usr)] creating an admin explosion at [epicenter.loc].") - log_admin("[key_name(usr)] created an admin explosion at [epicenter.loc].") + epicenter = get_turf(user.mob) //We need to reupdate as they may have moved again + explosion(epicenter, devastation_range = range_devastation, heavy_impact_range = range_heavy, light_impact_range = range_light, flash_range = range_flash, adminlog = TRUE, ignorecap = TRUE, explosion_cause = user.mob) + message_admins("[ADMIN_LOOKUPFLW(user.mob)] creating an admin explosion at [epicenter.loc].") + log_admin("[key_name(user)] created an admin explosion at [epicenter.loc].") BLACKBOX_LOG_ADMIN_VERB("Drop Bomb") -/client/proc/drop_dynex_bomb() - set category = "Admin.Fun" - set name = "Drop DynEx Bomb" - set desc = "Cause an explosion of varying strength at your location." - - var/ex_power = input("Explosive Power:") as null|num - var/turf/epicenter = mob.loc - if(ex_power && epicenter) - dyn_explosion(epicenter, ex_power) - message_admins("[ADMIN_LOOKUPFLW(usr)] creating an admin explosion at [epicenter.loc].") - log_admin("[key_name(usr)] created an admin explosion at [epicenter.loc].") - BLACKBOX_LOG_ADMIN_VERB("Drop Dynamic Bomb") - -/client/proc/get_dynex_range() - set category = "Debug" - set name = "Get DynEx Range" - set desc = "Get the estimated range of a bomb, using explosive power." - - var/ex_power = input("Explosive Power:") as null|num +ADMIN_VERB(drop_bomb_dynex, R_FUN, "Drop DynEx Bomb", "Cause an explosion of varying strength at your location.", ADMIN_CATEGORY_FUN) + var/ex_power = input(user, "Explosive Power:") as null|num + var/turf/epicenter = get_turf(user.mob) + if(!ex_power || !epicenter) + return + dyn_explosion(epicenter, ex_power) + message_admins("[ADMIN_LOOKUPFLW(user.mob)] creating an admin explosion at [epicenter.loc].") + log_admin("[key_name(user)] created an admin explosion at [epicenter.loc].") + BLACKBOX_LOG_ADMIN_VERB("Drop Dynamic Bomb") + +ADMIN_VERB(get_dynex_range, R_FUN, "Get DynEx Range", "Get the estimated range of a bomb using explosive power.", ADMIN_CATEGORY_DEBUG) + var/ex_power = input(user, "Explosive Power:") as null|num if (isnull(ex_power)) return var/range = round((2 * ex_power)**GLOB.DYN_EX_SCALE) - to_chat(usr, "Estimated Explosive Range: (Devastation: [round(range*0.25)], Heavy: [round(range*0.5)], Light: [round(range)])", confidential = TRUE) - -/client/proc/get_dynex_power() - set category = "Debug" - set name = "Get DynEx Power" - set desc = "Get the estimated required power of a bomb, to reach a specific range." + to_chat(user, "Estimated Explosive Range: (Devastation: [round(range*0.25)], Heavy: [round(range*0.5)], Light: [round(range)])", confidential = TRUE) - var/ex_range = input("Light Explosion Range:") as null|num +ADMIN_VERB(get_dynex_power, R_FUN, "Get DynEx Power", "Get the estimated required power of a bomb to reach the given range.", ADMIN_CATEGORY_DEBUG) + var/ex_range = input(user, "Light Explosion Range:") as null|num if (isnull(ex_range)) return var/power = (0.5 * ex_range)**(1/GLOB.DYN_EX_SCALE) - to_chat(usr, "Estimated Explosive Power: [power]", confidential = TRUE) - -/client/proc/set_dynex_scale() - set category = "Debug" - set name = "Set DynEx Scale" - set desc = "Set the scale multiplier of dynex explosions. The default is 0.5." + to_chat(user, "Estimated Explosive Power: [power]", confidential = TRUE) - var/ex_scale = input("New DynEx Scale:") as null|num +ADMIN_VERB(set_dynex_scale, R_FUN, "Set DynEx Scale", "Set the scale multiplier on dynex explosions. Default 0.5.", ADMIN_CATEGORY_DEBUG) + var/ex_scale = input(user, "New DynEx Scale:") as null|num if(!ex_scale) return GLOB.DYN_EX_SCALE = ex_scale - log_admin("[key_name(usr)] has modified Dynamic Explosion Scale: [ex_scale]") - message_admins("[key_name_admin(usr)] has modified Dynamic Explosion Scale: [ex_scale]") + log_admin("[key_name(user)] has modified Dynamic Explosion Scale: [ex_scale]") + message_admins("[key_name_admin(user)] has modified Dynamic Explosion Scale: [ex_scale]") -/client/proc/atmos_control() - set name = "Atmos Control Panel" - set category = "Debug" - if(!check_rights(R_DEBUG)) - return - SSair.ui_interact(mob) +ADMIN_VERB(atmos_control, R_DEBUG|R_SERVER, "Atmos Control Panel", "Open the atmospherics control panel.", ADMIN_CATEGORY_DEBUG) + SSair.ui_interact(user.mob) -/client/proc/reload_cards() - set name = "Reload Cards" - set category = "Debug" - if(!check_rights(R_DEBUG)) - return +ADMIN_VERB(reload_cards, R_DEBUG, "Reload Cards", "Reload all TCG cards.", ADMIN_CATEGORY_DEBUG) if(!SStrading_card_game.loaded) message_admins("The card subsystem is not currently loaded") return SStrading_card_game.reloadAllCardFiles() -/client/proc/validate_cards() - set name = "Validate Cards" - set category = "Debug" - if(!check_rights(R_DEBUG)) - return +ADMIN_VERB(validate_cards, R_DEBUG, "Validate Cards", "Validate the card settings.", ADMIN_CATEGORY_DEBUG) if(!SStrading_card_game.loaded) message_admins("The card subsystem is not currently loaded") return @@ -711,66 +272,55 @@ GLOBAL_PROTECT(admin_verbs_poll) else message_admins("No errors found in card rarities or overrides.") -/client/proc/test_cardpack_distribution() - set name = "Test Cardpack Distribution" - set category = "Debug" - if(!check_rights(R_DEBUG)) - return +ADMIN_VERB(test_cardpack_distribution, R_DEBUG, "Test Cardpack Distribution", "Test the distribution of a card pack.", ADMIN_CATEGORY_DEBUG) if(!SStrading_card_game.loaded) message_admins("The card subsystem is not currently loaded") return - var/pack = tgui_input_list(usr, "Which pack should we test?", "You fucked it didn't you", sort_list(SStrading_card_game.card_packs)) + var/pack = tgui_input_list(user, "Which pack should we test?", "You fucked it didn't you", sort_list(SStrading_card_game.card_packs)) if(!pack) return - var/batch_count = tgui_input_number(usr, "How many times should we open it?", "Don't worry, I understand") - var/batch_size = tgui_input_number(usr, "How many cards per batch?", "I hope you remember to check the validation") - var/guar = tgui_input_number(usr, "Should we use the pack's guaranteed rarity? If so, how many?", "We've all been there. Man you should have seen the old system") - + var/batch_count = tgui_input_number(user, "How many times should we open it?", "Don't worry, I understand") + var/batch_size = tgui_input_number(user, "How many cards per batch?", "I hope you remember to check the validation") + var/guar = tgui_input_number(user, "Should we use the pack's guaranteed rarity? If so, how many?", "We've all been there. Man you should have seen the old system") SStrading_card_game.check_card_distribution(pack, batch_size, batch_count, guar) -/client/proc/print_cards() - set name = "Print Cards" - set category = "Debug" +ADMIN_VERB(print_cards, R_DEBUG, "Print Cards", "Print all cards to chat.", ADMIN_CATEGORY_DEBUG) SStrading_card_game.printAllCards() -/client/proc/give_mob_action(mob/ability_recipient in GLOB.mob_list) - set category = "Admin.Fun" - set name = "Give Mob Action" - set desc = "Gives a mob ability to a mob." - +ADMIN_VERB(give_mob_action, R_FUN, "Give Mob Action", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/ability_recipient) var/static/list/all_mob_actions = sort_list(subtypesof(/datum/action/cooldown/mob_cooldown), GLOBAL_PROC_REF(cmp_typepaths_asc)) var/static/list/actions_by_name = list() if (!length(actions_by_name)) for (var/datum/action/cooldown/mob_cooldown as anything in all_mob_actions) actions_by_name["[initial(mob_cooldown.name)] ([mob_cooldown])"] = mob_cooldown - var/ability = tgui_input_list(usr, "Choose an ability", "Ability", actions_by_name) + var/ability = tgui_input_list(user, "Choose an ability", "Ability", actions_by_name) if(isnull(ability)) return var/ability_type = actions_by_name[ability] var/datum/action/cooldown/mob_cooldown/add_ability - var/make_sequence = tgui_alert(usr, "Would you like this action to be a sequence of multiple abilities?", "Sequence Ability", list("Yes", "No")) + var/make_sequence = tgui_alert(user, "Would you like this action to be a sequence of multiple abilities?", "Sequence Ability", list("Yes", "No")) if(make_sequence == "Yes") add_ability = new /datum/action/cooldown/mob_cooldown(ability_recipient) add_ability.sequence_actions = list() while(!isnull(ability_type)) - var/ability_delay = tgui_input_number(usr, "Enter the delay in seconds before the next ability in the sequence is used", "Ability Delay", 2) + var/ability_delay = tgui_input_number(user, "Enter the delay in seconds before the next ability in the sequence is used", "Ability Delay", 2) if(isnull(ability_delay) || ability_delay < 0) ability_delay = 0 add_ability.sequence_actions[ability_type] = ability_delay * 1 SECONDS - ability = tgui_input_list(usr, "Choose a new sequence ability", "Sequence Ability", actions_by_name) + ability = tgui_input_list(user, "Choose a new sequence ability", "Sequence Ability", actions_by_name) ability_type = actions_by_name[ability] - var/ability_cooldown = tgui_input_number(usr, "Enter the sequence abilities cooldown in seconds", "Ability Cooldown", 2) + var/ability_cooldown = tgui_input_number(user, "Enter the sequence abilities cooldown in seconds", "Ability Cooldown", 2) if(isnull(ability_cooldown) || ability_cooldown < 0) ability_cooldown = 2 add_ability.cooldown_time = ability_cooldown * 1 SECONDS - var/ability_melee_cooldown = tgui_input_number(usr, "Enter the abilities melee cooldown in seconds", "Melee Cooldown", 2) + var/ability_melee_cooldown = tgui_input_number(user, "Enter the abilities melee cooldown in seconds", "Melee Cooldown", 2) if(isnull(ability_melee_cooldown) || ability_melee_cooldown < 0) ability_melee_cooldown = 2 add_ability.melee_cooldown_time = ability_melee_cooldown * 1 SECONDS - add_ability.name = tgui_input_text(usr, "Choose ability name", "Ability name", "Generic Ability") + add_ability.name = tgui_input_text(user, "Choose ability name", "Ability name", "Generic Ability") add_ability.create_sequence_actions() else add_ability = new ability_type(ability_recipient) @@ -779,15 +329,11 @@ GLOBAL_PROTECT(admin_verbs_poll) return add_ability.Grant(ability_recipient) - message_admins("[key_name_admin(usr)] added mob ability [ability_type] to mob [ability_recipient].") - log_admin("[key_name(usr)] added mob ability [ability_type] to mob [ability_recipient].") + message_admins("[key_name_admin(user)] added mob ability [ability_type] to mob [ability_recipient].") + log_admin("[key_name(user)] added mob ability [ability_type] to mob [ability_recipient].") BLACKBOX_LOG_ADMIN_VERB("Add Mob Ability") -/client/proc/remove_mob_action(mob/removal_target in GLOB.mob_list) - set category = "Admin.Fun" - set name = "Remove Mob Action" - set desc = "Remove a special ability from the selected mob." - +ADMIN_VERB(remove_mob_action, R_FUN, "Remove Mob Action", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/removal_target) var/list/target_abilities = list() for(var/datum/action/cooldown/mob_cooldown/ability in removal_target.actions) target_abilities[ability.name] = ability @@ -795,7 +341,7 @@ GLOBAL_PROTECT(admin_verbs_poll) if(!length(target_abilities)) return - var/chosen_ability = tgui_input_list(usr, "Choose the spell to remove from [removal_target]", "Depower", sort_list(target_abilities)) + var/chosen_ability = tgui_input_list(user, "Choose the spell to remove from [removal_target]", "Depower", sort_list(target_abilities)) if(isnull(chosen_ability)) return var/datum/action/cooldown/mob_cooldown/to_remove = target_abilities[chosen_ability] @@ -803,20 +349,16 @@ GLOBAL_PROTECT(admin_verbs_poll) return qdel(to_remove) - log_admin("[key_name(usr)] removed the ability [chosen_ability] from [key_name(removal_target)].") - message_admins("[key_name_admin(usr)] removed the ability [chosen_ability] from [key_name_admin(removal_target)].") + log_admin("[key_name(user)] removed the ability [chosen_ability] from [key_name(removal_target)].") + message_admins("[key_name_admin(user)] removed the ability [chosen_ability] from [key_name_admin(removal_target)].") BLACKBOX_LOG_ADMIN_VERB("Remove Mob Ability") -/client/proc/give_spell(mob/spell_recipient in GLOB.mob_list) - set category = "Admin.Fun" - set name = "Give Spell" - set desc = "Gives a spell to a mob." - - var/which = tgui_alert(usr, "Chose by name or by type path?", "Chose option", list("Name", "Typepath")) +ADMIN_VERB(give_spell, R_FUN, "Give Spell", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/spell_recipient) + var/which = tgui_alert(user, "Chose by name or by type path?", "Chose option", list("Name", "Typepath")) if(!which) return if(QDELETED(spell_recipient)) - to_chat(usr, span_warning("The intended spell recipient no longer exists.")) + to_chat(user, span_warning("The intended spell recipient no longer exists.")) return var/list/spell_list = list() @@ -830,22 +372,22 @@ GLOBAL_PROTECT(admin_verbs_poll) else spell_list += to_add - var/chosen_spell = tgui_input_list(usr, "Choose the spell to give to [spell_recipient]", "ABRAKADABRA", sort_list(spell_list)) + var/chosen_spell = tgui_input_list(user, "Choose the spell to give to [spell_recipient]", "ABRAKADABRA", sort_list(spell_list)) if(isnull(chosen_spell)) return var/datum/action/cooldown/spell/spell_path = which == "Typepath" ? chosen_spell : spell_list[chosen_spell] if(!ispath(spell_path)) return - var/robeless = (tgui_alert(usr, "Would you like to force this spell to be robeless?", "Robeless Casting?", list("Force Robeless", "Use Spell Setting")) == "Force Robeless") + var/robeless = (tgui_alert(user, "Would you like to force this spell to be robeless?", "Robeless Casting?", list("Force Robeless", "Use Spell Setting")) == "Force Robeless") if(QDELETED(spell_recipient)) - to_chat(usr, span_warning("The intended spell recipient no longer exists.")) + to_chat(user, span_warning("The intended spell recipient no longer exists.")) return BLACKBOX_LOG_ADMIN_VERB("Give Spell") - log_admin("[key_name(usr)] gave [key_name(spell_recipient)] the spell [chosen_spell][robeless ? " (Forced robeless)" : ""].") - message_admins("[key_name_admin(usr)] gave [key_name_admin(spell_recipient)] the spell [chosen_spell][robeless ? " (Forced robeless)" : ""].") + log_admin("[key_name(user)] gave [key_name(spell_recipient)] the spell [chosen_spell][robeless ? " (Forced robeless)" : ""].") + message_admins("[key_name_admin(user)] gave [key_name_admin(spell_recipient)] the spell [chosen_spell][robeless ? " (Forced robeless)" : ""].") var/datum/action/cooldown/spell/new_spell = new spell_path(spell_recipient.mind || spell_recipient) @@ -855,14 +397,10 @@ GLOBAL_PROTECT(admin_verbs_poll) new_spell.Grant(spell_recipient) if(!spell_recipient.mind) - to_chat(usr, span_userdanger("Spells given to mindless mobs will belong to the mob and not their mind, \ + to_chat(user, span_userdanger("Spells given to mindless mobs will belong to the mob and not their mind, \ and as such will not be transferred if their mind changes body (Such as from Mindswap).")) -/client/proc/remove_spell(mob/removal_target in GLOB.mob_list) - set category = "Admin.Fun" - set name = "Remove Spell" - set desc = "Remove a spell from the selected mob." - +ADMIN_VERB(remove_spell, R_FUN, "Remove Spell", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/removal_target) var/list/target_spell_list = list() for(var/datum/action/cooldown/spell/spell in removal_target.actions) target_spell_list[spell.name] = spell @@ -870,7 +408,7 @@ GLOBAL_PROTECT(admin_verbs_poll) if(!length(target_spell_list)) return - var/chosen_spell = tgui_input_list(usr, "Choose the spell to remove from [removal_target]", "ABRAKADABRA", sort_list(target_spell_list)) + var/chosen_spell = tgui_input_list(user, "Choose the spell to remove from [removal_target]", "ABRAKADABRA", sort_list(target_spell_list)) if(isnull(chosen_spell)) return var/datum/action/cooldown/spell/to_remove = target_spell_list[chosen_spell] @@ -878,58 +416,39 @@ GLOBAL_PROTECT(admin_verbs_poll) return qdel(to_remove) - log_admin("[key_name(usr)] removed the spell [chosen_spell] from [key_name(removal_target)].") - message_admins("[key_name_admin(usr)] removed the spell [chosen_spell] from [key_name_admin(removal_target)].") + log_admin("[key_name(user)] removed the spell [chosen_spell] from [key_name(removal_target)].") + message_admins("[key_name_admin(user)] removed the spell [chosen_spell] from [key_name_admin(removal_target)].") BLACKBOX_LOG_ADMIN_VERB("Remove Spell") -/client/proc/give_disease(mob/living/T in GLOB.mob_living_list) - set category = "Admin.Fun" - set name = "Give Disease" - set desc = "Gives a Disease to a mob." - if(!istype(T)) - to_chat(src, span_notice("You can only give a disease to a mob of type /mob/living."), confidential = TRUE) - return - var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in sort_list(SSdisease.diseases, GLOBAL_PROC_REF(cmp_typepaths_asc)) +ADMIN_VERB(give_disease, R_FUN, "Give Disease", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/living/victim) + var/datum/disease/D = input(user, "Choose the disease to give to that guy", "ACHOO") as null|anything in sort_list(SSdisease.diseases, GLOBAL_PROC_REF(cmp_typepaths_asc)) if(!D) return - T.ForceContractDisease(new D, FALSE, TRUE) + victim.ForceContractDisease(new D, FALSE, TRUE) BLACKBOX_LOG_ADMIN_VERB("Give Disease") - log_admin("[key_name(usr)] gave [key_name(T)] the disease [D].") - message_admins(span_adminnotice("[key_name_admin(usr)] gave [key_name_admin(T)] the disease [D].")) - -/client/proc/object_say(obj/O in world) - set category = "Admin.Events" - set name = "OSay" - set desc = "Makes an object say something." - var/message = tgui_input_text(usr, "What do you want the message to be?", "Make Sound", encode = FALSE) + log_admin("[key_name(user)] gave [key_name(victim)] the disease [D].") + message_admins(span_adminnotice("[key_name_admin(user)] gave [key_name_admin(victim)] the disease [D].")) + +ADMIN_VERB_AND_CONTEXT_MENU(object_say, R_FUN, "OSay", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, obj/speaker in world) + var/message = tgui_input_text(user, "What do you want the message to be?", "Make Sound", encode = FALSE) if(!message) return - O.say(message, sanitize = FALSE) - log_admin("[key_name(usr)] made [O] at [AREACOORD(O)] say \"[message]\"") - message_admins(span_adminnotice("[key_name_admin(usr)] made [O] at [AREACOORD(O)]. say \"[message]\"")) + speaker.say(message, sanitize = FALSE) + log_admin("[key_name(user)] made [speaker] at [AREACOORD(speaker)] say \"[message]\"") + message_admins(span_adminnotice("[key_name_admin(user)] made [speaker] at [AREACOORD(speaker)]. say \"[message]\"")) BLACKBOX_LOG_ADMIN_VERB("Object Say") -/client/proc/togglebuildmodeself() - set name = "Toggle Build Mode Self" - set category = "Admin.Events" - if (!(holder.rank_flags() & R_BUILD)) - return - if(src.mob) - togglebuildmode(src.mob) - BLACKBOX_LOG_ADMIN_VERB("Toggle Build Mode") -/client/proc/check_ai_laws() - set name = "Check AI Laws" - set category = "Admin.Game" - if(holder) - src.holder.output_ai_laws() +ADMIN_VERB(build_mode_self, R_BUILD, "Toggle Build Mode Self", "Toggle build mode for yourself.", ADMIN_CATEGORY_EVENTS) + togglebuildmode(user.mob) // why is this a global proc??? + BLACKBOX_LOG_ADMIN_VERB("Toggle Build Mode") -/client/proc/manage_sect() - set name = "Manage Religious Sect" - set category = "Admin.Game" +ADMIN_VERB(check_ai_laws, R_ADMIN, "Check AI Laws", "View the current AI laws.", ADMIN_CATEGORY_GAME) + user.holder.output_ai_laws() +ADMIN_VERB(manage_sect, R_ADMIN, "Manage Religious Sect", "Manages the chaplain's religion.", ADMIN_CATEGORY_GAME) if (!isnull(GLOB.religious_sect)) var/you_sure = tgui_alert( - usr, + user, "The Chaplain has already chosen [GLOB.religious_sect.name], override their selection?", "Replace God?", list("Yes", "Cancel"), @@ -942,7 +461,7 @@ GLOBAL_PROTECT(admin_verbs_poll) choices["nothing"] = null for(var/datum/religion_sect/sect as anything in subtypesof(/datum/religion_sect)) choices[initial(sect.name)] = sect - var/choice = tgui_input_list(usr, "Set new Chaplain sect", "God Picker", choices) + var/choice = tgui_input_list(user, "Set new Chaplain sect", "God Picker", choices) if(isnull(choice)) return if(choice == "nothing") @@ -950,122 +469,51 @@ GLOBAL_PROTECT(admin_verbs_poll) return set_new_religious_sect(choices[choice], reset_existing = TRUE) -/client/proc/deadmin() - set name = "Deadmin" - set category = "Admin" - set desc = "Shed your admin powers." - - if(!holder) - return - - holder.deactivate() - - to_chat(src, span_interface("You are now a normal player.")) - log_admin("[src] deadminned themselves.") - message_admins("[src] deadminned themselves.") +ADMIN_VERB(deadmin, R_NONE, "DeAdmin", "Shed your admin powers.", ADMIN_CATEGORY_MAIN) + user.holder.deactivate() + to_chat(user, span_interface("You are now a normal player.")) + log_admin("[key_name(user)] deadminned themselves.") + message_admins("[key_name_admin(user)] deadminned themselves.") BLACKBOX_LOG_ADMIN_VERB("Deadmin") -/client/proc/readmin() - set name = "Readmin" - set category = "Admin" - set desc = "Regain your admin powers." - - var/datum/admins/A = GLOB.deadmins[ckey] - - if(!A) - A = GLOB.admin_datums[ckey] - if (!A) - var/msg = " is trying to readmin but they have no deadmin entry" - message_admins("[key_name_admin(src)][msg]") - log_admin_private("[key_name(src)][msg]") - return - - A.associate(src) - - if (!holder) - return //This can happen if an admin attempts to vv themself into somebody elses's deadmin datum by getting ref via brute force - - to_chat(src, span_interface("You are now an admin."), confidential = TRUE) - message_admins("[src] re-adminned themselves.") - log_admin("[src] re-adminned themselves.") - BLACKBOX_LOG_ADMIN_VERB("Readmin") - -/client/proc/populate_world(amount = 50) - set name = "Populate World" - set category = "Debug" - set desc = "(\"Amount of mobs to create\") Populate the world with test mobs." - +ADMIN_VERB(populate_world, R_DEBUG, "Populate World", "Populate the world with test mobs.", ADMIN_CATEGORY_DEBUG, amount = 50 as num) for (var/i in 1 to amount) var/turf/tile = get_safe_random_station_turf() var/mob/living/carbon/human/hooman = new(tile) hooman.equipOutfit(pick(subtypesof(/datum/outfit))) testing("Spawned test mob at [get_area_name(tile, TRUE)] ([tile.x],[tile.y],[tile.z])") -/client/proc/toggle_AI_interact() - set name = "Toggle Admin AI Interact" - set category = "Admin.Game" - set desc = "Allows you to interact with most machines as an AI would as a ghost" - - AI_Interact = !AI_Interact - if(mob && isAdminGhostAI(mob)) - mob.has_unlimited_silicon_privilege = AI_Interact - - log_admin("[key_name(usr)] has [AI_Interact ? "activated" : "deactivated"] Admin AI Interact") - message_admins("[key_name_admin(usr)] has [AI_Interact ? "activated" : "deactivated"] their AI interaction") - -/client/proc/debugstatpanel() - set name = "Debug Stat Panel" - set category = "Debug" - - src.stat_panel.send_message("create_debug") - -/client/proc/admin_2fa_verify() - set name = "Verify Admin" - set category = "Admin" - - var/datum/admins/admin = GLOB.admin_datums[ckey] - admin?.associate(src) - -/client/proc/display_sendmaps() - set name = "Send Maps Profile" - set category = "Debug" +ADMIN_VERB(toggle_ai_interact, R_ADMIN, "Toggle Admin AI Interact", "Allows you to interact with most machines as an AI would as a ghost.", ADMIN_CATEGORY_GAME) + user.AI_Interact = !user.AI_Interact + if(user.mob && isAdminGhostAI(user.mob)) + user.mob.has_unlimited_silicon_privilege = user.AI_Interact - src << link("?debug=profile&type=sendmaps&window=test") + log_admin("[key_name(user)] has [user.AI_Interact ? "activated" : "deactivated"] Admin AI Interact") + message_admins("[key_name_admin(user)] has [user.AI_Interact ? "activated" : "deactivated"] their AI interaction") -/** - * Debug verb that spawns human crewmembers - * of each job type, gives them a mind and assigns the role, - * and injects them into the manifest, as if they were a "player". - * - * This spawns humans with minds and jobs, but does NOT make them 'players'. - * They're all clientles mobs with minds / jobs. - */ -/client/proc/spawn_debug_full_crew() - set name = "Spawn Debug Full Crew" - set desc = "Creates a full crew for the station, filling the datacore and assigning them all minds / jobs. Don't do this on live" - set category = "Debug" +ADMIN_VERB(debug_statpanel, R_DEBUG, "Debug Stat Panel", "Toggles local debug of the stat panel", ADMIN_CATEGORY_DEBUG) + user.stat_panel.send_message("create_debug") - if(!check_rights(R_DEBUG)) - return - - var/mob/admin = usr +ADMIN_VERB(display_sendmaps, R_DEBUG, "Send Maps Profile", "View the profile.", ADMIN_CATEGORY_DEBUG) + user << link("?debug=profile&type=sendmaps&window=test") +ADMIN_VERB(spawn_debug_full_crew, R_DEBUG, "Spawn Debug Full Crew", "Creates a full crew for the station, flling datacore and assigning minds and jobs.", ADMIN_CATEGORY_DEBUG) if(SSticker.current_state != GAME_STATE_PLAYING) - to_chat(admin, "You should only be using this after a round has setup and started.") + to_chat(user, "You should only be using this after a round has setup and started.") return // Two input checks here to make sure people are certain when they're using this. - if(tgui_alert(admin, "This command will create a bunch of dummy crewmembers with minds, job, and datacore entries, which will take a while and fill the manifest.", "Spawn Crew", list("Yes", "Cancel")) != "Yes") + if(tgui_alert(user, "This command will create a bunch of dummy crewmembers with minds, job, and datacore entries, which will take a while and fill the manifest.", "Spawn Crew", list("Yes", "Cancel")) != "Yes") return - if(tgui_alert(admin, "I sure hope you aren't doing this on live. Are you sure?", "Spawn Crew (Be certain)", list("Yes", "Cancel")) != "Yes") + if(tgui_alert(user, "I sure hope you aren't doing this on live. Are you sure?", "Spawn Crew (Be certain)", list("Yes", "Cancel")) != "Yes") return // Find the observer spawn, so we have a place to dump the dummies. var/obj/effect/landmark/observer_start/observer_point = locate(/obj/effect/landmark/observer_start) in GLOB.landmarks_list var/turf/destination = get_turf(observer_point) if(!destination) - to_chat(admin, "Failed to find the observer spawn to send the dummies.") + to_chat(user, "Failed to find the observer spawn to send the dummies.") return // Okay, now go through all nameable occupations. @@ -1087,7 +535,7 @@ GLOBAL_PROTECT(admin_verbs_poll) // Assign the rank to the new player dummy. if(!SSjob.AssignRole(new_guy, job, do_eligibility_checks = FALSE)) qdel(new_guy) - to_chat(admin, "[rank] wasn't able to be spawned.") + to_chat(user, "[rank] wasn't able to be spawned.") continue // It's got a job, spawn in a human and shove it in the human. @@ -1108,13 +556,9 @@ GLOBAL_PROTECT(admin_verbs_poll) number_made++ CHECK_TICK - to_chat(admin, "[number_made] crewmembers have been created.") - -/// Debug verb for seeing at a glance what all spells have as set requirements -/client/proc/debug_spell_requirements() - set name = "Show Spell Requirements" - set category = "Debug" + to_chat(user, "[number_made] crewmembers have been created.") +ADMIN_VERB(debug_spell_requirements, R_DEBUG, "Debug Spell Requirements", "View all spells and their requirements.", ADMIN_CATEGORY_DEBUG) var/header = "Name Requirements" var/all_requirements = list() for(var/datum/action/cooldown/spell/spell as anything in typesof(/datum/action/cooldown/spell)) @@ -1142,69 +586,52 @@ GLOBAL_PROTECT(admin_verbs_poll) var/page_style = "" var/page_contents = "[page_style][header][jointext(all_requirements, "")]
" - var/datum/browser/popup = new(mob, "spellreqs", "Spell Requirements", 600, 400) + var/datum/browser/popup = new(user.mob, "spellreqs", "Spell Requirements", 600, 400) popup.set_content(page_contents) popup.open() -/client/proc/force_load_lazy_template() - set name = "Load/Jump Lazy Template" - set category = "Admin.Events" - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(load_lazy_template, R_ADMIN, "Load/Jump Lazy Template", "Loads a lazy template and/or jumps to it.", ADMIN_CATEGORY_EVENTS) var/list/choices = LAZY_TEMPLATE_KEY_LIST_ALL() - var/choice = tgui_input_list(usr, "Key?", "Lazy Loader", choices) + var/choice = tgui_input_list(user, "Key?", "Lazy Loader", choices) if(!choice) return choice = choices[choice] if(!choice) - to_chat(usr, span_warning("No template with that key found, report this!")) + to_chat(user, span_warning("No template with that key found, report this!")) return var/already_loaded = LAZYACCESS(SSmapping.loaded_lazy_templates, choice) var/force_load = FALSE - if(already_loaded && (tgui_alert(usr, "Template already loaded.", "", list("Jump", "Load Again")) == "Load Again")) + if(already_loaded && (tgui_alert(user, "Template already loaded.", "", list("Jump", "Load Again")) == "Load Again")) force_load = TRUE var/datum/turf_reservation/reservation = SSmapping.lazy_load_template(choice, force = force_load) if(!reservation) - to_chat(usr, span_boldwarning("Failed to load template!")) + to_chat(user, span_boldwarning("Failed to load template!")) return - if(!isobserver(usr)) - admin_ghost() - usr.forceMove(reservation.bottom_left_turfs[1]) + if(!isobserver(user.mob)) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/admin_ghost) + user.mob.forceMove(reservation.bottom_left_turfs[1]) - message_admins("[key_name_admin(usr)] has loaded lazy template '[choice]'") - to_chat(usr, span_boldnicegreen("Template loaded, you have been moved to the bottom left of the reservation.")) + message_admins("[key_name_admin(user)] has loaded lazy template '[choice]'") + to_chat(user, span_boldnicegreen("Template loaded, you have been moved to the bottom left of the reservation.")) -/client/proc/library_control() - set name = "Library Management" - set category = "Admin" - if(!check_rights(R_BAN)) - return - - if(!holder.library_manager) - holder.library_manager = new() - holder.library_manager.ui_interact(usr) +ADMIN_VERB(library_control, R_BAN, "Library Management", "List and manage the Library.", ADMIN_CATEGORY_MAIN) + if(!user.holder.library_manager) + user.holder.library_manager = new + user.holder.library_manager.ui_interact(user.mob) BLACKBOX_LOG_ADMIN_VERB("Library Management") -/client/proc/create_mob_worm() - set category = "Admin.Fun" - set name = "Create Mob Worm" - set desc = "Attached a linked list of mobs to a marked mob" - if (!check_rights(R_FUN)) - return - if(isnull(holder)) - return - if(!isliving(holder.marked_datum)) - to_chat(usr, span_warning("Error: Please mark a mob to attach mobs to.")) +ADMIN_VERB(create_mob_worm, R_FUN, "Create Mob Worm", "Attach a linked list of mobs to your marked mob.", ADMIN_CATEGORY_FUN) + if(!isliving(user.holder.marked_datum)) + to_chat(user, span_warning("Error: Please mark a mob to attach mobs to.")) return - var/mob/living/head = holder.marked_datum + var/mob/living/head = user.holder.marked_datum var/attempted_target_path = tgui_input_text( - usr, + user, "Enter typepath of a mob you'd like to make your chain from.", "Typepath", "[/mob/living/basic/pet/dog/corgi/ian]", @@ -1219,7 +646,7 @@ GLOBAL_PROTECT(admin_verbs_poll) if(isnull(desired_mob) || !ispath(desired_mob) || QDELETED(head)) return //The user pressed "Cancel" - var/amount = tgui_input_number(usr, "How long should our tail be?", "Worm Configurator", default = 3, min_value = 1) + var/amount = tgui_input_number(user, "How long should our tail be?", "Worm Configurator", default = 3, min_value = 1) if (isnull(amount) || amount < 1 || QDELETED(head)) return head.AddComponent(/datum/component/mob_chain) diff --git a/code/modules/admin/callproc/callproc.dm b/code/modules/admin/callproc/callproc.dm index 1680304679e..823a4a9e64b 100644 --- a/code/modules/admin/callproc/callproc.dm +++ b/code/modules/admin/callproc/callproc.dm @@ -92,11 +92,8 @@ GLOBAL_PROTECT(AdminProcCallHandler) usr = lastusr handler.remove_caller(user) -/client/proc/callproc() - set category = "Debug" - set name = "Advanced ProcCall" - set waitfor = FALSE - callproc_blocking() +ADMIN_VERB(advanced_proc_call, R_DEBUG, "Advanced ProcCall", "Call a proc on any datum in the server.", ADMIN_CATEGORY_DEBUG) + user.callproc_blocking() /client/proc/callproc_blocking(list/get_retval) if(!check_rights(R_DEBUG)) @@ -230,37 +227,30 @@ GLOBAL_PROTECT(LastAdminCalledProc) return (GLOB.AdminProcCaller && GLOB.AdminProcCaller == usr?.client?.ckey) || (GLOB.AdminProcCallHandler && usr == GLOB.AdminProcCallHandler) #endif -/client/proc/callproc_datum(datum/A as null|area|mob|obj|turf) - set category = "Debug" - set name = "Atom ProcCall" - set waitfor = FALSE - - if(!check_rights(R_DEBUG)) - return - - var/procname = input("Proc name, eg: fake_blood","Proc:", null) as text|null +ADMIN_VERB_ONLY_CONTEXT_MENU(call_proc_datum, R_DEBUG, "Atom ProcCall", datum/thing as null|area|mob|obj|turf) + var/procname = input(user, "Proc name, eg: fake_blood","Proc:", null) as text|null if(!procname) return - if(!hascall(A,procname)) - to_chat(usr, "Error: callproc_datum(): type [A.type] has no proc named [procname].", confidential = TRUE) + if(!hascall(thing, procname)) + to_chat(user, "Error: callproc_datum(): type [thing.type] has no proc named [procname].", confidential = TRUE) return - var/list/lst = get_callproc_args() + var/list/lst = user.get_callproc_args() if(!lst) return - if(!A || !is_valid_src(A)) - to_chat(usr, span_warning("Error: callproc_datum(): owner of proc no longer exists."), confidential = TRUE) + if(!thing || !is_valid_src(thing)) + to_chat(user, span_warning("Error: callproc_datum(): owner of proc no longer exists."), confidential = TRUE) return - log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].") - var/msg = "[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]." + log_admin("[key_name(user)] called [thing]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].") + var/msg = "[key_name(user)] called [thing]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]." message_admins(msg) - admin_ticket_log(A, msg) + admin_ticket_log(thing, msg) BLACKBOX_LOG_ADMIN_VERB("Atom ProcCall") - var/returnval = WrapAdminProcCall(A, procname, lst) // Pass the lst as an argument list to the proc - . = get_callproc_returnval(returnval,procname) + var/returnval = WrapAdminProcCall(thing, procname, lst) // Pass the lst as an argument list to the proc + . = user.get_callproc_returnval(returnval,procname) if(.) - to_chat(usr, ., confidential = TRUE) + to_chat(user, ., confidential = TRUE) /client/proc/get_callproc_args() var/argnum = input("Number of arguments","Number:",0) as num|null diff --git a/code/modules/admin/force_event.dm b/code/modules/admin/force_event.dm index 20066547de9..519adbd8a9e 100644 --- a/code/modules/admin/force_event.dm +++ b/code/modules/admin/force_event.dm @@ -1,12 +1,6 @@ -///Allows an admin to force an event -/client/proc/forceEvent() - set name = "Trigger Event" - set category = "Admin.Events" - if(!holder || !check_rights(R_FUN)) - return - - holder.forceEvent() +ADMIN_VERB(force_event, R_FUN, "Trigger Event", "Forces an event to occur.", ADMIN_CATEGORY_EVENTS) + user.holder.forceEvent() ///Opens up the Force Event Panel /datum/admins/proc/forceEvent() diff --git a/code/modules/admin/known_alts.dm b/code/modules/admin/known_alts.dm index d6486f77bd7..4105c7f4edc 100644 --- a/code/modules/admin/known_alts.dm +++ b/code/modules/admin/known_alts.dm @@ -187,8 +187,5 @@ GLOBAL_DATUM_INIT(known_alts, /datum/known_alts, new) client << browse(html, "window=known_alts;size=700x400") -/datum/admins/proc/known_alts_panel() - set name = "Known Alts Panel" - set category = "Admin" - - GLOB.known_alts.show_panel(usr.client) +ADMIN_VERB(known_alts_panel, R_ADMIN, "Known Alts Panel", "View a panel of known alts.", ADMIN_CATEGORY_MAIN) + GLOB.known_alts.show_panel(user) diff --git a/code/modules/admin/outfit_manager.dm b/code/modules/admin/outfit_manager.dm index fcb41b3f2f1..f3ef7d2685c 100644 --- a/code/modules/admin/outfit_manager.dm +++ b/code/modules/admin/outfit_manager.dm @@ -1,18 +1,8 @@ -/client/proc/outfit_manager() - set category = "Debug" - set name = "Outfit Manager" - - if(!check_rights(R_DEBUG)) - return - var/datum/outfit_manager/ui = new(usr) - ui.ui_interact(usr) - +ADMIN_VERB(outfit_manager, R_DEBUG|R_ADMIN, "Outfit Manager", "View and edit outfits.", ADMIN_CATEGORY_DEBUG) + var/static/datum/outfit_manager/ui = new + ui.ui_interact(user.mob) /datum/outfit_manager - var/client/owner - -/datum/outfit_manager/New(user) - owner = CLIENT_FROM_VAR(user) /datum/outfit_manager/ui_state(mob/user) return GLOB.admin_state @@ -53,24 +43,24 @@ switch(action) if("new") - owner.open_outfit_editor(new /datum/outfit) + ui.user.client.open_outfit_editor(new /datum/outfit) if("load") - owner.holder.load_outfit(owner.mob) + ui.user.client.holder.load_outfit(ui.user) if("copy") - var/datum/outfit/outfit = tgui_input_list(owner, "Pick an outfit to copy from", "Outfit Manager", subtypesof(/datum/outfit)) + var/datum/outfit/outfit = tgui_input_list(ui.user, "Pick an outfit to copy from", "Outfit Manager", subtypesof(/datum/outfit)) if(isnull(outfit)) return if(!ispath(outfit)) return - owner.open_outfit_editor(new outfit) + ui.user.client.open_outfit_editor(new outfit) var/datum/outfit/target_outfit = locate(params["outfit"]) if(!istype(target_outfit)) return switch(action) //wow we're switching through action again this is horrible optimization smh if("edit") - owner.open_outfit_editor(target_outfit) + ui.user.client.open_outfit_editor(target_outfit) if("save") - owner.holder.save_outfit(owner.mob, target_outfit) + ui.user.client.holder.save_outfit(ui.user, target_outfit) if("delete") - owner.holder.delete_outfit(owner.mob, target_outfit) + ui.user.client.holder.delete_outfit(ui.user, target_outfit) diff --git a/code/modules/admin/painting_manager.dm b/code/modules/admin/painting_manager.dm index bd7d28fb73f..7a8bd7127a4 100644 --- a/code/modules/admin/painting_manager.dm +++ b/code/modules/admin/painting_manager.dm @@ -1,11 +1,6 @@ -/datum/admins/proc/paintings_manager() - set name = "Paintings Manager" - set category = "Admin" - - if(!check_rights(R_ADMIN)) - return - var/datum/paintings_manager/ui = new(usr) - ui.ui_interact(usr) +ADMIN_VERB(painting_manager, R_ADMIN, "Paintings Manager", "View and redact paintings.", ADMIN_CATEGORY_MAIN) + var/static/datum/paintings_manager/ui = new + ui.ui_interact(user.mob) /// Painting Admin Management Panel /datum/paintings_manager diff --git a/code/modules/admin/permissionedit.dm b/code/modules/admin/permissionedit.dm index cf816fef8a7..e92ab1729e2 100644 --- a/code/modules/admin/permissionedit.dm +++ b/code/modules/admin/permissionedit.dm @@ -1,10 +1,6 @@ -/client/proc/edit_admin_permissions() - set category = "Admin" - set name = "Permissions Panel" - set desc = "Edit admin permissions" - if(!check_rights(R_PERMISSIONS)) - return - usr.client.holder.edit_admin_permissions() + +ADMIN_VERB(edit_admin_permissions, R_PERMISSIONS, "Permissions Panel", "Edit admin permissions.", ADMIN_CATEGORY_MAIN) + user.holder.edit_admin_permissions() /datum/admins/proc/edit_admin_permissions(action, target, operation, page) if(!check_rights(R_PERMISSIONS)) diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm index 537e0b92acb..fede9724ab1 100644 --- a/code/modules/admin/stickyban.dm +++ b/code/modules/admin/stickyban.dm @@ -481,10 +481,5 @@ . = list2params(.) - -/client/proc/stickybanpanel() - set name = "Sticky Ban Panel" - set category = "Admin" - if (!holder) - return - holder.stickyban_show() +ADMIN_VERB(panel_sticky_ban, R_BAN, "Sticky Ban Panel", "List and manage sticky bans.", ADMIN_CATEGORY_MAIN) + user.holder.stickyban_show() diff --git a/code/modules/admin/tag.dm b/code/modules/admin/tag.dm index 64c6c16fc40..e52112eba14 100644 --- a/code/modules/admin/tag.dm +++ b/code/modules/admin/tag.dm @@ -49,21 +49,14 @@ [X.getToxLoss()] \ [X.getOxyLoss()]" -/// Display all of the tagged datums -/datum/admins/proc/display_tags() - set category = "Admin.Game" - set name = "View Tags" - - if (!istype(src, /datum/admins)) - src = usr.client.holder - if (!istype(src, /datum/admins)) - to_chat(usr, "Error: you are not an admin!", confidential = TRUE) - return - +ADMIN_VERB(display_tags, R_ADMIN, "View Tags", "Display all of the tagged datums.", ADMIN_CATEGORY_GAME) var/index = 0 var/list/dat = list("
Tag Menu

") - dat += "
Refresh
" + var/list/tagged_datums = user.holder.tagged_datums + var/list/marked_datum = user.holder.marked_datum + + dat += "
Refresh
" if(LAZYLEN(tagged_datums)) for(var/datum/iter_datum as anything in tagged_datums) index++ @@ -71,7 +64,7 @@ if(isnull(iter_datum)) dat += "\t[index]: Null reference - Check runtime logs!" - stack_trace("Null datum found in tagged datum menu! User: [usr]") + stack_trace("Null datum found in tagged datum menu! User: [user]") continue else if(iscarbon(iter_datum)) var/mob/living/carbon/resolved_carbon = iter_datum @@ -99,7 +92,7 @@ dat += "No datums tagged :(" dat = dat.Join("
") - usr << browse(dat, "window=tag;size=800x480") + user << browse(dat, "window=tag;size=800x480") #undef TAG_DEL #undef TAG_MARK diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index ce5ea7bb4f5..137409e573c 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -173,8 +173,7 @@ to_chat(usr, "[shuttle_console] was [shuttle_console.admin_controlled ? "locked" : "unlocked"].", confidential = TRUE) else if(href_list["delay_round_end"]) - // Permissions are checked in delay_round_end - delay_round_end() + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/delay_round_end) else if(href_list["undelay_round_end"]) if(!check_rights(R_SERVER)) @@ -769,21 +768,10 @@ our_mob.AIize(our_mob.client, move) else if(href_list["makerobot"]) - if(!check_rights(R_SPAWN)) - return - - var/mob/our_mob = locate(href_list["makerobot"]) - if(!istype(our_mob)) - return - if(iscyborg(our_mob)) - to_chat(usr, "That's already a cyborg.", confidential = TRUE) - return - - usr.client.cmd_admin_robotize(our_mob) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/cmd_admin_robotize, locate(href_list["makerobot"])) else if(href_list["adminplayeropts"]) - var/mob/M = locate(href_list["adminplayeropts"]) - show_player_panel(M) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/show_player_panel, locate(href_list["adminplayeropts"])) else if(href_list["ppbyckey"]) var/target_ckey = href_list["ppbyckey"] @@ -798,7 +786,7 @@ return to_chat(usr, span_notice("Jumping to [target_ckey]'s new mob: [target_mob]!")) - show_player_panel(target_mob) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/show_player_panel, target_mob) else if(href_list["adminplayerobservefollow"]) if(!isobserver(usr) && !check_rights(R_ADMIN)) @@ -815,20 +803,13 @@ AM.forceMove(get_turf(usr)) else if(href_list["adminplayerobservecoodjump"]) - if(!isobserver(usr) && !check_rights(R_ADMIN)) - return - if(isnewplayer(usr)) - return - - var/x = text2num(href_list["X"]) - var/y = text2num(href_list["Y"]) - var/z = text2num(href_list["Z"]) - - var/client/C = usr.client - if(!isobserver(usr)) - C.admin_ghost() - sleep(0.2 SECONDS) - C.jumptocoord(x,y,z) + return SSadmin_verbs.dynamic_invoke_verb( + usr, + /datum/admin_verb/jump_to_coord, + text2num(href_list["X"]), + text2num(href_list["Y"]), + text2num(href_list["Z"]), + ) else if(href_list["adminchecklaws"]) if(!check_rights(R_ADMIN)) @@ -1028,15 +1009,7 @@ give_admin_popup(target, owner, message) else if(href_list["adminsmite"]) - if(!check_rights(R_ADMIN|R_FUN)) - return - - var/mob/living/carbon/human/H = locate(href_list["adminsmite"]) in GLOB.mob_list - if(!H || !istype(H)) - to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human", confidential = TRUE) - return - - usr.client.smite(H) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/admin_smite, locate(href_list["adminsmite"])) else if(href_list["CentComReply"]) if(!check_rights(R_ADMIN)) @@ -1065,42 +1038,21 @@ var/obj/item/station_charter/charter = locate(href_list["reject_custom_name"]) if(istype(charter)) charter.reject_proposed(usr) - else if(href_list["jumpto"]) - if(!isobserver(usr) && !check_rights(R_ADMIN)) - return - var/mob/M = locate(href_list["jumpto"]) - usr.client.jumptomob(M) + else if(href_list["jumpto"]) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/jump_to_mob, locate(href_list["jumpto"])) else if(href_list["getmob"]) - if(!check_rights(R_ADMIN)) - return - - if(tgui_alert(usr, "Confirm?", "Message", list("Yes", "No")) != "Yes") - return - var/mob/M = locate(href_list["getmob"]) - usr.client.Getmob(M) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/get_mob, locate(href_list["getmob"])) else if(href_list["sendmob"]) - if(!check_rights(R_ADMIN)) - return - - var/mob/M = locate(href_list["sendmob"]) - usr.client.sendmob(M) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/send_mob, locate(href_list["sendmob"])) else if(href_list["narrateto"]) - if(!check_rights(R_ADMIN)) - return - - var/mob/M = locate(href_list["narrateto"]) - usr.client.cmd_admin_direct_narrate(M) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/cmd_admin_direct_narrate, locate(href_list["narrateto"])) else if(href_list["subtlemessage"]) - if(!check_rights(R_ADMIN)) - return - - var/mob/M = locate(href_list["subtlemessage"]) - usr.client.cmd_admin_subtle_message(M) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/cmd_admin_subtle_message, locate(href_list["subtlemessage"])) else if(href_list["playsoundto"]) if(!check_rights(R_SOUND)) @@ -1109,7 +1061,7 @@ var/mob/M = locate(href_list["playsoundto"]) var/S = input("", "Select a sound file",) as null|sound if(S) - usr.client.play_direct_mob_sound(S, M) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/play_direct_mob_sound, S, M) else if(href_list["individuallog"]) if(!check_rights(R_ADMIN)) @@ -1148,7 +1100,8 @@ else D.traitor_panel() else - show_traitor_panel(M) + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/show_traitor_panel, M) + return else if(href_list["skill"]) if(!check_rights(R_ADMIN)) @@ -1168,17 +1121,11 @@ else to_chat(usr, "This can only be used on instances of type /mob and /mind", confidential = TRUE) return - show_skill_panel(target_mind) + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/show_skill_panel, target_mind) + return else if(href_list["borgpanel"]) - if(!check_rights(R_ADMIN)) - return - - var/mob/M = locate(href_list["borgpanel"]) - if(!iscyborg(M)) - to_chat(usr, "This can only be used on cyborgs", confidential = TRUE) - else - open_borgopanel(M) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/borg_panel, locate(href_list["borgpanel"])) else if(href_list["initmind"]) if(!check_rights(R_ADMIN)) @@ -1350,9 +1297,7 @@ return else if(href_list["check_antagonist"]) - if(!check_rights(R_ADMIN)) - return - usr.client.check_antagonists() + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/check_antagonists) else if(href_list["kick_all_from_lobby"]) if(!check_rights(R_ADMIN)) @@ -1422,7 +1367,7 @@ log_admin("[key_name(usr)] turned a Lag Switch measure at index ([switch_index]) [LAZYACCESS(SSlag_switch.measures, switch_index) ? "ON" : "OFF"]") message_admins("[key_name_admin(usr)] turned a Lag Switch measure [LAZYACCESS(SSlag_switch.measures, switch_index) ? "ON" : "OFF"]") - src.show_lag_switch_panel() + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/lag_switch_panel) else if(href_list["change_lag_switch_option"]) if(!check_rights(R_ADMIN)) @@ -1451,7 +1396,7 @@ log_admin("[key_name(usr)] set the Lag Switch slowmode cooldown to [new_num] seconds.") message_admins("[key_name_admin(usr)] set the Lag Switch slowmode cooldown to [new_num] seconds.") - src.show_lag_switch_panel() + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/lag_switch_panel) else if(href_list["viewruntime"]) var/datum/error_viewer/error_viewer = locate(href_list["viewruntime"]) @@ -1567,13 +1512,7 @@ toggle_id_ctf(usr, CTF_GHOST_CTF_GAME_ID) else if(href_list["rebootworld"]) - if(!check_rights(R_ADMIN)) - return - var/confirm = tgui_alert(usr,"Are you sure you want to reboot the server?", "Confirm Reboot", list("Yes", "No")) - if(confirm == "No") - return - if(confirm == "Yes") - restart() + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/restart) else if(href_list["check_teams"]) if(!check_rights(R_ADMIN)) @@ -1792,9 +1731,7 @@ return remove_tagged_datum(datum_to_remove) else if(href_list["show_tags"]) - if(!check_rights(R_ADMIN)) - return - return display_tags() + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/display_tags) else if(href_list["mark_datum"]) if(!check_rights(R_ADMIN)) @@ -1850,7 +1787,4 @@ web_sound(usr, link_url, credit) else if(href_list["debug_z_levels"]) - if(!check_rights(R_DEBUG)) - return - - owner.debug_z_levels() + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/debug_z_levels) diff --git a/code/modules/admin/trophy_manager.dm b/code/modules/admin/trophy_manager.dm index 6a45afb8e45..5ad703b0994 100644 --- a/code/modules/admin/trophy_manager.dm +++ b/code/modules/admin/trophy_manager.dm @@ -1,11 +1,6 @@ -/datum/admins/proc/trophy_manager() - set name = "Trophy Manager" - set category = "Admin" - - if(!check_rights(R_ADMIN)) - return - var/datum/trophy_manager/ui = new(usr) - ui.ui_interact(usr) +ADMIN_VERB(trophy_manager, R_ADMIN, "Trophy Manager", "View all trophies.", ADMIN_CATEGORY_MAIN) + var/static/datum/trophy_manager/ui = new + ui.ui_interact(user.mob) /// Trophy Admin Management Panel /datum/trophy_manager diff --git a/code/modules/admin/verb_datums/_admin_verb_datum.dm b/code/modules/admin/verb_datums/_admin_verb_datum.dm new file mode 100644 index 00000000000..6255d962c40 --- /dev/null +++ b/code/modules/admin/verb_datums/_admin_verb_datum.dm @@ -0,0 +1,27 @@ +GENERAL_PROTECT_DATUM(/datum/admin_verb) + +/** + * This is the admin verb datum. It is used to store the verb's information and handle the verb's functionality. + * All of this is setup for you, and you should not be defining this manually. + * That means you reader. + */ +/datum/admin_verb + var/name //! The name of the verb. + var/description //! The description of the verb. + var/category //! The category of the verb. + var/permissions //! The permissions required to use the verb. + var/visibility_flag //! The flag that determines if the verb is visible. + VAR_PROTECTED/verb_path //! The path to the verb proc. + +/datum/admin_verb/Destroy(force) + if(!force) + return QDEL_HINT_LETMELIVE + return ..() + +/// Assigns the verb to the admin. +/datum/admin_verb/proc/assign_to_client(client/admin) + add_verb(admin, verb_path) + +/// Unassigns the verb from the admin. +/datum/admin_verb/proc/unassign_from_client(client/admin) + remove_verb(admin, verb_path) diff --git a/code/modules/admin/verb_datums/_admin_verb_holder.dm b/code/modules/admin/verb_datums/_admin_verb_holder.dm new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm index 50da67115ea..36db4fa8bc4 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm @@ -195,20 +195,15 @@ state = SDQL2_STATE_ERROR;\ CRASH("SDQL2 fatal error");}; -/client/proc/SDQL2_query(query_text as message) - set category = "Debug" - if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe. - message_admins(span_danger("ERROR: Non-admin [key_name(usr)] attempted to execute a SDQL query!")) - usr.log_message("non-admin attempted to execute a SDQL query!", LOG_ADMIN) - return FALSE - var/prompt = tgui_alert(usr, "Run SDQL2 Query?", "SDQL2", list("Yes", "Cancel")) +ADMIN_VERB(sdql2_query, R_DEBUG, "SDQL2 Query", "Run a SDQL2 query.", ADMIN_CATEGORY_DEBUG, query_text as message) + var/prompt = tgui_alert(user, "Run SDQL2 Query?", "SDQL2", list("Yes", "Cancel")) if (prompt != "Yes") return - var/list/results = world.SDQL2_query(query_text, key_name_admin(usr), "[key_name(usr)]") + var/list/results = world.SDQL2_query(query_text, key_name_admin(user), "[key_name(user)]") if(length(results) == 3) for(var/I in 1 to 3) - to_chat(usr, span_admin(results[I]), confidential = TRUE) - SSblackbox.record_feedback("nested tally", "SDQL query", 1, list(ckey, query_text)) + to_chat(user, span_admin(results[I]), confidential = TRUE) + SSblackbox.record_feedback("nested tally", "SDQL query", 1, list(user.ckey, query_text)) /world/proc/SDQL2_query(query_text, log_entry1, log_entry2, silent = FALSE) var/query_log = "executed SDQL query(s): \"[query_text]\"." diff --git a/code/modules/admin/verbs/admin.dm b/code/modules/admin/verbs/admin.dm index d78014e84d2..93028ac9e5e 100644 --- a/code/modules/admin/verbs/admin.dm +++ b/code/modules/admin/verbs/admin.dm @@ -1,15 +1,5 @@ -// Admin Tab - Admin Verbs - -/client/proc/show_tip() - set category = "Admin" - set name = "Show Tip" - set desc = "Sends a tip (that you specify) to all players. After all \ - you're the experienced player here." - - if(!check_rights(R_ADMIN)) - return - - var/input = input(usr, "Please specify your tip that you want to send to the players.", "Tip", "") as message|null +ADMIN_VERB(show_tip, R_ADMIN, "Show Tip", "Sends a tip to all players.", ADMIN_CATEGORY_MAIN) + var/input = input(user, "Please specify your tip that you want to send to the players.", "Tip", "") as message|null if(!input) return @@ -22,44 +12,34 @@ else SSticker.selected_tip = input - message_admins("[key_name_admin(usr)] sent a tip of the round.") - log_admin("[key_name(usr)] sent \"[input]\" as the Tip of the Round.") + message_admins("[key_name_admin(user)] sent a tip of the round.") + log_admin("[key_name(user)] sent \"[input]\" as the Tip of the Round.") BLACKBOX_LOG_ADMIN_VERB("Show Tip") -/datum/admins/proc/announce() - set category = "Admin" - set name = "Announce" - set desc="Announce your desires to the world" - if(!check_rights(0)) +ADMIN_VERB(announce, R_ADMIN, "Announce", "Announce your desires to the world.", ADMIN_CATEGORY_MAIN) + var/message = input(user, "Global message to send:", "Admin Announce") as message|null + if(!message) return - var/message = input("Global message to send:", "Admin Announce", null, null) as message|null - if(message) - if(!check_rights(R_SERVER,0)) - message = adminscrub(message,500) - send_ooc_announcement(message, "From [usr.client.holder.fakekey ? "Administrator" : usr.key]") - log_admin("Announce: [key_name(usr)] : [message]") + if(!user.holder.check_for_rights(R_SERVER)) + message = adminscrub(message,500) + send_ooc_announcement(message, "From [user.holder.fakekey ? "Administrator" : user.key]") + log_admin("Announce: [key_name(user)] : [message]") BLACKBOX_LOG_ADMIN_VERB("Announce") -/datum/admins/proc/unprison(mob/M in GLOB.mob_list) - set category = "Admin" - set name = "Unprison" - if (is_centcom_level(M.z)) - SSjob.SendToLateJoin(M) - message_admins("[key_name_admin(usr)] has unprisoned [key_name_admin(M)]") - log_admin("[key_name(usr)] has unprisoned [key_name(M)]") - else - tgui_alert(usr,"[M.name] is not prisoned.") - BLACKBOX_LOG_ADMIN_VERB("Unprison") - -/client/proc/cmd_admin_check_player_exp() //Allows admins to determine who the newer players are. - set category = "Admin" - set name = "Player Playtime" - if(!check_rights(R_ADMIN)) +ADMIN_VERB(unprison, R_ADMIN, "UnPrison", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/prisoner) + if(!is_centcom_level(prisoner.z)) + tgui_alert(user, "[prisoner.name] is not prisoned.") return + SSjob.SendToLateJoin(prisoner) + message_admins("[key_name_admin(user)] has unprisoned [key_name_admin(prisoner)]") + log_admin("[key_name(user)] has unprisoned [key_name(prisoner)]") + BLACKBOX_LOG_ADMIN_VERB("Unprison") + +ADMIN_VERB(cmd_admin_check_player_exp, R_ADMIN, "Player Playtime", "View player playtime.", ADMIN_CATEGORY_MAIN) if(!CONFIG_GET(flag/use_exp_tracking)) - to_chat(usr, span_warning("Tracking is disabled in the server configuration file."), confidential = TRUE) + to_chat(user, span_warning("Tracking is disabled in the server configuration file."), confidential = TRUE) return var/list/msg = list() @@ -67,7 +47,7 @@ for(var/client/client in sort_list(GLOB.clients, GLOBAL_PROC_REF(cmp_playtime_asc))) msg += "
  • [ADMIN_PP(client.mob)] [key_name_admin(client)]: " + client.get_exp_living() + "
  • " msg += "" - src << browse(msg.Join(), "window=Player_playtime_check") + user << browse(msg.Join(), "window=Player_playtime_check") /client/proc/trigger_centcom_recall() if(!check_rights(R_ADMIN)) @@ -164,23 +144,18 @@ /////////////////////////////////////////////////////////////////////////////////////////////// -/client/proc/cmd_admin_drop_everything(mob/M in GLOB.mob_list) - set category = null - set name = "Drop Everything" - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Make [M] drop everything?", "Message", list("Yes", "No")) +ADMIN_VERB(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/dropee) + var/confirm = tgui_alert(user, "Make [dropee] drop everything?", "Message", list("Yes", "No")) if(confirm != "Yes") return - M.drop_everything(del_on_drop = FALSE, force = TRUE, del_if_nodrop = TRUE) - M.regenerate_icons() + dropee.drop_everything(del_on_drop = FALSE, force = TRUE, del_if_nodrop = TRUE) + dropee.regenerate_icons() - log_admin("[key_name(usr)] made [key_name(M)] drop everything!") - var/msg = "[key_name_admin(usr)] made [ADMIN_LOOKUPFLW(M)] drop everything!" + log_admin("[key_name(user)] made [key_name(dropee)] drop everything!") + var/msg = "[key_name_admin(user)] made [ADMIN_LOOKUPFLW(dropee)] drop everything!" message_admins(msg) - admin_ticket_log(M, msg) + admin_ticket_log(dropee, msg) BLACKBOX_LOG_ADMIN_VERB("Drop Everything") /proc/cmd_admin_mute(whom, mute_type, automute = 0) diff --git a/code/modules/admin/verbs/admin_newscaster.dm b/code/modules/admin/verbs/admin_newscaster.dm index 2f6870394c2..0439cfa8811 100644 --- a/code/modules/admin/verbs/admin_newscaster.dm +++ b/code/modules/admin/verbs/admin_newscaster.dm @@ -1,17 +1,6 @@ -/datum/admins/proc/access_news_network() //MARKER - set category = "Admin.Events" - set name = "Access Newscaster Network" - set desc = "Allows you to view, add and edit news feeds." - - if (!istype(src, /datum/admins)) - src = usr.client.holder - if (!istype(src, /datum/admins)) - to_chat(usr, "Error: you are not an admin!", confidential = TRUE) - return - +ADMIN_VERB(access_news_network, R_ADMIN, "Access Newscaster Network", "Allows you to view, add, and edit news feeds.", ADMIN_CATEGORY_EVENTS) var/datum/newspanel/new_newspanel = new - - new_newspanel.ui_interact(usr) + new_newspanel.ui_interact(user.mob) /datum/newspanel ///What newscaster channel is currently being viewed by the player? diff --git a/code/modules/admin/verbs/adminevents.dm b/code/modules/admin/verbs/adminevents.dm index a22bae5fd97..44cb8a9685f 100644 --- a/code/modules/admin/verbs/adminevents.dm +++ b/code/modules/admin/verbs/adminevents.dm @@ -1,37 +1,24 @@ // Admin Tab - Event Verbs -/client/proc/cmd_admin_subtle_message(mob/M in GLOB.mob_list) - set category = "Admin.Events" - set name = "Subtle Message" +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_subtle_message, R_ADMIN, "Subtle Message", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/target in world) + message_admins("[key_name_admin(user)] has started answering [ADMIN_LOOKUPFLW(target)]'s prayer.") + var/msg = input(user, "Message:", "Subtle PM to [target.key]") as text|null - if(!ismob(M)) - return - if(!check_rights(R_ADMIN)) + if(!msg) + message_admins("[key_name_admin(user)] decided not to answer [ADMIN_LOOKUPFLW(target)]'s prayer") return - message_admins("[key_name_admin(src)] has started answering [ADMIN_LOOKUPFLW(M)]'s prayer.") - var/msg = input("Message:", "Subtle PM to [M.key]") as text|null + target.balloon_alert(target, "you hear a voice") + to_chat(target, "You hear a voice in your head... [msg]", confidential = TRUE) - if(!msg) - message_admins("[key_name_admin(src)] decided not to answer [ADMIN_LOOKUPFLW(M)]'s prayer") - return - if(usr) - if (usr.client) - if(usr.client.holder) - M.balloon_alert(M, "you hear a voice") - to_chat(M, "You hear a voice in your head... [msg]", confidential = TRUE) - - log_admin("SubtlePM: [key_name(usr)] -> [key_name(M)] : [msg]") - msg = span_adminnotice(" SubtleMessage: [key_name_admin(usr)] -> [key_name_admin(M)] : [msg]") + log_admin("SubtlePM: [key_name(user)] -> [key_name(target)] : [msg]") + msg = span_adminnotice(" SubtleMessage: [key_name_admin(user)] -> [key_name_admin(target)] : [msg]") message_admins(msg) - admin_ticket_log(M, msg) + admin_ticket_log(target, msg) BLACKBOX_LOG_ADMIN_VERB("Subtle Message") -/client/proc/cmd_admin_headset_message(mob/M in GLOB.mob_list) - set category = "Admin.Events" - set name = "Headset Message" - - admin_headset_message(M) +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_headset_message, R_ADMIN, "Headset Message", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/target in world) + user.admin_headset_message(target) /client/proc/admin_headset_message(mob/target in GLOB.mob_list, sender = null) var/mob/living/carbon/human/human_recipient @@ -73,102 +60,64 @@ BLACKBOX_LOG_ADMIN_VERB("Headset Message") -/client/proc/cmd_admin_world_narrate() - set category = "Admin.Events" - set name = "Global Narrate" - - if(!check_rights(R_ADMIN)) - return - - var/msg = input("Message:", "Enter the text you wish to appear to everyone:") as text|null - +ADMIN_VERB(cmd_admin_world_narrate, R_ADMIN, "Global Narrate", "Send a direct narration to all connected players.", ADMIN_CATEGORY_EVENTS) + var/msg = input(user, "Message:", "Enter the text you wish to appear to everyone:") as text|null if (!msg) return to_chat(world, "[msg]", confidential = TRUE) - log_admin("GlobalNarrate: [key_name(usr)] : [msg]") - message_admins(span_adminnotice("[key_name_admin(usr)] Sent a global narrate")) + log_admin("GlobalNarrate: [key_name(user)] : [msg]") + message_admins(span_adminnotice("[key_name_admin(user)] Sent a global narrate")) BLACKBOX_LOG_ADMIN_VERB("Global Narrate") -/client/proc/cmd_admin_local_narrate(atom/A) - set category = "Admin.Events" - set name = "Local Narrate" - - if(!check_rights(R_ADMIN)) - return - if(!A) - return - var/range = input("Range:", "Narrate to mobs within how many tiles:", 7) as num|null +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_local_narrate, R_ADMIN, "Local Narrate", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, atom/locale in world) + var/range = input(user, "Range:", "Narrate to mobs within how many tiles:", 7) as num|null if(!range) return - var/msg = input("Message:", "Enter the text you wish to appear to everyone within view:") as text|null + var/msg = input(user, "Message:", "Enter the text you wish to appear to everyone within view:") as text|null if (!msg) return - for(var/mob/M in view(range,A)) + for(var/mob/M in view(range, locale)) to_chat(M, msg, confidential = TRUE) - log_admin("LocalNarrate: [key_name(usr)] at [AREACOORD(A)]: [msg]") - message_admins(span_adminnotice(" LocalNarrate: [key_name_admin(usr)] at [ADMIN_VERBOSEJMP(A)]: [msg]
    ")) + log_admin("LocalNarrate: [key_name(user)] at [AREACOORD(locale)]: [msg]") + message_admins(span_adminnotice(" LocalNarrate: [key_name_admin(user)] at [ADMIN_VERBOSEJMP(locale)]: [msg]
    ")) BLACKBOX_LOG_ADMIN_VERB("Local Narrate") -/client/proc/cmd_admin_direct_narrate(mob/M) - set category = "Admin.Events" - set name = "Direct Narrate" - - if(!check_rights(R_ADMIN)) - return - - if(!M) - M = input("Direct narrate to whom?", "Active Players") as null|anything in GLOB.player_list - - if(!M) - return - - var/msg = input("Message:", "Enter the text you wish to appear to your target:") as text|null +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_direct_narrate, R_ADMIN, "Direct Narrate", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/target) + var/msg = input(user, "Message:", "Enter the text you wish to appear to your target:") as text|null if( !msg ) return - to_chat(M, msg, confidential = TRUE) - log_admin("DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]") - msg = span_adminnotice(" DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]
    ") + to_chat(target, msg, confidential = TRUE) + log_admin("DirectNarrate: [key_name(user)] to ([key_name(target)]): [msg]") + msg = span_adminnotice(" DirectNarrate: [key_name_admin(user)] to ([key_name_admin(target)]): [msg]
    ") message_admins(msg) - admin_ticket_log(M, msg) + admin_ticket_log(target, msg) BLACKBOX_LOG_ADMIN_VERB("Direct Narrate") -/client/proc/cmd_admin_add_freeform_ai_law() - set category = "Admin.Events" - set name = "Add Custom AI law" - - if(!check_rights(R_ADMIN)) - return - - var/input = input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null +ADMIN_VERB(cmd_admin_add_freeform_ai_law, R_ADMIN, "Add Custom AI Law", "Add a custom law to the Silicons.", ADMIN_CATEGORY_EVENTS) + var/input = input(user, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null if(!input) return - log_admin("Admin [key_name(usr)] has added a new AI law - [input]") - message_admins("Admin [key_name_admin(usr)] has added a new AI law - [input]") + log_admin("Admin [key_name(user)] has added a new AI law - [input]") + message_admins("Admin [key_name_admin(user)] has added a new AI law - [input]") - var/show_log = tgui_alert(usr, "Show ion message?", "Message", list("Yes", "No")) + var/show_log = tgui_alert(user, "Show ion message?", "Message", list("Yes", "No")) var/announce_ion_laws = (show_log == "Yes" ? 100 : 0) - var/datum/round_event/ion_storm/add_law_only/ion = new() + var/datum/round_event/ion_storm/add_law_only/ion = new ion.announce_chance = announce_ion_laws ion.ionMessage = input BLACKBOX_LOG_ADMIN_VERB("Add Custom AI Law") -/client/proc/admin_call_shuttle() - set category = "Admin.Events" - set name = "Call Shuttle" - +ADMIN_VERB(call_shuttle, R_ADMIN, "Call Shuttle", "Force a shuttle call with additional modifiers.", ADMIN_CATEGORY_EVENTS) if(EMERGENCY_AT_LEAST_DOCKED) return - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "You sure?", "Confirm", list("Yes", "Yes (No Recall)", "No")) + var/confirm = tgui_alert(user, "You sure?", "Confirm", list("Yes", "Yes (No Recall)", "No")) switch(confirm) if(null, "No") return @@ -178,46 +127,30 @@ SSshuttle.emergency.request() BLACKBOX_LOG_ADMIN_VERB("Call Shuttle") - log_admin("[key_name(usr)] admin-called the emergency shuttle.") - message_admins(span_adminnotice("[key_name_admin(usr)] admin-called the emergency shuttle[confirm == "Yes (No Recall)" ? " (non-recallable)" : ""].")) - return - -/client/proc/admin_cancel_shuttle() - set category = "Admin.Events" - set name = "Cancel Shuttle" - if(!check_rights(0)) - return - if(tgui_alert(usr, "You sure?", "Confirm", list("Yes", "No")) != "Yes") - return - - if(SSshuttle.admin_emergency_no_recall) - SSshuttle.admin_emergency_no_recall = FALSE + log_admin("[key_name(user)] admin-called the emergency shuttle.") + message_admins(span_adminnotice("[key_name_admin(user)] admin-called the emergency shuttle[confirm == "Yes (No Recall)" ? " (non-recallable)" : ""].")) +ADMIN_VERB(cancel_shuttle, R_ADMIN, "Cancel Shuttle", "Recall the shuttle, regardless of circumstances.", ADMIN_CATEGORY_EVENTS) if(EMERGENCY_AT_LEAST_DOCKED) return + if(tgui_alert(user, "You sure?", "Confirm", list("Yes", "No")) != "Yes") + return + SSshuttle.admin_emergency_no_recall = FALSE SSshuttle.emergency.cancel() BLACKBOX_LOG_ADMIN_VERB("Cancel Shuttle") - log_admin("[key_name(usr)] admin-recalled the emergency shuttle.") - message_admins(span_adminnotice("[key_name_admin(usr)] admin-recalled the emergency shuttle.")) - - return - -/client/proc/admin_disable_shuttle() - set category = "Admin.Events" - set name = "Disable Shuttle" - - if(!check_rights(R_ADMIN)) - return + log_admin("[key_name(user)] admin-recalled the emergency shuttle.") + message_admins(span_adminnotice("[key_name_admin(user)] admin-recalled the emergency shuttle.")) +ADMIN_VERB(disable_shuttle, R_ADMIN, "Disable Shuttle", "Those fuckers aren't getting out.", ADMIN_CATEGORY_EVENTS) if(SSshuttle.emergency.mode == SHUTTLE_DISABLED) - to_chat(usr, span_warning("Error, shuttle is already disabled.")) + to_chat(user, span_warning("Error, shuttle is already disabled.")) return - if(tgui_alert(usr, "You sure?", "Confirm", list("Yes", "No")) != "Yes") + if(tgui_alert(user, "You sure?", "Confirm", list("Yes", "No")) != "Yes") return - message_admins(span_adminnotice("[key_name_admin(usr)] disabled the shuttle.")) + message_admins(span_adminnotice("[key_name_admin(user)] disabled the shuttle.")) SSshuttle.last_mode = SSshuttle.emergency.mode SSshuttle.last_call_time = SSshuttle.emergency.timeLeft(1) @@ -232,21 +165,15 @@ color_override = "grey", ) -/client/proc/admin_enable_shuttle() - set category = "Admin.Events" - set name = "Enable Shuttle" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(enable_shuttle, R_ADMIN, "Enable Shuttle", "Those fuckers ARE getting out.", ADMIN_CATEGORY_EVENTS) if(SSshuttle.emergency.mode != SHUTTLE_DISABLED) - to_chat(usr, span_warning("Error, shuttle not disabled.")) + to_chat(user, span_warning("Error, shuttle not disabled.")) return - if(tgui_alert(usr, "You sure?", "Confirm", list("Yes", "No")) != "Yes") + if(tgui_alert(user, "You sure?", "Confirm", list("Yes", "No")) != "Yes") return - message_admins(span_adminnotice("[key_name_admin(usr)] enabled the emergency shuttle.")) + message_admins(span_adminnotice("[key_name_admin(user)] enabled the emergency shuttle.")) SSshuttle.admin_emergency_no_recall = FALSE SSshuttle.emergency_no_recall = FALSE if(SSshuttle.last_mode == SHUTTLE_DISABLED) //If everything goes to shit, fix it. @@ -264,136 +191,77 @@ color_override = "green", ) -/client/proc/admin_hostile_environment() - set category = "Admin.Events" - set name = "Hostile Environment" - - if(!check_rights(R_ADMIN)) - return - - switch(tgui_alert(usr, "Select an Option", "Hostile Environment Manager", list("Enable", "Disable", "Clear All"))) +ADMIN_VERB(hostile_environment, R_ADMIN, "Hostile Environment", "Disable the shuttle, naturally.", ADMIN_CATEGORY_EVENTS) + switch(tgui_alert(user, "Select an Option", "Hostile Environment Manager", list("Enable", "Disable", "Clear All"))) if("Enable") if (SSshuttle.hostile_environments["Admin"] == TRUE) - to_chat(usr, span_warning("Error, admin hostile environment already enabled.")) + to_chat(user, span_warning("Error, admin hostile environment already enabled.")) else - message_admins(span_adminnotice("[key_name_admin(usr)] Enabled an admin hostile environment")) + message_admins(span_adminnotice("[key_name_admin(user)] Enabled an admin hostile environment")) SSshuttle.registerHostileEnvironment("Admin") if("Disable") if (!SSshuttle.hostile_environments["Admin"]) - to_chat(usr, span_warning("Error, no admin hostile environment found.")) + to_chat(user, span_warning("Error, no admin hostile environment found.")) else - message_admins(span_adminnotice("[key_name_admin(usr)] Disabled the admin hostile environment")) + message_admins(span_adminnotice("[key_name_admin(user)] Disabled the admin hostile environment")) SSshuttle.clearHostileEnvironment("Admin") if("Clear All") - message_admins(span_adminnotice("[key_name_admin(usr)] Disabled all current hostile environment sources")) + message_admins(span_adminnotice("[key_name_admin(user)] Disabled all current hostile environment sources")) SSshuttle.hostile_environments.Cut() SSshuttle.checkHostileEnvironment() -/client/proc/toggle_nuke(obj/machinery/nuclearbomb/N in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/nuclearbomb)) - set category = "Admin.Events" - set name = "Toggle Nuke" - set popup_menu = FALSE - if(!check_rights(R_DEBUG)) - return - - if(!N.timing) - var/newtime = input(usr, "Set activation timer.", "Activate Nuke", "[N.timer_set]") as num|null +ADMIN_VERB(toggle_nuke, R_DEBUG|R_ADMIN, "Toggle Nuke", "Arm or disarm a nuke.", ADMIN_CATEGORY_EVENTS, obj/machinery/nuclearbomb/nuke in world) + if(!nuke.timing) + var/newtime = input(user, "Set activation timer.", "Activate Nuke", "[nuke.timer_set]") as num|null if(!newtime) return - N.timer_set = newtime - N.toggle_nuke_safety() - N.toggle_nuke_armed() - - log_admin("[key_name(usr)] [N.timing ? "activated" : "deactivated"] a nuke at [AREACOORD(N)].") - message_admins("[ADMIN_LOOKUPFLW(usr)] [N.timing ? "activated" : "deactivated"] a nuke at [ADMIN_VERBOSEJMP(N)].") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Nuke", "[N.timing]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! - -/client/proc/admin_change_sec_level() - set category = "Admin.Events" - set name = "Set Security Level" - set desc = "Changes the security level. Announcement only, i.e. setting to Delta won't activate nuke" + nuke.timer_set = newtime + nuke.toggle_nuke_safety() + nuke.toggle_nuke_armed() - if(!check_rights(R_ADMIN)) - return + log_admin("[key_name(user)] [nuke.timing ? "activated" : "deactivated"] a nuke at [AREACOORD(nuke)].") + message_admins("[ADMIN_LOOKUPFLW(user)] [nuke.timing ? "activated" : "deactivated"] a nuke at [ADMIN_VERBOSEJMP(nuke)].") + SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Nuke", "[nuke.timing]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! - var/level = tgui_input_list(usr, "Select Security Level:", "Set Security Level", SSsecurity_level.available_levels) +ADMIN_VERB(change_sec_level, R_ADMIN, "Set Security Level", "Changes the security level. Announcement effects only.", ADMIN_CATEGORY_EVENTS) + var/level = tgui_input_list(user, "Select Security Level:", "Set Security Level", SSsecurity_level.available_levels) if(!level) return SSsecurity_level.set_level(level) - log_admin("[key_name(usr)] changed the security level to [level]") - message_admins("[key_name_admin(usr)] changed the security level to [level]") + log_admin("[key_name(user)] changed the security level to [level]") + message_admins("[key_name_admin(user)] changed the security level to [level]") BLACKBOX_LOG_ADMIN_VERB("Set Security Level [capitalize(level)]") -/client/proc/run_weather() - set category = "Admin.Events" - set name = "Run Weather" - set desc = "Triggers a weather on the z-level you choose." - - if(!holder) - return - - var/weather_type = input("Choose a weather", "Weather") as null|anything in sort_list(subtypesof(/datum/weather), GLOBAL_PROC_REF(cmp_typepaths_asc)) +ADMIN_VERB(run_weather, R_FUN, "Run Weather", "Triggers specific weather on the z-level you choose.", ADMIN_CATEGORY_EVENTS) + var/weather_type = input(user, "Choose a weather", "Weather") as null|anything in sort_list(subtypesof(/datum/weather), GLOBAL_PROC_REF(cmp_typepaths_asc)) if(!weather_type) return - var/turf/T = get_turf(mob) - var/z_level = input("Z-Level to target?", "Z-Level", T?.z) as num|null + var/turf/T = get_turf(user.mob) + var/z_level = input(user, "Z-Level to target?", "Z-Level", T?.z) as num|null if(!isnum(z_level)) return SSweather.run_weather(weather_type, z_level) - message_admins("[key_name_admin(usr)] started weather of type [weather_type] on the z-level [z_level].") - log_admin("[key_name(usr)] started weather of type [weather_type] on the z-level [z_level].") + message_admins("[key_name_admin(user)] started weather of type [weather_type] on the z-level [z_level].") + log_admin("[key_name(user)] started weather of type [weather_type] on the z-level [z_level].") BLACKBOX_LOG_ADMIN_VERB("Run Weather") -/client/proc/add_marked_mob_ability() - set category = "Admin.Events" - set name = "Add Mob Ability (Marked Mob)" - set desc = "Adds an ability to a marked mob." - - if(!holder) - return - - if(!isliving(holder.marked_datum)) - to_chat(usr, span_warning("Error: Please mark a mob to add actions to it.")) - return - give_mob_action(holder.marked_datum) - -/client/proc/remove_marked_mob_ability() - set category = "Admin.Events" - set name = "Remove Mob Ability (Marked Mob)" - set desc = "Removes an ability from marked mob." - - if(!holder) - return - - if(!isliving(holder.marked_datum)) - to_chat(usr, span_warning("Error: Please mark a mob to remove actions from it.")) - return - remove_mob_action(holder.marked_datum) - - -/client/proc/command_report_footnote() - set category = "Admin.Events" - set name = "Command Report Footnote" - set desc = "Adds a footnote to the roundstart command report." - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(command_report_footnote, R_ADMIN, "Command Report Footnote", "Adds a footnote to the roundstart command report.", ADMIN_CATEGORY_EVENTS) var/datum/command_footnote/command_report_footnote = new /datum/command_footnote() - SScommunications.block_command_report++ //Add a blocking condition to the counter until the inputs are done. - - command_report_footnote.message = tgui_input_text(usr, "This message will be attached to the bottom of the roundstart threat report. Be sure to delay the roundstart report if you need extra time.", "P.S.") + SScommunications.block_command_report += 1 //Add a blocking condition to the counter until the inputs are done. + command_report_footnote.message = tgui_input_text(user, "This message will be attached to the bottom of the roundstart threat report. Be sure to delay the roundstart report if you need extra time.", "P.S.") if(!command_report_footnote.message) + SScommunications.block_command_report -= 1 + qdel(command_report_footnote) return - command_report_footnote.signature = tgui_input_text(usr, "Whose signature will appear on this footnote?", "Also sign here, here, aaand here.") + command_report_footnote.signature = tgui_input_text(user, "Whose signature will appear on this footnote?", "Also sign here, here, aaand here.") if(!command_report_footnote.signature) command_report_footnote.signature = "Classified" @@ -401,24 +269,12 @@ SScommunications.command_report_footnotes += command_report_footnote SScommunications.block_command_report-- - message_admins("[usr] has added a footnote to the command report: [command_report_footnote.message], signed [command_report_footnote.signature]") + message_admins("[user] has added a footnote to the command report: [command_report_footnote.message], signed [command_report_footnote.signature]") /datum/command_footnote var/message var/signature -/client/proc/delay_command_report() - set category = "Admin.Events" - set name = "Delay Command Report" - set desc = "Prevents the roundstart command report from being sent until toggled." - - if(!check_rights(R_ADMIN)) - return - - if(SScommunications.block_command_report) //If it's anything other than 0, decrease. If 0, increase. - SScommunications.block_command_report-- - message_admins("[usr] has enabled the roundstart command report.") - else - SScommunications.block_command_report++ - message_admins("[usr] has delayed the roundstart command report.") - +ADMIN_VERB(delay_command_report, R_FUN, "Delay Command Report", "Prevents the roundstart command report from being sent; or forces it to send it delayed.", ADMIN_CATEGORY_EVENTS) + SScommunications.block_command_report = !SScommunications.block_command_report + message_admins("[key_name_admin(user)] has [(SScommunications.block_command_report ? "delayed" : "sent")] the roundstart command report.") diff --git a/code/modules/admin/verbs/adminfun.dm b/code/modules/admin/verbs/adminfun.dm index fcba8d40928..f115e8808b5 100644 --- a/code/modules/admin/verbs/adminfun.dm +++ b/code/modules/admin/verbs/adminfun.dm @@ -1,74 +1,54 @@ -// Admin Tab - Fun Verbs - -/client/proc/cmd_admin_explosion(atom/O as obj|mob|turf in world) - set category = "Admin.Fun" - set name = "Explosion" - - if(!check_rights(R_ADMIN)) - return - - var/devastation = input("Range of total devastation. -1 to none", "Input") as num|null +ADMIN_VERB(admin_explosion, R_ADMIN|R_FUN, "Explosion", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, atom/orignator as obj|mob|turf) + var/devastation = input(user, "Range of total devastation. -1 to none", "Input") as num|null if(devastation == null) return - var/heavy = input("Range of heavy impact. -1 to none", "Input") as num|null + var/heavy = input(user, "Range of heavy impact. -1 to none", "Input") as num|null if(heavy == null) return - var/light = input("Range of light impact. -1 to none", "Input") as num|null + var/light = input(user, "Range of light impact. -1 to none", "Input") as num|null if(light == null) return - var/flash = input("Range of flash. -1 to none", "Input") as num|null + var/flash = input(user, "Range of flash. -1 to none", "Input") as num|null if(flash == null) return - var/flames = input("Range of flames. -1 to none", "Input") as num|null + var/flames = input(user, "Range of flames. -1 to none", "Input") as num|null if(flames == null) return if ((devastation != -1) || (heavy != -1) || (light != -1) || (flash != -1) || (flames != -1)) if ((devastation > 20) || (heavy > 20) || (light > 20) || (flames > 20)) - if (tgui_alert(usr, "Are you sure you want to do this? It will laaag.", "Confirmation", list("Yes", "No")) == "No") + if (tgui_alert(user, "Are you sure you want to do this? It will laaag.", "Confirmation", list("Yes", "No")) == "No") return - explosion(O, devastation, heavy, light, flames, flash, explosion_cause = mob) - log_admin("[key_name(usr)] created an explosion ([devastation],[heavy],[light],[flames]) at [AREACOORD(O)]") - message_admins("[key_name_admin(usr)] created an explosion ([devastation],[heavy],[light],[flames]) at [AREACOORD(O)]") + explosion(orignator, devastation, heavy, light, flames, flash, explosion_cause = user.mob) + log_admin("[key_name(user)] created an explosion ([devastation],[heavy],[light],[flames]) at [AREACOORD(orignator)]") + message_admins("[key_name_admin(user)] created an explosion ([devastation],[heavy],[light],[flames]) at [AREACOORD(orignator)]") BLACKBOX_LOG_ADMIN_VERB("Explosion") -/client/proc/cmd_admin_emp(atom/O as obj|mob|turf in world) - set category = "Admin.Fun" - set name = "EM Pulse" - - if(!check_rights(R_ADMIN)) - return - - var/heavy = input("Range of heavy pulse.", "Input") as num|null +ADMIN_VERB(admin_emp, R_ADMIN|R_FUN, "EM Pulse", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, atom/orignator as obj|mob|turf) + var/heavy = input(user, "Range of heavy pulse.", "Input") as num|null if(heavy == null) return - var/light = input("Range of light pulse.", "Input") as num|null + var/light = input(user, "Range of light pulse.", "Input") as num|null if(light == null) return if (heavy || light) - empulse(O, heavy, light) - log_admin("[key_name(usr)] created an EM Pulse ([heavy],[light]) at [AREACOORD(O)]") - message_admins("[key_name_admin(usr)] created an EM Pulse ([heavy],[light]) at [AREACOORD(O)]") + empulse(orignator, heavy, light) + log_admin("[key_name(user)] created an EM Pulse ([heavy],[light]) at [AREACOORD(orignator)]") + message_admins("[key_name_admin(user)] created an EM Pulse ([heavy],[light]) at [AREACOORD(orignator)]") BLACKBOX_LOG_ADMIN_VERB("EM Pulse") -/client/proc/cmd_admin_gib(mob/victim in GLOB.mob_list) - set category = "Admin.Fun" - set name = "Gib" - - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Drop a brain?", "Confirm", list("Yes", "No","Cancel")) || "Cancel" +ADMIN_VERB(gib_them, R_ADMIN, "Gib", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/victim) + var/confirm = tgui_alert(user, "Drop a brain?", "Confirm", list("Yes", "No","Cancel")) || "Cancel" if(confirm == "Cancel") return //Due to the delay here its easy for something to have happened to the mob if(isnull(victim)) return - log_admin("[key_name(usr)] has gibbed [key_name(victim)]") - message_admins("[key_name_admin(usr)] has gibbed [key_name_admin(victim)]") + log_admin("[key_name(user)] has gibbed [key_name(victim)]") + message_admins("[key_name_admin(user)] has gibbed [key_name_admin(victim)]") if(isobserver(victim)) new /obj/effect/gibspawner/generic(get_turf(victim)) @@ -84,62 +64,47 @@ BLACKBOX_LOG_ADMIN_VERB("Gib") -/client/proc/cmd_admin_gib_self() - set name = "Gibself" - set category = "Admin.Fun" - - var/confirm = tgui_alert(usr, "You sure?", "Confirm", list("Yes", "No")) +ADMIN_VERB(gib_self, R_ADMIN, "Gibself", "Give yourself the same treatment you give others.", ADMIN_CATEGORY_FUN) + var/confirm = tgui_alert(user, "You sure?", "Confirm", list("Yes", "No")) if(confirm != "Yes") return - log_admin("[key_name(usr)] used gibself.") - message_admins(span_adminnotice("[key_name_admin(usr)] used gibself.")) + log_admin("[key_name(user)] used gibself.") + message_admins(span_adminnotice("[key_name_admin(user)] used gibself.")) BLACKBOX_LOG_ADMIN_VERB("Gib Self") - var/mob/living/ourself = mob + var/mob/living/ourself = user.mob if (istype(ourself)) ourself.gib() -/client/proc/everyone_random() - set category = "Admin.Fun" - set name = "Make Everyone Random" - set desc = "Make everyone have a random appearance. You can only use this before rounds!" - +ADMIN_VERB(everyone_random, R_SERVER, "Make Everyone Random", "Make everyone have a random appearance.", ADMIN_CATEGORY_FUN) if(SSticker.HasRoundStarted()) - to_chat(usr, "Nope you can't do this, the game's already started. This only works before rounds!", confidential = TRUE) + to_chat(user, "Nope you can't do this, the game's already started. This only works before rounds!", confidential = TRUE) return var/frn = CONFIG_GET(flag/force_random_names) if(frn) CONFIG_SET(flag/force_random_names, FALSE) - message_admins("Admin [key_name_admin(usr)] has disabled \"Everyone is Special\" mode.") - to_chat(usr, "Disabled.", confidential = TRUE) + message_admins("Admin [key_name_admin(user)] has disabled \"Everyone is Special\" mode.") + to_chat(user, "Disabled.", confidential = TRUE) return - var/notifyplayers = tgui_alert(usr, "Do you want to notify the players?", "Options", list("Yes", "No", "Cancel")) || "Cancel" + var/notifyplayers = tgui_alert(user, "Do you want to notify the players?", "Options", list("Yes", "No", "Cancel")) || "Cancel" if(notifyplayers == "Cancel") return - log_admin("Admin [key_name(src)] has forced the players to have random appearances.") - message_admins("Admin [key_name_admin(usr)] has forced the players to have random appearances.") + log_admin("Admin [key_name(user)] has forced the players to have random appearances.") + message_admins("Admin [key_name_admin(user)] has forced the players to have random appearances.") if(notifyplayers == "Yes") - to_chat(world, span_adminnotice("Admin [usr.key] has forced the players to have completely random identities!"), confidential = TRUE) + to_chat(world, span_adminnotice("Admin [user.key] has forced the players to have completely random identities!"), confidential = TRUE) - to_chat(usr, "Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet.", confidential = TRUE) + to_chat(user, "Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet.", confidential = TRUE) CONFIG_SET(flag/force_random_names, TRUE) BLACKBOX_LOG_ADMIN_VERB("Make Everyone Random") -/client/proc/mass_zombie_infection() - set category = "Admin.Fun" - set name = "Mass Zombie Infection" - set desc = "Infects all humans with a latent organ that will zombify \ - them on death." - - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Please confirm you want to add latent zombie organs in all humans?", "Confirm Zombies", list("Yes", "No")) +ADMIN_VERB(mass_zombie_infection, R_ADMIN, "Mass Zombie Infection", "Infects all humans with a latent organ that will zombify them on death.", ADMIN_CATEGORY_FUN) + var/confirm = tgui_alert(user, "Please confirm you want to add latent zombie organs in all humans?", "Confirm Zombies", list("Yes", "No")) if(confirm != "Yes") return @@ -147,45 +112,32 @@ var/mob/living/carbon/human/H = i new /obj/item/organ/internal/zombie_infection/nodamage(H) - message_admins("[key_name_admin(usr)] added a latent zombie infection to all humans.") - log_admin("[key_name(usr)] added a latent zombie infection to all humans.") + message_admins("[key_name_admin(user)] added a latent zombie infection to all humans.") + log_admin("[key_name(user)] added a latent zombie infection to all humans.") BLACKBOX_LOG_ADMIN_VERB("Mass Zombie Infection") -/client/proc/mass_zombie_cure() - set category = "Admin.Fun" - set name = "Mass Zombie Cure" - set desc = "Removes the zombie infection from all humans, returning them to normal." - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Please confirm you want to cure all zombies?", "Confirm Zombie Cure", list("Yes", "No")) +ADMIN_VERB(mass_zombie_cure, R_ADMIN, "Mass Zombie Cure", "Removes the zombie infection from all humans, returning them to normal.", ADMIN_CATEGORY_FUN) + var/confirm = tgui_alert(user, "Please confirm you want to cure all zombies?", "Confirm Zombie Cure", list("Yes", "No")) if(confirm != "Yes") return for(var/obj/item/organ/internal/zombie_infection/nodamage/I in GLOB.zombie_infection_list) qdel(I) - message_admins("[key_name_admin(usr)] cured all zombies.") - log_admin("[key_name(usr)] cured all zombies.") + message_admins("[key_name_admin(user)] cured all zombies.") + log_admin("[key_name(user)] cured all zombies.") BLACKBOX_LOG_ADMIN_VERB("Mass Zombie Cure") -/client/proc/polymorph_all() - set category = "Admin.Fun" - set name = "Polymorph All" - set desc = "Applies the effects of the bolt of change to every single mob." - - if(!check_rights(R_ADMIN)) - return - - var/confirm = tgui_alert(usr, "Please confirm you want polymorph all mobs?", "Confirm Polymorph", list("Yes", "No")) +ADMIN_VERB(polymorph_all, R_ADMIN, "Polymorph All", "Applies the effects of the bolt of change to every single mob.", ADMIN_CATEGORY_FUN) + var/confirm = tgui_alert(user, "Please confirm you want polymorph all mobs?", "Confirm Polymorph", list("Yes", "No")) if(confirm != "Yes") return var/list/mobs = shuffle(GLOB.alive_mob_list.Copy()) // might change while iterating - var/who_did_it = key_name_admin(usr) + var/who_did_it = key_name_admin(user) - message_admins("[key_name_admin(usr)] started polymorphed all living mobs.") - log_admin("[key_name(usr)] polymorphed all living mobs.") + message_admins("[key_name_admin(user)] started polymorphed all living mobs.") + log_admin("[key_name(user)] polymorphed all living mobs.") BLACKBOX_LOG_ADMIN_VERB("Polymorph All") for(var/mob/living/M in mobs) @@ -201,23 +153,18 @@ message_admins("Mass polymorph started by [who_did_it] is complete.") -/client/proc/smite(mob/living/target as mob) - set category = "Admin.Fun" - set name = "Smite" - if(!check_rights(R_ADMIN) || !check_rights(R_FUN)) - return - - var/punishment = input("Choose a punishment", "DIVINE SMITING") as null|anything in GLOB.smites +ADMIN_VERB_AND_CONTEXT_MENU(admin_smite, R_ADMIN|R_FUN, "Smite", "Smite a player with divine power.", ADMIN_CATEGORY_FUN, mob/living/target in world) + var/punishment = input(user, "Choose a punishment", "DIVINE SMITING") as null|anything in GLOB.smites if(QDELETED(target) || !punishment) return var/smite_path = GLOB.smites[punishment] var/datum/smite/smite = new smite_path - var/configuration_success = smite.configure(usr) + var/configuration_success = smite.configure(user) if (configuration_success == FALSE) return - smite.effect(src, target) + smite.effect(user, target) /// "Turns" people into objects. Really, we just add them to the contents of the item. /proc/objectify(atom/movable/target, path) diff --git a/code/modules/admin/verbs/admingame.dm b/code/modules/admin/verbs/admingame.dm index 43aec44a825..19995f128eb 100644 --- a/code/modules/admin/verbs/admingame.dm +++ b/code/modules/admin/verbs/admingame.dm @@ -1,177 +1,168 @@ -// Admin Tab - Game Verbs +ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_ADMIN, "Show Player Panel", mob/player in world) + log_admin("[key_name(user)] checked the individual player panel for [key_name(player)][isobserver(user.mob)?"":" while in game"].") -/datum/admins/proc/show_player_panel(mob/M in GLOB.mob_list) - set category = "Admin.Game" - set name = "Show Player Panel" - set desc="Edit player (respawn, ban, heal, etc)" - - if(!check_rights()) - return - - log_admin("[key_name(usr)] checked the individual player panel for [key_name(M)][isobserver(usr)?"":" while in game"].") - - if(!M) - to_chat(usr, span_warning("You seem to be selecting a mob that doesn't exist anymore."), confidential = TRUE) + if(!player) + to_chat(user, span_warning("You seem to be selecting a mob that doesn't exist anymore."), confidential = TRUE) return - var/body = "Options for [M.key]" - body += "Options panel for [M]" - if(M.client) - body += " played by [M.client] " - body += "\[[M.client.holder ? M.client.holder.rank_names() : "Player"]\]" + var/body = "Options for [player.key]" + body += "Options panel for [player]" + if(player.client) + body += " played by [player.client] " + body += "\[[player.client.holder ? player.client.holder.rank_names() : "Player"]\]" if(CONFIG_GET(flag/use_exp_tracking)) - body += "\[" + M.client.get_exp_living(FALSE) + "\]" + body += "\[" + player.client.get_exp_living(FALSE) + "\]" - if(isnewplayer(M)) + if(isnewplayer(player)) body += " Hasn't Entered Game " else - body += " \[Heal\] " + body += " \[Heal\] " - if(M.ckey) - body += "
    \[Find Updated Panel\]" + if(player.ckey) + body += "
    \[Find Updated Panel\]" - if(M.client) - body += "
    \[First Seen: [M.client.player_join_date]\]\[Byond account registered on: [M.client.account_join_date]\]" + if(player.client) + body += "
    \[First Seen: [player.client.player_join_date]\]\[Byond account registered on: [player.client.account_join_date]\]" // NOVA EDIT ADDITION START - Player Ranks var/list/player_ranks = list() - if(SSplayer_ranks.is_donator(M.client, admin_bypass = FALSE)) + if(SSplayer_ranks.is_donator(player.client, admin_bypass = FALSE)) player_ranks += "Donator" - if(SSplayer_ranks.is_mentor(M.client, admin_bypass = FALSE)) + if(SSplayer_ranks.is_mentor(player.client, admin_bypass = FALSE)) player_ranks += "Mentor" - if(SSplayer_ranks.is_veteran(M.client, admin_bypass = FALSE)) + if(SSplayer_ranks.is_veteran(player.client, admin_bypass = FALSE)) player_ranks += "Veteran" body += "

    Player Ranks: [length(player_ranks) ? player_ranks.Join(", ") : "None"]" - // NOVA EDIT END + // NOVA EDIT ADDITION END body += "

    CentCom Galactic Ban DB: " if(CONFIG_GET(string/centcom_ban_db)) - body += "Search" + body += "Search" else body += "Disabled" body += "

    Show related accounts by: " - body += "\[ CID | " - body += "IP \]" + body += "\[ CID | " + body += "IP \]" var/full_version = "Unknown" - if(M.client.byond_version) - full_version = "[M.client.byond_version].[M.client.byond_build ? M.client.byond_build : "xxx"]" + if(player.client.byond_version) + full_version = "[player.client.byond_version].[player.client.byond_build ? player.client.byond_build : "xxx"]" body += "
    \[Byond version: [full_version]\]
    " body += "

    \[ " - body += "VV - " - if(M.mind) - body += "TP - " - body += "SKILLS - " + body += "VV - " + if(player.mind) + body += "TP - " + body += "SKILLS - " else - body += "Init Mind - " - if (iscyborg(M)) - body += "BP - " - body += "PM - " - body += "SM - " - if (ishuman(M) && M.mind) - body += "HM - " - body += "FLW - " + body += "Init Mind - " + if (iscyborg(player)) + body += "BP - " + body += "PM - " + body += "SM - " + if (ishuman(player) && player.mind) + body += "HM - " + body += "FLW - " //Default to client logs if available var/source = LOGSRC_MOB - if(M.ckey) + if(player.ckey) source = LOGSRC_CKEY - body += "LOGS\]
    " + body += "LOGS\]
    " - body += "Mob type = [M.type]

    " + body += "Mob type = [player.type]

    " - if(M.client) + if(player.client) body += "Old names: " - var/datum/player_details/deets = GLOB.player_details[M.ckey] + var/datum/player_details/deets = GLOB.player_details[player.ckey] if(deets) body += deets.get_played_names() else body += "None?!" body += "

    " - body += "Kick | " - if(M.client) - body += "Ban | " + body += "Kick | " + if(player.client) + body += "Ban | " else - body += "Ban | " + body += "Ban | " - body += "Notes | Messages | Watchlist | " - if(M.client) - body += "| Prison | " - body += "\ Send back to Lobby | " - var/muted = M.client.prefs.muted + body += "Notes | Messages | Watchlist | " + if(player.client) + body += "| Prison | " + body += "\ Send back to Lobby | " + var/muted = player.client.prefs.muted body += "
    Mute: " - body += "\[IC | " - body += "OOC | " - body += "PRAY | " - body += "ADMINHELP | " - //Skyrat Addition Begin - LOOC muting again. - body += "DEADCHAT | " - body += "LOOC\]" - //Skyrat Addition End - LOOC muting again. - body += " WEBREQ | " - body += "DEADCHAT\]" - body += "(toggle all)" + body += "\[IC | " + body += "OOC | " + body += "PRAY | " + body += "ADMINHELP | " + //Nova Edit Addition Begin - LOOC muting again. + body += "DEADCHAT | " + body += "LOOC\]" + //Nova Edit Addition End - LOOC muting again. + body += "WEBREQ | " + body += "DEADCHAT\]" + body += "(toggle all)" body += "

    " - body += "Jump to | " - body += "Get | " - body += "Send To" + body += "Jump to | " + body += "Get | " + body += "Send To" body += "

    " - body += "Traitor panel | " - body += "Narrate to | " - body += "Subtle message | " - body += "Play sound to | " - body += "Language Menu" - - if(M.client) - if(!isnewplayer(M)) + body += "Traitor panel | " + body += "Narrate to | " + body += "Subtle message | " + body += "Play sound to | " + body += "Language Menu" + + if(player.client) + if(!isnewplayer(player)) body += "

    " body += "Transformation:
    " - if(isobserver(M)) + if(isobserver(player)) body += "Ghost | " else - body += "Make Ghost | " + body += "Make Ghost | " - if(ishuman(M) && !ismonkey(M)) + if(ishuman(player) && !ismonkey(player)) body += "Human | " else - body += "Make Human | " + body += "Make Human | " - if(ismonkey(M)) + if(ismonkey(player)) body += "Monkey | " else - body += "Make Monkey | " + body += "Make Monkey | " - if(iscyborg(M)) + if(iscyborg(player)) body += "Cyborg | " else - body += "Make Cyborg | " + body += "Make Cyborg | " - if(isAI(M)) + if(isAI(player)) body += "AI" else - body += "Make AI" + body += "Make AI" body += "

    " body += "Other actions:" body += "
    " - if(!isnewplayer(M)) - body += "Forcesay | " - body += "Apply Client Quirks | " - body += "Thunderdome 1 | " - body += "Thunderdome 2 | " - body += "Thunderdome Admin | " - body += "Thunderdome Observer | " - body += "Commend Behavior | " + if(!isnewplayer(player)) + body += "Forcesay | " + body += "Apply Client Quirks | " + body += "Thunderdome 1 | " + body += "Thunderdome 2 | " + body += "Thunderdome Admin | " + body += "Thunderdome Observer | " + body += "Commend Behavior | " body += "
    " body += "" - usr << browse(body, "window=adminplayeropts-[REF(M)];size=550x515") + user << browse(body, "window=adminplayeropts-[REF(player)];size=550x515") BLACKBOX_LOG_ADMIN_VERB("Player Panel") /client/proc/cmd_admin_godmode(mob/M in GLOB.mob_list) @@ -194,14 +185,8 @@ If a guy was gibbed and you want to revive him, this is a good way to do so. Works kind of like entering the game with a new character. Character receives a new mind if they didn't have one. Traitors and the like can also be revived with the previous role mostly intact. /N */ -/client/proc/respawn_character() - set category = "Admin.Game" - set name = "Respawn Character" - set desc = "Respawn a person that has been gibbed/dusted/killed. They must be a ghost for this to work and preferably should not have a body to go back into." - if(!check_rights(R_ADMIN)) - return - - var/input = ckey(input(src, "Please specify which key will be respawned.", "Key", "")) +ADMIN_VERB(respawn_character, R_ADMIN, "Respawn Character", "Respawn a player that has been round removed in some manner. They must be a ghost.", ADMIN_CATEGORY_GAME) + var/input = ckey(input(user, "Please specify which key will be respawned.", "Key", "")) if(!input) return @@ -212,19 +197,19 @@ Traitors and the like can also be revived with the previous role mostly intact. break if(!G_found)//If a ghost was not found. - to_chat(usr, "There is no active key like that in the game or the person is not currently a ghost.", confidential = TRUE) + to_chat(user, "There is no active key like that in the game or the person is not currently a ghost.", confidential = TRUE) return if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something //check if they were a monkey if(findtext(G_found.real_name,"monkey")) - if(tgui_alert(usr,"This character appears to have been a monkey. Would you like to respawn them as such?",,list("Yes","No")) == "Yes") + if(tgui_alert(user,"This character appears to have been a monkey. Would you like to respawn them as such?",,list("Yes","No")) == "Yes") var/mob/living/carbon/human/species/monkey/new_monkey = new SSjob.SendToLateJoin(new_monkey) G_found.mind.transfer_to(new_monkey) //be careful when doing stuff like this! I've already checked the mind isn't in use new_monkey.key = G_found.key to_chat(new_monkey, "You have been fully respawned. Enjoy the game.", confidential = TRUE) - var/msg = span_adminnotice("[key_name_admin(usr)] has respawned [new_monkey.key] as a filthy monkey.") + var/msg = span_adminnotice("[key_name_admin(user)] has respawned [new_monkey.key] as a filthy monkey.") message_admins(msg) admin_ticket_log(new_monkey, msg) return //all done. The ghost is auto-deleted @@ -266,7 +251,7 @@ Traitors and the like can also be revived with the previous role mostly intact. */ //Two variables to properly announce later on. - var/admin = key_name_admin(src) + var/admin = key_name_admin(user) var/player_key = G_found.key //Now for special roles and equipment. @@ -321,13 +306,8 @@ Traitors and the like can also be revived with the previous role mostly intact. BLACKBOX_LOG_ADMIN_VERB("Respawn Character") return new_character -/client/proc/cmd_admin_list_open_jobs() - set category = "Admin.Game" - set name = "Manage Job Slots" - - if(!check_rights(R_ADMIN)) - return - holder.manage_free_slots() +ADMIN_VERB(manage_job_slots, R_ADMIN, "Manage Job Slots", "Manage the number of available job slots.", ADMIN_CATEGORY_GAME) + user.holder.manage_free_slots() BLACKBOX_LOG_ADMIN_VERB("Manage Job Slots") /datum/admins/proc/manage_free_slots() @@ -370,38 +350,25 @@ Traitors and the like can also be revived with the previous role mostly intact. browser.set_content(dat.Join()) browser.open() -/client/proc/toggle_view_range() - set category = "Admin.Game" - set name = "Change View Range" - set desc = "switches between 1x and custom views" - - if(view_size.getView() == view_size.default) - view_size.setTo(input("Select view range:", "FUCK YE", 7) in list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,37) - 7) +ADMIN_VERB(toggle_view_range, R_ADMIN, "Change View Range", "Switch between 1x and custom views.", ADMIN_CATEGORY_GAME) + if(user.view_size.getView() == user.view_size.default) + user.view_size.setTo(input(user, "Select view range:", "FUCK YE", 7) in list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,37) - 7) else - view_size.resetToDefault(getScreenSize(prefs.read_preference(/datum/preference/toggle/widescreen))) + user.view_size.resetToDefault(getScreenSize(user.prefs.read_preference(/datum/preference/toggle/widescreen))) - log_admin("[key_name(usr)] changed their view range to [view].") - //message_admins("\blue [key_name_admin(usr)] changed their view range to [view].") //why? removed by order of XSI + log_admin("[key_name(user)] changed their view range to [user.view].") + SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Change View Range", "[user.view]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Change View Range", "[view]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! - -/client/proc/toggle_combo_hud() - set category = "Admin.Game" - set name = "Toggle Combo HUD" - set desc = "Toggles the Admin Combo HUD (antag, sci, med, eng)" - - if(!check_rights(R_ADMIN)) - return - - if (combo_hud_enabled) - disable_combo_hud() +ADMIN_VERB(combo_hud, R_ADMIN, "Toggle Combo HUD", "Toggles the Admin Combo HUD.", ADMIN_CATEGORY_GAME) + if(user.combo_hud_enabled) + user.disable_combo_hud() else - enable_combo_hud() + user.enable_combo_hud() - to_chat(usr, "You toggled your admin combo HUD [combo_hud_enabled ? "ON" : "OFF"].", confidential = TRUE) - message_admins("[key_name_admin(usr)] toggled their admin combo HUD [combo_hud_enabled ? "ON" : "OFF"].") - log_admin("[key_name(usr)] toggled their admin combo HUD [combo_hud_enabled ? "ON" : "OFF"].") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Combo HUD", "[combo_hud_enabled ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! + to_chat(user, "You toggled your admin combo HUD [user.combo_hud_enabled ? "ON" : "OFF"].", confidential = TRUE) + message_admins("[key_name_admin(user)] toggled their admin combo HUD [user.combo_hud_enabled ? "ON" : "OFF"].") + log_admin("[key_name(user)] toggled their admin combo HUD [user.combo_hud_enabled ? "ON" : "OFF"].") + SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Combo HUD", "[user.combo_hud_enabled ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! /client/proc/enable_combo_hud() if (combo_hud_enabled) @@ -435,47 +402,31 @@ Traitors and the like can also be revived with the previous role mostly intact. mob.lighting_cutoff = mob.default_lighting_cutoff() mob.update_sight() -/datum/admins/proc/show_traitor_panel(mob/target_mob in GLOB.mob_list) - set category = "Admin.Game" - set desc = "Edit mobs's memory and role" - set name = "Show Traitor Panel" +ADMIN_VERB(show_traitor_panel, R_ADMIN, "Show Traitor Panel", "Edit mobs's memory and role", ADMIN_CATEGORY_GAME, mob/target_mob) var/datum/mind/target_mind = target_mob.mind if(!target_mind) - to_chat(usr, "This mob has no mind!", confidential = TRUE) + to_chat(user, "This mob has no mind!", confidential = TRUE) return if(!istype(target_mob) && !istype(target_mind)) - to_chat(usr, "This can only be used on instances of type /mob and /mind", confidential = TRUE) + to_chat(user, "This can only be used on instances of type /mob and /mind", confidential = TRUE) return target_mind.traitor_panel() BLACKBOX_LOG_ADMIN_VERB("Traitor Panel") -/datum/admins/proc/show_skill_panel(target) - set category = "Admin.Game" - set desc = "Edit mobs's experience and skill levels" - set name = "Show Skill Panel" +ADMIN_VERB(show_skill_panel, R_ADMIN, "Show Skill Panel", "Edit mobs's experience and skill levels", ADMIN_CATEGORY_GAME, mob/target_mob) var/datum/mind/target_mind - if(ismob(target)) - var/mob/target_mob = target - target_mind = target_mob.mind - else if (istype(target, /datum/mind)) - target_mind = target + if(istype(target_mob, /datum/mind)) + target_mind = target_mob else - to_chat(usr, "This can only be used on instances of type /mob and /mind", confidential = TRUE) - return - var/datum/skill_panel/SP = new(usr, target_mind) - SP.ui_interact(usr) + target_mind = target_mob.mind -/datum/admins/proc/show_lag_switch_panel() - set category = "Admin.Game" - set name = "Show Lag Switches" - set desc="Display the controls for drastic lag mitigation measures." + var/datum/skill_panel/SP = new(user, target_mind) + SP.ui_interact(user.mob) +ADMIN_VERB(lag_switch_panel, R_ADMIN, "Show Lag Switches", "Display the controls for drastic lag mitigation.", ADMIN_CATEGORY_GAME) if(!SSlag_switch.initialized) - to_chat(usr, span_notice("The Lag Switch subsystem has not yet been initialized.")) - return - if(!check_rights()) + to_chat(user, span_notice("The Lag Switch subsystem has not yet been initialized.")) return - var/list/dat = list("Lag Switches

    Lag (Reduction) Switches

    ") dat += "Automatic Trigger: [SSlag_switch.auto_switch ? "On" : "Off"]
    " dat += "Population Threshold: [SSlag_switch.trigger_pop]
    " @@ -494,4 +445,4 @@ Traitors and the like can also be revived with the previous role mostly intact. dat += "Disable footsteps: [SSlag_switch.measures[DISABLE_FOOTSTEPS] ? "On" : "Off"] - trait applies to character
    " dat += "Disable character creator: [SSlag_switch.measures[DISABLE_CREATOR] ? "On" : "Off"] - trait applies to all
    " // SKRYAT EDIT ADDITION dat += "" - usr << browse(dat.Join(), "window=lag_switch_panel;size=420x480") + user << browse(dat.Join(), "window=lag_switch_panel;size=420x480") diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index dfcc5f60dd0..155839942c9 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -1,114 +1,75 @@ -/client/proc/jumptoarea(area/A in get_sorted_areas()) - set name = "Jump to Area" - set desc = "Area to jump to" - set category = "Admin.Game" - if(!src.holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return +ADMIN_VERB(jump_to_area, R_ADMIN, "Jump To Area", "Jumps to the specified area.", ADMIN_CATEGORY_GAME, area/target in world) + if(!isobserver(user.mob)) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/admin_ghost) - if(!A) - return + var/turf/drop_location + top_level: + for(var/list/zlevel_turfs as anything in target.get_zlevel_turf_lists()) + for(var/turf/area_turf as anything in zlevel_turfs) + drop_location = area_turf + break top_level - var/list/turfs = list() - for (var/list/zlevel_turfs as anything in A.get_zlevel_turf_lists()) - for (var/turf/area_turf as anything in zlevel_turfs) - if(!area_turf.density) - turfs.Add(area_turf) - - if(length(turfs)) - var/turf/T = pick(turfs) - usr.forceMove(T) - log_admin("[key_name(usr)] jumped to [AREACOORD(T)]") - message_admins("[key_name_admin(usr)] jumped to [AREACOORD(T)]") - BLACKBOX_LOG_ADMIN_VERB("Jump To Area") - else - to_chat(src, "Nowhere to jump to!", confidential = TRUE) + if(isnull(drop_location)) + to_chat(user, span_warning("No valid drop location found in the area!")) return + user.mob.abstract_move(drop_location) + log_admin("[key_name(user)] jumped to [AREACOORD(drop_location)]") + message_admins("[key_name_admin(user)] jumped to [AREACOORD(drop_location)]") + BLACKBOX_LOG_ADMIN_VERB("Jump To Area") -/client/proc/jumptoturf(turf/T in world) - set name = "Jump to Turf" - set category = "Admin.Game" - if(!src.holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return +ADMIN_VERB(jump_to_turf, R_ADMIN, "Jump To Turf", "Jump to any turf in the game. This will lag your client.", ADMIN_CATEGORY_GAME, turf/locale in world) + if(!isobserver(user.mob)) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/admin_ghost) - log_admin("[key_name(usr)] jumped to [AREACOORD(T)]") - message_admins("[key_name_admin(usr)] jumped to [AREACOORD(T)]") - usr.forceMove(T) + log_admin("[key_name(user)] jumped to [AREACOORD(locale)]") + message_admins("[key_name_admin(user)] jumped to [AREACOORD(locale)]") + user.mob.abstract_move(locale) BLACKBOX_LOG_ADMIN_VERB("Jump To Turf") - return -/client/proc/jumptomob(mob/M in GLOB.mob_list) - set category = "Admin.Game" - set name = "Jump to Mob" +ADMIN_VERB(jump_to_mob, R_ADMIN, "Jump To Mob", "Jump to any mob in the game.", ADMIN_CATEGORY_GAME, mob/target in world) + if(!isobserver(user.mob)) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/admin_ghost) + user.mob.abstract_move(target.loc) + log_admin("[key_name(user)] jumped to [key_name(target)]") + message_admins("[key_name_admin(user)] jumped to [ADMIN_LOOKUPFLW(target)] at [AREACOORD(target)]") + BLACKBOX_LOG_ADMIN_VERB("Jump To Mob") - if(!src.holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return +ADMIN_VERB(jump_to_coord, R_ADMIN, "Jump To Coordinate", "Jump to a specific coordinate in the game world.", ADMIN_CATEGORY_GAME, cx as num, cy as num, cz as num) + if(!isobserver(user.mob)) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/admin_ghost) - log_admin("[key_name(usr)] jumped to [key_name(M)]") - message_admins("[key_name_admin(usr)] jumped to [ADMIN_LOOKUPFLW(M)] at [AREACOORD(M)]") - if(src.mob) - var/mob/A = src.mob - var/turf/T = get_turf(M) - if(T && isturf(T)) - BLACKBOX_LOG_ADMIN_VERB("Jump To Mob") - A.forceMove(M.loc) - else - to_chat(A, "This mob is not located in the game world.", confidential = TRUE) - -/client/proc/jumptocoord(tx as num, ty as num, tz as num) - set category = "Admin.Game" - set name = "Jump to Coordinate" - - if (!holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) + var/turf/where_we_droppin = locate(cx, cy, cz) + if(isnull(where_we_droppin)) + to_chat(user, span_warning("Invalid coordinates.")) return - if(src.mob) - var/mob/A = src.mob - var/turf/T = locate(tx,ty,tz) - A.forceMove(T) - BLACKBOX_LOG_ADMIN_VERB("Jump To Coordiate") - message_admins("[key_name_admin(usr)] jumped to coordinates [tx], [ty], [tz]") + user.mob.abstract_move(where_we_droppin) + message_admins("[key_name_admin(user)] jumped to coordinates [cx], [cy], [cz]") + BLACKBOX_LOG_ADMIN_VERB("Jump To Coordiate") -/client/proc/jumptokey() - set category = "Admin.Game" - set name = "Jump to Key" - - if(!src.holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return +ADMIN_VERB(jump_to_key, R_ADMIN, "Jump To Key", "Jump to a specific player.", ADMIN_CATEGORY_GAME) + if(!isobserver(user.mob)) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/admin_ghost) var/list/keys = list() for(var/mob/M in GLOB.player_list) keys += M.client - var/client/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sort_key(keys) + var/client/selection = input(user, "Please, select a player!", "Admin Jumping") as null|anything in sort_key(keys) if(!selection) - to_chat(src, "No keys found.", confidential = TRUE) + to_chat(user, "No keys found.", confidential = TRUE) return var/mob/M = selection.mob - log_admin("[key_name(usr)] jumped to [key_name(M)]") - message_admins("[key_name_admin(usr)] jumped to [ADMIN_LOOKUPFLW(M)]") - - usr.forceMove(M.loc) - + log_admin("[key_name(user)] jumped to [key_name(M)]") + message_admins("[key_name_admin(user)] jumped to [ADMIN_LOOKUPFLW(M)]") + user.mob.abstract_move(M.loc) BLACKBOX_LOG_ADMIN_VERB("Jump To Key") -/client/proc/Getmob(mob/M in GLOB.mob_list - GLOB.dummy_mob_list) - set category = "Admin.Game" - set name = "Get Mob" - set desc = "Mob to teleport" - if(!src.holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return - - var/atom/loc = get_turf(usr) - M.admin_teleport(loc) +ADMIN_VERB_AND_CONTEXT_MENU(get_mob, R_ADMIN, "Get Mob", "Teleport a mob to your location.", ADMIN_CATEGORY_GAME, mob/target in world) + var/atom/loc = get_turf(user.mob) + target.admin_teleport(loc) BLACKBOX_LOG_ADMIN_VERB("Get Mob") - /// Proc to hook user-enacted teleporting behavior and keep logging of the event. /atom/movable/proc/admin_teleport(atom/new_location) if(isnull(new_location)) @@ -126,56 +87,41 @@ admin_ticket_log(src, msg) return ..() - -/client/proc/Getkey() - set category = "Admin.Game" - set name = "Get Key" - set desc = "Key to teleport" - - if(!src.holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return - +ADMIN_VERB(get_key, R_ADMIN, "Get Key", "Teleport the player with the provided key to you.", ADMIN_CATEGORY_GAME) var/list/keys = list() for(var/mob/M in GLOB.player_list) keys += M.client - var/client/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sort_key(keys) + var/client/selection = input(user, "Please, select a player!", "Admin Jumping") as null|anything in sort_key(keys) if(!selection) return var/mob/M = selection.mob if(!M) return - log_admin("[key_name(usr)] teleported [key_name(M)]") - var/msg = "[key_name_admin(usr)] teleported [ADMIN_LOOKUPFLW(M)]" + log_admin("[key_name(user)] teleported [key_name(M)]") + var/msg = "[key_name_admin(user)] teleported [ADMIN_LOOKUPFLW(M)]" message_admins(msg) admin_ticket_log(M, msg) if(M) - M.forceMove(get_turf(usr)) - usr.forceMove(M.loc) + M.forceMove(get_turf(user)) BLACKBOX_LOG_ADMIN_VERB("Get Key") -/client/proc/sendmob(mob/jumper in sort_mobs()) - set category = "Admin.Game" - set name = "Send Mob" - if(!src.holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return +ADMIN_VERB(send_mob, R_ADMIN, "Send Mob", "Teleport the specified mob to an area of your choosing.", ADMIN_CATEGORY_GAME, mob/jumper) var/list/sorted_areas = get_sorted_areas() if(!length(sorted_areas)) - to_chat(src, "No areas found.", confidential = TRUE) + to_chat(user, "No areas found.", confidential = TRUE) return - var/area/target_area = tgui_input_list(src, "Pick an area", "Send Mob", sorted_areas) + var/area/target_area = tgui_input_list(user, "Pick an area", "Send Mob", sorted_areas) if(isnull(target_area)) return if(!istype(target_area)) return var/list/turfs = get_area_turfs(target_area) if(length(turfs) && jumper.forceMove(pick(turfs))) - log_admin("[key_name(usr)] teleported [key_name(jumper)] to [AREACOORD(jumper)]") - var/msg = "[key_name_admin(usr)] teleported [ADMIN_LOOKUPFLW(jumper)] to [AREACOORD(jumper)]" + log_admin("[key_name(user)] teleported [key_name(jumper)] to [AREACOORD(jumper)]") + var/msg = "[key_name_admin(user)] teleported [ADMIN_LOOKUPFLW(jumper)] to [AREACOORD(jumper)]" message_admins(msg) admin_ticket_log(jumper, msg) else - to_chat(src, "Failed to move mob to a valid location.", confidential = TRUE) + to_chat(user, "Failed to move mob to a valid location.", confidential = TRUE) BLACKBOX_LOG_ADMIN_VERB("Send Mob") diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 76e1d5ab507..2af39d9bdda 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -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 diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index f4cc840ced1..b988104dd23 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -1,18 +1,12 @@ -/client/proc/cmd_admin_say(msg as text) - set category = "Admin" - set name = "Asay" //Gave this shit a shorter name so you only have to time out "asay" rather than "admin say" to use it --NeoFite - set hidden = TRUE - if(!check_rights(0)) +ADMIN_VERB(cmd_admin_say, R_NONE, "ASay", "Send a message to other admins", ADMIN_CATEGORY_MAIN, message as text) + message = emoji_parse(copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN)) + if(!message) return - msg = emoji_parse(copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)) - if(!msg) - return - - if(findtext(msg, "@") || findtext(msg, "#")) - var/list/link_results = check_asay_links(msg) + if(findtext(message, "@") || findtext(message, "#")) + var/list/link_results = check_asay_links(message) if(length(link_results)) - msg = link_results[ASAY_LINK_NEW_MESSAGE_INDEX] + message = link_results[ASAY_LINK_NEW_MESSAGE_INDEX] link_results[ASAY_LINK_NEW_MESSAGE_INDEX] = null var/list/pinged_admin_clients = link_results[ASAY_LINK_PINGED_ADMINS_INDEX] for(var/iter_ckey in pinged_admin_clients) @@ -22,19 +16,19 @@ window_flash(iter_admin_client) SEND_SOUND(iter_admin_client.mob, sound('sound/misc/asay_ping.ogg')) - mob.log_talk(msg, LOG_ASAY) - msg = keywords_lookup(msg) - send_asay_to_other_server(ckey, msg) //NOVA EDIT ADDITION - var/asay_color = prefs.read_preference(/datum/preference/color/asay_color) + user.mob.log_talk(message, LOG_ASAY) + message = keywords_lookup(message) + send_asay_to_other_server(user.ckey, message) //NOVA EDIT ADDITION + var/asay_color = user.prefs.read_preference(/datum/preference/color/asay_color) var/custom_asay_color = (CONFIG_GET(flag/allow_admin_asaycolor) && asay_color) ? "" : "" - msg = "[span_adminsay("[span_prefix("ADMIN:")] [key_name(usr, 1)] [ADMIN_FLW(mob)]: [custom_asay_color][msg]")][custom_asay_color ? "":null]" + message = "[span_adminsay("[span_prefix("ADMIN:")] [key_name_admin(user)] [ADMIN_FLW(user.mob)]: [custom_asay_color][message]")][custom_asay_color ? "":null]" to_chat(GLOB.admins, type = MESSAGE_TYPE_ADMINCHAT, - html = msg, + html = message, confidential = TRUE) BLACKBOX_LOG_ADMIN_VERB("Asay") /client/proc/get_admin_say() var/msg = input(src, null, "asay \"text\"") as text|null - cmd_admin_say(msg) + SSadmin_verbs.dynamic_invoke_verb(src, /datum/admin_verb/cmd_admin_say, msg) diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 2e73a9955f7..9f744ff0147 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -1,35 +1,27 @@ -/client/proc/atmosscan() - set category = "Mapping" - set name = "Check Plumbing" - if(!src.holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return +ADMIN_VERB_VISIBILITY(atmos_debug, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(atmos_debug, R_DEBUG, "Check Plumbing", "Verifies the integrity of the plumbing network.", ADMIN_CATEGORY_MAPPING) BLACKBOX_LOG_ADMIN_VERB("Check Plumbing") //all plumbing - yes, some things might get stated twice, doesn't matter. for(var/obj/machinery/atmospherics/components/pipe as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics/components)) if(pipe.z && (!pipe.nodes || !pipe.nodes.len || (null in pipe.nodes))) - to_chat(usr, "Unconnected [pipe.name] located at [ADMIN_VERBOSEJMP(pipe)]", confidential = TRUE) + to_chat(user, "Unconnected [pipe.name] located at [ADMIN_VERBOSEJMP(pipe)]", confidential = TRUE) //Pipes for(var/obj/machinery/atmospherics/pipe/pipe as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics/pipe)) if(istype(pipe, /obj/machinery/atmospherics/pipe/smart) || istype(pipe, /obj/machinery/atmospherics/pipe/layer_manifold)) continue if(pipe.z && (!pipe.nodes || !pipe.nodes.len || (null in pipe.nodes))) - to_chat(usr, "Unconnected [pipe.name] located at [ADMIN_VERBOSEJMP(pipe)]", confidential = TRUE) + to_chat(user, "Unconnected [pipe.name] located at [ADMIN_VERBOSEJMP(pipe)]", confidential = TRUE) //Nodes for(var/obj/machinery/atmospherics/node1 as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics)) for(var/obj/machinery/atmospherics/node2 in node1.nodes) if(!(node1 in node2.nodes)) - to_chat(usr, "One-way connection in [node1.name] located at [ADMIN_VERBOSEJMP(node1)]", confidential = TRUE) + to_chat(user, "One-way connection in [node1.name] located at [ADMIN_VERBOSEJMP(node1)]", confidential = TRUE) -/client/proc/powerdebug() - set category = "Mapping" - set name = "Check Power" - if(!src.holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return +ADMIN_VERB_VISIBILITY(power_debug, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(power_debug, R_DEBUG, "Check Power", "Verifies the integrity of the power network.", ADMIN_CATEGORY_MAPPING) BLACKBOX_LOG_ADMIN_VERB("Check Power") var/list/results = list() @@ -56,4 +48,4 @@ var/obj/structure/cable/C = locate(/obj/structure/cable) in T.contents if(!C) results += "Unwired terminal at [ADMIN_VERBOSEJMP(term)]" - to_chat(usr, "[results.Join("\n")]", confidential = TRUE) + to_chat(user, "[results.Join("\n")]", confidential = TRUE) diff --git a/code/modules/admin/verbs/beakerpanel.dm b/code/modules/admin/verbs/beakerpanel.dm index 5ba32ae7b6c..7088fba92f1 100644 --- a/code/modules/admin/verbs/beakerpanel.dm +++ b/code/modules/admin/verbs/beakerpanel.dm @@ -60,14 +60,11 @@ reagents.add_reagent(reagenttype, amount) return container -/datum/admins/proc/beaker_panel() - set category = "Admin.Events" - set name = "Spawn reagent container" - if(!check_rights()) - return +ADMIN_VERB(beaker_panel, R_SPAWN, "Spawn Reagent Container", "Spawn a reagent container.", ADMIN_CATEGORY_EVENTS) var/datum/asset/asset_datum = get_asset_datum(/datum/asset/simple/namespaced/common) - asset_datum.send(usr) + asset_datum.send(user) //Could somebody tell me why this isn't using the browser datum, given that it copypastes all of browser datum's html + // fuck if I know, but im not touching it var/dat = {" @@ -320,4 +317,4 @@ "} - usr << browse(dat, "window=beakerpanel;size=1100x720") + user << browse(dat, "window=beakerpanel;size=1100x720") diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index b8fd3698a56..6a8e1efdb56 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -1,21 +1,6 @@ -/datum/admins/proc/open_borgopanel(borgo in GLOB.silicon_mobs) - set category = "Admin.Game" - set name = "Show Borg Panel" - set desc = "Show borg panel" - - if(!check_rights(R_ADMIN)) - return - - if (!iscyborg(borgo)) - borgo = input("Select a borg", "Select a borg", null, null) as null|anything in sort_names(GLOB.silicon_mobs) - if (!iscyborg(borgo)) - to_chat(usr, span_warning("Borg is required for borgpanel"), confidential = TRUE) - - var/datum/borgpanel/borgpanel = new(usr, borgo) - - borgpanel.ui_interact(usr) - - +ADMIN_VERB(borg_panel, R_ADMIN, "Show Borg Panel", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/living/silicon/robot/borgo) + var/datum/borgpanel/borgpanel = new(user.mob, borgo) + borgpanel.ui_interact(user.mob) /datum/borgpanel var/mob/living/silicon/robot/borg diff --git a/code/modules/admin/verbs/change_shuttle_events.dm b/code/modules/admin/verbs/change_shuttle_events.dm index 4ec8a7cd7b8..90f7e03672e 100644 --- a/code/modules/admin/verbs/change_shuttle_events.dm +++ b/code/modules/admin/verbs/change_shuttle_events.dm @@ -1,20 +1,9 @@ -///Manipulate the events that are gonna run/are running on the escape shuttle -/datum/admins/proc/change_shuttle_events() - set category = "Admin.Events" - set name = "Change Shuttle Events" - set desc = "Allows you to change the events on a shuttle." - - if (!istype(src, /datum/admins)) - src = usr.client.holder - if (!istype(src, /datum/admins)) - to_chat(usr, "Error: you are not an admin!", confidential = TRUE) - return - +ADMIN_VERB(change_shuttle_events, R_ADMIN|R_FUN, "Change Shuttle Events", "Change the events on a shuttle.", ADMIN_CATEGORY_EVENTS) //At least for now, just letting admins modify the emergency shuttle is fine var/obj/docking_port/mobile/port = SSshuttle.emergency if(!port) - to_chat(usr, span_admin("Uh oh, couldn't find the escape shuttle!")) + to_chat(user, span_admin("Uh oh, couldn't find the escape shuttle!")) var/list/options = list("Clear"="Clear") @@ -27,16 +16,16 @@ options[((event in active) ? "(Remove)" : "(Add)") + initial(event.name)] = event //Throw up an ugly menu with the shuttle events and the options to add or remove them, or clear them all - var/result = input(usr, "Choose an event to add/remove", "Shuttle Events") as null|anything in sort_list(options) + var/result = input(user, "Choose an event to add/remove", "Shuttle Events") as null|anything in sort_list(options) if(result == "Clear") port.event_list.Cut() - message_admins("[key_name_admin(usr)] has cleared the shuttle events on: [port]") + message_admins("[key_name_admin(user)] has cleared the shuttle events on: [port]") else if(options[result]) var/typepath = options[result] if(typepath in active) port.event_list.Remove(active[options[result]]) - message_admins("[key_name_admin(usr)] has removed '[active[result]]' from [port].") + message_admins("[key_name_admin(user)] has removed '[active[result]]' from [port].") else port.event_list.Add(new typepath (port)) - message_admins("[key_name_admin(usr)] has added '[typepath]' to [port].") + message_admins("[key_name_admin(user)] has added '[typepath]' to [port].") diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm index b001099d283..f9e96c89cd0 100644 --- a/code/modules/admin/verbs/cinematic.dm +++ b/code/modules/admin/verbs/cinematic.dm @@ -1,14 +1,10 @@ -/client/proc/cinematic() - set name = "Cinematic" - set category = "Admin.Fun" - set desc = "Shows a cinematic." // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted. - set hidden = TRUE - - if(!SSticker) - return - - var/datum/cinematic/choice = tgui_input_list(usr, "Chose a cinematic to play to everyone in the server.", "Choose Cinematic", sort_list(subtypesof(/datum/cinematic), GLOBAL_PROC_REF(cmp_typepaths_asc))) +ADMIN_VERB(cinematic, R_FUN, "Cinematic", "Show a cinematic to all players.", ADMIN_CATEGORY_FUN) + var/datum/cinematic/choice = tgui_input_list( + user, + "Chose a cinematic to play to everyone in the server.", + "Choose Cinematic", + sort_list(subtypesof(/datum/cinematic), GLOBAL_PROC_REF(cmp_typepaths_asc)), + ) if(!choice || !ispath(choice, /datum/cinematic)) return - play_cinematic(choice, world) diff --git a/code/modules/admin/verbs/commandreport.dm b/code/modules/admin/verbs/commandreport.dm index 86e7ec1328b..047ef04a0b7 100644 --- a/code/modules/admin/verbs/commandreport.dm +++ b/code/modules/admin/verbs/commandreport.dm @@ -7,32 +7,19 @@ #define WIZARD_PRESET "The Wizard Federation" #define CUSTOM_PRESET "Custom Command Name" -/// Verb to change the global command name. -/client/proc/cmd_change_command_name() - set category = "Admin.Events" - set name = "Change Command Name" - - if(!check_rights(R_ADMIN)) - return - - var/input = input(usr, "Please input a new name for Central Command.", "What?", "") as text|null +ADMIN_VERB(change_command_name, R_ADMIN, "Change Command Name", "Change the name of Central Command.", ADMIN_CATEGORY_EVENTS) + var/input = input(user, "Please input a new name for Central Command.", "What?", "") as text|null if(!input) return change_command_name(input) - message_admins("[key_name_admin(src)] has changed Central Command's name to [input]") - log_admin("[key_name(src)] has changed the Central Command name to: [input]") + message_admins("[key_name_admin(user)] has changed Central Command's name to [input]") + log_admin("[key_name(user)] has changed the Central Command name to: [input]") /// Verb to open the create command report window and send command reports. -/client/proc/cmd_admin_create_centcom_report() - set category = "Admin.Events" - set name = "Create Command Report" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(create_command_report, R_ADMIN, "Create Command Report", "Create a command report to be sent to the station.", ADMIN_CATEGORY_EVENTS) BLACKBOX_LOG_ADMIN_VERB("Create Command Report") - var/datum/command_report_menu/tgui = new(usr) - tgui.ui_interact(usr) + var/datum/command_report_menu/tgui = new /datum/command_report_menu(user.mob) + tgui.ui_interact(user.mob) /// Datum for holding the TGUI window for command reports. /datum/command_report_menu diff --git a/code/modules/admin/verbs/config_helpers.dm b/code/modules/admin/verbs/config_helpers.dm index 013c7b63f8a..c043274d427 100644 --- a/code/modules/admin/verbs/config_helpers.dm +++ b/code/modules/admin/verbs/config_helpers.dm @@ -1,19 +1,14 @@ -/// Verbs created to help server operators with generating certain config files. +#define GENERATE_JOB_CONFIG_VERB_DESC "Generate a job configuration (jobconfig.toml) file for the server. If TOML file already exists, will re-generate it based off the already existing config values. Will migrate from the old jobs.txt format if necessary." -/client/proc/generate_job_config() - set name = "Generate Job Configuration" - set category = "Server" - set desc = "Generate a job configuration (jobconfig.toml) file for the server. If TOML file already exists, will re-generate it based off the already existing config values. Will migrate from the old jobs.txt format if necessary." - - if(!check_rights(R_SERVER)) - return - - if(tgui_alert(usr, "This verb is not at all useful if you are not a server operator with access to the configuration folder. Do you wish to proceed?", "Generate jobconfig.toml for download", list("Yes", "No")) != "Yes") +ADMIN_VERB(generate_job_config, R_SERVER, "Generate Job Configuration", GENERATE_JOB_CONFIG_VERB_DESC, ADMIN_CATEGORY_SERVER) + if(tgui_alert(user, "This verb is not at all useful if you are not a server operator with access to the configuration folder. Do you wish to proceed?", "Generate jobconfig.toml for download", list("Yes", "No")) != "Yes") return - if(SSjob.generate_config(usr)) - to_chat(usr, span_notice("Job configuration file generated. Download prompt should appear now.")) + if(SSjob.generate_config(user)) + to_chat(user, span_notice("Job configuration file generated. Download prompt should appear now.")) else - to_chat(usr, span_warning("Job configuration file could not be generated. Check the server logs / runtimes / above warning messages for more information.")) + to_chat(user, span_warning("Job configuration file could not be generated. Check the server logs / runtimes / above warning messages for more information.")) BLACKBOX_LOG_ADMIN_VERB("Generate Job Configuration") + +#undef GENERATE_JOB_CONFIG_VERB_DESC diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 032a4d4fa48..c330618d8b4 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -1,39 +1,30 @@ -/client/proc/dsay(msg as text) - set category = "Admin.Game" - set name = "Dsay" - set hidden = TRUE - if(!holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return - if(!mob) - return - if(prefs.muted & MUTE_DEADCHAT) - to_chat(src, span_danger("You cannot send DSAY messages (muted)."), confidential = TRUE) + +ADMIN_VERB(dsay, R_NONE, "DSay", "Speak to the dead.", ADMIN_CATEGORY_GAME, message as text) + if(user.prefs.muted & MUTE_DEADCHAT) + to_chat(user, span_danger("You cannot send DSAY messages (muted)."), confidential = TRUE) return - if (handle_spam_prevention(msg,MUTE_DEADCHAT)) + if (user.handle_spam_prevention(message,MUTE_DEADCHAT)) return - msg = copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN) - mob.log_talk(msg, LOG_DSAY) + message = copytext_char(sanitize(message), 1, MAX_MESSAGE_LEN) + user.mob.log_talk(message, LOG_DSAY) - if (!msg) + if (!message) return - var/rank_name = holder.rank_names() - var/admin_name = key - if(holder.fakekey) + var/rank_name = user.holder.rank_names() + var/admin_name = user.key + if(user.holder.fakekey) rank_name = pick(strings("admin_nicknames.json", "ranks", "config")) admin_name = pick(strings("admin_nicknames.json", "names", "config")) var/name_and_rank = "[span_tooltip(rank_name, "STAFF")] ([admin_name])" - deadchat_broadcast("[span_prefix("DEAD:")] [name_and_rank] says, \"[emoji_parse(msg)]\"") + deadchat_broadcast("[span_prefix("DEAD:")] [name_and_rank] says, \"[emoji_parse(message)]\"") BLACKBOX_LOG_ADMIN_VERB("Dsay") /client/proc/get_dead_say() var/msg = input(src, null, "dsay \"text\"") as text|null - if (isnull(msg)) return - - dsay(msg) + SSadmin_verbs.dynamic_invoke_verb(src, /datum/admin_verb/dsay, msg) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 35b1baa063d..e56eb1e5101 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1,40 +1,27 @@ -/client/proc/Debug2() - set category = "Debug" - set name = "Debug-Game" - if(!check_rights(R_DEBUG)) - return - - if(GLOB.Debug2) - GLOB.Debug2 = 0 - message_admins("[key_name(src)] toggled debugging off.") - log_admin("[key_name(src)] toggled debugging off.") - else - GLOB.Debug2 = 1 - message_admins("[key_name(src)] toggled debugging on.") - log_admin("[key_name(src)] toggled debugging on.") - +ADMIN_VERB(toggle_game_debug, R_DEBUG, "Debug-Game", "Toggles game debugging.", ADMIN_CATEGORY_DEBUG) + GLOB.Debug2 = !GLOB.Debug2 + var/message = "toggled debugging [(GLOB.Debug2 ? "ON" : "OFF")]" + message_admins("[key_name_admin(user)] [message].") + log_admin("[key_name(user)] [message].") BLACKBOX_LOG_ADMIN_VERB("Toggle Debug Two") -/client/proc/Cell() - set category = "Debug" - set name = "Air Status in Location" - if(!mob) - return - var/turf/T = get_turf(mob) - if(!isturf(T)) +ADMIN_VERB_VISIBILITY(air_status, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(air_status, R_DEBUG, "Air Status In Location", "Gets the air status for your current turf.", ADMIN_CATEGORY_DEBUG) + var/turf/user_turf = get_turf(user.mob) + if(!isturf(user_turf)) return - atmos_scan(user=usr, target=T, silent=TRUE) + atmos_scan(user.mob, user_turf, silent = TRUE) BLACKBOX_LOG_ADMIN_VERB("Air Status In Location") -/client/proc/cmd_admin_robotize(mob/M in GLOB.mob_list) - set category = "Admin.Fun" - set name = "Make Cyborg" - +ADMIN_VERB(cmd_admin_robotize, R_FUN, "Make Cyborg", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/target) if(!SSticker.HasRoundStarted()) - tgui_alert(usr,"Wait until the game starts") + tgui_alert(user, "Wait until the game starts") + return + if(issilicon(target)) + tgui_alert(user, "They are already a cyborg.") return - log_admin("[key_name(src)] has robotized [M.key].") - INVOKE_ASYNC(M, TYPE_PROC_REF(/mob, Robotize)) + log_admin("[key_name(user)] has robotized [target.key].") + INVOKE_ASYNC(target, TYPE_PROC_REF(/mob, Robotize)) /client/proc/poll_type_to_del(search_string) var/list/types = get_fancy_list_of_atom_types() @@ -50,13 +37,8 @@ return return types[key] -//TODO: merge the vievars version into this or something maybe mayhaps -/client/proc/cmd_debug_del_all(object as text) - set category = "Debug" - set name = "Del-All" - - var/type_to_del = poll_type_to_del(object) - +ADMIN_VERB(cmd_del_all, R_DEBUG|R_SPAWN, "Del-All", "Delete all datums with the specified type.", ADMIN_CATEGORY_DEBUG, object as text) + var/type_to_del = user.poll_type_to_del(object) if(!type_to_del) return @@ -66,16 +48,12 @@ counter++ qdel(O) CHECK_TICK - log_admin("[key_name(src)] has deleted all ([counter]) instances of [type_to_del].") - message_admins("[key_name_admin(src)] has deleted all ([counter]) instances of [type_to_del].") + log_admin("[key_name(user)] has deleted all ([counter]) instances of [type_to_del].") + message_admins("[key_name_admin(user)] has deleted all ([counter]) instances of [type_to_del].") BLACKBOX_LOG_ADMIN_VERB("Delete All") -/client/proc/cmd_debug_force_del_all(object as text) - set category = "Debug" - set name = "Force-Del-All" - - var/type_to_del = poll_type_to_del(object) - +ADMIN_VERB(cmd_del_all_force, R_DEBUG|R_SPAWN, "Force-Del-All", "Forcibly delete all datums with the specified type.", ADMIN_CATEGORY_DEBUG, object as text) + var/type_to_del = user.poll_type_to_del(object) if(!type_to_del) return @@ -85,29 +63,25 @@ counter++ qdel(O, force = TRUE) CHECK_TICK - log_admin("[key_name(src)] has force-deleted all ([counter]) instances of [type_to_del].") - message_admins("[key_name_admin(src)] has force-deleted all ([counter]) instances of [type_to_del].") + log_admin("[key_name(user)] has force-deleted all ([counter]) instances of [type_to_del].") + message_admins("[key_name_admin(user)] has force-deleted all ([counter]) instances of [type_to_del].") BLACKBOX_LOG_ADMIN_VERB("Force-Delete All") -/client/proc/cmd_debug_hard_del_all(object as text) - set category = "Debug" - set name = "Hard-Del-All" - - var/type_to_del = poll_type_to_del(object) - +ADMIN_VERB(cmd_del_all_hard, R_DEBUG|R_SPAWN, "Hard-Del-All", "Hard delete all datums with the specified type.", ADMIN_CATEGORY_DEBUG, object as text) + var/type_to_del = user.poll_type_to_del(object) if(!type_to_del) return - var/choice = alert("ARE YOU SURE that you want to hard delete this type? It will cause MASSIVE lag.", "Hoooo lad what happen?", "Yes", "No") + var/choice = alert(user, "ARE YOU SURE that you want to hard delete this type? It will cause MASSIVE lag.", "Hoooo lad what happen?", "Yes", "No") if(choice != "Yes") return - choice = alert("Do you want to pre qdelete the atom? This will speed things up significantly, but may break depending on your level of fuckup.", "How do you even get it that bad", "Yes", "No") + choice = alert(user, "Do you want to pre qdelete the atom? This will speed things up significantly, but may break depending on your level of fuckup.", "How do you even get it that bad", "Yes", "No") var/should_pre_qdel = TRUE if(choice == "No") should_pre_qdel = FALSE - choice = alert("Ok one last thing, do you want to yield to the game? or do it all at once. These are hard deletes remember.", "Jesus christ man", "Yield", "Ignore the server") + choice = alert(user, "Ok one last thing, do you want to yield to the game? or do it all at once. These are hard deletes remember.", "Jesus christ man", "Yield", "Ignore the server") var/should_check_tick = TRUE if(choice == "Ignore the server") should_check_tick = FALSE @@ -129,24 +103,20 @@ qdel(O) del(O) CHECK_TICK - log_admin("[key_name(src)] has hard deleted all ([counter]) instances of [type_to_del].") - message_admins("[key_name_admin(src)] has hard deleted all ([counter]) instances of [type_to_del].") + log_admin("[key_name(user)] has hard deleted all ([counter]) instances of [type_to_del].") + message_admins("[key_name_admin(user)] has hard deleted all ([counter]) instances of [type_to_del].") BLACKBOX_LOG_ADMIN_VERB("Hard Delete All") -/client/proc/cmd_debug_make_powernets() - set category = "Debug" - set name = "Make Powernets" +ADMIN_VERB(cmd_debug_make_powernets, R_DEBUG|R_SERVER, "Make Powernets", "Regenerates all powernets for all cables.", ADMIN_CATEGORY_DEBUG) SSmachines.makepowernets() - log_admin("[key_name(src)] has remade the powernet. makepowernets() called.") - message_admins("[key_name_admin(src)] has remade the powernets. makepowernets() called.") + log_admin("[key_name(user)] has remade the powernet. makepowernets() called.") + message_admins("[key_name_admin(user)] has remade the powernets. makepowernets() called.") BLACKBOX_LOG_ADMIN_VERB("Make Powernets") -/client/proc/cmd_admin_grantfullaccess(mob/M in GLOB.mob_list) - set category = "Debug" - set name = "Grant Full Access" - +ADMIN_VERB_VISIBILITY(cmd_admin_grantfullaccess, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(cmd_admin_grantfullaccess, R_DEBUG, "Grant Full Access", "Grant full access to a mob.", ADMIN_CATEGORY_DEBUG, mob/M in world) if(!SSticker.HasRoundStarted()) - tgui_alert(usr,"Wait until the game starts") + tgui_alert(user, "Wait until the game starts") return if(ishuman(M)) var/mob/living/carbon/human/H = M @@ -180,51 +150,44 @@ H.equip_to_slot(id, ITEM_SLOT_ID) else - tgui_alert(usr,"Invalid mob") + tgui_alert(user,"Invalid mob") BLACKBOX_LOG_ADMIN_VERB("Grant Full Access") - log_admin("[key_name(src)] has granted [M.key] full access.") - message_admins(span_adminnotice("[key_name_admin(usr)] has granted [M.key] full access.")) - -/client/proc/cmd_assume_direct_control(mob/M in GLOB.mob_list) - set category = "Admin.Game" - set name = "Assume direct control" - set desc = "Direct intervention" + log_admin("[key_name(user)] has granted [M.key] full access.") + message_admins(span_adminnotice("[key_name_admin(user)] has granted [M.key] full access.")) +ADMIN_VERB(cmd_assume_direct_control, R_ADMIN, "Assume Direct Control", "Assume direct control of a mob.", ADMIN_CATEGORY_DEBUG, mob/M) if(M.ckey) - if(tgui_alert(usr,"This mob is being controlled by [M.key]. Are you sure you wish to assume control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes") + if(tgui_alert(user,"This mob is being controlled by [M.key]. Are you sure you wish to assume control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes") return if(!M || QDELETED(M)) - to_chat(usr, span_warning("The target mob no longer exists.")) + to_chat(user, span_warning("The target mob no longer exists.")) return - message_admins(span_adminnotice("[key_name_admin(usr)] assumed direct control of [M].")) - log_admin("[key_name(usr)] assumed direct control of [M].") - var/mob/adminmob = mob + message_admins(span_adminnotice("[key_name_admin(user)] assumed direct control of [M].")) + log_admin("[key_name(user)] assumed direct control of [M].") + var/mob/adminmob = user.mob if(M.ckey) M.ghostize(FALSE) - M.key = key - init_verbs() + M.key = user.key + user.init_verbs() if(isobserver(adminmob)) qdel(adminmob) BLACKBOX_LOG_ADMIN_VERB("Assume Direct Control") -/client/proc/cmd_give_direct_control(mob/M in GLOB.mob_list) - set category = "Admin.Game" - set name = "Give direct control" - +ADMIN_VERB(cmd_give_direct_control, R_ADMIN, "Give Direct Control", "Give direct control of a mob to another player.", ADMIN_CATEGORY_GAME, mob/M) if(!M) return if(M.ckey) - if(tgui_alert(usr,"This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes") + if(tgui_alert(user,"This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes") return - var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sort_list(GLOB.clients) + var/client/newkey = input(user, "Pick the player to put in control.", "New player") as null|anything in sort_list(GLOB.clients) if(isnull(newkey)) return var/mob/oldmob = newkey.mob var/delmob = FALSE - if((isobserver(oldmob) || tgui_alert(usr,"Do you want to delete [newkey]'s old mob?","Delete?",list("Yes","No")) != "No")) + if((isobserver(oldmob) || tgui_alert(user,"Do you want to delete [newkey]'s old mob?","Delete?",list("Yes","No")) != "No")) delmob = TRUE if(!M || QDELETED(M)) - to_chat(usr, span_warning("The target mob no longer exists, aborting.")) + to_chat(user, span_warning("The target mob no longer exists, aborting.")) return if(M.ckey) M.ghostize(FALSE) @@ -232,14 +195,12 @@ M.client?.init_verbs() if(delmob) qdel(oldmob) - message_admins(span_adminnotice("[key_name_admin(usr)] gave away direct control of [M] to [newkey].")) - log_admin("[key_name(usr)] gave away direct control of [M] to [newkey].") + message_admins(span_adminnotice("[key_name_admin(user)] gave away direct control of [M] to [newkey].")) + log_admin("[key_name(user)] gave away direct control of [M] to [newkey].") BLACKBOX_LOG_ADMIN_VERB("Give Direct Control") -/client/proc/cmd_admin_areatest(on_station, filter_maint) - set category = "Mapping" - set name = "Test Areas" - +ADMIN_VERB_VISIBILITY(cmd_admin_areatest, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(cmd_admin_areatest, R_DEBUG, "Test Areas", "Tests the areas for various machinery.", ADMIN_CATEGORY_MAPPING, on_station as num, filter_maint as num) var/list/dat = list() var/list/areas_all = list() var/list/areas_with_APC = list() @@ -270,7 +231,7 @@ )) if(SSticker.current_state == GAME_STATE_STARTUP) - to_chat(usr, "Game still loading, please hold!", confidential = TRUE) + to_chat(user, "Game still loading, please hold!", confidential = TRUE) return var/log_message @@ -283,8 +244,8 @@ dat += "Maintenance Areas Filtered Out" log_message += ", with no maintenance areas" - message_admins(span_adminnotice("[key_name_admin(usr)] used the Test Areas debug command checking [log_message].")) - log_admin("[key_name(usr)] used the Test Areas debug command checking [log_message].") + message_admins(span_adminnotice("[key_name_admin(user)] used the Test Areas debug command checking [log_message].")) + log_admin("[key_name(user)] used the Test Areas debug command checking [log_message].") for(var/area/A as anything in GLOB.areas) if(on_station) @@ -425,28 +386,23 @@ if(!(areas_with_APC.len || areas_with_multiple_APCs.len || areas_with_air_alarm.len || areas_with_RC.len || areas_with_light.len || areas_with_LS.len || areas_with_intercom.len || areas_with_camera.len)) dat += "No problem areas!" - var/datum/browser/popup = new(usr, "testareas", "Test Areas", 500, 750) + var/datum/browser/popup = new(user.mob, "testareas", "Test Areas", 500, 750) popup.set_content(dat.Join()) popup.open() +ADMIN_VERB_VISIBILITY(cmd_admin_areatest_station, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(cmd_admin_areatest_station, R_DEBUG, "Test Areas (STATION ONLY)", "Tests the areas for various machinery on station z-levels.", ADMIN_CATEGORY_MAPPING) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/cmd_admin_areatest, /* on_station = */ TRUE) -/client/proc/cmd_admin_areatest_station() - set category = "Mapping" - set name = "Test Areas (STATION ONLY)" - cmd_admin_areatest(TRUE) +ADMIN_VERB_VISIBILITY(cmd_admin_areatest_station_no_maintenance, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(cmd_admin_areatest_station_no_maintenance, R_DEBUG, "Test Areas (STATION - NO MAINT)", "Tests the areas for various machinery on station z-levels, excluding maintenance areas.", ADMIN_CATEGORY_MAPPING) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/cmd_admin_areatest, /* on_station = */ TRUE, /* filter_maint = */ TRUE) -/client/proc/cmd_admin_areatest_station_no_maintenance() - set category = "Mapping" - set name = "Test Areas (STATION - NO MAINT)" - cmd_admin_areatest(on_station = TRUE, filter_maint = TRUE) - -/client/proc/cmd_admin_areatest_all() - set category = "Mapping" - set name = "Test Areas (ALL)" - cmd_admin_areatest(FALSE) +ADMIN_VERB_VISIBILITY(cmd_admin_areatest_all, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(cmd_admin_areatest_all, R_DEBUG, "Test Areas (ALL)", "Tests the areas for various machinery on all z-levels.", ADMIN_CATEGORY_MAPPING) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/cmd_admin_areatest) /client/proc/robust_dress_shop() - var/list/baseoutfits = list("Naked","Custom","As Job...", "As Plasmaman...") var/list/outfits = list() var/list/paths = subtypesof(/datum/outfit) - typesof(/datum/outfit/job) - typesof(/datum/outfit/plasmaman) @@ -497,52 +453,29 @@ return dresscode -/client/proc/cmd_admin_rejuvenate(mob/living/M in GLOB.mob_list) - set category = "Debug" - set name = "Rejuvenate" - - if(!check_rights(R_ADMIN)) - return - - if(!mob) - return +ADMIN_VERB_ONLY_CONTEXT_MENU(cmd_admin_rejuvenate, R_ADMIN, "Rejuvenate", mob/living/M in world) if(!istype(M)) - tgui_alert(usr,"Cannot revive a ghost") + tgui_alert(user,"Cannot revive a ghost") return M.revive(ADMIN_HEAL_ALL) - log_admin("[key_name(usr)] healed / revived [key_name(M)]") - var/msg = span_danger("Admin [key_name_admin(usr)] healed / revived [ADMIN_LOOKUPFLW(M)]!") + log_admin("[key_name(user)] healed / revived [key_name(M)]") + var/msg = span_danger("Admin [key_name_admin(user)] healed / revived [ADMIN_LOOKUPFLW(M)]!") message_admins(msg) admin_ticket_log(M, msg) BLACKBOX_LOG_ADMIN_VERB("Rejuvenate") -/client/proc/cmd_admin_delete(atom/A as obj|mob|turf in world) - set category = "Debug" - set name = "Delete" - - if(!check_rights(R_SPAWN|R_DEBUG)) - return - - admin_delete(A) +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_delete, R_DEBUG|R_SPAWN, "Delete", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, atom/target as obj|mob|turf in world) + user.admin_delete(target) -/client/proc/cmd_admin_check_contents(mob/living/M in GLOB.mob_list) - set category = "Debug" - set name = "Check Contents" - - var/list/L = M.get_contents() - for(var/t in L) - to_chat(usr, "[t] [ADMIN_VV(t)] [ADMIN_TAG(t)]", confidential = TRUE) +ADMIN_VERB_AND_CONTEXT_MENU(cmd_check_contents, R_ADMIN, "Check Contents", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/living/mob) + var/list/mob_contents = mob.get_contents() + for(var/content in mob_contents) + to_chat(user, "[content] [ADMIN_VV(content)] [ADMIN_TAG(content)]", confidential = TRUE) BLACKBOX_LOG_ADMIN_VERB("Check Contents") -/client/proc/modify_goals() - set category = "Debug" - set name = "Modify goals" - - if(!check_rights(R_ADMIN)) - return - - holder.modify_goals() +ADMIN_VERB(modify_goals, R_ADMIN, "Modify Goals", "Modify the station goals for the shift.", ADMIN_CATEGORY_DEBUG) + user.holder.modify_goals() /datum/admins/proc/modify_goals() var/dat = "" @@ -551,34 +484,27 @@ dat += "
    Add New Goal" usr << browse(dat, "window=goals;size=400x400") -/client/proc/cmd_debug_mob_lists() - set category = "Debug" - set name = "Debug Mob Lists" - set desc = "For when you just gotta know" - var/chosen_list = tgui_input_list(usr, "Which list?", "Select List", list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients")) +ADMIN_VERB(debug_mob_lists, R_DEBUG, "Debug Mob Lists", "For when you just gotta know.", ADMIN_CATEGORY_DEBUG) + var/chosen_list = tgui_input_list(user, "Which list?", "Select List", list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients")) if(isnull(chosen_list)) return switch(chosen_list) if("Players") - to_chat(usr, jointext(GLOB.player_list,","), confidential = TRUE) + to_chat(user, jointext(GLOB.player_list,","), confidential = TRUE) if("Admins") - to_chat(usr, jointext(GLOB.admins,","), confidential = TRUE) + to_chat(user, jointext(GLOB.admins,","), confidential = TRUE) if("Mobs") - to_chat(usr, jointext(GLOB.mob_list,","), confidential = TRUE) + to_chat(user, jointext(GLOB.mob_list,","), confidential = TRUE) if("Living Mobs") - to_chat(usr, jointext(GLOB.alive_mob_list,","), confidential = TRUE) + to_chat(user, jointext(GLOB.alive_mob_list,","), confidential = TRUE) if("Dead Mobs") - to_chat(usr, jointext(GLOB.dead_mob_list,","), confidential = TRUE) + to_chat(user, jointext(GLOB.dead_mob_list,","), confidential = TRUE) if("Clients") - to_chat(usr, jointext(GLOB.clients,","), confidential = TRUE) + to_chat(user, jointext(GLOB.clients,","), confidential = TRUE) if("Joined Clients") - to_chat(usr, jointext(GLOB.joined_player_list,","), confidential = TRUE) - -/client/proc/cmd_display_del_log() - set category = "Debug" - set name = "Display del() Log" - set desc = "Display del's log of everything that's passed through it." + to_chat(user, jointext(GLOB.joined_player_list,","), confidential = TRUE) +ADMIN_VERB(del_log, R_DEBUG, "Display del() Log", "Display del's log of everything that's passed through it.", ADMIN_CATEGORY_DEBUG) var/list/dellog = list("List of things that have gone through qdel this round

      ") sortTim(SSgarbage.items, cmp=/proc/cmp_qdel_item_time, associative = TRUE) for(var/path in SSgarbage.items) @@ -609,37 +535,19 @@ dellog += "
    " - usr << browse(dellog.Join(), "window=dellog") - -/client/proc/cmd_display_overlay_log() - set category = "Debug" - set name = "Display overlay Log" - set desc = "Display SSoverlays log of everything that's passed through it." - - render_stats(SSoverlays.stats, src) - -/client/proc/cmd_display_init_log() - set category = "Debug" - set name = "Display Initialize() Log" - set desc = "Displays a list of things that didn't handle Initialize() properly" + user << browse(dellog.Join(), "window=dellog") - usr << browse(replacetext(SSatoms.InitLog(), "\n", "
    "), "window=initlog") +ADMIN_VERB(display_overlay_log, R_DEBUG, "Display Overlay Log", "Display SSoverlays log of everything that's passed through it.", ADMIN_CATEGORY_DEBUG) + render_stats(SSoverlays.stats, user) -/client/proc/open_colorblind_test() - set category = "Debug" - set name = "Colorblind Testing" - set desc = "Change your view to a budget version of colorblindness to test for usability" +ADMIN_VERB(init_log, R_DEBUG, "Display Initialize() Log", "Displays a list of things that didn't handle Initialize() properly.", ADMIN_CATEGORY_DEBUG) + user << browse(replacetext(SSatoms.InitLog(), "\n", "
    "), "window=initlog") - if(!holder) - return - holder.color_test.ui_interact(mob) - -/client/proc/debug_plane_masters() - set category = "Debug" - set name = "Edit/Debug Planes" - set desc = "Edit and visualize plane masters and their connections (relays)" +ADMIN_VERB(debug_color_test, R_DEBUG, "Colorblind Testing", "Change your view to a budget version of colorblindness to test for usability.", ADMIN_CATEGORY_DEBUG) + user.holder.color_test.ui_interact(user.mob) - edit_plane_masters() +ADMIN_VERB(debug_plane_masters, R_DEBUG, "Edit/Debug Planes", "Edit and visualize plane masters and their connections (relays).", ADMIN_CATEGORY_DEBUG) + user.edit_plane_masters() /client/proc/edit_plane_masters(mob/debug_on) if(!holder) @@ -651,21 +559,10 @@ holder.plane_debug.set_mirroring(FALSE) holder.plane_debug.ui_interact(mob) -/client/proc/debug_huds(i as num) - set category = "Debug" - set name = "Debug HUDs" - set desc = "Debug the data or antag HUDs" +ADMIN_VERB(debug_huds, R_DEBUG, "Debug HUDs", "Debug the data or antag HUDs.", ADMIN_CATEGORY_DEBUG, i as num) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/debug_variables, GLOB.huds[i]) - if(!holder) - return - debug_variables(GLOB.huds[i]) - -/client/proc/jump_to_ruin() - set category = "Debug" - set name = "Jump to Ruin" - set desc = "Displays a list of all placed ruins to teleport to." - if(!holder) - return +ADMIN_VERB(jump_to_ruin, R_DEBUG, "Jump to Ruin", "Displays a list of all placed ruins to teleport to.", ADMIN_CATEGORY_DEBUG) var/list/names = list() for(var/obj/effect/landmark/ruin/ruin_landmark as anything in GLOB.ruin_landmarks) var/datum/map_template/ruin/template = ruin_landmark.ruin_template @@ -680,23 +577,17 @@ names[name] = ruin_landmark - var/ruinname = tgui_input_list(usr, "Select ruin", "Jump to Ruin", sort_list(names)) - + var/ruinname = tgui_input_list(user, "Select ruin", "Jump to Ruin", sort_list(names)) var/obj/effect/landmark/ruin/landmark = names[ruinname] - - if(istype(landmark)) - var/datum/map_template/ruin/template = landmark.ruin_template - usr.forceMove(get_turf(landmark)) - to_chat(usr, span_name("[template.name]"), confidential = TRUE) - to_chat(usr, "[template.description]", confidential = TRUE) - -/client/proc/place_ruin() - set category = "Debug" - set name = "Spawn Ruin" - set desc = "Attempt to randomly place a specific ruin." - if (!holder) + if(!istype(landmark)) return + var/datum/map_template/ruin/template = landmark.ruin_template + user.mob.forceMove(get_turf(landmark)) + to_chat(user, span_name("[template.name]"), confidential = TRUE) + to_chat(user, "[template.description]", confidential = TRUE) +ADMIN_VERB_VISIBILITY(place_ruin, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(place_ruin, R_DEBUG, "Spawn Ruin", "Attempt to randomly place a specific ruin.", ADMIN_CATEGORY_MAPPING) var/list/exists = list() for(var/landmark in GLOB.ruin_landmarks) var/obj/effect/landmark/ruin/L = landmark @@ -714,15 +605,15 @@ themed_names[name] = list(ruin, theme, list(ruin.default_area)) names += sort_list(themed_names) - var/ruinname = tgui_input_list(usr, "Select ruin", "Spawn Ruin", sort_list(names)) + var/ruinname = tgui_input_list(user, "Select ruin", "Spawn Ruin", sort_list(names)) var/data = names[ruinname] if (!data) return var/datum/map_template/ruin/template = data[1] if (exists[template]) - var/response = tgui_alert(usr,"There is already a [template] in existence.", "Spawn Ruin", list("Jump", "Place Another", "Cancel")) + var/response = tgui_alert(user,"There is already a [template] in existence.", "Spawn Ruin", list("Jump", "Place Another", "Cancel")) if (response == "Jump") - usr.forceMove(get_turf(exists[template])) + user.mob.forceMove(get_turf(exists[template])) return else if (response == "Cancel") return @@ -731,25 +622,17 @@ seedRuins(SSmapping.levels_by_trait(data[2]), max(1, template.cost), data[3], list(ruinname = template)) if (GLOB.ruin_landmarks.len > len) var/obj/effect/landmark/ruin/landmark = GLOB.ruin_landmarks[GLOB.ruin_landmarks.len] - log_admin("[key_name(src)] randomly spawned ruin [ruinname] at [COORD(landmark)].") - usr.forceMove(get_turf(landmark)) - to_chat(src, span_name("[template.name]"), confidential = TRUE) - to_chat(src, "[template.description]", confidential = TRUE) + log_admin("[key_name(user)] randomly spawned ruin [ruinname] at [COORD(landmark)].") + user.mob.forceMove(get_turf(landmark)) + to_chat(user, span_name("[template.name]"), confidential = TRUE) + to_chat(user, "[template.description]", confidential = TRUE) else - to_chat(src, span_warning("Failed to place [template.name]."), confidential = TRUE) - -/client/proc/unload_ctf() - set category = "Debug" - set name = "Unload CTF" - set desc = "Despawns the majority of CTF" + to_chat(user, span_warning("Failed to place [template.name]."), confidential = TRUE) - toggle_id_ctf(usr, CTF_GHOST_CTF_GAME_ID, unload=TRUE) - -/client/proc/run_empty_query(val as num) - set category = "Debug" - set name = "Run empty query" - set desc = "Amount of queries to run" +ADMIN_VERB(unload_ctf, R_DEBUG, "Unload CTF", "Despawns the majority of CTF.", ADMIN_CATEGORY_DEBUG) + toggle_id_ctf(user, CTF_GHOST_CTF_GAME_ID, unload=TRUE) +ADMIN_VERB(run_empty_query, R_DEBUG, "Run Empty Query", "Runs a specified number of empty queries.", ADMIN_CATEGORY_DEBUG, val as num) var/list/queries = list() for(var/i in 1 to val) var/datum/db_query/query = SSdbcore.NewQuery("NULL") @@ -761,45 +644,31 @@ qdel(query) queries.Cut() - message_admins("[key_name_admin(src)] ran [val] empty queries.") + message_admins("[key_name_admin(user)] ran [val] empty queries.") -/client/proc/clear_dynamic_transit() - set category = "Debug" - set name = "Clear Dynamic Turf Reservations" - set desc = "Deallocates all reserved space, restoring it to round start conditions." - if(!holder) - return - var/answer = tgui_alert(usr,"WARNING: THIS WILL WIPE ALL RESERVED SPACE TO A CLEAN SLATE! ANY MOVING SHUTTLES, ELEVATORS, OR IN-PROGRESS PHOTOGRAPHY WILL BE DELETED!", "Really wipe dynamic turfs?", list("YES", "NO")) +ADMIN_VERB(clear_turf_reservations, R_DEBUG, "Clear Dynamic Turf Reservations", "Deallocates all reserved space, restoring it to round start conditions.", ADMIN_CATEGORY_DEBUG) + var/answer = tgui_alert( + user, + "WARNING: THIS WILL WIPE ALL RESERVED SPACE TO A CLEAN SLATE! ANY MOVING SHUTTLES, ELEVATORS, OR IN-PROGRESS PHOTOGRAPHY WILL BE DELETED!", + "Really wipe dynamic turfs?", + list("YES", "NO"), + ) if(answer != "YES") return - message_admins(span_adminnotice("[key_name_admin(src)] cleared dynamic transit space.")) - BLACKBOX_LOG_ADMIN_VERB("Clear Dynamic Transit") - log_admin("[key_name(src)] cleared dynamic transit space.") + message_admins(span_adminnotice("[key_name_admin(user)] cleared dynamic transit space.")) + BLACKBOX_LOG_ADMIN_VERB("Clear Dynamic Turf Reservations") + log_admin("[key_name(user)] cleared dynamic turf reservations.") SSmapping.wipe_reservations() //this goes after it's logged, incase something horrible happens. -/client/proc/toggle_medal_disable() - set category = "Debug" - set name = "Toggle Medal Disable" - set desc = "Toggles the safety lock on trying to contact the medal hub." - - if(!check_rights(R_DEBUG)) - return - +ADMIN_VERB(toggle_medal_disable, R_DEBUG, "Toggle Medal Disable", "Toggles the safety lock on trying to contact the medal hub.", ADMIN_CATEGORY_DEBUG) SSachievements.achievements_enabled = !SSachievements.achievements_enabled - message_admins(span_adminnotice("[key_name_admin(src)] [SSachievements.achievements_enabled ? "disabled" : "enabled"] the medal hub lockout.")) + message_admins(span_adminnotice("[key_name_admin(user)] [SSachievements.achievements_enabled ? "disabled" : "enabled"] the medal hub lockout.")) BLACKBOX_LOG_ADMIN_VERB("Toggle Medal Disable") - log_admin("[key_name(src)] [SSachievements.achievements_enabled ? "disabled" : "enabled"] the medal hub lockout.") - -/client/proc/view_runtimes() - set category = "Debug" - set name = "View Runtimes" - set desc = "Open the runtime Viewer" - - if(!holder) - return + log_admin("[key_name(user)] [SSachievements.achievements_enabled ? "disabled" : "enabled"] the medal hub lockout.") - GLOB.error_cache.show_to(src) +ADMIN_VERB(view_runtimes, R_DEBUG, "View Runtimes", "Opens the runtime viewer.", ADMIN_CATEGORY_DEBUG) + GLOB.error_cache.show_to(user) // The runtime viewer has the potential to crash the server if there's a LOT of runtimes // this has happened before, multiple times, so we'll just leave an alert on it @@ -808,80 +677,54 @@ if(GLOB.total_runtimes >= 100000) warning = "There are a TON of runtimes, clicking any button (especially \"linear\") WILL LIKELY crash the server" // Not using TGUI alert, because it's view runtimes, stuff is probably broken - alert(usr, "[warning]. Proceed with caution. If you really need to see the runtimes, download the runtime log and view it in a text editor.", "HEED THIS WARNING CAREFULLY MORTAL") - -/client/proc/pump_random_event() - set category = "Debug" - set name = "Pump Random Event" - set desc = "Schedules the event subsystem to fire a new random event immediately. Some events may fire without notification." - if(!holder) - return + alert(user, "[warning]. Proceed with caution. If you really need to see the runtimes, download the runtime log and view it in a text editor.", "HEED THIS WARNING CAREFULLY MORTAL") +ADMIN_VERB(pump_random_event, R_DEBUG, "Pump Random Event", "Schedules the event subsystem to fire a new random event immediately. Some events may fire without notification.", ADMIN_CATEGORY_DEBUG) SSevents.scheduled = world.time - message_admins(span_adminnotice("[key_name_admin(src)] pumped a random event.")) + message_admins(span_adminnotice("[key_name_admin(user)] pumped a random event.")) BLACKBOX_LOG_ADMIN_VERB("Pump Random Event") - log_admin("[key_name(src)] pumped a random event.") - -/client/proc/start_line_profiling() - set category = "Profile" - set name = "Start Line Profiling" - set desc = "Starts tracking line by line profiling for code lines that support it" + log_admin("[key_name(user)] pumped a random event.") +ADMIN_VERB_VISIBILITY(start_line_profiling, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(start_line_profiling, R_DEBUG, "Start Line Profiling", "Starts tracking line by line profiling for code lines that support it.", ADMIN_CATEGORY_PROFILE) LINE_PROFILE_START - message_admins(span_adminnotice("[key_name_admin(src)] started line by line profiling.")) + message_admins(span_adminnotice("[key_name_admin(user)] started line by line profiling.")) BLACKBOX_LOG_ADMIN_VERB("Start Line Profiling") - log_admin("[key_name(src)] started line by line profiling.") - -/client/proc/stop_line_profiling() - set category = "Profile" - set name = "Stops Line Profiling" - set desc = "Stops tracking line by line profiling for code lines that support it" + log_admin("[key_name(user)] started line by line profiling.") +ADMIN_VERB_VISIBILITY(stop_line_profiling, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(stop_line_profiling, R_DEBUG, "Stop Line Profiling", "Stops tracking line by line profiling for code lines that support it.", ADMIN_CATEGORY_PROFILE) LINE_PROFILE_STOP - message_admins(span_adminnotice("[key_name_admin(src)] stopped line by line profiling.")) + message_admins(span_adminnotice("[key_name_admin(user)] stopped line by line profiling.")) BLACKBOX_LOG_ADMIN_VERB("Stop Line Profiling") - log_admin("[key_name(src)] stopped line by line profiling.") - -/client/proc/show_line_profiling() - set category = "Profile" - set name = "Show Line Profiling" - set desc = "Shows tracked profiling info from code lines that support it" + log_admin("[key_name(user)] stopped line by line profiling.") +ADMIN_VERB_VISIBILITY(show_line_profiling, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(show_line_profiling, R_DEBUG, "Show Line Profiling", "Shows tracked profiling info from code lines that support it.", ADMIN_CATEGORY_PROFILE) var/sortlist = list( "Avg time" = GLOBAL_PROC_REF(cmp_profile_avg_time_dsc), "Total Time" = GLOBAL_PROC_REF(cmp_profile_time_dsc), "Call Count" = GLOBAL_PROC_REF(cmp_profile_count_dsc) ) - var/sort = input(src, "Sort type?", "Sort Type", "Avg time") as null|anything in sortlist + var/sort = input(user, "Sort type?", "Sort Type", "Avg time") as null|anything in sortlist if (!sort) return sort = sortlist[sort] - profile_show(src, sort) + profile_show(user, sort) -/client/proc/reload_configuration() - set category = "Debug" - set name = "Reload Configuration" - set desc = "Force config reload to world default" - if(!check_rights(R_DEBUG)) - return - if(tgui_alert(usr, "Are you absolutely sure you want to reload the configuration from the default path on the disk, wiping any in-round modifications?", "Really reset?", list("No", "Yes")) == "Yes") - config.admin_reload() - -/// A debug verb to check the sources of currently running timers -/client/proc/check_timer_sources() - set category = "Debug" - set name = "Check Timer Sources" - set desc = "Checks the sources of the running timers" - if (!check_rights(R_DEBUG)) +ADMIN_VERB(reload_configuration, R_DEBUG, "Reload Configuration", "Reloads the configuration from the default path on the disk, wiping any in-round modifications.", ADMIN_CATEGORY_DEBUG) + if(!tgui_alert(user, "Are you absolutely sure you want to reload the configuration from the default path on the disk, wiping any in-round modifications?", "Really reset?", list("No", "Yes")) == "Yes") return + config.admin_reload() +ADMIN_VERB(check_timer_sources, R_DEBUG, "Check Timer Sources", "Checks the sources of running timers.", ADMIN_CATEGORY_DEBUG) var/bucket_list_output = generate_timer_source_output(SStimer.bucket_list) var/second_queue = generate_timer_source_output(SStimer.second_queue) - usr << browse({" + user << browse({"

    bucket_list

    [bucket_list_output] @@ -889,24 +732,16 @@ [second_queue] "}, "window=check_timer_sources;size=700x700") -/// A debug verb to try and re-establish a connection with the TTS server and to refetch TTS voices. -/// Since voices are cached beforehand, this is unlikely to update preferences. -/client/proc/reestablish_tts_connection() - set category = "Debug" - set name = "Re-establish Connection To TTS" - set desc = "Re-establishes connection to the TTS server if possible" - if (!check_rights(R_DEBUG)) - return - - message_admins("[key_name_admin(usr)] attempted to re-establish connection to the TTS HTTP server.") - log_admin("[key_name(usr)] attempted to re-establish connection to the TTS HTTP server.") +ADMIN_VERB(reestablish_tts_connection, R_DEBUG, "Re-establish Connection To TTS", "Re-establishes connection to the TTS server if possible", ADMIN_CATEGORY_DEBUG) + message_admins("[key_name_admin(user)] attempted to re-establish connection to the TTS HTTP server.") + log_admin("[key_name(user)] attempted to re-establish connection to the TTS HTTP server.") var/success = SStts.establish_connection_to_tts() if(!success) - message_admins("[key_name_admin(usr)] failed to re-established the connection to the TTS HTTP server.") - log_admin("[key_name(usr)] failed to re-established the connection to the TTS HTTP server.") + message_admins("[key_name_admin(user)] failed to re-established the connection to the TTS HTTP server.") + log_admin("[key_name(user)] failed to re-established the connection to the TTS HTTP server.") return - message_admins("[key_name_admin(usr)] successfully re-established the connection to the TTS HTTP server.") - log_admin("[key_name(usr)] successfully re-established the connection to the TTS HTTP server.") + message_admins("[key_name_admin(user)] successfully re-established the connection to the TTS HTTP server.") + log_admin("[key_name(user)] successfully re-established the connection to the TTS HTTP server.") /proc/generate_timer_source_output(list/datum/timedevent/events) var/list/per_source = list() @@ -950,10 +785,14 @@ return b["count"] - a["count"] #ifdef TESTING -/client/proc/check_missing_sprites() - set category = "Debug" - set name = "Debug Worn Item Sprites" - set desc = "We're cancelling the Spritemageddon. (This will create a LOT of runtimes! Don't use on a live server!)" +ADMIN_VERB_CUSTOM_EXIST_CHECK(check_missing_sprites) + return TRUE +#else +ADMIN_VERB_CUSTOM_EXIST_CHECK(check_missing_sprites) + return FALSE +#endif + +ADMIN_VERB(check_missing_sprites, R_DEBUG, "Debug Worn Item Sprites", "We're cancelling the Spritemageddon. (This will create a LOT of runtimes! Don't use on a live server!)", ADMIN_CATEGORY_DEBUG) var/actual_file_name for(var/test_obj in subtypesof(/obj/item)) var/obj/item/sprite = new test_obj @@ -962,55 +801,54 @@ //Is there an explicit worn_icon to pick against the worn_icon_state? Easy street expected behavior. if(sprite.worn_icon) if(!(sprite.icon_state in icon_states(sprite.worn_icon))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Slot Flags are [sprite.slot_flags]."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Slot Flags are [sprite.slot_flags]."), confidential = TRUE) else if(sprite.worn_icon_state) if(sprite.slot_flags & ITEM_SLOT_MASK) actual_file_name = 'icons/mob/clothing/mask.dmi' if(!(sprite.worn_icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Mask slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Mask slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_NECK) actual_file_name = 'icons/mob/clothing/neck.dmi' if(!(sprite.worn_icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Neck slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Neck slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_BACK) actual_file_name = 'icons/mob/clothing/back.dmi' if(!(sprite.worn_icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Back slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Back slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_HEAD) actual_file_name = 'icons/mob/clothing/head/default.dmi' if(!(sprite.worn_icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Head slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Head slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_BELT) actual_file_name = 'icons/mob/clothing/belt.dmi' if(!(sprite.worn_icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Belt slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Belt slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_SUITSTORE) actual_file_name = 'icons/mob/clothing/belt_mirror.dmi' if(!(sprite.worn_icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Suit Storage slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Suit Storage slot."), confidential = TRUE) else if(sprite.icon_state) if(sprite.slot_flags & ITEM_SLOT_MASK) actual_file_name = 'icons/mob/clothing/mask.dmi' if(!(sprite.icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Mask slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Mask slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_NECK) actual_file_name = 'icons/mob/clothing/neck.dmi' if(!(sprite.icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Neck slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Neck slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_BACK) actual_file_name = 'icons/mob/clothing/back.dmi' if(!(sprite.icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Back slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Back slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_HEAD) actual_file_name = 'icons/mob/clothing/head/default.dmi' if(!(sprite.icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Head slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Head slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_BELT) actual_file_name = 'icons/mob/clothing/belt.dmi' if(!(sprite.icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Belt slot."), confidential = TRUE) + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Belt slot."), confidential = TRUE) if(sprite.slot_flags & ITEM_SLOT_SUITSTORE) actual_file_name = 'icons/mob/clothing/belt_mirror.dmi' if(!(sprite.icon_state in icon_states(actual_file_name))) - to_chat(src, span_warning("ERROR sprites for [sprite.type]. Suit Storage slot."), confidential = TRUE) -#endif + to_chat(user, span_warning("ERROR sprites for [sprite.type]. Suit Storage slot."), confidential = TRUE) diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index a6a9a204b85..4575614bb94 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -1,15 +1,10 @@ -/client/proc/air_status(turf/target) - set category = "Debug" - set name = "Display Air Status" - - if(!isturf(target)) - return - atmos_scan(user=usr, target=target, silent=TRUE) +ADMIN_VERB_VISIBILITY(debug_air_status, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(debug_air_status, R_DEBUG, "Debug Air Status" , ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, turf/target in world) + atmos_scan(user.mob, target, silent = TRUE) BLACKBOX_LOG_ADMIN_VERB("Show Air Status") -/client/proc/fix_next_move() - set category = "Debug" - set name = "Unfreeze Everyone" +ADMIN_VERB_VISIBILITY(fix_next_move, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(fix_next_move, R_DEBUG, "Fix Next Move", "Unfreezes all frozen mobs.", ADMIN_CATEGORY_DEBUG) var/largest_move_time = 0 var/largest_click_time = 0 var/mob/largest_move_mob = null @@ -34,12 +29,9 @@ message_admins("[ADMIN_LOOKUPFLW(largest_click_mob)] had the largest click delay with [largest_click_time] frames / [DisplayTimeText(largest_click_time)]!") message_admins("world.time = [world.time]") BLACKBOX_LOG_ADMIN_VERB("Unfreeze Everyone") - return - -/client/proc/radio_report() - set category = "Debug" - set name = "Radio report" +ADMIN_VERB_VISIBILITY(radio_report, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(radio_report, R_DEBUG, "Radio Report", "Shows a report of all radio devices and their filters.", ADMIN_CATEGORY_DEBUG) var/output = "Radio Report
    " for (var/fq in SSradio.frequencies) output += "Freq: [fq]
    " @@ -64,29 +56,21 @@ else output += "    [device]
    " - usr << browse(output,"window=radioreport") + user << browse(output,"window=radioreport") BLACKBOX_LOG_ADMIN_VERB("Show Radio Report") -/client/proc/reload_admins() - set name = "Reload Admins" - set category = "Admin" - - if(!src.holder) - return - - var/confirm = tgui_alert(usr, "Are you sure you want to reload all admins?", "Confirm", list("Yes", "No")) +ADMIN_VERB(reload_admins, R_NONE, "Reload Admins", "Reloads all admins from the database.", ADMIN_CATEGORY_MAIN) + var/confirm = tgui_alert(user, "Are you sure you want to reload all admins?", "Confirm", list("Yes", "No")) if(confirm != "Yes") return load_admins() BLACKBOX_LOG_ADMIN_VERB("Reload All Admins") - message_admins("[key_name_admin(usr)] manually reloaded admins") + message_admins("[key_name_admin(user)] manually reloaded admins") -/client/proc/toggle_cdn() - set name = "Toggle CDN" - set category = "Server" +ADMIN_VERB(toggle_cdn, R_SERVER|R_DEBUG, "Toggle CDN", "Toggles the CDN for the server.", ADMIN_CATEGORY_SERVER) var/static/admin_disabled_cdn_transport = null - if (alert(usr, "Are you sure you want to toggle the CDN asset transport?", "Confirm", "Yes", "No") != "Yes") + if (alert(user, "Are you sure you want to toggle the CDN asset transport?", "Confirm", "Yes", "No") != "Yes") return var/current_transport = CONFIG_GET(string/asset_transport) if (!current_transport || current_transport == "simple") @@ -94,17 +78,17 @@ CONFIG_SET(string/asset_transport, admin_disabled_cdn_transport) admin_disabled_cdn_transport = null SSassets.OnConfigLoad() - message_admins("[key_name_admin(usr)] re-enabled the CDN asset transport") - log_admin("[key_name(usr)] re-enabled the CDN asset transport") + message_admins("[key_name_admin(user)] re-enabled the CDN asset transport") + log_admin("[key_name(user)] re-enabled the CDN asset transport") else - to_chat(usr, span_adminnotice("The CDN is not enabled!")) - if (tgui_alert(usr, "The CDN asset transport is not enabled! If you having issues with assets you can also try disabling filename mutations.", "The CDN asset transport is not enabled!", list("Try disabling filename mutations", "Nevermind")) == "Try disabling filename mutations") + to_chat(user, span_adminnotice("The CDN is not enabled!")) + if (tgui_alert(user, "The CDN asset transport is not enabled! If you having issues with assets you can also try disabling filename mutations.", "The CDN asset transport is not enabled!", list("Try disabling filename mutations", "Nevermind")) == "Try disabling filename mutations") SSassets.transport.dont_mutate_filenames = !SSassets.transport.dont_mutate_filenames - message_admins("[key_name_admin(usr)] [(SSassets.transport.dont_mutate_filenames ? "disabled" : "re-enabled")] asset filename transforms") - log_admin("[key_name(usr)] [(SSassets.transport.dont_mutate_filenames ? "disabled" : "re-enabled")] asset filename transforms") + message_admins("[key_name_admin(user)] [(SSassets.transport.dont_mutate_filenames ? "disabled" : "re-enabled")] asset filename transforms") + log_admin("[key_name(user)] [(SSassets.transport.dont_mutate_filenames ? "disabled" : "re-enabled")] asset filename transforms") else admin_disabled_cdn_transport = current_transport CONFIG_SET(string/asset_transport, "simple") SSassets.OnConfigLoad() - message_admins("[key_name_admin(usr)] disabled the CDN asset transport") - log_admin("[key_name(usr)] disabled the CDN asset transport") + message_admins("[key_name_admin(user)] disabled the CDN asset transport") + log_admin("[key_name(user)] disabled the CDN asset transport") diff --git a/code/modules/admin/verbs/ert.dm b/code/modules/admin/verbs/ert.dm index 73b2e4d0116..bfb33c67c53 100644 --- a/code/modules/admin/verbs/ert.dm +++ b/code/modules/admin/verbs/ert.dm @@ -266,18 +266,14 @@ return -/client/proc/summon_ert() - set category = "Admin.Fun" - set name = "Summon ERT" - set desc = "Summons an emergency response team" - - message_admins("[key_name(usr)] is creating a CentCom response team...") - if(holder?.makeEmergencyresponseteam()) - message_admins("[key_name(usr)] created a CentCom response team.") - log_admin("[key_name(usr)] created a CentCom response team.") +ADMIN_VERB(summon_ert, R_FUN, "Summon ERT", "Summons an emergency response team.", ADMIN_CATEGORY_FUN) + message_admins("[key_name_admin(user)] is creating a CentCom response team...") + if(user.holder?.makeEmergencyresponseteam()) + message_admins("[key_name_admin(user)] created a CentCom response team.") + log_admin("[key_name(user)] created a CentCom response team.") else - message_admins("[key_name_admin(usr)] tried to create a CentCom response team. Unfortunately, there were not enough candidates available.") - log_admin("[key_name(usr)] failed to create a CentCom response team.") + message_admins("[key_name_admin(user)] tried to create a CentCom response team. Unfortunately, there were not enough candidates available.") + log_admin("[key_name(user)] failed to create a CentCom response team.") #undef ERT_EXPERIENCED_LEADER_CHOOSE_TOP #undef DUMMY_HUMAN_SLOT_ADMIN diff --git a/code/modules/admin/verbs/fix_air.dm b/code/modules/admin/verbs/fix_air.dm index f122f0d0746..b0dce8c29ea 100644 --- a/code/modules/admin/verbs/fix_air.dm +++ b/code/modules/admin/verbs/fix_air.dm @@ -1,23 +1,16 @@ // Proc taken from yogstation, credit to nichlas0010 for the original -/client/proc/fix_air(turf/open/T in world) - set name = "Fix Air" - set category = "Admin.Game" - set desc = "Fixes air in specified radius." +ADMIN_VERB(fix_air, R_ADMIN, "Fix Air", "Fixes air in a specified radius.", ADMIN_CATEGORY_GAME, turf/open/locale in world, range = 2 as num) + message_admins("[key_name_admin(user)] fixed air with range [range] in area [locale.loc.name]") + user.mob.log_message("fixed air with range [range] in area [locale.loc.name]", LOG_ADMIN) - if(!holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return - if(check_rights(R_ADMIN,1)) - var/range=input("Enter range:","Num",2) as num - message_admins("[key_name_admin(usr)] fixed air with range [range] in area [T.loc.name]") - usr.log_message("fixed air with range [range] in area [T.loc.name]", LOG_ADMIN) - for(var/turf/open/F in range(range,T)) - if(F.blocks_air) - //skip walls - continue - var/datum/gas_mixture/GM = SSair.parse_gas_string(F.initial_gas_mix, /datum/gas_mixture/turf) - F.copy_air(GM) - F.update_visuals() - - if(F.pollution) //NOVA EDIT ADDITION - qdel(F.pollution) + for(var/turf/open/valid_range_turf in range(range,locale)) + if(valid_range_turf.blocks_air) + //skip walls + continue + var/datum/gas_mixture/GM = SSair.parse_gas_string(valid_range_turf.initial_gas_mix, /datum/gas_mixture/turf) + valid_range_turf.copy_air(GM) + valid_range_turf.update_visuals() + //NOVA EDIT ADDITION START + if(valid_range_turf.pollution) + qdel(valid_range_turf.pollution) + //NOVA EDIT ADDITION END diff --git a/code/modules/admin/verbs/fov.dm b/code/modules/admin/verbs/fov.dm index f74ba6f8058..afcd379e4a0 100644 --- a/code/modules/admin/verbs/fov.dm +++ b/code/modules/admin/verbs/fov.dm @@ -1,14 +1,8 @@ -/client/proc/cmd_admin_toggle_fov() - set name = "Enable/Disable Field of View" - set category = "Debug" - - if(!check_rights(R_ADMIN) || !check_rights(R_DEBUG)) - return - +ADMIN_VERB(toggle_fov, R_ADMIN|R_DEBUG, "Enable/Disable Field Of View", "Toggle FOV globally.", ADMIN_CATEGORY_DEBUG) var/on_off = CONFIG_GET(flag/native_fov) - message_admins("[key_name_admin(usr)] has [on_off ? "disabled" : "enabled"] the Native Field of View configuration..") - log_admin("[key_name(usr)] has [on_off ? "disabled" : "enabled"] the Native Field of View configuration.") + message_admins("[key_name_admin(user)] has [on_off ? "disabled" : "enabled"] the Native Field of View configuration..") + log_admin("[key_name(user)] has [on_off ? "disabled" : "enabled"] the Native Field of View configuration.") CONFIG_SET(flag/native_fov, !on_off) SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggled Field of View", "[on_off ? "Enabled" : "Disabled"]")) diff --git a/code/modules/admin/verbs/fps.dm b/code/modules/admin/verbs/fps.dm index 578a0c09514..7af7968cde4 100644 --- a/code/modules/admin/verbs/fps.dm +++ b/code/modules/admin/verbs/fps.dm @@ -1,23 +1,16 @@ -//replaces the old Ticklag verb, fps is easier to understand -/client/proc/set_server_fps() - set category = "Debug" - set name = "Set Server FPS" - set desc = "Sets game speed in frames-per-second. Can potentially break the game" - - if(!check_rights(R_DEBUG)) - return - +ADMIN_VERB_VISIBILITY(set_server_fps, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(set_server_fps, R_DEBUG, "Set Server FPS", "Sets game speed in frames-per-second. Can potentially break the game", ADMIN_CATEGORY_DEBUG) var/cfg_fps = CONFIG_GET(number/fps) - var/new_fps = round(input("Sets game frames-per-second. Can potentially break the game (default: [cfg_fps])","FPS", world.fps) as num|null) + var/new_fps = round(input(user, "Sets game frames-per-second. Can potentially break the game (default: [cfg_fps])","FPS", world.fps) as num|null) if(new_fps <= 0) - to_chat(src, span_danger("Error: set_server_fps(): Invalid world.fps value. No changes made."), confidential = TRUE) + to_chat(user, span_danger("Error: set_server_fps(): Invalid world.fps value. No changes made."), confidential = TRUE) return if(new_fps > cfg_fps * 1.5) - if(tgui_alert(usr, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [cfg_fps]","Warning!",list("Confirm","ABORT-ABORT-ABORT")) != "Confirm") + if(tgui_alert(user, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [cfg_fps]","Warning!",list("Confirm","ABORT-ABORT-ABORT")) != "Confirm") return - var/msg = "[key_name(src)] has modified world.fps to [new_fps]" + var/msg = "[key_name(user)] has modified world.fps to [new_fps]" log_admin(msg, 0) message_admins(msg, 0) SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Set Server FPS", "[new_fps]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/getlogs.dm b/code/modules/admin/verbs/getlogs.dm index 77b43f9b49f..bceac01cbe0 100644 --- a/code/modules/admin/verbs/getlogs.dm +++ b/code/modules/admin/verbs/getlogs.dm @@ -1,17 +1,8 @@ -//This proc allows download of past server logs saved within the data/logs/ folder. -/client/proc/getserverlogs() - set name = "Get Server Logs" - set desc = "View/retrieve logfiles." - set category = "Admin" +ADMIN_VERB(get_server_logs, R_ADMIN, "Get Server Logs", "View or retrieve logfiles.", ADMIN_CATEGORY_MAIN) + user.browseserverlogs() - browseserverlogs() - -/client/proc/getcurrentlogs() - set name = "Get Current Logs" - set desc = "View/retrieve logfiles for the current round." - set category = "Admin" - - browseserverlogs(current=TRUE) +ADMIN_VERB(get_current_logs, R_ADMIN, "Get Current Logs", "View or retrieve logfiles for the current round.", ADMIN_CATEGORY_MAIN) + user.browseserverlogs(current=TRUE) /client/proc/browseserverlogs(current=FALSE) var/path = browse_files(current ? BROWSE_ROOT_CURRENT_LOGS : BROWSE_ROOT_ALL_LOGS) @@ -32,4 +23,3 @@ else return to_chat(src, "Attempting to send [path], this may take a fair few minutes if the file is very large.", confidential = TRUE) - return diff --git a/code/modules/admin/verbs/ghost_pool_protection.dm b/code/modules/admin/verbs/ghost_pool_protection.dm index 843f6868e70..439f4a37b89 100644 --- a/code/modules/admin/verbs/ghost_pool_protection.dm +++ b/code/modules/admin/verbs/ghost_pool_protection.dm @@ -1,11 +1,8 @@ //very similar to centcom_podlauncher in terms of how this is coded, so i kept a lot of comments from it -/client/proc/ghost_pool_protection() //Creates a verb for admins to open up the ui - set name = "Ghost Pool Protection" - set desc = "Choose which ways people can get into the round, or just clear it out completely for admin events." - set category = "Admin.Events" - var/datum/ghost_pool_menu/tgui = new(usr)//create the datum - tgui.ui_interact(usr)//datum has a tgui component, here we open the window +ADMIN_VERB(ghost_pool_protection, R_ADMIN, "Ghost Pool Protection", "Choose which ways people can get into the round, or just clear it out completely for admin events.", ADMIN_CATEGORY_EVENTS) + var/datum/ghost_pool_menu/tgui = new(user) + tgui.ui_interact(user.mob) /datum/ghost_pool_menu var/client/holder //client of whoever is using this datum diff --git a/code/modules/admin/verbs/lawpanel.dm b/code/modules/admin/verbs/lawpanel.dm index 9b52c8d7339..f1daaf17576 100644 --- a/code/modules/admin/verbs/lawpanel.dm +++ b/code/modules/admin/verbs/lawpanel.dm @@ -1,15 +1,9 @@ -/client/proc/cmd_admin_law_panel() - set category = "Admin.Events" - set name = "Law Panel" - - if(!check_rights(R_ADMIN)) - return - if(!isobserver(usr) && SSticker.HasRoundStarted()) - message_admins("[key_name_admin(usr)] checked AI laws via the Law Panel.") - +ADMIN_VERB(law_panel, R_ADMIN, "Law Panel", "View the AI laws.", ADMIN_CATEGORY_EVENTS) + if(!isobserver(user) && SSticker.HasRoundStarted()) + message_admins("[key_name_admin(user)] checked AI laws via the Law Panel.") + var/datum/law_panel/tgui = new + tgui.ui_interact(user.mob) BLACKBOX_LOG_ADMIN_VERB("Law Panel") - var/datum/law_panel/tgui = new() - tgui.ui_interact(usr) /datum/law_panel @@ -211,7 +205,7 @@ switch(action) if("lawchange_logs") - usr.client?.list_law_changes() + ui.user?.client?.holder?.list_law_changes() return FALSE if("force_state_laws") diff --git a/code/modules/admin/verbs/lua/lua_editor.dm b/code/modules/admin/verbs/lua/lua_editor.dm index 9e1b851824b..d4a4bc2ee50 100644 --- a/code/modules/admin/verbs/lua/lua_editor.dm +++ b/code/modules/admin/verbs/lua/lua_editor.dm @@ -233,10 +233,6 @@ . = ..() qdel(src) -/client/proc/open_lua_editor() - set name = "Open Lua Editor" - set category = "Debug" - if(!check_rights_for(src, R_DEBUG)) - return - var/datum/lua_editor/editor = new() - editor.ui_interact(usr) +ADMIN_VERB(lua_editor, R_DEBUG, "Open Lua Editor", "Its codin' time.", ADMIN_CATEGORY_DEBUG) + var/datum/lua_editor/editor = new + editor.ui_interact(user.mob) diff --git a/code/modules/admin/verbs/machine_upgrade.dm b/code/modules/admin/verbs/machine_upgrade.dm index 2f681574d5d..258de6bcf4d 100644 --- a/code/modules/admin/verbs/machine_upgrade.dm +++ b/code/modules/admin/verbs/machine_upgrade.dm @@ -1,13 +1,7 @@ -/proc/machine_upgrade(obj/machinery/M in world) - set name = "Tweak Component Ratings" - set category = "Debug" - if (!istype(M)) - return - - var/new_rating = input("Enter new rating:","Num") as num|null - if(new_rating && M.component_parts) - for(var/obj/item/stock_parts/P in M.component_parts) +ADMIN_VERB(machine_upgrade, R_DEBUG, "Tweak Component Ratings", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, obj/machinery/machine in world) + var/new_rating = input(user, "Enter new rating:","Num") as num|null + if(new_rating && machine.component_parts) + for(var/obj/item/stock_parts/P in machine.component_parts) P.rating = new_rating - M.RefreshParts() - + machine.RefreshParts() SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Machine Upgrade", "[new_rating]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/manipulate_organs.dm b/code/modules/admin/verbs/manipulate_organs.dm index 30f198bfba9..bfb5050dafa 100644 --- a/code/modules/admin/verbs/manipulate_organs.dm +++ b/code/modules/admin/verbs/manipulate_organs.dm @@ -1,7 +1,6 @@ -/client/proc/manipulate_organs(mob/living/carbon/carbon_victim in world) - set name = "Manipulate Organs" - set category = "Debug" - var/operation = tgui_input_list(usr, "Select organ operation", "Organ Manipulation", list("add organ", "add implant", "drop organ/implant", "remove organ/implant")) +ADMIN_VERB_VISIBILITY(manipulate_organs, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(manipulate_organs, R_DEBUG, "Manipulate Organs", "Manipulate the organs of a living carbon.", ADMIN_CATEGORY_DEBUG, mob/living/carbon/carbon_victim in world) + var/operation = tgui_input_list(user, "Select organ operation", "Organ Manipulation", list("add organ", "add implant", "drop organ/implant", "remove organ/implant")) if (isnull(operation)) return @@ -12,7 +11,7 @@ var/dat = replacetext("[path]", "/obj/item/organ/", ":") organs[dat] = path - var/obj/item/organ/organ_to_grant = tgui_input_list(usr, "Select organ type", "Organ Manipulation", organs) + var/obj/item/organ/organ_to_grant = tgui_input_list(user, "Select organ type", "Organ Manipulation", organs) if(isnull(organ_to_grant)) return if(isnull(organs[organ_to_grant])) @@ -20,18 +19,18 @@ organ_to_grant = organs[organ_to_grant] organ_to_grant = new organ_to_grant if(!organ_to_grant.Insert(carbon_victim)) - to_chat(usr, span_notice("[carbon_victim] is unable to carry this organ!")) + to_chat(user, span_notice("[carbon_victim] is unable to carry this organ!")) qdel(organ_to_grant) return - log_admin("[key_name(usr)] has added organ [organ_to_grant.type] to [key_name(carbon_victim)]") - message_admins("[key_name_admin(usr)] has added organ [organ_to_grant.type] to [ADMIN_LOOKUPFLW(carbon_victim)]") + log_admin("[key_name(user)] has added organ [organ_to_grant.type] to [key_name(carbon_victim)]") + message_admins("[key_name_admin(user)] has added organ [organ_to_grant.type] to [ADMIN_LOOKUPFLW(carbon_victim)]") if("add implant") for(var/path in subtypesof(/obj/item/implant)) var/dat = replacetext("[path]", "/obj/item/implant/", ":") organs[dat] = path - var/obj/item/implant/implant_to_grant = tgui_input_list(usr, "Select implant type", "Organ Manipulation", organs) + var/obj/item/implant/implant_to_grant = tgui_input_list(user, "Select implant type", "Organ Manipulation", organs) if(isnull(implant_to_grant)) return if(isnull(organs[implant_to_grant])) @@ -39,11 +38,11 @@ implant_to_grant = organs[implant_to_grant] implant_to_grant = new implant_to_grant if(!implant_to_grant.implant(carbon_victim)) - to_chat(usr, span_notice("[carbon_victim] is unable to hold this implant!")) + to_chat(user, span_notice("[carbon_victim] is unable to hold this implant!")) qdel(implant_to_grant) return - log_admin("[key_name(usr)] has added implant [implant_to_grant.type] to [key_name(carbon_victim)]") - message_admins("[key_name_admin(usr)] has added implant [implant_to_grant.type] to [ADMIN_LOOKUPFLW(carbon_victim)]") + log_admin("[key_name(user)] has added implant [implant_to_grant.type] to [key_name(carbon_victim)]") + message_admins("[key_name_admin(user)] has added implant [implant_to_grant.type] to [ADMIN_LOOKUPFLW(carbon_victim)]") if("drop organ/implant", "remove organ/implant") for(var/obj/item/organ/user_organs as anything in carbon_victim.organs) @@ -52,15 +51,15 @@ for(var/obj/item/implant/user_implants as anything in carbon_victim.implants) organs["[user_implants.name] ([user_implants.type])"] = user_implants - var/obj/item/organ_to_modify = tgui_input_list(usr, "Select organ/implant", "Organ Manipulation", organs) + var/obj/item/organ_to_modify = tgui_input_list(user, "Select organ/implant", "Organ Manipulation", organs) if(isnull(organ_to_modify)) return if(isnull(organs[organ_to_modify])) return organ_to_modify = organs[organ_to_modify] - log_admin("[key_name(usr)] has removed [organ_to_modify.type] from [key_name(carbon_victim)]") - message_admins("[key_name_admin(usr)] has removed [organ_to_modify.type] from [ADMIN_LOOKUPFLW(carbon_victim)]") + log_admin("[key_name(user)] has removed [organ_to_modify.type] from [key_name(carbon_victim)]") + message_admins("[key_name_admin(user)] has removed [organ_to_modify.type] from [ADMIN_LOOKUPFLW(carbon_victim)]") var/obj/item/organ/organ_holder var/obj/item/implant/implant_holder diff --git a/code/modules/admin/verbs/map_export.dm b/code/modules/admin/verbs/map_export.dm index 8233ce4389d..056a2ea1f8a 100644 --- a/code/modules/admin/verbs/map_export.dm +++ b/code/modules/admin/verbs/map_export.dm @@ -1,23 +1,22 @@ -/client/proc/map_export() - set category = "Debug" - set name = "Map Export" - set desc = "Select a part of the map by coordinates and download it." - - var/z_level = tgui_input_number(usr, "Export Which Z-Level?", "Map Exporter", usr.z || 2) - var/start_x = tgui_input_number(usr, "Start X?", "Map Exporter", usr.x || 1, world.maxx, 1) - var/start_y = tgui_input_number(usr, "Start Y?", "Map Exporter", usr.y || 1, world.maxy, 1) - var/end_x = tgui_input_number(usr, "End X?", "Map Exporter", usr.x || 1, world.maxx, 1) - var/end_y = tgui_input_number(usr, "End Y?", "Map Exporter", usr.y || 1, world.maxy, 1) +ADMIN_VERB(map_export, R_DEBUG, "Map Export", "Select a part of the map by coordinates and download it.", ADMIN_CATEGORY_DEBUG) + var/user_x = user.mob.x + var/user_y = user.mob.y + var/user_z = user.mob.z + var/z_level = tgui_input_number(user, "Export Which Z-Level?", "Map Exporter", user_z || 2) + var/start_x = tgui_input_number(user, "Start X?", "Map Exporter", user_x || 1, world.maxx, 1) + var/start_y = tgui_input_number(user, "Start Y?", "Map Exporter", user_y || 1, world.maxy, 1) + var/end_x = tgui_input_number(user, "End X?", "Map Exporter", user_x || 1, world.maxx, 1) + var/end_y = tgui_input_number(user, "End Y?", "Map Exporter", user_y || 1, world.maxy, 1) var/date = time2text(world.timeofday, "YYYY-MM-DD_hh-mm-ss") - var/file_name = sanitize_filename(tgui_input_text(usr, "Filename?", "Map Exporter", "exported_map_[date]")) - var/confirm = tgui_alert(usr, "Are you sure you want to do this? This will cause extreme lag!", "Map Exporter", list("Yes", "No")) + var/file_name = sanitize_filename(tgui_input_text(user, "Filename?", "Map Exporter", "exported_map_[date]")) + var/confirm = tgui_alert(user, "Are you sure you want to do this? This will cause extreme lag!", "Map Exporter", list("Yes", "No")) - if(confirm != "Yes" || !check_rights(R_DEBUG)) + if(confirm != "Yes") return var/map_text = write_map(start_x, start_y, z_level, end_x, end_y, z_level) - log_admin("Build Mode: [key_name(usr)] is exporting the map area from ([start_x], [start_y], [z_level]) through ([end_x], [end_y], [z_level])") - send_exported_map(usr, file_name, map_text) + log_admin("Build Mode: [key_name(user)] is exporting the map area from ([start_x], [start_y], [z_level]) through ([end_x], [end_y], [z_level])") + send_exported_map(user, file_name, map_text) /** * A procedure for saving DMM text to a file and then sending it to the user. diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm index 827bbfb16e8..a27aca0f014 100644 --- a/code/modules/admin/verbs/map_template_loadverb.dm +++ b/code/modules/admin/verbs/map_template_loadverb.dm @@ -1,20 +1,17 @@ -/client/proc/map_template_load() - set category = "Debug" - set name = "Map template - Place" - +ADMIN_VERB(map_template_load, R_DEBUG, "Map Template - Place", "Place a map template at your current location.", ADMIN_CATEGORY_DEBUG) var/datum/map_template/template - var/map = tgui_input_list(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template", sort_list(SSmapping.map_templates)) + var/map = tgui_input_list(user, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template", sort_list(SSmapping.map_templates)) if(!map) return template = SSmapping.map_templates[map] - var/turf/T = get_turf(mob) + var/turf/T = get_turf(user.mob) if(!T) return var/list/preview = list() var/center - var/centeralert = tgui_alert(usr,"Center Template.","Template Centering",list("Yes","No")) + var/centeralert = tgui_alert(user,"Center Template.","Template Centering",list("Yes","No")) switch(centeralert) if("Yes") center = TRUE @@ -26,8 +23,8 @@ var/image/item = image('icons/turf/overlays.dmi', place_on,"greenOverlay") SET_PLANE(item, ABOVE_LIGHTING_PLANE, place_on) preview += item - images += preview - if(tgui_alert(usr,"Confirm location.","Template Confirm",list("Yes","No")) == "Yes") + user.images += preview + if(tgui_alert(user,"Confirm location.","Template Confirm",list("Yes","No")) == "Yes") if(template.load(T, centered = center)) var/affected = template.get_affected_turfs(T, centered = center) for(var/AT in affected) @@ -36,23 +33,20 @@ template.post_load(P) break - message_admins(span_adminnotice("[key_name_admin(src)] has placed a map template ([template.name]) at [ADMIN_COORDJMP(T)]")) + message_admins(span_adminnotice("[key_name_admin(user)] has placed a map template ([template.name]) at [ADMIN_COORDJMP(T)]")) else - to_chat(src, "Failed to place map", confidential = TRUE) - images -= preview - -/client/proc/map_template_upload() - set category = "Debug" - set name = "Map Template - Upload" + to_chat(user, "Failed to place map", confidential = TRUE) + user.images -= preview - var/map = input(src, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file +ADMIN_VERB(map_template_upload, R_DEBUG, "Map Template - Upload", "Upload a map template to the server.", ADMIN_CATEGORY_DEBUG) + var/map = input(user, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file if(!map) return if(copytext("[map]", -4) != ".dmm")//4 == length(".dmm") - to_chat(src, span_warning("Filename must end in '.dmm': [map]"), confidential = TRUE) + to_chat(user, span_warning("Filename must end in '.dmm': [map]"), confidential = TRUE) return var/datum/map_template/M - switch(tgui_alert(usr, "What kind of map is this?", "Map type", list("Normal", "Shuttle", "Cancel"))) + switch(tgui_alert(user, "What kind of map is this?", "Map type", list("Normal", "Shuttle", "Cancel"))) if("Normal") M = new /datum/map_template(map, "[map]", TRUE) if("Shuttle") @@ -60,23 +54,23 @@ else return if(!M.cached_map) - to_chat(src, span_warning("Map template '[map]' failed to parse properly."), confidential = TRUE) + to_chat(user, span_warning("Map template '[map]' failed to parse properly."), confidential = TRUE) return var/datum/map_report/report = M.cached_map.check_for_errors() var/report_link if(report) - report.show_to(src) + report.show_to(user) report_link = " - validation report" - to_chat(src, span_warning("Map template '[map]' failed validation."), confidential = TRUE) + to_chat(user, span_warning("Map template '[map]' failed validation."), confidential = TRUE) if(report.loadable) - var/response = tgui_alert(usr, "The map failed validation, would you like to load it anyways?", "Map Errors", list("Cancel", "Upload Anyways")) + var/response = tgui_alert(user, "The map failed validation, would you like to load it anyways?", "Map Errors", list("Cancel", "Upload Anyways")) if(response != "Upload Anyways") return else - tgui_alert(usr, "The map failed validation and cannot be loaded.", "Map Errors", list("Oh Darn")) + tgui_alert(user, "The map failed validation and cannot be loaded.", "Map Errors", list("Oh Darn")) return SSmapping.map_templates[M.name] = M - message_admins(span_adminnotice("[key_name_admin(src)] has uploaded a map template '[map]' ([M.width]x[M.height])[report_link].")) - to_chat(src, span_notice("Map template '[map]' ready to place ([M.width]x[M.height])"), confidential = TRUE) + message_admins(span_adminnotice("[key_name_admin(user)] has uploaded a map template '[map]' ([M.width]x[M.height])[report_link].")) + to_chat(user, span_notice("Map template '[map]' ready to place ([M.width]x[M.height])"), confidential = TRUE) diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index b7b3ae49494..5bc4a8d3b83 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -1,69 +1,5 @@ -//- Are all the floors with or without air, as they should be? (regular or airless) -//- Does the area have an APC? -//- Does the area have an Air Alarm? -//- Does the area have a Request Console? -//- Does the area have lights? -//- Does the area have a light switch? -//- Does the area have enough intercoms? -//- Does the area have enough security cameras? (Use the 'Camera Range Display' verb under Debug) -//- Is the area connected to the scrubbers air loop? -//- Is the area connected to the vent air loop? (vent pumps) -//- Is everything wired properly? -//- Does the area have a fire alarm and firedoors? -//- Do all pod doors work properly? -//- Are accesses set properly on doors, pod buttons, etc. -//- Are all items placed properly? (not below vents, scrubbers, tables) -//- Does the disposal system work properly from all the disposal units in this room and all the units, the pipes of which pass through this room? -//- Check for any misplaced or stacked piece of pipe (air and disposal) -//- Check for any misplaced or stacked piece of wire -//- Identify how hard it is to break into the area and where the weak points are -//- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels. - -GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list( - /client/proc/camera_view, //-errorage - /client/proc/sec_camera_report, //-errorage - /client/proc/intercom_view, //-errorage - /client/proc/air_status, //Air things - /client/proc/Cell, //More air things - /client/proc/atmosscan, //check plumbing - /client/proc/powerdebug, //check power - /client/proc/count_objects_on_z_level, - /client/proc/count_objects_all, - /client/proc/cmd_assume_direct_control, //-errorage - /client/proc/cmd_give_direct_control, - /client/proc/set_server_fps, //allows you to set the ticklag. - /client/proc/cmd_admin_grantfullaccess, - /client/proc/cmd_admin_areatest_all, - /client/proc/cmd_admin_areatest_station, - /client/proc/cmd_admin_areatest_station_no_maintenance, - #ifdef TESTING - /client/proc/see_dirty_varedits, - #endif - /client/proc/cmd_admin_rejuvenate, - /datum/admins/proc/show_traitor_panel, - /client/proc/disable_communication, - /client/proc/show_map_reports, - /client/proc/cmd_show_at_list, - /client/proc/cmd_show_at_markers, - /client/proc/manipulate_organs, - /client/proc/start_line_profiling, - /client/proc/stop_line_profiling, - /client/proc/show_line_profiling, - /client/proc/create_mapping_job_icons, - /client/proc/debug_z_levels, - /client/proc/place_ruin, - /client/proc/station_food_debug, - /client/proc/station_stack_debug, - /client/proc/check_for_obstructed_atmospherics, - /client/proc/modify_lights, - /client/proc/visualize_lights, -)) -GLOBAL_PROTECT(admin_verbs_debug_mapping) - -/client/proc/camera_view() - set category = "Mapping" - set name = "Camera Range Display" - +ADMIN_VERB_VISIBILITY(camera_view, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(camera_view, R_DEBUG, "Camera Range Display", "Shows the range of cameras on the station.", ADMIN_CATEGORY_MAPPING) var/on = FALSE for(var/turf/T in world) if(T.maptext) @@ -82,28 +18,20 @@ GLOBAL_PROTECT(admin_verbs_debug_mapping) #ifdef TESTING GLOBAL_LIST_EMPTY(dirty_vars) -/client/proc/see_dirty_varedits() - set category = "Mapping" - set name = "Dirty Varedits" - +ADMIN_VERB_VISIBILITY(see_dirty_varedits, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(see_dirty_varedits, R_DEBUG, "Dirty Varedits", "Shows all dirty varedits.", ADMIN_CATEGORY_MAPPING) var/list/dat = list() dat += "

    Abandon all hope ye who enter here



    " for(var/thing in GLOB.dirty_vars) dat += "[thing]
    " CHECK_TICK - var/datum/browser/popup = new(usr, "dirty_vars", "Dirty Varedits", 900, 750) + var/datum/browser/popup = new(user, "dirty_vars", "Dirty Varedits", 900, 750) popup.set_content(dat.Join()) popup.open() #endif -/client/proc/sec_camera_report() - set category = "Mapping" - set name = "Camera Report" - - if(!Master) - tgui_alert(usr,"Master_controller not found.","Sec Camera Report") - return FALSE - +ADMIN_VERB_VISIBILITY(sec_camera_report, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(sec_camera_report, R_DEBUG, "Camera Report", "Get a printout of all camera issues.", ADMIN_CATEGORY_MAPPING) var/list/obj/machinery/camera/CL = list() for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras) @@ -133,15 +61,13 @@ GLOBAL_LIST_EMPTY(dirty_vars) output += "
  • Camera not connected to wall at [ADMIN_VERBOSEJMP(C1)] Network: [json_encode(C1.network)]
  • " output += "" - usr << browse(output,"window=airreport;size=1000x500") + user << browse(output,"window=airreport;size=1000x500") BLACKBOX_LOG_ADMIN_VERB("Show Camera Report") -/client/proc/intercom_view() - set category = "Mapping" - set name = "Intercom Range Display" - +ADMIN_VERB_VISIBILITY(intercom_view, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(intercom_view, R_DEBUG, "Intercom Range Display", "Shows the range of intercoms on the station.", ADMIN_CATEGORY_MAPPING) var/static/intercom_range_display_status = FALSE - intercom_range_display_status = !intercom_range_display_status //blame cyberboss if this breaks something //blamed + intercom_range_display_status = !intercom_range_display_status for(var/obj/effect/abstract/marker/intercom/marker in GLOB.all_abstract_markers) qdel(marker) @@ -153,23 +79,17 @@ GLOBAL_LIST_EMPTY(dirty_vars) new /obj/effect/abstract/marker/intercom(turf) BLACKBOX_LOG_ADMIN_VERB("Show Intercom Range") -/client/proc/show_map_reports() - set category = "Mapping" - set name = "Show map report list" - set desc = "Displays a list of map reports" - +ADMIN_VERB_VISIBILITY(show_map_reports, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(show_map_reports, R_DEBUG, "Show Map Reports", "Displays a list of map reports.", ADMIN_CATEGORY_MAPPING) var/dat = {"List of all map reports:
    "} for(var/datum/map_report/report as anything in GLOB.map_reports) dat += "[report.tag] ([report.original_path]) - View
    " - usr << browse(dat, "window=map_reports") - -/client/proc/cmd_show_at_list() - set category = "Mapping" - set name = "Show roundstart AT list" - set desc = "Displays a list of active turfs coordinates at roundstart" + user << browse(dat, "window=map_reports") +ADMIN_VERB_VISIBILITY(cmd_show_at_list, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(cmd_show_at_list, R_DEBUG, "Show roundstart AT list", "Displays a list of active turfs coordinates at roundstart.", ADMIN_CATEGORY_MAPPING) var/dat = {"Coordinate list of Active Turfs at Roundstart
    Real-time Active Turfs list you can see in Air Subsystem at active_turfs var
    "} @@ -178,50 +98,39 @@ GLOBAL_LIST_EMPTY(dirty_vars) dat += "[ADMIN_VERBOSEJMP(T)]\n" dat += "
    " - usr << browse(dat, "window=at_list") + user << browse(dat, "window=at_list") BLACKBOX_LOG_ADMIN_VERB("Show Roundstart Active Turfs") -/client/proc/cmd_show_at_markers() - set category = "Mapping" - set name = "Show roundstart AT markers" - set desc = "Places a marker on all active-at-roundstart turfs" - +ADMIN_VERB_VISIBILITY(cmd_show_at_markers, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(cmd_show_at_markers, R_DEBUG, "Show roundstart AT markers", "Places a marker on all active-at-roundstart turfs.", ADMIN_CATEGORY_MAPPING) var/count = 0 for(var/obj/effect/abstract/marker/at/AT in GLOB.all_abstract_markers) qdel(AT) count++ if(count) - to_chat(usr, "[count] AT markers removed.", confidential = TRUE) + to_chat(user, "[count] AT markers removed.", confidential = TRUE) else for(var/t in GLOB.active_turfs_startlist) new /obj/effect/abstract/marker/at(t) count++ - to_chat(usr, "[count] AT markers placed.", confidential = TRUE) + to_chat(user, "[count] AT markers placed.", confidential = TRUE) BLACKBOX_LOG_ADMIN_VERB("Show Roundstart Active Turf Markers") -/client/proc/enable_mapping_verbs() - set category = "Debug" - set name = "Mapping verbs - Enable" - if(!check_rights(R_DEBUG)) - return - remove_verb(src, /client/proc/enable_mapping_verbs) - add_verb(src, list(/client/proc/disable_mapping_verbs, GLOB.admin_verbs_debug_mapping)) +ADMIN_VERB(enable_mapping_verbs, R_DEBUG, "Enable Mapping Verbs", "Enable all mapping verbs.", ADMIN_CATEGORY_MAPPING) + SSadmin_verbs.update_visibility_flag(user, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG, TRUE) BLACKBOX_LOG_ADMIN_VERB("Enable Debug Verbs") -/client/proc/disable_mapping_verbs() - set category = "Debug" - set name = "Mapping verbs - Disable" - remove_verb(src, list(/client/proc/disable_mapping_verbs, GLOB.admin_verbs_debug_mapping)) - add_verb(src, /client/proc/enable_mapping_verbs) +ADMIN_VERB_VISIBILITY(disable_mapping_verbs, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(disable_mapping_verbs, R_DEBUG, "Disable Mapping Verbs", "Disable all mapping verbs.", ADMIN_CATEGORY_MAPPING) + SSadmin_verbs.update_visibility_flag(user, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG, FALSE) BLACKBOX_LOG_ADMIN_VERB("Disable Debug Verbs") -/client/proc/count_objects_on_z_level() - set category = "Mapping" - set name = "Count Objects On Level" - var/level = input("Which z-level?","Level?") as text|null +ADMIN_VERB_VISIBILITY(count_objects_on_z_level, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(count_objects_on_z_level, R_DEBUG, "Count Objects On Z-Level", "Counts the number of objects of a certain type on a specific z-level.", ADMIN_CATEGORY_MAPPING) + var/level = input(user, "Which z-level?","Level?") as text|null if(!level) return var/num_level = text2num(level) @@ -230,7 +139,7 @@ GLOBAL_LIST_EMPTY(dirty_vars) if(!isnum(num_level)) return - var/type_text = input("Which type path?","Path?") as text|null + var/type_text = input(user, "Which type path?","Path?") as text|null if(!type_text) return var/type_path = text2path(type_text) @@ -257,11 +166,9 @@ GLOBAL_LIST_EMPTY(dirty_vars) to_chat(world, "There are [count] objects of type [type_path] on z-level [num_level]", confidential = TRUE) BLACKBOX_LOG_ADMIN_VERB("Count Objects Zlevel") -/client/proc/count_objects_all() - set category = "Mapping" - set name = "Count Objects All" - - var/type_text = input("Which type path?","") as text|null +ADMIN_VERB_VISIBILITY(count_objects_all, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(count_objects_all, R_DEBUG, "Count Objects All", "Counts the number of objects of a certain type in the game world.", ADMIN_CATEGORY_MAPPING) + var/type_text = input(user, "Which type path?","") as text|null if(!type_text) return var/type_path = text2path(type_text) @@ -277,84 +184,51 @@ GLOBAL_LIST_EMPTY(dirty_vars) to_chat(world, "There are [count] objects of type [type_path] in the game world", confidential = TRUE) BLACKBOX_LOG_ADMIN_VERB("Count Objects All") - -//This proc is intended to detect lag problems relating to communication procs GLOBAL_VAR_INIT(say_disabled, FALSE) -/client/proc/disable_communication() - set category = "Mapping" - set name = "Disable all communication verbs" - +ADMIN_VERB_VISIBILITY(disable_communication, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(disable_communication, R_DEBUG, "Disable all communication verbs", "Disables all communication verbs.", ADMIN_CATEGORY_MAPPING) GLOB.say_disabled = !GLOB.say_disabled if(GLOB.say_disabled) - message_admins("[key] used 'Disable all communication verbs', killing all communication methods.") + message_admins("[key_name_admin(user)] used 'Disable all communication verbs', killing all communication methods.") else - message_admins("[key] used 'Disable all communication verbs', restoring all communication methods.") -/* NOVA EDIT: lol, lmao, fuck icon bugs from byond -//This generates the icon states for job starting location landmarks. -/client/proc/create_mapping_job_icons() - set name = "Generate job landmarks icons" - set category = "Mapping" + message_admins("[key_name_admin(user)] used 'Disable all communication verbs', restoring all communication methods.") + +ADMIN_VERB_VISIBILITY(create_mapping_job_icons, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(create_mapping_job_icons, R_DEBUG, "Generate job landmarks icons", "Generates job starting location landmarks.", ADMIN_CATEGORY_MAPPING) var/icon/final = icon() + var/list/job_key_to_icon = list() // NOVA EDIT ADDITION var/mob/living/carbon/human/dummy/D = new(locate(1,1,1)) //spawn on 1,1,1 so we don't have runtimes when items are deleted D.setDir(SOUTH) for(var/job in subtypesof(/datum/job)) var/datum/job/JB = new job switch(JB.title) if(JOB_AI) - final.Insert(icon('icons/mob/silicon/ai.dmi', "ai", SOUTH, 1), "AI") + job_key_to_icon["AI"] = icon('icons/mob/silicon/ai.dmi', "ai", SOUTH, 1) // NOVA EDIT CHANGE - ORIGINAL: final.Insert(icon('icons/mob/silicon/ai.dmi', "ai", SOUTH, 1), "AI") if(JOB_CYBORG) - final.Insert(icon('icons/mob/silicon/robots.dmi', "robot", SOUTH, 1), "Cyborg") + job_key_to_icon["Cyborg"] = icon('icons/mob/silicon/robots.dmi', "robot", SOUTH, 1) // NOVA EDIT CHANGE - ORIGINAL: final.Insert(icon('icons/mob/silicon/robots.dmi', "robot", SOUTH, 1), "Cyborg") else for(var/obj/item/I in D) qdel(I) randomize_human(D) - D.dress_up_as_job(JB, TRUE) - var/icon/I = icon(getFlatIcon(D), frame = 1) - final.Insert(I, JB.title) - qdel(D) - //Also add the x - for(var/x_number in 1 to 4) - final.Insert(icon('icons/hud/screen_gen.dmi', "x[x_number == 1 ? "" : x_number]"), "x[x_number == 1 ? "" : x_number]") - fcopy(final, "icons/mob/landmarks.dmi") -*/ -// NOVA EDIT BEGIN: THIS SHIT WAS BROKEN due to an issue with byond and how icons cache -//This generates the icon states for job starting location landmarks. -/client/proc/create_mapping_job_icons() - set name = "Generate job landmarks icons" - set category = "Mapping" - var/list/job_key_to_icon = list() - for(var/job in subtypesof(/datum/job)) - var/mob/living/carbon/human/dummy/D = new(locate(1,1,1)) //spawn on 1,1,1 so we don't have runtimes when items are deleted - D.setDir(SOUTH) - var/datum/job/JB = new job - to_chat(world, "Generating icon for job [JB.title]") - switch(JB.title) - if("AI") - job_key_to_icon["AI"] = icon('icons/mob/silicon/ai.dmi', "ai", SOUTH, 1) - if("Cyborg") - job_key_to_icon["Cyborg"] = icon('icons/mob/silicon/robots.dmi', "robot", SOUTH, 1) - else - randomize_human(D) + // NOVA EDIT CHANGE START - ORIGINAL: D.dress_up_as_job(JB, TRUE) if(JB.outfit) D.equipOutfit(JB.outfit, TRUE) + // NOVA EDIT CHANGE END var/icon/I = icon(getFlatIcon(D), frame = 1) - job_key_to_icon[JB.title] = I - qdel(D) - to_chat(world, "Done generating icons.") - var/icon/final = icon() + job_key_to_icon[JB.title] = I // NOVA EDIT CHANGE - ORIGINAL: final.Insert(I, JB.title) + qdel(D) + // NOVA EDIT ADDITION START for(var/job_key in job_key_to_icon) final.Insert(job_key_to_icon[job_key], job_key) + // NOVA EDIT ADDITION END //Also add the x for(var/x_number in 1 to 4) final.Insert(icon('icons/hud/screen_gen.dmi', "x[x_number == 1 ? "" : x_number]"), "x[x_number == 1 ? "" : x_number]") fcopy(final, "icons/mob/landmarks.dmi") - to_chat(world, "Done generating landmarks.dmi.") -// NOVA EDIT END -/client/proc/debug_z_levels() - set name = "Debug Z-Levels" - set category = "Mapping" - to_chat(src, examine_block(gather_z_level_information(append_grid = TRUE)), confidential = TRUE) +ADMIN_VERB_VISIBILITY(debug_z_levels, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(debug_z_levels, R_DEBUG, "Debug Z-Levels", "Displays a list of all z-levels and their linkages.", ADMIN_CATEGORY_MAPPING) + to_chat(user, examine_block(gather_z_level_information(append_grid = TRUE)), confidential = TRUE) /// Returns all necessary z-level information. Argument `append_grid` allows the user to see a table showing all of the z-level linkages, which is only visible and useful in-game. /proc/gather_z_level_information(append_grid = FALSE) @@ -416,9 +290,8 @@ GLOBAL_VAR_INIT(say_disabled, FALSE) return messages.Join("\n") -/client/proc/station_food_debug() - set name = "Count Station Food" - set category = "Mapping" +ADMIN_VERB_VISIBILITY(station_food_debug, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(station_food_debug, R_DEBUG, "Count Station Food", "Counts the number of food items on the station.", ADMIN_CATEGORY_MAPPING) var/list/foodcount = list() for(var/obj/item/food/fuck_me in world) var/turf/location = get_turf(fuck_me) @@ -435,13 +308,12 @@ GLOBAL_VAR_INIT(say_disabled, FALSE) var/page_style = "" var/page_contents = "[page_style][table_header][jointext(table_contents, "")]
    " - var/datum/browser/popup = new(mob, "fooddebug", "Station Food Count", 600, 400) + var/datum/browser/popup = new(user.mob, "fooddebug", "Station Food Count", 600, 400) popup.set_content(page_contents) popup.open() -/client/proc/station_stack_debug() - set name = "Count Station Stacks" - set category = "Mapping" +ADMIN_VERB_VISIBILITY(station_stack_debug, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(station_stack_debug, R_DEBUG, "Count Station Stacks", "Count the stacks of materials on station.", ADMIN_CATEGORY_MAPPING) var/list/stackcount = list() for(var/obj/item/stack/fuck_me in world) var/turf/location = get_turf(fuck_me) @@ -458,18 +330,13 @@ GLOBAL_VAR_INIT(say_disabled, FALSE) var/page_style = "" var/page_contents = "[page_style][table_header][jointext(table_contents, "")]
    " - var/datum/browser/popup = new(mob, "stackdebug", "Station Stack Count", 600, 400) + var/datum/browser/popup = new(user.mob, "stackdebug", "Station Stack Count", 600, 400) popup.set_content(page_contents) popup.open() -/// Check all tiles with a vent or scrubber on it and ensure that nothing is covering it up. -/client/proc/check_for_obstructed_atmospherics() - set name = "Check For Obstructed Atmospherics" - set category = "Mapping" - if(!holder) - to_chat(src, "Only administrators may use this command.", confidential = TRUE) - return - message_admins(span_adminnotice("[key_name_admin(usr)] is checking for obstructed atmospherics through the debug command.")) +ADMIN_VERB_VISIBILITY(check_for_obstructed_atmospherics, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(check_for_obstructed_atmospherics, R_DEBUG, "Check For Obstructed Atmospherics", "Checks for obstructions on atmospherics machines.", ADMIN_CATEGORY_MAPPING) + message_admins(span_adminnotice("[key_name_admin(user)] is checking for obstructed atmospherics through the debug command.")) BLACKBOX_LOG_ADMIN_VERB("Check For Obstructed Atmospherics") var/list/results = list() @@ -518,17 +385,14 @@ GLOBAL_VAR_INIT(say_disabled, FALSE) results += "There is an obstruction on top of an atmospherics machine at: [ADMIN_VERBOSEJMP(iterated_turf)].
    " if(results.len == 1) // only the header is in the list, we're good - to_chat(src, "No obstructions detected.", confidential = TRUE) + to_chat(user, "No obstructions detected.", confidential = TRUE) else - var/datum/browser/popup = new(usr, "atmospherics_obstructions", "Atmospherics Obstructions", 900, 750) + var/datum/browser/popup = new(user.mob, "atmospherics_obstructions", "Atmospherics Obstructions", 900, 750) popup.set_content(results.Join()) popup.open() -/client/proc/modify_lights() - set name = "Toggle Light Debug" - set category = "Mapping" - if(!check_rights(R_DEBUG)) - return +ADMIN_VERB_VISIBILITY(modify_lights, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(modify_lights, R_DEBUG, "Toggle Light Debug", "Toggles light debug mode.", ADMIN_CATEGORY_MAPPING) if(GLOB.light_debug_enabled) undebug_sources() return @@ -540,10 +404,6 @@ GLOBAL_VAR_INIT(say_disabled, FALSE) CHECK_TICK debug_sources() -/client/proc/visualize_lights() - set name = "Visualize Lighting Corners" - set category = "Mapping" - if(!check_rights(R_DEBUG)) - return - +ADMIN_VERB_VISIBILITY(visualize_lights, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(visualize_lights, R_DEBUG, "Visualize Lighting Corners", "Visualizes the corners of all lights on the station.", ADMIN_CATEGORY_MAPPING) display_corners() diff --git a/code/modules/admin/verbs/maprotation.dm b/code/modules/admin/verbs/maprotation.dm index c41677db37c..09d6d93bee6 100644 --- a/code/modules/admin/verbs/maprotation.dm +++ b/code/modules/admin/verbs/maprotation.dm @@ -1,16 +1,13 @@ -/client/proc/forcerandomrotate() - set category = "Server" - set name = "Trigger Random Map Rotation" - var/rotate = tgui_alert(usr,"Force a random map rotation to trigger?", "Rotate map?", list("Yes", "Cancel")) + +ADMIN_VERB(force_random_rotate, R_SERVER, "Trigger 'Random' Map Rotation", "Force a map vote.", ADMIN_CATEGORY_SERVER) + var/rotate = tgui_alert(user,"Force a random map rotation to trigger?", "Rotate map?", list("Yes", "Cancel")) if (rotate != "Yes") return - message_admins("[key_name_admin(usr)] is forcing a random map rotation.") - log_admin("[key_name(usr)] is forcing a random map rotation.") + message_admins("[key_name_admin(user)] is forcing a random map rotation.") + log_admin("[key_name(user)] is forcing a random map rotation.") SSmapping.maprotate() -/client/proc/adminchangemap() - set category = "Server" - set name = "Change Map" +ADMIN_VERB(admin_change_map, R_SERVER, "Change Map", "Set the next map.", ADMIN_CATEGORY_SERVER) var/list/maprotatechoices = list() for (var/map in config.maplist) var/datum/map_config/virtual_map = config.maplist[map] @@ -32,21 +29,21 @@ mapname += "\]" maprotatechoices[mapname] = virtual_map - var/chosenmap = tgui_input_list(usr, "Choose a map to change to", "Change Map", sort_list(maprotatechoices)|"Custom") + var/chosenmap = tgui_input_list(user, "Choose a map to change to", "Change Map", sort_list(maprotatechoices)|"Custom") if (isnull(chosenmap)) return if(chosenmap == "Custom") - message_admins("[key_name_admin(usr)] is changing the map to a custom map") - log_admin("[key_name(usr)] is changing the map to a custom map") + message_admins("[key_name_admin(user)] is changing the map to a custom map") + log_admin("[key_name(user)] is changing the map to a custom map") var/datum/map_config/virtual_map = new - var/map_file = input("Pick file:", "Map File") as null|file + var/map_file = input(user, "Pick file:", "Map File") as null|file if(isnull(map_file)) return if(copytext("[map_file]", -4) != ".dmm")//4 == length(".dmm") - to_chat(src, span_warning("Filename must end in '.dmm': [map_file]")) + to_chat(user, span_warning("Filename must end in '.dmm': [map_file]")) return if(fexists("_maps/custom/[map_file]")) @@ -56,20 +53,20 @@ // This is to make sure the map works so the server does not start without a map. var/datum/parsed_map/M = new (map_file) if(!M) - to_chat(src, span_warning("Map '[map_file]' failed to parse properly.")) + to_chat(user, span_warning("Map '[map_file]' failed to parse properly.")) return if(!M.bounds) - to_chat(src, span_warning("Map '[map_file]' has non-existant bounds.")) + to_chat(user, span_warning("Map '[map_file]' has non-existant bounds.")) qdel(M) return qdel(M) var/config_file = null var/list/json_value = list() - var/config = tgui_alert(usr,"Would you like to upload an additional config for this map?", "Map Config", list("Yes", "No")) + var/config = tgui_alert(user,"Would you like to upload an additional config for this map?", "Map Config", list("Yes", "No")) if(config == "Yes") - config_file = input("Pick file:", "Config JSON File") as null|file + config_file = input(user, "Pick file:", "Config JSON File") as null|file if(isnull(config_file)) return if(copytext("[config_file]", -5) != ".json") @@ -94,18 +91,18 @@ ) else virtual_map = load_map_config() - virtual_map.map_name = input("Choose the name for the map", "Map Name") as null|text + virtual_map.map_name = input(user, "Choose the name for the map", "Map Name") as null|text if(isnull(virtual_map.map_name)) virtual_map.map_name = "Custom" - var/shuttles = tgui_alert(usr,"Do you want to modify the shuttles?", "Map Shuttles", list("Yes", "No")) + var/shuttles = tgui_alert(user,"Do you want to modify the shuttles?", "Map Shuttles", list("Yes", "No")) if(shuttles == "Yes") for(var/s in virtual_map.shuttles) - var/shuttle = input(s, "Map Shuttles") as null|text + var/shuttle = input(user, s, "Map Shuttles") as null|text if(!shuttle) continue if(!SSmapping.shuttle_templates[shuttle]) - to_chat(usr, span_warning("No such shuttle as '[shuttle]' exists, using default.")) + to_chat(user, span_warning("No such shuttle as '[shuttle]' exists, using default.")) continue virtual_map.shuttles[s] = shuttle @@ -123,13 +120,13 @@ text2file(json_encode(json_value), PATH_TO_NEXT_MAP_JSON) if(SSmapping.changemap(virtual_map)) - message_admins("[key_name_admin(usr)] has changed the map to [virtual_map.map_name]") + message_admins("[key_name_admin(user)] has changed the map to [virtual_map.map_name]") SSmapping.map_force_chosen = TRUE fdel("data/custom_map_json/[config_file]") else var/datum/map_config/virtual_map = maprotatechoices[chosenmap] - message_admins("[key_name_admin(usr)] is changing the map to [virtual_map.map_name]") - log_admin("[key_name(usr)] is changing the map to [virtual_map.map_name]") + message_admins("[key_name_admin(user)] is changing the map to [virtual_map.map_name]") + log_admin("[key_name(user)] is changing the map to [virtual_map.map_name]") if (SSmapping.changemap(virtual_map)) - message_admins("[key_name_admin(usr)] has changed the map to [virtual_map.map_name]") + message_admins("[key_name_admin(user)] has changed the map to [virtual_map.map_name]") SSmapping.map_force_chosen = TRUE diff --git a/code/modules/admin/verbs/panicbunker.dm b/code/modules/admin/verbs/panicbunker.dm index c8c47858669..57aba1ee8d9 100644 --- a/code/modules/admin/verbs/panicbunker.dm +++ b/code/modules/admin/verbs/panicbunker.dm @@ -1,8 +1,6 @@ -/client/proc/panicbunker() - set category = "Server" - set name = "Toggle Panic Bunker" +ADMIN_VERB(panic_bunker, R_SERVER, "Toggle Panic Bunker", "Toggles the panic bunker for the server.", ADMIN_CATEGORY_SERVER) if (!CONFIG_GET(flag/sql_enabled)) - to_chat(usr, span_adminnotice("The Database is not enabled!"), confidential = TRUE) + to_chat(user, span_adminnotice("The Database is not enabled!"), confidential = TRUE) return var/new_pb = !CONFIG_GET(flag/panic_bunker) @@ -10,28 +8,26 @@ var/time_rec = 0 var/message = "" if(new_pb) - time_rec = input(src, "How many living minutes should they need to play? 0 to disable.", "Shit's fucked isn't it", CONFIG_GET(number/panic_bunker_living)) as num - message = input(src, "What should they see when they log in?", "MMM", CONFIG_GET(string/panic_bunker_message)) as text + time_rec = input(user, "How many living minutes should they need to play? 0 to disable.", "Shit's fucked isn't it", CONFIG_GET(number/panic_bunker_living)) as num + message = input(user, "What should they see when they log in?", "MMM", CONFIG_GET(string/panic_bunker_message)) as text message = replacetext(message, "%minutes%", time_rec) CONFIG_SET(number/panic_bunker_living, time_rec) CONFIG_SET(string/panic_bunker_message, message) - var/interview_sys = tgui_alert(usr, "Should the interview system be enabled? (Allows players to connect under the hour limit and force them to be manually approved to play)", "Enable interviews?", list("Enable", "Disable")) + var/interview_sys = tgui_alert(user, "Should the interview system be enabled? (Allows players to connect under the hour limit and force them to be manually approved to play)", "Enable interviews?", list("Enable", "Disable")) interview = interview_sys == "Enable" CONFIG_SET(flag/panic_bunker_interview, interview) CONFIG_SET(flag/panic_bunker, new_pb) - log_admin("[key_name(usr)] has toggled the Panic Bunker, it is now [new_pb ? "on and set to [time_rec] with a message of [message]. The interview system is [interview ? "enabled" : "disabled"]" : "off"].") - message_admins("[key_name_admin(usr)] has toggled the Panic Bunker, it is now [new_pb ? "enabled with a living minutes requirement of [time_rec]. The interview system is [interview ? "enabled" : "disabled"]" : "disabled"].") + log_admin("[key_name(user)] has toggled the Panic Bunker, it is now [new_pb ? "on and set to [time_rec] with a message of [message]. The interview system is [interview ? "enabled" : "disabled"]" : "off"].") + message_admins("[key_name_admin(user)] has toggled the Panic Bunker, it is now [new_pb ? "enabled with a living minutes requirement of [time_rec]. The interview system is [interview ? "enabled" : "disabled"]" : "disabled"].") if (new_pb && !SSdbcore.Connect()) message_admins("The Database is not connected! Panic bunker will not work until the connection is reestablished.") SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Panic Bunker", "[new_pb ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! -/client/proc/toggle_interviews() - set category = "Server" - set name = "Toggle PB Interviews" +ADMIN_VERB(toggle_interviews, R_SERVER, "Toggle PB Interviews", "Toggle whether new players will be interviewed or blocked from connecting.", ADMIN_CATEGORY_SERVER) if (!CONFIG_GET(flag/panic_bunker)) - to_chat(usr, span_adminnotice("NOTE: The panic bunker is not enabled, so this change will not effect anything until it is enabled."), confidential = TRUE) + to_chat(user, span_adminnotice("NOTE: The panic bunker is not enabled, so this change will not effect anything until it is enabled."), confidential = TRUE) var/new_interview = !CONFIG_GET(flag/panic_bunker_interview) CONFIG_SET(flag/panic_bunker_interview, new_interview) - log_admin("[key_name(usr)] has toggled the Panic Bunker's interview system, it is now [new_interview ? "enabled" : "disabled"].") - message_admins("[key_name(usr)] has toggled the Panic Bunker's interview system, it is now [new_interview ? "enabled" : "disabled"].") + log_admin("[key_name(user)] has toggled the Panic Bunker's interview system, it is now [new_interview ? "enabled" : "disabled"].") + message_admins("[key_name(user)] has toggled the Panic Bunker's interview system, it is now [new_interview ? "enabled" : "disabled"].") diff --git a/code/modules/admin/verbs/player_ticket_history.dm b/code/modules/admin/verbs/player_ticket_history.dm index 08373db3470..829d4dfc2b5 100644 --- a/code/modules/admin/verbs/player_ticket_history.dm +++ b/code/modules/admin/verbs/player_ticket_history.dm @@ -19,13 +19,8 @@ GENERAL_PROTECT_DATUM(/datum/ticket_log_entry) GLOBAL_DATUM_INIT(player_ticket_history, /datum/ticket_history_holder, new) GLOBAL_PROTECT(player_ticket_history) -/client/proc/player_ticket_history() - set name = "Player Ticket History" - set desc = "Allows you to view the ticket history of a player." - set category = "Admin" - if(!check_rights(R_ADMIN)) - return - GLOB.player_ticket_history.ui_interact(mob) +ADMIN_VERB(player_ticket_history, R_ADMIN, "Player Ticket History", "Allows you to view the ticket history of a player.", ADMIN_CATEGORY_MAIN) + GLOB.player_ticket_history.ui_interact(user.mob) /datum/ticket_history_holder /// Assosciative list of ticket histories. ckey -> list/datum/ticket_history diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 1b63c83529b..c4e4257e84f 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -3,20 +3,15 @@ #define SHELLEO_STDOUT 2 #define SHELLEO_STDERR 3 -/client/proc/play_sound(S as sound) - set category = "Admin.Fun" - set name = "Play Global Sound" - if(!check_rights(R_SOUND)) - return - +ADMIN_VERB(play_sound, R_SOUND, "Play Global Sound", "Play a sound to all connected players.", ADMIN_CATEGORY_FUN, sound as sound) var/freq = 1 - var/vol = input(usr, "What volume would you like the sound to play at?",, 100) as null|num + var/vol = tgui_input_number(user, "What volume would you like the sound to play at?", max_value = 100) if(!vol) return vol = clamp(vol, 1, 100) - var/sound/admin_sound = new() - admin_sound.file = S + var/sound/admin_sound = new + admin_sound.file = sound admin_sound.priority = 250 admin_sound.channel = CHANNEL_ADMIN admin_sound.frequency = freq @@ -25,15 +20,15 @@ admin_sound.status = SOUND_STREAM admin_sound.volume = vol - var/res = tgui_alert(usr, "Show the title of this song to the players?",, list("Yes","No", "Cancel")) + var/res = tgui_alert(user, "Show the title of this song to the players?",, list("Yes","No", "Cancel")) switch(res) if("Yes") - to_chat(world, span_boldannounce("An admin played: [S]"), confidential = TRUE) + to_chat(world, span_boldannounce("An admin played: [sound]"), confidential = TRUE) if("Cancel") return - log_admin("[key_name(src)] played sound [S]") - message_admins("[key_name_admin(src)] played sound [S]") + log_admin("[key_name(user)] played sound [sound]") + message_admins("[key_name_admin(user)] played sound [sound]") for(var/mob/M in GLOB.player_list) if(M.client.prefs.read_preference(/datum/preference/toggle/sound_midi)) @@ -43,31 +38,20 @@ BLACKBOX_LOG_ADMIN_VERB("Play Global Sound") - -/client/proc/play_local_sound(S as sound) - set category = "Admin.Fun" - set name = "Play Local Sound" - if(!check_rights(R_SOUND)) - return - - log_admin("[key_name(src)] played a local sound [S]") - message_admins("[key_name_admin(src)] played a local sound [S]") - playsound(get_turf(src.mob), S, 50, FALSE, FALSE) +ADMIN_VERB(play_local_sound, R_SOUND, "Play Local Sound", "Plays a sound only you can hear.", ADMIN_CATEGORY_FUN, sound as sound) + log_admin("[key_name(user)] played a local sound [sound]") + message_admins("[key_name_admin(user)] played a local sound [sound]") + playsound(get_turf(user.mob), sound, 50, FALSE, FALSE) BLACKBOX_LOG_ADMIN_VERB("Play Local Sound") -/client/proc/play_direct_mob_sound(S as sound, mob/M) - set category = "Admin.Fun" - set name = "Play Direct Mob Sound" - if(!check_rights(R_SOUND)) - return - - if(!M) - M = input(usr, "Choose a mob to play the sound to. Only they will hear it.", "Play Mob Sound") as null|anything in sort_names(GLOB.player_list) - if(!M || QDELETED(M)) +ADMIN_VERB(play_direct_mob_sound, R_SOUND, "Play Direct Mob Sound", "Play a sound directly to a mob.", ADMIN_CATEGORY_FUN, sound as sound, mob/target in world) + if(!target) + target = input(user, "Choose a mob to play the sound to. Only they will hear it.", "Play Mob Sound") as null|anything in sort_names(GLOB.player_list) + if(QDELETED(target)) return - log_admin("[key_name(src)] played a direct mob sound [S] to [M].") - message_admins("[key_name_admin(src)] played a direct mob sound [S] to [ADMIN_LOOKUPFLW(M)].") - SEND_SOUND(M, S) + log_admin("[key_name(user)] played a direct mob sound [sound] to [key_name_admin(target)].") + message_admins("[key_name_admin(user)] played a direct mob sound [sound] to [ADMIN_LOOKUPFLW(target)].") + SEND_SOUND(target, sound) BLACKBOX_LOG_ADMIN_VERB("Play Direct Mob Sound") ///Takes an input from either proc/play_web_sound or the request manager and runs it through youtube-dl and prompts the user before playing it to the server. @@ -169,59 +153,41 @@ BLACKBOX_LOG_ADMIN_VERB("Play Internet Sound") +ADMIN_VERB_CUSTOM_EXIST_CHECK(play_web_sound) + return !!CONFIG_GET(string/invoke_youtubedl) -/client/proc/play_web_sound() - set category = "Admin.Fun" - set name = "Play Internet Sound" - if(!check_rights(R_SOUND)) - return - - var/ytdl = CONFIG_GET(string/invoke_youtubedl) - if(!ytdl) - to_chat(src, span_boldwarning("Youtube-dl was not configured, action unavailable"), confidential = TRUE) //Check config.txt for the INVOKE_YOUTUBEDL value - return - +ADMIN_VERB(play_web_sound, R_SOUND, "Play Internet Sound", "Play a given internet sound to all players.", ADMIN_CATEGORY_FUN) if(S_TIMER_COOLDOWN_TIMELEFT(SStimer, COOLDOWN_INTERNET_SOUND)) - if(tgui_alert(usr, "Someone else is already playing an Internet sound! It has [DisplayTimeText(S_TIMER_COOLDOWN_TIMELEFT(SStimer, COOLDOWN_INTERNET_SOUND), 1)] remaining. \ + if(tgui_alert(user, "Someone else is already playing an Internet sound! It has [DisplayTimeText(S_TIMER_COOLDOWN_TIMELEFT(SStimer, COOLDOWN_INTERNET_SOUND), 1)] remaining. \ Would you like to override?", "Musicalis Interruptus", list("No","Yes")) != "Yes") return - var/web_sound_input = tgui_input_text(usr, "Enter content URL (supported sites only, leave blank to stop playing)", "Play Internet Sound", null) + var/web_sound_input = tgui_input_text(user, "Enter content URL (supported sites only, leave blank to stop playing)", "Play Internet Sound", null) if(length(web_sound_input)) web_sound_input = trim(web_sound_input) if(findtext(web_sound_input, ":") && !findtext(web_sound_input, GLOB.is_http_protocol)) - to_chat(src, span_boldwarning("Non-http(s) URIs are not allowed."), confidential = TRUE) - to_chat(src, span_warning("For youtube-dl shortcuts like ytsearch: please use the appropriate full URL from the website."), confidential = TRUE) + to_chat(user, span_boldwarning("Non-http(s) URIs are not allowed."), confidential = TRUE) + to_chat(user, span_warning("For youtube-dl shortcuts like ytsearch: please use the appropriate full URL from the website."), confidential = TRUE) return - web_sound(usr, web_sound_input) + web_sound(user.mob, web_sound_input) else - web_sound(usr, null) + web_sound(user.mob, null) -/client/proc/set_round_end_sound(S as sound) - set category = "Admin.Fun" - set name = "Set Round End Sound" - if(!check_rights(R_SOUND)) - return - - SSticker.SetRoundEndSound(S) +ADMIN_VERB(set_round_end_sound, R_SOUND, "Set Round End Sound", "Set the sound that plays on round end.", ADMIN_CATEGORY_FUN, sound as sound) + SSticker.SetRoundEndSound(sound) - log_admin("[key_name(src)] set the round end sound to [S]") - message_admins("[key_name_admin(src)] set the round end sound to [S]") + log_admin("[key_name(user)] set the round end sound to [sound]") + message_admins("[key_name_admin(user)] set the round end sound to [sound]") BLACKBOX_LOG_ADMIN_VERB("Set Round End Sound") -/client/proc/stop_sounds() - set category = "Debug" - set name = "Stop All Playing Sounds" - if(!src.holder) - return - - log_admin("[key_name(src)] stopped all currently playing sounds.") - message_admins("[key_name_admin(src)] stopped all currently playing sounds.") - for(var/mob/M in GLOB.player_list) - SEND_SOUND(M, sound(null)) - var/client/C = M.client - C?.tgui_panel?.stop_music() +ADMIN_VERB(stop_sounds, R_NONE, "Stop All Playing Sounds", "Stops all playing sounds for EVERYONE.", ADMIN_CATEGORY_DEBUG) + log_admin("[key_name(user)] stopped all currently playing sounds.") + message_admins("[key_name_admin(user)] stopped all currently playing sounds.") + for(var/mob/player as anything in GLOB.player_list) + SEND_SOUND(player, sound(null)) + var/client/player_client = player.client + player_client?.tgui_panel?.stop_music() S_TIMER_COOLDOWN_RESET(SStimer, COOLDOWN_INTERNET_SOUND) BLACKBOX_LOG_ADMIN_VERB("Stop All Playing Sounds") diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm index 63304104ab5..a7e50840f5e 100644 --- a/code/modules/admin/verbs/possess.dm +++ b/code/modules/admin/verbs/possess.dm @@ -1,32 +1,20 @@ -/proc/possess(obj/target in world) - set name = "Possess Obj" - set category = "Object" - var/result = usr.AddComponent(/datum/component/object_possession, target) +ADMIN_VERB(possess, R_POSSESS, "Possess Obj", "Possess an object.", ADMIN_CATEGORY_OBJECT, obj/target in world) + var/result = user.mob.AddComponent(/datum/component/object_possession, target) if(isnull(result)) // trigger a safety movement just in case we yonk - usr.forceMove(get_turf(usr)) + user.mob.forceMove(get_turf(user.mob)) return var/turf/target_turf = get_turf(target) - var/message = "[key_name(usr)] has possessed [target] ([target.type]) at [AREACOORD(target_turf)]" + var/message = "[key_name(user)] has possessed [target] ([target.type]) at [AREACOORD(target_turf)]" message_admins(message) log_admin(message) BLACKBOX_LOG_ADMIN_VERB("Possess Object") -/proc/release() - set name = "Release Obj" - set category = "Object" - - qdel(usr.GetComponent(/datum/component/object_possession)) +ADMIN_VERB(release, R_POSSESS, "Release Object", "Stop possessing an object.", ADMIN_CATEGORY_OBJECT) + var/possess_component = user.mob.GetComponent(/datum/component/object_possession) + if(!isnull(possess_component)) + qdel(possess_component) BLACKBOX_LOG_ADMIN_VERB("Release Object") - -/proc/give_possession_verbs(mob/dude in GLOB.mob_list) - set desc = "Give this guy possess/release verbs" - set category = "Debug" - set name = "Give Possessing Verbs" - - add_verb(dude, GLOBAL_PROC_REF(possess)) - add_verb(dude, GLOBAL_PROC_REF(release)) - BLACKBOX_LOG_ADMIN_VERB("Give Possessing Verbs") diff --git a/code/modules/admin/verbs/reestablish_db_connection.dm b/code/modules/admin/verbs/reestablish_db_connection.dm index a299eb43b0f..5c3701c97b0 100644 --- a/code/modules/admin/verbs/reestablish_db_connection.dm +++ b/code/modules/admin/verbs/reestablish_db_connection.dm @@ -1,26 +1,24 @@ -/client/proc/reestablish_db_connection() - set category = "Server" - set name = "Reestablish DB Connection" +ADMIN_VERB(reestablish_db_connection, R_NONE, "Reestablish DB Connection", "Attempts to (re)establish the DB Connection", ADMIN_CATEGORY_SERVER) if (!CONFIG_GET(flag/sql_enabled)) - to_chat(usr, span_adminnotice("The Database is not enabled!"), confidential = TRUE) + to_chat(user, span_adminnotice("The Database is not enabled!"), confidential = TRUE) return if (SSdbcore.IsConnected()) - if (!check_rights(R_DEBUG,0)) - tgui_alert(usr,"The database is already connected! (Only those with +debug can force a reconnection)", "The database is already connected!") + if (!user.holder.check_for_rights(R_DEBUG)) + tgui_alert(user,"The database is already connected! (Only those with +debug can force a reconnection)", "The database is already connected!") return - var/reconnect = tgui_alert(usr,"The database is already connected! If you *KNOW* that this is incorrect, you can force a reconnection", "The database is already connected!", list("Force Reconnect", "Cancel")) + var/reconnect = tgui_alert(user,"The database is already connected! If you *KNOW* that this is incorrect, you can force a reconnection", "The database is already connected!", list("Force Reconnect", "Cancel")) if (reconnect != "Force Reconnect") return SSdbcore.Disconnect() - log_admin("[key_name(usr)] has forced the database to disconnect") - message_admins("[key_name_admin(usr)] has forced the database to disconnect!") + log_admin("[key_name(user)] has forced the database to disconnect") + message_admins("[key_name_admin(user)] has forced the database to disconnect!") BLACKBOX_LOG_ADMIN_VERB("Force Reestablished Database Connection") - log_admin("[key_name(usr)] is attempting to re-establish the DB Connection") - message_admins("[key_name_admin(usr)] is attempting to re-establish the DB Connection") + log_admin("[key_name(user)] is attempting to re-establish the DB Connection") + message_admins("[key_name_admin(user)] is attempting to re-establish the DB Connection") BLACKBOX_LOG_ADMIN_VERB("Reestablished Database Connection") SSdbcore.failed_connections = 0 diff --git a/code/modules/admin/verbs/requests.dm b/code/modules/admin/verbs/requests.dm index 2cd32648b67..53d3e092f81 100644 --- a/code/modules/admin/verbs/requests.dm +++ b/code/modules/admin/verbs/requests.dm @@ -1,7 +1,4 @@ -/// Verb for opening the requests manager panel -/client/proc/requests() - set name = "Requests Manager" - set desc = "Open the request manager panel to view all requests during this round" - set category = "Admin.Game" - BLACKBOX_LOG_ADMIN_VERB("Request Manager") + +ADMIN_VERB(requests, R_NONE, "Requests Manager", "Open the request manager panel to view all requests during this round", ADMIN_CATEGORY_GAME) GLOB.requests.ui_interact(usr) + BLACKBOX_LOG_ADMIN_VERB("Request Manager") diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index e70138ad8ac..b7aa16b6b5f 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -1,12 +1,9 @@ GLOBAL_DATUM(everyone_an_antag, /datum/everyone_is_an_antag_controller) -/client/proc/secrets() //Creates a verb for admins to open up the ui - set name = "Secrets" - set desc = "Abuse harder than you ever have before with this handy dandy semi-misc stuff menu" - set category = "Admin.Game" +ADMIN_VERB(secrets, R_NONE, "Secrets", "Abuse harder than you ever have before with this handy dandy semi-misc stuff menu.", ADMIN_CATEGORY_GAME) + var/datum/secrets_menu/tgui = new(user) + tgui.ui_interact(user.mob) BLACKBOX_LOG_ADMIN_VERB("Secrets Panel") - var/datum/secrets_menu/tgui = new(usr)//create the datum - tgui.ui_interact(usr)//datum has a tgui component, here we open the window /datum/secrets_menu var/client/holder //client of whoever is using this datum @@ -102,25 +99,25 @@ GLOBAL_DATUM(everyone_an_antag, /datum/everyone_is_an_antag_controller) D.cure(0) if("list_bombers") - holder.list_bombers() + holder.holder.list_bombers() if("list_signalers") - holder.list_signalers() + holder.holder.list_signalers() if("list_lawchanges") - holder.list_law_changes() + holder.holder.list_law_changes() if("showailaws") - holder.check_ai_laws() + holder.holder.list_law_changes() if("manifest") - holder.show_manifest() + holder.holder.show_manifest() if("dna") - holder.list_dna() + holder.holder.list_dna() if("fingerprints") - holder.list_fingerprints() + holder.holder.list_fingerprints() if("ctfbutton") toggle_id_ctf(holder, CTF_GHOST_CTF_GAME_ID) diff --git a/code/modules/admin/verbs/selectequipment.dm b/code/modules/admin/verbs/selectequipment.dm index 59513db0129..b94fd5cb2e4 100644 --- a/code/modules/admin/verbs/selectequipment.dm +++ b/code/modules/admin/verbs/selectequipment.dm @@ -1,10 +1,6 @@ -/client/proc/cmd_select_equipment(mob/target in GLOB.mob_list) - set category = "Admin.Events" - set name = "Select equipment" - - - var/datum/select_equipment/ui = new(usr, target) - ui.ui_interact(usr) +ADMIN_VERB_ONLY_CONTEXT_MENU(select_equipment, R_FUN, "Select Equipment", mob/target in world) + var/datum/select_equipment/ui = new(user, target) + ui.ui_interact(user.mob) /* * This is the datum housing the select equipment UI. @@ -152,7 +148,7 @@ return custom_outfit -/datum/select_equipment/ui_act(action, params) +/datum/select_equipment/ui_act(action, params, datum/tgui/ui, datum/ui_state/state) if(..()) return . = TRUE @@ -181,7 +177,7 @@ user.admin_apply_outfit(target_mob, new_outfit) if("customoutfit") - user.outfit_manager() + return SSadmin_verbs.dynamic_invoke_verb(ui.user, /datum/admin_verb/outfit_manager) if("togglefavorite") var/datum/outfit/outfit_path = resolve_outfit(params["path"]) diff --git a/code/modules/admin/verbs/server.dm b/code/modules/admin/verbs/server.dm index d7e1cbcbc8c..b57dcdc9bbf 100644 --- a/code/modules/admin/verbs/server.dm +++ b/code/modules/admin/verbs/server.dm @@ -1,191 +1,147 @@ // Server Tab - Server Verbs -/client/proc/toggle_random_events() - set category = "Server" - set name = "Toggle random events on/off" - set desc = "Toggles random events such as meteors, black holes, blob (but not space dust) on/off" +ADMIN_VERB(toggle_random_events, R_SERVER, "Toggle Random Events", "Toggles random events on or off.", ADMIN_CATEGORY_SERVER) var/new_are = !CONFIG_GET(flag/allow_random_events) CONFIG_SET(flag/allow_random_events, new_are) - message_admins("[key_name_admin(usr)] has [new_are ? "enabled" : "disabled"] random events.") + message_admins("[key_name_admin(user)] has [new_are ? "enabled" : "disabled"] random events.") SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Random Events", "[new_are ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! -/client/proc/toggle_hub() - set category = "Server" - set name = "Toggle Hub" - +ADMIN_VERB(toggle_hub, R_SERVER, "Toggle Hub", "Toggles the server's visilibility on the BYOND Hub.", ADMIN_CATEGORY_SERVER) world.update_hub_visibility(!GLOB.hub_visibility) - log_admin("[key_name(usr)] has toggled the server's hub status for the round, it is now [(GLOB.hub_visibility?"on":"off")] the hub.") - message_admins("[key_name_admin(usr)] has toggled the server's hub status for the round, it is now [(GLOB.hub_visibility?"on":"off")] the hub.") + log_admin("[key_name(user)] has toggled the server's hub status for the round, it is now [(GLOB.hub_visibility?"on":"off")] the hub.") + message_admins("[key_name_admin(user)] has toggled the server's hub status for the round, it is now [(GLOB.hub_visibility?"on":"off")] the hub.") if (GLOB.hub_visibility && !world.reachable) message_admins("WARNING: The server will not show up on the hub because byond is detecting that a filewall is blocking incoming connections.") SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggled Hub Visibility", "[GLOB.hub_visibility ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! -/datum/admins/proc/restart() - set category = "Server" - set name = "Reboot World" - set desc = "Restarts the world immediately" - if (!usr.client.holder) - return - - var/localhost_addresses = list("127.0.0.1", "::1") +ADMIN_VERB(restart, R_SERVER, "Reboot World", "Restarts the world immediately.", ADMIN_CATEGORY_SERVER) var/list/options = list("Regular Restart", "Regular Restart (with delay)", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)") if(world.TgsAvailable()) options += "Server Restart (Kill and restart DD)"; if(SSticker.admin_delay_notice) - if(alert(usr, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", "Yes", "No") != "Yes") + if(alert(user, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", "Yes", "No") != "Yes") return FALSE - var/result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options - if(result) - BLACKBOX_LOG_ADMIN_VERB("Reboot World") - var/init_by = "Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]." - switch(result) - if("Regular Restart") - if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses))) - if(alert(usr, "Are you sure you want to restart the server?","This server is live", "Restart", "Cancel") != "Restart") - return FALSE - SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10) - if("Regular Restart (with delay)") - var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null - if(!delay) - return FALSE - if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses))) - if(alert(usr,"Are you sure you want to restart the server?","This server is live", "Restart", "Cancel") != "Restart") - return FALSE - SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", delay * 10) - if("Hard Restart (No Delay, No Feeback Reason)") - to_chat(world, "World reboot - [init_by]") - world.Reboot() - if("Hardest Restart (No actions, just reboot)") - to_chat(world, "Hard world reboot - [init_by]") - world.Reboot(fast_track = TRUE) - if("Server Restart (Kill and restart DD)") - to_chat(world, "Server restart - [init_by]") - world.TgsEndProcess() - -/datum/admins/proc/end_round() - set category = "Server" - set name = "End Round" - set desc = "Attempts to produce a round end report and then restart the server organically." - - if (!usr.client.holder) + var/result = input(user, "Select reboot method", "World Reboot", options[1]) as null|anything in options + if(isnull(result)) return - var/confirm = tgui_alert(usr, "End the round and restart the game world?", "End Round", list("Yes", "Cancel")) - if(confirm == "Cancel") + + BLACKBOX_LOG_ADMIN_VERB("Reboot World") + var/init_by = "Initiated by [user.holder.fakekey ? "Admin" : user.key]." + switch(result) + if("Regular Restart") + if(!user.is_localhost()) + if(alert(user, "Are you sure you want to restart the server?","This server is live", "Restart", "Cancel") != "Restart") + return FALSE + SSticker.Reboot(init_by, "admin reboot - by [user.key] [user.holder.fakekey ? "(stealth)" : ""]", 10) + if("Regular Restart (with delay)") + var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null + if(!delay) + return FALSE + if(!user.is_localhost()) + if(alert(user,"Are you sure you want to restart the server?","This server is live", "Restart", "Cancel") != "Restart") + return FALSE + SSticker.Reboot(init_by, "admin reboot - by [user.key] [user.holder.fakekey ? "(stealth)" : ""]", delay * 10) + if("Hard Restart (No Delay, No Feeback Reason)") + to_chat(world, "World reboot - [init_by]") + world.Reboot() + if("Hardest Restart (No actions, just reboot)") + to_chat(world, "Hard world reboot - [init_by]") + world.Reboot(fast_track = TRUE) + if("Server Restart (Kill and restart DD)") + to_chat(world, "Server restart - [init_by]") + world.TgsEndProcess() + +ADMIN_VERB(end_round, R_SERVER, "End Round", "Forcibly ends the round and allows the server to restart normally.", ADMIN_CATEGORY_SERVER) + var/confirm = tgui_alert(user, "End the round and restart the game world?", "End Round", list("Yes", "Cancel")) + if(confirm != "Yes") return - if(confirm == "Yes") - SSticker.force_ending = FORCE_END_ROUND - BLACKBOX_LOG_ADMIN_VERB("End Round") - -/datum/admins/proc/toggleooc() - set category = "Server" - set desc = "Toggle dis bitch" - set name = "Toggle OOC" + SSticker.force_ending = FORCE_END_ROUND + BLACKBOX_LOG_ADMIN_VERB("End Round") + +ADMIN_VERB(toggle_ooc, R_ADMIN, "Toggle OOC", "Toggle the OOC channel on or off.", ADMIN_CATEGORY_SERVER) toggle_ooc() - log_admin("[key_name(usr)] toggled OOC.") - message_admins("[key_name_admin(usr)] toggled OOC.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle OOC", "[GLOB.ooc_allowed ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! - -/datum/admins/proc/toggleoocdead() - set category = "Server" - set desc = "Toggle dis bitch" - set name = "Toggle Dead OOC" + log_admin("[key_name(user)] toggled OOC.") + message_admins("[key_name_admin(user)] toggled OOC.") + SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle OOC", "[GLOB.ooc_allowed ? "Enabled" : "Disabled"]")) + +ADMIN_VERB(toggle_ooc_dead, R_ADMIN, "Toggle Dead OOC", "Toggle the OOC channel for dead players on or off.", ADMIN_CATEGORY_SERVER) toggle_dooc() + log_admin("[key_name(user)] toggled OOC.") + message_admins("[key_name_admin(user)] toggled Dead OOC.") + SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Dead OOC", "[GLOB.dooc_allowed ? "Enabled" : "Disabled"]")) + +ADMIN_VERB(start_now, R_SERVER, "Start Now", "Start the round RIGHT NOW.", ADMIN_CATEGORY_SERVER) + var/static/list/waiting_states = list(GAME_STATE_PREGAME, GAME_STATE_STARTUP) + if(!(SSticker.current_state in waiting_states)) + to_chat(user, span_warning(span_red("The game has already started!"))) + return - log_admin("[key_name(usr)] toggled OOC.") - message_admins("[key_name_admin(usr)] toggled Dead OOC.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Dead OOC", "[GLOB.dooc_allowed ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! - -/datum/admins/proc/startnow() - set category = "Server" - set desc = "Start the round RIGHT NOW" - set name = "Start Now" - if(SSticker.current_state == GAME_STATE_PREGAME || SSticker.current_state == GAME_STATE_STARTUP) - if(!SSticker.start_immediately) - var/localhost_addresses = list("127.0.0.1", "::1") - if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses))) - if(tgui_alert(usr, "Are you sure you want to start the round?","Start Now",list("Start Now","Cancel")) != "Start Now") - return FALSE - SSticker.start_immediately = TRUE - log_admin("[usr.key] has started the game.") - var/msg = "" - if(SSticker.current_state == GAME_STATE_STARTUP) - msg = " (The server is still setting up, but the round will be \ - started as soon as possible.)" - message_admins("[usr.key] has started the game.[msg]") - BLACKBOX_LOG_ADMIN_VERB("Start Now") - return TRUE + if(SSticker.start_immediately) SSticker.start_immediately = FALSE - SSticker.SetTimeLeft(1800) - to_chat(world, span_infoplain(span_bold("The game will start in 180 seconds."))) + SSticker.SetTimeLeft(3 MINUTES) + to_chat(world, span_big(span_notice("The game will start in 3 minutes."))) SEND_SOUND(world, sound('sound/ai/default/attention.ogg')) - message_admins("[usr.key] has cancelled immediate game start. Game will start in 180 seconds.") - log_admin("[usr.key] has cancelled immediate game start.") - else - to_chat(usr, "Error: Start Now: Game has already started.") - return FALSE + message_admins(span_adminnotice("[key_name_admin(user)] has cancelled immediate game start. Game will start in 3 minutes.")) + log_admin("[key_name(user)] has cancelled immediate game start.") + return -/datum/admins/proc/delay_round_end() - set category = "Server" - set desc = "Prevent the server from restarting" - set name = "Delay Round End" + if(!user.is_localhost()) + var/response = tgui_alert(user, "Are you sure you want to start the round?", "Start Now", list("Start Now", "Cancel")) + if(response != "Start Now") + return + SSticker.start_immediately = TRUE - if(!check_rights(R_ADMIN)) // NOVA EDIT - Admins can delay the round end - ORIGINAL: if(!check_rights(R_SERVER)) - return + log_admin("[key_name(user)] has started the game.") + message_admins("[key_name_admin(user)] has started the game.") + if(SSticker.current_state == GAME_STATE_STARTUP) + message_admins("The server is still setting up, but the round will be started as soon as possible.") + BLACKBOX_LOG_ADMIN_VERB("Start Now") +ADMIN_VERB(delay_round_end, R_ADMIN, "Delay Round End", "Prevent the server from restarting.", ADMIN_CATEGORY_SERVER) // NOVA EDIT CHANGE - Admins can delay the round end - ORIGINAL: ADMIN_VERB(delay_round_end, R_SERVER, "Delay Round End", "Prevent the server from restarting.", ADMIN_CATEGORY_SERVER) if(SSticker.delay_end) - tgui_alert(usr, "The round end is already delayed. The reason for the current delay is: \"[SSticker.admin_delay_notice]\"", "Alert", list("Ok")) + tgui_alert(user, "The round end is already delayed. The reason for the current delay is: \"[SSticker.admin_delay_notice]\"", "Alert", list("Ok")) return - var/delay_reason = input(usr, "Enter a reason for delaying the round end", "Round Delay Reason") as null|text + var/delay_reason = input(user, "Enter a reason for delaying the round end", "Round Delay Reason") as null|text if(isnull(delay_reason)) return if(SSticker.delay_end) - tgui_alert(usr, "The round end is already delayed. The reason for the current delay is: \"[SSticker.admin_delay_notice]\"", "Alert", list("Ok")) + tgui_alert(user, "The round end is already delayed. The reason for the current delay is: \"[SSticker.admin_delay_notice]\"", "Alert", list("Ok")) return SSticker.delay_end = TRUE SSticker.admin_delay_notice = delay_reason - log_admin("[key_name(usr)] delayed the round end for reason: [SSticker.admin_delay_notice]") - message_admins("[key_name_admin(usr)] delayed the round end for reason: [SSticker.admin_delay_notice]") + log_admin("[key_name(user)] delayed the round end for reason: [SSticker.admin_delay_notice]") + message_admins("[key_name_admin(user)] delayed the round end for reason: [SSticker.admin_delay_notice]") SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Delay Round End", "Reason: [delay_reason]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! -/datum/admins/proc/toggleenter() - set category = "Server" - set desc = "People can't enter" - set name = "Toggle Entering" +ADMIN_VERB(toggle_enter, R_SERVER, "Toggle Entering", "Toggle the ability to enter the game.", ADMIN_CATEGORY_SERVER) if(!SSlag_switch.initialized) return SSlag_switch.set_measure(DISABLE_NON_OBSJOBS, !SSlag_switch.measures[DISABLE_NON_OBSJOBS]) - log_admin("[key_name(usr)] toggled new player game entering. Lag Switch at index ([DISABLE_NON_OBSJOBS])") - message_admins("[key_name_admin(usr)] toggled new player game entering [SSlag_switch.measures[DISABLE_NON_OBSJOBS] ? "OFF" : "ON"].") + log_admin("[key_name(user)] toggled new player game entering. Lag Switch at index ([DISABLE_NON_OBSJOBS])") + message_admins("[key_name_admin(user)] toggled new player game entering [SSlag_switch.measures[DISABLE_NON_OBSJOBS] ? "OFF" : "ON"].") SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Entering", "[!SSlag_switch.measures[DISABLE_NON_OBSJOBS] ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! -/datum/admins/proc/toggleAI() - set category = "Server" - set desc = "People can't be AI" - set name = "Toggle AI" +ADMIN_VERB(toggle_ai, R_SERVER, "Toggle AI", "Toggle the ability to choose AI jobs.", ADMIN_CATEGORY_SERVER) var/alai = CONFIG_GET(flag/allow_ai) CONFIG_SET(flag/allow_ai, !alai) if (alai) to_chat(world, span_bold("The AI job is no longer chooseable."), confidential = TRUE) else - to_chat(world, span_bold("The AI job is chooseable now."), confidential = TRUE) - log_admin("[key_name(usr)] toggled AI allowed.") + to_chat(world, "The AI job is chooseable now.", confidential = TRUE) + log_admin("[key_name(user)] toggled AI allowed.") world.update_status() SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle AI", "[!alai ? "Disabled" : "Enabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! -/datum/admins/proc/toggleaban() - set category = "Server" - set desc = "Respawn basically" - set name = "Toggle Respawn" - +ADMIN_VERB(toggle_respawn, R_SERVER, "Toggle Respawn", "Toggle the ability to respawn.", ADMIN_CATEGORY_SERVER) var/respawn_state = CONFIG_GET(flag/allow_respawn) var/new_state = -1 var/new_state_text = "" @@ -203,80 +159,71 @@ if(RESPAWN_FLAG_NEW_CHARACTER) // respawn currently enabled for different slot characters only new_state = RESPAWN_FLAG_DISABLED new_state_text = "Disabled" - to_chat(world, span_bold("You may no longer respawn :("), confidential = TRUE) + to_chat(world, span_bold("You may no longer respawn."), confidential = TRUE) else WARNING("Invalid respawn state in config: [respawn_state]") if(new_state == -1) - to_chat(usr, span_warning("The config for respawn is set incorrectly, please complain to your nearest server host (or fix it yourself). \ + to_chat(user, span_warning("The config for respawn is set incorrectly, please complain to your nearest server host (or fix it yourself). \ In the meanwhile respawn has been set to \"Off\".")) new_state = RESPAWN_FLAG_DISABLED new_state_text = "Disabled" CONFIG_SET(flag/allow_respawn, new_state) - message_admins(span_adminnotice("[key_name_admin(usr)] toggled respawn to \"[new_state_text]\".")) - log_admin("[key_name(usr)] toggled respawn to \"[new_state_text]\".") + message_admins(span_adminnotice("[key_name_admin(user)] toggled respawn to \"[new_state_text]\".")) + log_admin("[key_name(user)] toggled respawn to \"[new_state_text]\".") world.update_status() SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Respawn", "[new_state_text]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! -/datum/admins/proc/delay() - set category = "Server" - set desc = "Delay the game start" - set name = "Delay Pre-Game" - - var/newtime = input("Set a new time in seconds. Set -1 for indefinite delay.","Set Delay",round(SSticker.GetTimeLeft()/10)) as num|null +ADMIN_VERB(delay, R_SERVER, "Delay Pre-Game", "Delay the game start.", ADMIN_CATEGORY_SERVER) + var/newtime = input(user, "Set a new time in seconds. Set -1 for indefinite delay.", "Set Delay", round(SSticker.GetTimeLeft()/10)) as num|null if(!newtime) return if(SSticker.current_state > GAME_STATE_PREGAME) - return tgui_alert(usr, "Too late... The game has already started!") + return tgui_alert(user, "Too late... The game has already started!") newtime = newtime*10 SSticker.SetTimeLeft(newtime) SSticker.start_immediately = FALSE if(newtime < 0) - to_chat(world, span_infoplain(span_bold("The game start has been delayed.")), confidential = TRUE) - log_admin("[key_name(usr)] delayed the round start.") + to_chat(world, "The game start has been delayed.", confidential = TRUE) + log_admin("[key_name(user)] delayed the round start.") else to_chat(world, span_infoplain(span_bold("The game will start in [DisplayTimeText(newtime)].")), confidential = TRUE) SEND_SOUND(world, sound('sound/ai/default/attention.ogg')) - log_admin("[key_name(usr)] set the pre-game delay to [DisplayTimeText(newtime)].") + log_admin("[key_name(user)] set the pre-game delay to [DisplayTimeText(newtime)].") BLACKBOX_LOG_ADMIN_VERB("Delay Game Start") -/datum/admins/proc/set_admin_notice() - set category = "Server" - set name = "Set Admin Notice" - set desc ="Set an announcement that appears to everyone who joins the server. Only lasts this round" - if(!check_rights(0)) - return - - var/new_admin_notice = input(src,"Set a public notice for this round. Everyone who joins the server will see it.\n(Leaving it blank will delete the current notice):","Set Notice",GLOB.admin_notice) as message|null +ADMIN_VERB(set_admin_notice, R_SERVER, "Set Admin Notice", "Set an announcement that appears to everyone who joins the server. Only lasts this round.", ADMIN_CATEGORY_SERVER) + var/new_admin_notice = input( + user, + "Set a public notice for this round. Everyone who joins the server will see it.\n(Leaving it blank will delete the current notice):", + "Set Notice", + GLOB.admin_notice, + ) as message|null if(new_admin_notice == null) return if(new_admin_notice == GLOB.admin_notice) return if(new_admin_notice == "") - message_admins("[key_name(usr)] removed the admin notice.") - log_admin("[key_name(usr)] removed the admin notice:\n[GLOB.admin_notice]") + message_admins("[key_name(user)] removed the admin notice.") + log_admin("[key_name(user)] removed the admin notice:\n[GLOB.admin_notice]") else - message_admins("[key_name(usr)] set the admin notice.") - log_admin("[key_name(usr)] set the admin notice:\n[new_admin_notice]") + message_admins("[key_name(user)] set the admin notice.") + log_admin("[key_name(user)] set the admin notice:\n[new_admin_notice]") to_chat(world, span_adminnotice("Admin Notice:\n \t [new_admin_notice]"), confidential = TRUE) BLACKBOX_LOG_ADMIN_VERB("Set Admin Notice") GLOB.admin_notice = new_admin_notice - return -/datum/admins/proc/toggleguests() - set category = "Server" - set desc = "Guests can't enter" - set name = "Toggle guests" +ADMIN_VERB(toggle_guests, R_SERVER, "Toggle Guests", "Toggle the ability for guests to enter the game.", ADMIN_CATEGORY_SERVER) var/new_guest_ban = !CONFIG_GET(flag/guest_ban) CONFIG_SET(flag/guest_ban, new_guest_ban) if (new_guest_ban) to_chat(world, span_bold("Guests may no longer enter the game."), confidential = TRUE) else - to_chat(world, span_bold("Guests may now enter the game."), confidential = TRUE) - log_admin("[key_name(usr)] toggled guests game entering [!new_guest_ban ? "" : "dis"]allowed.") - message_admins(span_adminnotice("[key_name_admin(usr)] toggled guests game entering [!new_guest_ban ? "" : "dis"]allowed.")) + to_chat(world, "Guests may now enter the game.", confidential = TRUE) + log_admin("[key_name(user)] toggled guests game entering [!new_guest_ban ? "" : "dis"]allowed.") + message_admins(span_adminnotice("[key_name_admin(user)] toggled guests game entering [!new_guest_ban ? "" : "dis"]allowed.")) SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Guests", "[!new_guest_ban ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/shuttlepanel.dm b/code/modules/admin/verbs/shuttlepanel.dm index d95eadbe7a4..48a6872171e 100644 --- a/code/modules/admin/verbs/shuttlepanel.dm +++ b/code/modules/admin/verbs/shuttlepanel.dm @@ -1,13 +1,5 @@ -/datum/admins/proc/open_shuttlepanel() - set category = "Admin.Events" - set name = "Shuttle Manipulator" - set desc = "Opens the shuttle manipulator UI." - - if(!check_rights(R_ADMIN)) - return - - SSshuttle.ui_interact(usr) - +ADMIN_VERB(shuttle_panel, R_ADMIN, "Shuttle Manipulator", "Opens the shuttle manipulator UI.", ADMIN_CATEGORY_EVENTS) + SSshuttle.ui_interact(user.mob) /obj/docking_port/mobile/proc/admin_fly_shuttle(mob/user) var/list/options = list() diff --git a/code/modules/admin/verbs/spawnobjasmob.dm b/code/modules/admin/verbs/spawnobjasmob.dm index 924c9885713..e673202f0ba 100644 --- a/code/modules/admin/verbs/spawnobjasmob.dm +++ b/code/modules/admin/verbs/spawnobjasmob.dm @@ -1,11 +1,4 @@ -/datum/admins/proc/spawn_objasmob(object as text) - set category = "Debug" - set desc = "(obj path) Spawn object-mob" - set name = "Spawn object-mob" - - if(!check_rights(R_SPAWN)) - return - +ADMIN_VERB(spawn_obj_as_mob, R_SPAWN, "Spawn Object-Mob", "Spawn an object as if it were a mob.", ADMIN_CATEGORY_DEBUG, object as text) var/chosen = pick_closest_path(object, make_types_fancy(subtypesof(/obj))) if (!chosen) @@ -15,21 +8,63 @@ var/obj/chosen_obj = text2path(chosen) - var/list/settings = list( - "mainsettings" = list( - "name" = list("desc" = "Name", "type" = "string", "value" = "Bob"), - "maxhealth" = list("desc" = "Max. health", "type" = "number", "value" = 100), - "access" = list("desc" = "Access ID", "type" = "datum", "path" = "/obj/item/card/id", "value" = "Default"), - "objtype" = list("desc" = "Base obj type", "type" = "datum", "path" = "/obj", "value" = "[chosen]"), - "googlyeyes" = list("desc" = "Googly eyes", "type" = "boolean", "value" = "No"), - "disableai" = list("desc" = "Disable AI", "type" = "boolean", "value" = "Yes"), - "idledamage" = list("desc" = "Damaged while idle", "type" = "boolean", "value" = "No"), - "dropitem" = list("desc" = "Drop obj on death", "type" = "boolean", "value" = "Yes"), - "mobtype" = list("desc" = "Base mob type", "type" = "datum", "path" = "/mob/living/simple_animal/hostile/mimic/copy", "value" = "/mob/living/simple_animal/hostile/mimic/copy"), - "ckey" = list("desc" = "ckey", "type" = "ckey", "value" = "none"), + var/list/settings = list("mainsettings" = list( + "name" = list( + "desc" = "Name", + "type" = "string", + "value" = "Bob", + ), + "maxhealth" = list( + "desc" = "Max. health", + "type" = "number", + "value" = 100, + ), + "access" = list( + "desc" = "Access ID", + "type" = "datum", + "path" = "/obj/item/card/id", + "value" = "Default", + ), + "objtype" = list( + "desc" = "Base obj type", + "type" = "datum", + "path" = "/obj", + "value" = "[chosen]", + ), + "googlyeyes" = list( + "desc" = "Googly eyes", + "type" = "boolean", + "value" = "No", + ), + "disableai" = list( + "desc" = "Disable AI", + "type" = "boolean", + "value" = "Yes", + ), + "idledamage" = list( + "desc" = "Damaged while idle", + "type" = "boolean", + "value" = "No", + ), + "dropitem" = list( + "desc" = "Drop obj on death", + "type" = "boolean", + "value" = "Yes", + ), + "mobtype" = list( + "desc" = "Base mob type", + "type" = "datum", + "path" = "/mob/living/simple_animal/hostile/mimic/copy", + "value" = "/mob/living/simple_animal/hostile/mimic/copy", + ), + "ckey" = list( + "desc" = "ckey", + "type" = "ckey", + "value" = "none", + ), )) - var/list/prefreturn = presentpreflikepicker(usr,"Customize mob", "Customize mob", Button1="Ok", width = 450, StealFocus = 1,Timeout = 0, settings=settings) + var/list/prefreturn = presentpreflikepicker(user.mob,"Customize mob", "Customize mob", Button1="Ok", width = 450, StealFocus = 1,Timeout = 0, settings=settings) if (prefreturn["button"] == 1) settings = prefreturn["settings"] var/mainsettings = settings["mainsettings"] @@ -37,9 +72,9 @@ basemob = text2path(mainsettings["mobtype"]["value"]) if (!ispath(basemob, /mob/living/simple_animal/hostile/mimic/copy) || !ispath(chosen_obj, /obj)) - to_chat(usr, "Mob or object path invalid", confidential = TRUE) + to_chat(user.mob, "Mob or object path invalid", confidential = TRUE) - basemob = new basemob(get_turf(usr), new chosen_obj(get_turf(usr)), usr, mainsettings["dropitem"]["value"] == "Yes" ? FALSE : TRUE, (mainsettings["googlyeyes"]["value"] == "Yes" ? FALSE : TRUE)) + basemob = new basemob(get_turf(user.mob), new chosen_obj(get_turf(user.mob)), user.mob, mainsettings["dropitem"]["value"] == "Yes" ? FALSE : TRUE, (mainsettings["googlyeyes"]["value"] == "Yes" ? FALSE : TRUE)) if (mainsettings["disableai"]["value"] == "Yes") basemob.toggle_ai(AI_OFF) @@ -65,5 +100,5 @@ basemob.ckey = mainsettings["ckey"]["value"] - log_admin("[key_name(usr)] spawned a sentient object-mob [basemob] from [chosen_obj] at [AREACOORD(usr)]") + log_admin("[key_name(user.mob)] spawned a sentient object-mob [basemob] from [chosen_obj] at [AREACOORD(user.mob)]") BLACKBOX_LOG_ADMIN_VERB("Spawn object-mob") diff --git a/code/modules/admin/verbs/special_verbs.dm b/code/modules/admin/verbs/special_verbs.dm new file mode 100644 index 00000000000..309c14d4455 --- /dev/null +++ b/code/modules/admin/verbs/special_verbs.dm @@ -0,0 +1,43 @@ +// Admin Verbs in this file are special and cannot use the AVD system for some reason or another. + +/client/proc/show_verbs() + set name = "Adminverbs - Show" + set category = ADMIN_CATEGORY_MAIN + + remove_verb(src, /client/proc/show_verbs) + add_admin_verbs() + + to_chat(src, span_interface("All of your adminverbs are now visible."), confidential = TRUE) + BLACKBOX_LOG_ADMIN_VERB("Show Adminverbs") + +/client/proc/readmin() + set name = "Readmin" + set category = "Admin" + set desc = "Regain your admin powers." + + var/datum/admins/A = GLOB.deadmins[ckey] + + if(!A) + A = GLOB.admin_datums[ckey] + if (!A) + var/msg = " is trying to readmin but they have no deadmin entry" + message_admins("[key_name_admin(src)][msg]") + log_admin_private("[key_name(src)][msg]") + return + + A.associate(src) + + if (!holder) + return //This can happen if an admin attempts to vv themself into somebody elses's deadmin datum by getting ref via brute force + + to_chat(src, span_interface("You are now an admin."), confidential = TRUE) + message_admins("[src] re-adminned themselves.") + log_admin("[src] re-adminned themselves.") + BLACKBOX_LOG_ADMIN_VERB("Readmin") + +/client/proc/admin_2fa_verify() + set name = "Verify Admin" + set category = "Admin" + + var/datum/admins/admin = GLOB.admin_datums[ckey] + admin?.associate(src) diff --git a/code/modules/admin/view_variables/mark_datum.dm b/code/modules/admin/view_variables/mark_datum.dm index 44c3b2b83b2..1d9dd3a1a37 100644 --- a/code/modules/admin/view_variables/mark_datum.dm +++ b/code/modules/admin/view_variables/mark_datum.dm @@ -8,10 +8,8 @@ holder.RegisterSignal(holder.marked_datum, COMSIG_QDELETING, TYPE_PROC_REF(/datum/admins, handle_marked_del)) vv_update_display(D, "marked", VV_MSG_MARKED) -/client/proc/mark_datum_mapview(datum/D as mob|obj|turf|area in view(view)) - set category = "Debug" - set name = "Mark Object" - mark_datum(D) +ADMIN_VERB_ONLY_CONTEXT_MENU(mark_datum, R_NONE, "Mark Object", datum/target as mob|obj|turf|area in view()) + user.mark_datum(target) /datum/admins/proc/handle_marked_del(datum/source) SIGNAL_HANDLER diff --git a/code/modules/admin/view_variables/tag_datum.dm b/code/modules/admin/view_variables/tag_datum.dm index 3b611e3cdf9..b4ca42860c3 100644 --- a/code/modules/admin/view_variables/tag_datum.dm +++ b/code/modules/admin/view_variables/tag_datum.dm @@ -12,7 +12,5 @@ else holder.add_tagged_datum(target_datum) -/client/proc/tag_datum_mapview(datum/target_datum as mob|obj|turf|area in view(view)) - set category = "Debug" - set name = "Tag Datum" - tag_datum(target_datum) +ADMIN_VERB_ONLY_CONTEXT_MENU(tag_datum, R_NONE, "Tag Datum", datum/target_datum as mob|obj|turf|area in view()) + user.tag_datum(target_datum) diff --git a/code/modules/admin/view_variables/topic_basic.dm b/code/modules/admin/view_variables/topic_basic.dm index 8a27d342578..4f363653127 100644 --- a/code/modules/admin/view_variables/topic_basic.dm +++ b/code/modules/admin/view_variables/topic_basic.dm @@ -140,6 +140,7 @@ return var/datum/greyscale_modify_menu/menu = new(target, usr, SSgreyscale.configurations, unlocked = TRUE) menu.ui_interact(usr) + if(href_list[VV_HK_CALLPROC]) - usr.client.callproc_datum(target) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/call_proc_datum, target) diff --git a/code/modules/admin/view_variables/view_variables.dm b/code/modules/admin/view_variables/view_variables.dm index 9f0d86e04f6..b139ec9d488 100644 --- a/code/modules/admin/view_variables/view_variables.dm +++ b/code/modules/admin/view_variables/view_variables.dm @@ -1,3 +1,7 @@ +ADMIN_VERB_AND_CONTEXT_MENU(debug_variables, R_NONE, "View Variables", "View the variables of a datum.", ADMIN_CATEGORY_DEBUG, datum/thing in world) + user.debug_variables(thing) + +// This is kept as a seperate proc because admins are able to show VV to non-admins /client/proc/debug_variables(datum/thing in world) set category = "Debug" set name = "View Variables" diff --git a/code/modules/antagonists/traitor/balance_helper.dm b/code/modules/antagonists/traitor/balance_helper.dm index e78625ff1c1..b2a9661bfeb 100644 --- a/code/modules/antagonists/traitor/balance_helper.dm +++ b/code/modules/antagonists/traitor/balance_helper.dm @@ -1,11 +1,5 @@ -/client/proc/cmd_admin_debug_traitor_objectives() - set name = "Debug Traitor Objectives" - set category = "Debug" - - if(!check_rights(R_DEBUG)) - return - - SStraitor.traitor_debug_panel?.ui_interact(usr) +ADMIN_VERB(debug_traitor_objectives, R_DEBUG, "Debug Traitor Objectives", "Verify functionality of traitor goals.", ADMIN_CATEGORY_DEBUG) + SStraitor.traitor_debug_panel?.ui_interact(user.mob) /datum/traitor_objective_debug var/list/all_objectives diff --git a/code/modules/atmospherics/machinery/pipes/pipe_spritesheet_helper.dm b/code/modules/atmospherics/machinery/pipes/pipe_spritesheet_helper.dm index 6b1997cc3c7..75c85d2a665 100644 --- a/code/modules/atmospherics/machinery/pipes/pipe_spritesheet_helper.dm +++ b/code/modules/atmospherics/machinery/pipes/pipe_spritesheet_helper.dm @@ -1,7 +1,4 @@ -/client/proc/GeneratePipeSpritesheet() - set name = "Generate Pipe Spritesheet" - set category = "Debug" - +ADMIN_VERB(generate_pipe_spritesheet, R_DEBUG, "Generate Pipe Spritesheet", "Generates the pipe spritesheets.", ADMIN_CATEGORY_DEBUG) var/datum/pipe_icon_generator/generator = new generator.Start() fcopy(generator.generated_icons, "icons/obj/pipes_n_cables/!pipes_bitmask.dmi") diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index 218aed8c681..cf4a5dfc875 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -16,11 +16,8 @@ //The user can change properties of the supplypod using the UI, and change the way that items are taken from the bay (One at a time, ordered, random, etc) //Many of the effects of the supplypod set here are put into action in supplypod.dm -/client/proc/centcom_podlauncher() //Creates a verb for admins to open up the ui - set name = "Config/Launch Supplypod" - set desc = "Configure and launch a CentCom supplypod full of whatever your heart desires!" - set category = "Admin.Events" - new /datum/centcom_podlauncher(usr)//create the datum +ADMIN_VERB(centcom_podlauncher, R_ADMIN, "Config/Launch Supplypod", "Configure and launch a CentCom supplypod full of whatever your heart desires!", ADMIN_CATEGORY_EVENTS) + new /datum/centcom_podlauncher(user.mob) //Variables declared to change how items in the launch bay are picked and launched. (Almost) all of these are changed in the ui_act proc //Some effect groups are choices, while other are booleans. This is because some effects can stack, while others dont (ex: you can stack explosion and quiet, but you cant stack ordered launch and random launch) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 618d6c8cd1c..e79e2894db8 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -157,6 +157,15 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( to_chat(src, "Become a BYOND member to access member-perks and features, as well as support the engine that makes this game possible. Only 10 bucks for 3 months! Click Here to find out more.") return FALSE return TRUE + +/client/proc/is_localhost() + var/static/localhost_addresses = list( + "127.0.0.1", + "::1", + null, + ) + return address in localhost_addresses + /* * Call back proc that should be checked in all paths where a client can send messages * @@ -254,32 +263,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( GLOB.ahelp_tickets.ClientLogin(src) GLOB.interviews.client_login(src) GLOB.requests.client_login(src) - var/connecting_admin = FALSE //because de-admined admins connecting should be treated like admins. - //Admin Authorisation - var/datum/admins/admin_datum = GLOB.admin_datums[ckey] - if (!isnull(admin_datum)) - admin_datum.associate(src) - connecting_admin = TRUE - else if(GLOB.deadmins[ckey]) - add_verb(src, /client/proc/readmin) - connecting_admin = TRUE - //NOVA EDIT ADDITION //We will check the population here, because we need to know if the client is an admin or not. - if(!check_population(connecting_admin)) - qdel(src) - return - // NOVA EDIT END - if(CONFIG_GET(flag/autoadmin)) - if(!GLOB.admin_datums[ckey]) - var/list/autoadmin_ranks = ranks_from_rank_name(CONFIG_GET(string/autoadmin_rank)) - if (autoadmin_ranks.len == 0) - to_chat(GLOB.admins, "Autoadmin rank not found") - else - new /datum/admins(autoadmin_ranks, ckey) - if(CONFIG_GET(flag/enable_localhost_rank) && !connecting_admin) - var/localhost_addresses = list("127.0.0.1", "::1") - if(isnull(address) || (address in localhost_addresses)) - var/datum/admin_rank/localhost_rank = new("!localhost!", R_EVERYTHING, R_DBRANKS, R_EVERYTHING) //+EVERYTHING -DBRANKS *EVERYTHING - new /datum/admins(list(localhost_rank), ckey, 1, 1) //preferences datum - also holds some persistent data for the client (because we may as well keep these datums to a minimum) prefs = GLOB.preferences_datums[ckey] if(prefs) @@ -352,6 +335,34 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( . = ..() //calls mob.Login() + + // Admin Verbs need the client's mob to exist. Must be after ..() + var/connecting_admin = FALSE //because de-admined admins connecting should be treated like admins. + //Admin Authorisation + var/datum/admins/admin_datum = GLOB.admin_datums[ckey] + if (!isnull(admin_datum)) + admin_datum.associate(src) + connecting_admin = TRUE + else if(GLOB.deadmins[ckey]) + add_verb(src, /client/proc/readmin) + connecting_admin = TRUE + //NOVA EDIT ADDITION START - We will check the population here, because we need to know if the client is an admin or not. + if(!check_population(connecting_admin)) + qdel(src) + return + // NOVA EDIT ADDITION END + if(CONFIG_GET(flag/autoadmin)) + if(!GLOB.admin_datums[ckey]) + var/list/autoadmin_ranks = ranks_from_rank_name(CONFIG_GET(string/autoadmin_rank)) + if (autoadmin_ranks.len == 0) + to_chat(world, "Autoadmin rank not found") + else + new /datum/admins(autoadmin_ranks, ckey) + + if(CONFIG_GET(flag/enable_localhost_rank) && !connecting_admin && is_localhost()) + var/datum/admin_rank/localhost_rank = new("!localhost!", R_EVERYTHING, R_DBRANKS, R_EVERYTHING) //+EVERYTHING -DBRANKS *EVERYTHING + new /datum/admins(list(localhost_rank), ckey, 1, 1) + if (length(GLOB.stickybanadminexemptions)) GLOB.stickybanadminexemptions -= ckey if (!length(GLOB.stickybanadminexemptions)) @@ -1207,13 +1218,10 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( /// Attempts to make the client orbit the given object, for administrative purposes. /// If they are not an observer, will try to aghost them. /client/proc/admin_follow(atom/movable/target) - var/can_ghost = TRUE - - if (!isobserver(mob)) - can_ghost = admin_ghost() - - if(!can_ghost) - return FALSE + if(!isobserver(mob)) + SSadmin_verbs.dynamic_invoke_verb(src, /datum/admin_verb/admin_ghost) + if(!isobserver(mob)) + return var/mob/dead/observer/observer = mob observer.ManualFollow(target) diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index bb355beb1b0..39a0429e4fa 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -144,33 +144,28 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8") set category = "Server" if(IsAdminAdvancedProcCall()) return - var/newColor = input(src, "Please select the new player OOC color.", "OOC color") as color|null + +ADMIN_VERB(set_ooc_color, R_FUN, "Set Player OOC Color", "Modifies the global OOC color.", ADMIN_CATEGORY_SERVER) + var/newColor = input(user, "Please select the new player OOC color.", "OOC color") as color|null if(isnull(newColor)) return - if(!check_rights(R_FUN)) - message_admins("[usr.key] has attempted to use the Set Player OOC Color verb!") - log_admin("[key_name(usr)] tried to set player ooc color without authorization.") - return var/new_color = sanitize_color(newColor) - message_admins("[key_name_admin(usr)] has set the players' ooc color to [new_color].") - log_admin("[key_name_admin(usr)] has set the player ooc color to [new_color].") + message_admins("[key_name_admin(user)] has set the players' ooc color to [new_color].") + log_admin("[key_name_admin(user)] has set the player ooc color to [new_color].") GLOB.OOC_COLOR = new_color - /client/proc/reset_ooc() set name = "Reset Player OOC Color" set desc = "Returns player OOC Color to default" set category = "Server" if(IsAdminAdvancedProcCall()) return - if(tgui_alert(usr, "Are you sure you want to reset the OOC color of all players?", "Reset Player OOC Color", list("Yes", "No")) != "Yes") - return - if(!check_rights(R_FUN)) - message_admins("[usr.key] has attempted to use the Reset Player OOC Color verb!") - log_admin("[key_name(usr)] tried to reset player ooc color without authorization.") + +ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC color to default.", ADMIN_CATEGORY_SERVER) + if(tgui_alert(user, "Are you sure you want to reset the OOC color of all players?", "Reset Player OOC Color", list("Yes", "No")) != "Yes") return - message_admins("[key_name_admin(usr)] has reset the players' ooc color.") - log_admin("[key_name_admin(usr)] has reset player ooc color.") + message_admins("[key_name_admin(user)] has reset the players' ooc color.") + log_admin("[key_name_admin(user)] has reset player ooc color.") GLOB.OOC_COLOR = null //Checks admin notice diff --git a/code/modules/explorer_drone/manager.dm b/code/modules/explorer_drone/manager.dm index 00909d03abf..ee51a2d5db3 100644 --- a/code/modules/explorer_drone/manager.dm +++ b/code/modules/explorer_drone/manager.dm @@ -83,11 +83,6 @@ . = ..() QDEL_NULL(temp_adventure) -/client/proc/adventure_manager() - set category = "Debug" - set name = "Adventure Manager" - - if(!check_rights(R_DEBUG)) - return +ADMIN_VERB(adventure_manager, R_DEBUG, "Adventure Manager", "View and edit adventures.", ADMIN_CATEGORY_DEBUG) var/datum/adventure_browser/browser = new() - browser.ui_interact(usr) + browser.ui_interact(user.mob) diff --git a/code/modules/fishing/admin.dm b/code/modules/fishing/admin.dm index d1d2c0ae2c5..0a9cfc9d51d 100644 --- a/code/modules/fishing/admin.dm +++ b/code/modules/fishing/admin.dm @@ -1,12 +1,6 @@ -// Helper tool to see fishing probabilities with different setups -/datum/admins/proc/fishing_calculator() - set name = "Fishing Calculator" - set category = "Debug" - - if(!check_rights(R_DEBUG)) - return - var/datum/fishing_calculator/ui = new(usr) - ui.ui_interact(usr) +ADMIN_VERB(fishing_calculator, R_DEBUG, "Fishing Calculator", "A calculator... for fishes?", ADMIN_CATEGORY_DEBUG) + var/datum/fishing_calculator/ui = new + ui.ui_interact(user.mob) /datum/fishing_calculator var/list/current_table diff --git a/code/modules/logging/log_holder.dm b/code/modules/logging/log_holder.dm index 20ff2c866b3..85a436076c8 100644 --- a/code/modules/logging/log_holder.dm +++ b/code/modules/logging/log_holder.dm @@ -32,10 +32,8 @@ GLOBAL_REAL(logger, /datum/log_holder) GENERAL_PROTECT_DATUM(/datum/log_holder) -/client/proc/log_viewer_new() - set name = "View Round Logs" - set category = "Admin" - logger.ui_interact(mob) +ADMIN_VERB(log_viewer_new, R_ADMIN|R_DEBUG, "View Round Logs", "View the rounds logs.", ADMIN_CATEGORY_MAIN) + logger.ui_interact(user.mob) /datum/log_holder/ui_interact(mob/user, datum/tgui/ui) if(!check_rights_for(user.client, R_ADMIN)) diff --git a/code/modules/mob/dead/observer/observer_say.dm b/code/modules/mob/dead/observer/observer_say.dm index e3a5ff3cdf0..a8fd0094934 100644 --- a/code/modules/mob/dead/observer/observer_say.dm +++ b/code/modules/mob/dead/observer/observer_say.dm @@ -44,9 +44,9 @@ message = trim_left(copytext_char(message, length(message_mods[RADIO_KEY]) + 2)) switch(message_mods[RADIO_EXTENSION]) if(MODE_ADMIN) - client.cmd_admin_say(message) + SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/cmd_admin_say, message) if(MODE_DEADMIN) - client.dsay(message) + SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/dsay, message) if(MODE_PUPPET) if(!mind.current.say(message)) to_chat(src, span_warning("Your linked body was unable to speak!")) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 4a868962c24..1c4ab380664 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1177,9 +1177,7 @@ admin_ticket_log("[key_name_admin(usr)] has attempted to modify the bodyparts of [src]") if(href_list[VV_HK_MODIFY_ORGANS]) - if(!check_rights(NONE)) - return - usr.client.manipulate_organs(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/manipulate_organs, src) if(href_list[VV_HK_MARTIAL_ART]) if(!check_rights(NONE)) diff --git a/code/modules/mob/living/living_say.dm b/code/modules/mob/living/living_say.dm index 7ff13621b6b..015f6e88555 100644 --- a/code/modules/mob/living/living_say.dm +++ b/code/modules/mob/living/living_say.dm @@ -127,11 +127,11 @@ GLOBAL_LIST_INIT(message_modes_stat_limits, list( return if(message_mods[RADIO_EXTENSION] == MODE_ADMIN) - client?.cmd_admin_say(message) + SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/cmd_admin_say, message) return if(message_mods[RADIO_EXTENSION] == MODE_DEADMIN) - client?.dsay(message) + SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/dsay, message) return // dead is the only state you can never emote diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 9333dffa7f8..f3464d25638 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1474,9 +1474,7 @@ regenerate_icons() if(href_list[VV_HK_PLAYER_PANEL]) - if(!check_rights(NONE)) - return - usr.client.holder.show_player_panel(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/show_player_panel, src) if(href_list[VV_HK_GODMODE]) if(!check_rights(R_ADMIN)) @@ -1484,34 +1482,22 @@ usr.client.cmd_admin_godmode(src) if(href_list[VV_HK_GIVE_MOB_ACTION]) - if(!check_rights(NONE)) - return - usr.client.give_mob_action(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/give_mob_action, src) if(href_list[VV_HK_REMOVE_MOB_ACTION]) - if(!check_rights(NONE)) - return - usr.client.remove_mob_action(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/remove_mob_action, src) if(href_list[VV_HK_GIVE_SPELL]) - if(!check_rights(NONE)) - return - usr.client.give_spell(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/give_spell, src) if(href_list[VV_HK_REMOVE_SPELL]) - if(!check_rights(NONE)) - return - usr.client.remove_spell(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/remove_spell, src) if(href_list[VV_HK_GIVE_DISEASE]) - if(!check_rights(NONE)) - return - usr.client.give_disease(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/give_disease, src) if(href_list[VV_HK_GIB]) - if(!check_rights(R_FUN)) - return - usr.client.cmd_admin_gib(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/gib_them, src) if(href_list[VV_HK_BUILDMODE]) if(!check_rights(R_BUILD)) @@ -1519,19 +1505,13 @@ togglebuildmode(src) if(href_list[VV_HK_DROP_ALL]) - if(!check_rights(NONE)) - return - usr.client.cmd_admin_drop_everything(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/drop_everything, src) if(href_list[VV_HK_DIRECT_CONTROL]) - if(!check_rights(NONE)) - return - usr.client.cmd_assume_direct_control(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/cmd_assume_direct_control, src) if(href_list[VV_HK_GIVE_DIRECT_CONTROL]) - if(!check_rights(NONE)) - return - usr.client.cmd_give_direct_control(src) + return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/cmd_give_direct_control, src) if(href_list[VV_HK_OFFER_GHOSTS]) if(!check_rights(NONE)) diff --git a/code/modules/procedural_mapping/mapGenerator.dm b/code/modules/procedural_mapping/mapGenerator.dm index 420ac9c8d79..58ff5641907 100644 --- a/code/modules/procedural_mapping/mapGenerator.dm +++ b/code/modules/procedural_mapping/mapGenerator.dm @@ -136,40 +136,36 @@ // HERE BE DEBUG DRAGONS // /////////////////////////// -/client/proc/debugNatureMapGenerator() - set name = "Test Nature Map Generator" - set category = "Debug" - +ADMIN_VERB(debug_nature_map_generator, R_DEBUG, "Test Nature Map Generator", "Test the nature map generator", ADMIN_CATEGORY_DEBUG) var/datum/map_generator/nature/N = new() - var/startInput = input(usr, "Start turf of Map, (X;Y;Z)", "Map Gen Settings", "1;1;1") as text|null + var/startInput = input(user, "Start turf of Map, (X;Y;Z)", "Map Gen Settings", "1;1;1") as text|null if (isnull(startInput)) return - var/endInput = input(usr, "End turf of Map (X;Y;Z)", "Map Gen Settings", "[world.maxx];[world.maxy];[mob ? mob.z : 1]") as text|null - + var/endInput = input(user, "End turf of Map (X;Y;Z)", "Map Gen Settings", "[world.maxx];[world.maxy];[user.mob.z]") as text|null if (isnull(endInput)) return //maxx maxy and current z so that if you fuck up, you only fuck up one entire z level instead of the entire universe if(!startInput || !endInput) - to_chat(src, "Missing Input") + to_chat(user, "Missing Input") return var/list/startCoords = splittext(startInput, ";") var/list/endCoords = splittext(endInput, ";") if(!startCoords || !endCoords) - to_chat(src, "Invalid Coords") - to_chat(src, "Start Input: [startInput]") - to_chat(src, "End Input: [endInput]") + to_chat(user, "Invalid Coords") + to_chat(user, "Start Input: [startInput]") + to_chat(user, "End Input: [endInput]") return var/turf/Start = locate(text2num(startCoords[1]),text2num(startCoords[2]),text2num(startCoords[3])) var/turf/End = locate(text2num(endCoords[1]),text2num(endCoords[2]),text2num(endCoords[3])) if(!Start || !End) - to_chat(src, "Invalid Turfs") - to_chat(src, "Start Coords: [startCoords[1]] - [startCoords[2]] - [startCoords[3]]") - to_chat(src, "End Coords: [endCoords[1]] - [endCoords[2]] - [endCoords[3]]") + to_chat(user, "Invalid Turfs") + to_chat(user, "Start Coords: [startCoords[1]] - [startCoords[2]] - [startCoords[3]]") + to_chat(user, "End Coords: [endCoords[1]] - [endCoords[2]] - [endCoords[3]]") return var/static/list/clusters = list( @@ -191,7 +187,7 @@ var/theCluster = 0 if(moduleClusters != "None") if(!clusters[moduleClusters]) - to_chat(src, "Invalid Cluster Flags") + to_chat(user, "Invalid Cluster Flags") return theCluster = clusters[moduleClusters] else @@ -202,9 +198,9 @@ M.clusterCheckFlags = theCluster - to_chat(src, "Defining Region") + to_chat(user, "Defining Region") N.defineRegion(Start, End) - to_chat(src, "Region Defined") - to_chat(src, "Generating Region") + to_chat(user, "Region Defined") + to_chat(user, "Generating Region") N.generate() - to_chat(src, "Generated Region") + to_chat(user, "Generated Region") diff --git a/code/modules/reagents/chemistry/chem_wiki_render.dm b/code/modules/reagents/chemistry/chem_wiki_render.dm index a2ac0af8ffb..99116adc84b 100644 --- a/code/modules/reagents/chemistry/chem_wiki_render.dm +++ b/code/modules/reagents/chemistry/chem_wiki_render.dm @@ -1,10 +1,6 @@ -//Generates a wikitable txt file for use with the wiki - does not support productless reactions at the moment -/client/proc/generate_wikichem_list() - set category = "Debug" - set name = "Parse Wikichems" - +ADMIN_VERB(generate_wikichem_list, R_DEBUG, "Parse Wikichems", "Parse and generate a text file for wikichem.", ADMIN_CATEGORY_DEBUG) //If we're a reaction product - var/prefix_reaction = {"{| class=\"wikitable sortable\" style=\"width:100%; text-align:left; border: 3px solid #FFDD66; cellspacing=0; cellpadding=2; background-color:white;\" + var/static/prefix_reaction = {"{| class=\"wikitable sortable\" style=\"width:100%; text-align:left; border: 3px solid #FFDD66; cellspacing=0; cellpadding=2; background-color:white;\" ! scope=\"col\" style='width:150px; background-color:#FFDD66;'|Name ! scope=\"col\" class=\"unsortable\" style='background-color:#FFDD66;'|Formula ! scope=\"col\" class=\"unsortable\" style='background-color:#FFDD66; width:170px;'|Reaction conditions @@ -13,9 +9,9 @@ |- "} - var/input_text = tgui_input_text(usr, "Input a name of a reagent, or a series of reagents split with a comma (no spaces) to get it's wiki table entry", "Recipe") //95% of the time, the reagent type is a lowercase, no spaces / underscored version of the name + var/input_text = tgui_input_text(user, "Input a name of a reagent, or a series of reagents split with a comma (no spaces) to get it's wiki table entry", "Recipe") //95% of the time, the reagent type is a lowercase, no spaces / underscored version of the name if(!input_text) - to_chat(usr, "Input was blank!") + to_chat(user, "Input was blank!") return text2file(prefix_reaction, "[GLOB.log_directory]/chem_parse.txt") var/list/names = splittext("[input_text]", ",") @@ -23,13 +19,13 @@ for(var/name in names) var/datum/reagent/reagent = find_reagent_object_from_type(get_chem_id(name)) if(!reagent) - to_chat(usr, "Could not find [name]. Skipping.") + to_chat(user, "Could not find [name]. Skipping.") continue //Get reaction var/list/reactions = GLOB.chemical_reactions_list_product_index[reagent.type] if(!length(reactions)) - to_chat(usr, "Could not find [name] reaction! Continuing anyways.") + to_chat(user, "Could not find [name] reaction! Continuing anyways.") var/single_parse = generate_chemwiki_line(reagent, null) text2file(single_parse, "[GLOB.log_directory]/chem_parse.txt") continue @@ -38,8 +34,7 @@ var/single_parse = generate_chemwiki_line(reagent, reaction) text2file(single_parse, "[GLOB.log_directory]/chem_parse.txt") text2file("|}", "[GLOB.log_directory]/chem_parse.txt") //Cap off the table - to_chat(usr, "Done! Saved file to (wherever your root folder is, i.e. where the DME is)/[GLOB.log_directory]/chem_parse.txt OR use the Get Current Logs verb under the Admin tab. (if you click Open, and it does nothing, that's because you've not set a .txt default program! Try downloading it instead, and use that file to set a default program! Have a nice day!") - + to_chat(user, "Done! Saved file to (wherever your root folder is, i.e. where the DME is)/[GLOB.log_directory]/chem_parse.txt OR use the Get Current Logs verb under the Admin tab. (if you click Open, and it does nothing, that's because you've not set a .txt default program! Try downloading it instead, and use that file to set a default program! Have a nice day!") /// Generate the big list of reagent based reactions. /proc/generate_chemwiki_line(datum/reagent/reagent, datum/chemical_reaction/reaction) diff --git a/code/modules/requests/request_manager.dm b/code/modules/requests/request_manager.dm index dd6d8d42a48..74a40304f7a 100644 --- a/code/modules/requests/request_manager.dm +++ b/code/modules/requests/request_manager.dm @@ -163,17 +163,18 @@ GLOBAL_DATUM_INIT(requests, /datum/request_manager, new) switch(action) if ("pp") - var/mob/M = request.owner?.mob - usr.client.holder.show_player_panel(M) + SSadmin_verbs.dynamic_invoke_verb(ui.user, /datum/admin_verb/show_player_panel, request.owner?.mob) return TRUE + if ("vv") var/mob/M = request.owner?.mob usr.client.debug_variables(M) return TRUE + if ("sm") - var/mob/M = request.owner?.mob - usr.client.cmd_admin_subtle_message(M) + SSadmin_verbs.dynamic_invoke_verb(ui.user, /datum/admin_verb/cmd_admin_subtle_message, request.owner?.mob) return TRUE + if ("flw") var/mob/M = request.owner?.mob usr.client.admin_follow(M) @@ -192,8 +193,9 @@ GLOBAL_DATUM_INIT(requests, /datum/request_manager, new) D.traitor_panel() return TRUE else - usr.client.holder.show_traitor_panel(M) + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/show_traitor_panel, M) return TRUE + if ("logs") var/mob/M = request.owner?.mob if(!ismob(M)) @@ -201,16 +203,11 @@ GLOBAL_DATUM_INIT(requests, /datum/request_manager, new) return TRUE show_individual_logging_panel(M, null, null) return TRUE + if ("smite") - if(!check_rights(R_FUN)) - to_chat(usr, "Insufficient permissions to smite, you require +FUN", confidential = TRUE) - return TRUE - var/mob/living/carbon/human/H = request.owner?.mob - if (!H || !istype(H)) - to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human", confidential = TRUE) - return TRUE - usr.client.smite(H) + SSadmin_verbs.dynamic_invoke_verb(ui.user, /datum/admin_verb/admin_smite, request.owner?.mob) return TRUE + if ("rply") if (request.req_type == REQUEST_PRAYER) to_chat(usr, "Cannot reply to a prayer", confidential = TRUE) diff --git a/code/modules/tgui_input/say_modal/speech.dm b/code/modules/tgui_input/say_modal/speech.dm index 7797e44afb1..9ed87be111a 100644 --- a/code/modules/tgui_input/say_modal/speech.dm +++ b/code/modules/tgui_input/say_modal/speech.dm @@ -45,7 +45,7 @@ client.ooc(entry) return TRUE if(ADMIN_CHANNEL) - client.cmd_admin_say(entry) + SSadmin_verbs.dynamic_invoke_verb(client, /datum/admin_verb/cmd_admin_say, entry) return TRUE // NOVA EDIT ADDITION START - CUSTOMIZATION if(LOOC_CHANNEL) diff --git a/code/modules/transport/admin.dm b/code/modules/transport/admin.dm index 9d68d967e60..63f1fbfd55a 100644 --- a/code/modules/transport/admin.dm +++ b/code/modules/transport/admin.dm @@ -1,23 +1,14 @@ -/** - * Helper tool to try and resolve tram controller errors, or reset the contents if someone put a million chickens on the tram - * and now it's slow as hell and lagging things. - */ -/datum/admins/proc/reset_tram() - set name = "Reset Tram" - set category = "Debug" +ADMIN_VERB(reset_tram, R_DEBUG|R_ADMIN, "Reset Tram", "Reset a tram controller or its contents.", ADMIN_CATEGORY_DEBUG) var/static/list/debug_tram_list = list( - TRAMSTATION_LINE_1, - BIRDSHOT_LINE_1, - BIRDSHOT_LINE_2, - HILBERT_LINE_1, + TRAMSTATION_LINE_1, + BIRDSHOT_LINE_1, + BIRDSHOT_LINE_2, + HILBERT_LINE_1, ) - if(!check_rights(R_DEBUG)) - return - var/datum/transport_controller/linear/tram/broken_controller - var/selected_transport_id = tgui_input_list(usr, "Which tram?", "Off the rails", debug_tram_list) - var/reset_type = tgui_input_list(usr, "How hard of a reset?", "How bad is it screwed up", list("Clear Tram Contents", "Controller", "Controller and Contents", "Delete Datum", "Cancel")) + var/selected_transport_id = tgui_input_list(user, "Which tram?", "Off the rails", debug_tram_list) + var/reset_type = tgui_input_list(user, "How hard of a reset?", "How bad is it screwed up", list("Clear Tram Contents", "Controller", "Controller and Contents", "Delete Datum", "Cancel")) if(isnull(reset_type) || reset_type == "Cancel") return @@ -28,40 +19,40 @@ break if(isnull(broken_controller)) - to_chat(usr, span_warning("Couldn't find a transport controller datum with ID [selected_transport_id]!")) + to_chat(user, span_warning("Couldn't find a transport controller datum with ID [selected_transport_id]!")) return switch(reset_type) if("Clear Tram Contents") - var/selection = tgui_alert(usr, "Include player mobs in the clearing?", "Contents reset [selected_transport_id]", list("Contents", "Contents and Players", "Cancel")) + var/selection = tgui_alert(user, "Include player mobs in the clearing?", "Contents reset [selected_transport_id]", list("Contents", "Contents and Players", "Cancel")) switch(selection) if("Contents") broken_controller.reset_lift_contents(foreign_objects = TRUE, foreign_non_player_mobs = TRUE, consider_player_mobs = FALSE) - message_admins("[key_name_admin(usr)] performed a contents reset of tram ID [selected_transport_id].") - log_transport("TC: [selected_transport_id]: [key_name_admin(usr)] performed a contents reset.") + message_admins("[key_name_admin(user)] performed a contents reset of tram ID [selected_transport_id].") + log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a contents reset.") if("Contents and Players") broken_controller.reset_lift_contents(foreign_objects = TRUE, foreign_non_player_mobs = TRUE, consider_player_mobs = TRUE) - message_admins("[key_name_admin(usr)] performed a contents and player mob reset of tram ID [selected_transport_id].") - log_transport("TC: [selected_transport_id]: [key_name_admin(usr)] performed a contents and player mob reset.") + message_admins("[key_name_admin(user)] performed a contents and player mob reset of tram ID [selected_transport_id].") + log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a contents and player mob reset.") else return if("Controller") - log_transport("TC: [selected_transport_id]: [key_name_admin(usr)] performed a controller reset, force operational.") - message_admins("[key_name_admin(usr)] performed a controller reset of tram ID [selected_transport_id].") + log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a controller reset, force operational.") + message_admins("[key_name_admin(user)] performed a controller reset of tram ID [selected_transport_id].") broken_controller.set_operational(TRUE) broken_controller.reset_position() if("Controller and Contents") - var/selection = tgui_alert(usr, "Include player mobs in the clearing?", "Contents reset [selected_transport_id]", list("Contents", "Contents and Players", "Cancel")) + var/selection = tgui_alert(user, "Include player mobs in the clearing?", "Contents reset [selected_transport_id]", list("Contents", "Contents and Players", "Cancel")) switch(selection) if("Contents") - message_admins("[key_name_admin(usr)] performed a contents and controller reset of tram ID [selected_transport_id].") - log_transport("TC: [selected_transport_id]: [key_name_admin(usr)] performed a contents reset. Controller reset, force operational.") + message_admins("[key_name_admin(user)] performed a contents and controller reset of tram ID [selected_transport_id].") + log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a contents reset. Controller reset, force operational.") broken_controller.reset_lift_contents(foreign_objects = TRUE, foreign_non_player_mobs = TRUE, consider_player_mobs = FALSE) if("Contents and Players") - message_admins("[key_name_admin(usr)] performed a contents/player/controller reset of tram ID [selected_transport_id].") - log_transport("TC: [selected_transport_id]: [key_name_admin(usr)] performed a contents and player mob reset. Controller reset, force operational.") + message_admins("[key_name_admin(user)] performed a contents/player/controller reset of tram ID [selected_transport_id].") + log_transport("TC: [selected_transport_id]: [key_name_admin(user)] performed a contents and player mob reset. Controller reset, force operational.") broken_controller.reset_lift_contents(foreign_objects = TRUE, foreign_non_player_mobs = TRUE, consider_player_mobs = TRUE) else return @@ -70,7 +61,7 @@ broken_controller.reset_position() if("Delete Datum") - var/confirm = tgui_alert(usr, "Deleting [selected_transport_id] will make it unrecoverable this round. Are you sure?", "Delete tram ID [selected_transport_id]", list("Yes", "Cancel")) + var/confirm = tgui_alert(user, "Deleting [selected_transport_id] will make it unrecoverable this round. Are you sure?", "Delete tram ID [selected_transport_id]", list("Yes", "Cancel")) if(confirm != "Yes") return @@ -82,4 +73,4 @@ broken_controller.cycle_doors(CYCLE_OPEN, BYPASS_DOOR_CHECKS) broken_controller.estop() qdel(broken_controller) - message_admins("[key_name_admin(usr)] performed a datum delete of tram ID [selected_transport_id].") + message_admins("[key_name_admin(user)] performed a datum delete of tram ID [selected_transport_id].") diff --git a/code/modules/wiremod/core/admin_panel.dm b/code/modules/wiremod/core/admin_panel.dm index 74e72ad5efe..9a262cb5e4c 100644 --- a/code/modules/wiremod/core/admin_panel.dm +++ b/code/modules/wiremod/core/admin_panel.dm @@ -1,10 +1,7 @@ -/// An admin verb to view all circuits, plus useful information -/datum/admins/proc/view_all_circuits() - set category = "Admin.Game" - set name = "View All Circuits" +ADMIN_VERB(view_all_circuits, R_ADMIN, "View All Circuits", "List all circuits in the game.", ADMIN_CATEGORY_GAME) var/static/datum/circuit_admin_panel/circuit_admin_panel = new - circuit_admin_panel.ui_interact(usr) + circuit_admin_panel.ui_interact(user.mob) /datum/circuit_admin_panel @@ -66,9 +63,10 @@ usr.client?.debug_variables(circuit) if ("open_circuit") circuit.ui_interact(usr) + if ("open_player_panel") var/datum/mind/inserter = circuit.inserter_mind?.resolve() - usr.client?.holder?.show_player_panel(inserter?.current) + SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/show_player_panel, inserter?.current) return TRUE diff --git a/code/modules/wiremod/core/duplicator.dm b/code/modules/wiremod/core/duplicator.dm index 2f248d11a89..25e83326804 100644 --- a/code/modules/wiremod/core/duplicator.dm +++ b/code/modules/wiremod/core/duplicator.dm @@ -220,30 +220,24 @@ GLOBAL_LIST_INIT(circuit_dupe_whitelisted_types, list( rel_x = component_data["rel_x"] rel_y = component_data["rel_y"] -/client/proc/load_circuit() - set name = "Load Circuit" - set category = "Admin.Fun" - - if(!check_rights(R_VAREDIT)) - return - +ADMIN_VERB(load_circuit, R_VAREDIT, "Load Circuit", "Loads a circuit from a file or direct input.", ADMIN_CATEGORY_FUN) var/list/errors = list() - var/option = alert(usr, "Load by file or direct input?", "Load by file or string", "File", "Direct Input") + var/option = alert(user, "Load by file or direct input?", "Load by file or string", "File", "Direct Input") var/txt switch(option) if("File") - txt = file2text(input(usr, "Input File") as null|file) + txt = file2text(input(user, "Input File") as null|file) if("Direct Input") - txt = input(usr, "Input JSON", "Input JSON") as text|null + txt = input(user, "Input JSON", "Input JSON") as text|null if(!txt) return - var/obj/item/integrated_circuit/loaded/circuit = new(mob.drop_location()) + var/obj/item/integrated_circuit/loaded/circuit = new(user.mob.drop_location()) circuit.load_circuit_data(txt, errors) if(length(errors)) - to_chat(src, span_warning("The following errors were found whilst compiling the circuit data:")) + to_chat(user, span_warning("The following errors were found whilst compiling the circuit data:")) for(var/error in errors) - to_chat(src, span_warning(error)) + to_chat(user, span_warning(error)) diff --git a/modular_nova/master_files/code/modules/admin/admin.dm b/modular_nova/master_files/code/modules/admin/admin.dm index 951f3a87839..350d37ccdb8 100644 --- a/modular_nova/master_files/code/modules/admin/admin.dm +++ b/modular_nova/master_files/code/modules/admin/admin.dm @@ -1,9 +1,6 @@ GLOBAL_VAR_INIT(dchat_allowed, TRUE) -/datum/admins/proc/toggledchat() - set category = "Server" - set desc = "Toggle dis bitch" - set name = "Toggle Dead Chat" +ADMIN_VERB(toggledchat, R_ADMIN, "Toggle Dead Chat", "Toggle dis bitch.", ADMIN_CATEGORY_SERVER) toggle_dchat() log_admin("[key_name(usr)] toggled dead chat.") message_admins("[key_name_admin(usr)] toggled dead chat.") diff --git a/modular_nova/modules/admin/code/aooc.dm b/modular_nova/modules/admin/code/aooc.dm index b679f5c8e0d..b3bfb8be52e 100644 --- a/modular_nova/modules/admin/code/aooc.dm +++ b/modular_nova/modules/admin/code/aooc.dm @@ -102,9 +102,7 @@ GLOBAL_LIST_EMPTY(ckey_to_aooc_name) var/client/iterated_client = iterated_listener to_chat(iterated_client, span_oocplain("The AOOC channel has been globally [GLOB.aooc_allowed ? "enabled" : "disabled"].")) -/datum/admins/proc/toggleaooc() - set category = "Server" - set name = "Toggle Antag OOC" +ADMIN_VERB(toggleaooc, R_ADMIN, "Toggle Antag OOC", "Toggles Antag OOC.", ADMIN_CATEGORY_SERVER) toggle_aooc() log_admin("[key_name(usr)] toggled Antagonist OOC.") message_admins("[key_name_admin(usr)] toggled Antagonist OOC.") diff --git a/modular_nova/modules/admin/code/fix_chat.dm b/modular_nova/modules/admin/code/fix_chat.dm index e82c3cf73d7..ac764376239 100644 --- a/modular_nova/modules/admin/code/fix_chat.dm +++ b/modular_nova/modules/admin/code/fix_chat.dm @@ -1,6 +1,5 @@ +ADMIN_VERB(fix_say, R_ADMIN, "Fix say", "Fix say for the players.", ADMIN_CATEGORY_MAIN) /client/proc/fix_say() - set name = "Fix say for players" - set category = "Admin" for(var/player in GLOB.player_list) if(!isnull(player)) continue diff --git a/modular_nova/modules/admin/code/loud_say.dm b/modular_nova/modules/admin/code/loud_say.dm index 43b701fed5e..77940b379d0 100644 --- a/modular_nova/modules/admin/code/loud_say.dm +++ b/modular_nova/modules/admin/code/loud_say.dm @@ -1,22 +1,16 @@ -/client/proc/cmd_loud_admin_say(msg as text) - set category = "Admin" - set name = "loudAsay" - set hidden = TRUE - if(!check_rights(0)) - return - +ADMIN_VERB(cmd_loud_admin_say, R_NONE, "loudAsay", "Send a message to other admins (loudly).", ADMIN_CATEGORY_MAIN, msg as text) msg = emoji_parse(copytext_char(sanitize(msg), 1, MAX_MESSAGE_LEN)) if(!msg) return msg = emoji_parse(msg) - mob.log_talk(msg, LOG_ASAY) + user.mob.log_talk(msg, LOG_ASAY) - send_asay_to_other_server(ckey, span_command_headset(msg)) + send_asay_to_other_server(user.ckey, span_command_headset(msg)) msg = keywords_lookup(msg) - var/custom_asay_color = (CONFIG_GET(flag/allow_admin_asaycolor) && prefs?.read_preference(/datum/preference/color/asay_color)) ? "" : "" - msg = span_command_headset("ADMIN: [key_name(usr, 1)] [ADMIN_FLW(mob)]: [custom_asay_color][msg][custom_asay_color ? "":null]") + var/custom_asay_color = (CONFIG_GET(flag/allow_admin_asaycolor) && user.mob.client?.prefs?.read_preference(/datum/preference/color/asay_color)) ? "" : "" + msg = span_command_headset("ADMIN: [key_name(user, 1)] [ADMIN_FLW(user.mob)]: [custom_asay_color][msg][custom_asay_color ? "":null]") to_chat(GLOB.admins, type = MESSAGE_TYPE_ADMINCHAT, diff --git a/modular_nova/modules/admin/code/player_ranks.dm b/modular_nova/modules/admin/code/player_ranks.dm index 4c3f4bd9a43..95962d89f41 100644 --- a/modular_nova/modules/admin/code/player_ranks.dm +++ b/modular_nova/modules/admin/code/player_ranks.dm @@ -1,14 +1,8 @@ /// The list of the available special player ranks -#define SKYRAT_PLAYER_RANKS list("Donator", "Mentor", "Veteran") +#define NOVA_PLAYER_RANKS list("Donator", "Mentor", "Veteran") +ADMIN_VERB(manage_player_ranks, R_PERMISSIONS, "Manage Player Ranks", "Manage who has the special player ranks while the server is running.", ADMIN_CATEGORY_MAIN) /client/proc/manage_player_ranks() - set category = "Admin" - set name = "Manage Player Ranks" - set desc = "Manage who has the special player ranks while the server is running." - - if(!check_rights(R_PERMISSIONS)) - return - usr.client?.holder.manage_player_ranks() /// Proc for admins to change people's "player" ranks (donator, mentor, veteran, etc.) @@ -19,8 +13,8 @@ if(!check_rights(R_PERMISSIONS)) return - var/choice = tgui_alert(usr, "Which rank would you like to manage?", "Manage Player Ranks", SKYRAT_PLAYER_RANKS) - if(!choice || !(choice in SKYRAT_PLAYER_RANKS)) + var/choice = tgui_alert(usr, "Which rank would you like to manage?", "Manage Player Ranks", NOVA_PLAYER_RANKS) + if(!choice || !(choice in NOVA_PLAYER_RANKS)) return manage_player_rank_in_group(choice) @@ -37,7 +31,7 @@ if(IsAdminAdvancedProcCall()) return - if(!(group in SKYRAT_PLAYER_RANKS)) + if(!(group in NOVA_PLAYER_RANKS)) CRASH("[key_name(usr)] attempted to add someone to an invalid \"[group]\" group.") var/group_title = LOWER_TEXT(group) @@ -85,17 +79,8 @@ return - -/client/proc/migrate_player_ranks() - set category = "Debug" - set name = "Migrate Player Ranks" - set desc = "Individually migrate the various player ranks from their legacy system to the SQL-based one." - - if(!check_rights(R_PERMISSIONS | R_DEBUG | R_SERVER)) - return - - usr.client?.holder.migrate_player_ranks() - +ADMIN_VERB(migrate_player_ranks, R_PERMISSIONS|R_DEBUG|R_SERVER, "Migrate Player Ranks", "Individually migrate the various player ranks from their legacy system to the SQL-based one.", ADMIN_CATEGORY_DEBUG) + user.mob.client?.holder.migrate_player_ranks() /datum/admins/proc/migrate_player_ranks() if(IsAdminAdvancedProcCall()) @@ -107,8 +92,8 @@ if(!CONFIG_GET(flag/sql_enabled)) return - var/choice = tgui_alert(usr, "Which rank would you like to migrate?", "Migrate Player Ranks", SKYRAT_PLAYER_RANKS) - if(!choice || !(choice in SKYRAT_PLAYER_RANKS)) + var/choice = tgui_alert(usr, "Which rank would you like to migrate?", "Migrate Player Ranks", NOVA_PLAYER_RANKS) + if(!choice || !(choice in NOVA_PLAYER_RANKS)) return if(tgui_alert(usr, "Are you sure that you would like to migrate [choice]s to the SQL-based system?", "Migrate Player Ranks", list("Yes", "No")) != "Yes") @@ -118,4 +103,4 @@ SSplayer_ranks.migrate_player_rank_to_sql(usr.client, choice) -#undef SKYRAT_PLAYER_RANKS +#undef NOVA_PLAYER_RANKS diff --git a/modular_nova/modules/admin/code/sooc.dm b/modular_nova/modules/admin/code/sooc.dm index 9c60d2347db..051391d658c 100644 --- a/modular_nova/modules/admin/code/sooc.dm +++ b/modular_nova/modules/admin/code/sooc.dm @@ -104,9 +104,7 @@ GLOBAL_LIST_EMPTY(ckey_to_sooc_name) var/client/iterated_client = iterated_listener to_chat(iterated_client, span_oocplain("The SOOC channel has been globally [GLOB.sooc_allowed ? "enabled" : "disabled"].")) -/datum/admins/proc/togglesooc() - set category = "Server" - set name = "Toggle Security OOC" +ADMIN_VERB(togglesooc, R_ADMIN, "Toggle Security OOC", "Toggles Security OOC.", ADMIN_CATEGORY_SERVER) toggle_sooc() log_admin("[key_name(usr)] toggled Security OOC.") message_admins("[key_name_admin(usr)] toggled Security OOC.") diff --git a/modular_nova/modules/automapper/code/area_spawn_subsystem.dm b/modular_nova/modules/automapper/code/area_spawn_subsystem.dm index 2d50b17c471..26961395d2d 100644 --- a/modular_nova/modules/automapper/code/area_spawn_subsystem.dm +++ b/modular_nova/modules/automapper/code/area_spawn_subsystem.dm @@ -358,11 +358,7 @@ SUBSYSTEM_DEF(area_spawn) /** * Show overlay over area of priorities. Wall priority over open priority. */ -/client/proc/test_area_spawner(area/area) - set category = "Debug" - set name = "Test Area Spawner" - set desc = "Show area spawner placement candidates as an overlay." - +ADMIN_VERB(test_area_spawner, R_DEBUG, "Test Area Spawner", "Show area spawner placement candidates as an overlay.", ADMIN_CATEGORY_DEBUG, area/area) for(var/list/zlevel_turfs as anything in area.get_zlevel_turf_lists()) for(var/turf/area_turf as anything in zlevel_turfs) for(var/obj/effect/turf_test/old_test in area_turf) diff --git a/modular_nova/modules/bsa_overhaul/code/admin_verb.dm b/modular_nova/modules/bsa_overhaul/code/admin_verb.dm index aa0082ad244..f0d731c4579 100644 --- a/modular_nova/modules/bsa_overhaul/code/admin_verb.dm +++ b/modular_nova/modules/bsa_overhaul/code/admin_verb.dm @@ -1,10 +1,6 @@ -/client/proc/toggle_bsa() - set category = "Admin.Fun" - set name = "Toggle BSA Control" - set desc = "Toggles the BSA control lock on and off." - +ADMIN_VERB(toggle_bsa, R_ADMIN, "Toggle BSA Control", "Toggles the BSA control lock on and off.", ADMIN_CATEGORY_FUN) GLOB.bsa_unlock = !GLOB.bsa_unlock minor_announce("Bluespace Artillery firing protocols have been [GLOB.bsa_unlock? "unlocked" : "locked"]", "Weapons Systems Update:") message_admins("[ADMIN_LOOKUPFLW(usr)] [GLOB.bsa_unlock? "unlocked" : "locked"] BSA firing protocols.") - log_admin("[key_name(usr)] [GLOB.bsa_unlock? "unlocked" : "locked"] BSA firing protocols.") + log_admin("[key_name(user)] [GLOB.bsa_unlock? "unlocked" : "locked"] BSA firing protocols.") diff --git a/modular_nova/modules/decay_subsystem/code/spawn_nest.dm b/modular_nova/modules/decay_subsystem/code/spawn_nest.dm index 5ab0c9a713b..9227b8582b2 100644 --- a/modular_nova/modules/decay_subsystem/code/spawn_nest.dm +++ b/modular_nova/modules/decay_subsystem/code/spawn_nest.dm @@ -1,9 +1,5 @@ -/client/proc/spawn_mob_spawner() - set category = "Admin.Fun" - set name = "Spawn mob spawner" - set desc = "Spawns a mob spawner structure below the user." - - holder?.spawn_mob_spawner() +ADMIN_VERB(spawn_mob_spawner, R_ADMIN, "Spawn mob spawner", "Spawns a mob spawner structure at your location.", ADMIN_CATEGORY_FUN) + user.holder?.spawn_mob_spawner() /datum/admins/proc/spawn_mob_spawner(chosen_mob as text) if(!check_rights(R_SPAWN)) diff --git a/modular_nova/modules/delam_emergency_stop/code/admin_scram.dm b/modular_nova/modules/delam_emergency_stop/code/admin_scram.dm index fc338d7b214..0d4a99627c3 100644 --- a/modular_nova/modules/delam_emergency_stop/code/admin_scram.dm +++ b/modular_nova/modules/delam_emergency_stop/code/admin_scram.dm @@ -1,12 +1,7 @@ /// Lets an admin activate the delam suppression system -/client/proc/try_stop_delam() - set name = "Delam Emergency Stop" - set category = "Admin.Events" +ADMIN_VERB(try_stop_delam, R_ADMIN, "Delam Emergency Stop", "Activate the delam suppression system.", ADMIN_CATEGORY_EVENTS) var/obj/machinery/atmospherics/components/unary/delam_scram/suppression_system = null - if(!holder || !check_rights(R_FUN)) - return - suppression_system = validate_suppression_status() if(!suppression_system) @@ -14,19 +9,19 @@ // Warn them if they're intervening in the work of God if(world.time - SSticker.round_start_time < 30 MINUTES) - var/go_early = tgui_alert(usr, "The [suppression_system.name] is set to automatically start at the programmed time. \ + var/go_early = tgui_alert(user, "The [suppression_system.name] is set to automatically start at the programmed time. \ Are you sure you want to override this and fire it early? It's less scary that way.", "Suffering premature delamination?", list("No", "Yes")) if(go_early != "Yes") return FALSE - var/double_check = tgui_alert(usr, "You really sure that you want to push this?", "Reticulating Splines", list("No", "Yes")) + var/double_check = tgui_alert(user, "You really sure that you want to push this?", "Reticulating Splines", list("No", "Yes")) if(double_check != "Yes") return FALSE // Send the signal to start, unlock the temp emergency exits - log_admin("[key_name_admin(usr)] started a supermatter emergency stop!") - message_admins("[ADMIN_LOOKUPFLW(usr)] started a supermatter emergency stop! [ADMIN_COORDJMP(suppression_system)]") - suppression_system.investigate_log("[key_name_admin(usr)] started a supermatter emergency stop!", INVESTIGATE_ATMOS) + log_admin("[key_name_admin(user)] started a supermatter emergency stop!") + message_admins("[ADMIN_LOOKUPFLW(user)] started a supermatter emergency stop! [ADMIN_COORDJMP(suppression_system)]") + suppression_system.investigate_log("[key_name_admin(user)] started a supermatter emergency stop!", INVESTIGATE_ATMOS) SEND_GLOBAL_SIGNAL(COMSIG_MAIN_SM_DELAMINATING, DIVINE_INTERVENTION) for(var/obj/machinery/door/airlock/escape_route in range(14, suppression_system)) // a little more space here due to positioning if(istype(escape_route, /obj/machinery/door/airlock/command)) @@ -34,13 +29,10 @@ INVOKE_ASYNC(escape_route, TYPE_PROC_REF(/obj/machinery/door/airlock, temp_emergency_exit), 45 SECONDS) /// Lets admins disable/enable the delam suppression system -/client/proc/toggle_delam_suppression() - set name = "Delam Suppression Toggle" - set category = "Admin.Events" - - if(!holder || !check_rights(R_FUN)) - return +ADMIN_VERB(toggle_delam_suppression, R_FUN, "Delam Suppression Toggle", "Disable/enable the delam suppression system.", ADMIN_CATEGORY_EVENTS) + user.mob.client?.toggle_delam_suppression() +/client/proc/toggle_delam_suppression() var/obj/machinery/atmospherics/components/unary/delam_scram/suppression_system = validate_suppression_status() if(!suppression_system) diff --git a/modular_nova/modules/events/code/event_spawner_menu.dm b/modular_nova/modules/events/code/event_spawner_menu.dm index 68f552443cd..6cfaf9619e6 100644 --- a/modular_nova/modules/events/code/event_spawner_menu.dm +++ b/modular_nova/modules/events/code/event_spawner_menu.dm @@ -366,13 +366,7 @@ ShowPanel(usr, null) return -/client/proc/admin_open_event_spawners_menu() - set category = "Admin.Events" - set name = "Event Spawners Menu" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(admin_open_event_spawners_menu, R_ADMIN, "Event Spawners Menu", "Event Spawners Menu.", ADMIN_CATEGORY_EVENTS) var/datum/event_spawner_manager/ESM = GLOB.event_spawner_manager ESM.ShowPanel(usr, null) diff --git a/modular_nova/modules/ices_events/code/ICES_tgui.dm b/modular_nova/modules/ices_events/code/ICES_tgui.dm index fb4c04a3678..6d28556209d 100644 --- a/modular_nova/modules/ices_events/code/ICES_tgui.dm +++ b/modular_nova/modules/ices_events/code/ICES_tgui.dm @@ -1,12 +1,6 @@ ///Allows an admin to open the panel -/client/proc/intensity_credits_panel() - set name = "ICES Events Panel" - set category = "Admin.Events" - - if(!holder || !check_rights(R_FUN)) - return - - holder.intensity_credits_panel() +ADMIN_VERB(intensity_credits_panel, R_FUN, "ICES Events Panel", "Opens up the ICES panel.", ADMIN_CATEGORY_EVENTS) + user.holder?.intensity_credits_panel() ///Opens up the ICES panel /datum/admins/proc/intensity_credits_panel() diff --git a/modular_nova/modules/interaction_menu/code/interaction_datum.dm b/modular_nova/modules/interaction_menu/code/interaction_datum.dm index 472fa668807..38460d4a613 100644 --- a/modular_nova/modules/interaction_menu/code/interaction_datum.dm +++ b/modular_nova/modules/interaction_menu/code/interaction_datum.dm @@ -292,11 +292,5 @@ GLOBAL_LIST_EMPTY_TYPED(interaction_instances, /datum/interaction) GLOB.interaction_instances[iname] = interaction -/client/proc/reload_interactions() - set category = "Debug" - set name = "Reload Interactions" - set desc = "Force reload interactions" - if(!check_rights(R_DEBUG)) - return - +ADMIN_VERB(reload_interactions, R_DEBUG, "Reload Interactions", "Force reload interactions.", ADMIN_CATEGORY_DEBUG) populate_interaction_instances() diff --git a/modular_nova/modules/liquids/code/liquid_systems/liquid_controller.dm b/modular_nova/modules/liquids/code/liquid_systems/liquid_controller.dm index ed462fceaf5..b53cbc3bf04 100644 --- a/modular_nova/modules/liquids/code/liquid_systems/liquid_controller.dm +++ b/modular_nova/modules/liquids/code/liquid_systems/liquid_controller.dm @@ -112,10 +112,5 @@ SUBSYSTEM_DEF(liquids) if(T.lgroup) T.lgroup.amount_of_active_turfs-- -/client/proc/toggle_liquid_debug() - set category = "Debug" - set name = "Liquid Groups Color Debug" - set desc = "Liquid Groups Color Debug." - if(!holder) - return +ADMIN_VERB(toggle_liquid_debug, R_DEBUG, "Liquid Groups Color Debug", "Liquid Groups Color Debug.", ADMIN_CATEGORY_DEBUG) GLOB.liquid_debug_colors = !GLOB.liquid_debug_colors diff --git a/modular_nova/modules/liquids/code/tools.dm b/modular_nova/modules/liquids/code/tools.dm index 1ee43b78a37..c55e3ffa7cf 100644 --- a/modular_nova/modules/liquids/code/tools.dm +++ b/modular_nova/modules/liquids/code/tools.dm @@ -1,12 +1,8 @@ -/client/proc/spawn_liquid() - set category = "Admin.Fun" - set name = "Spawn Liquid" - set desc = "Spawns an amount of chosen liquid at your current location." - +ADMIN_VERB(spawn_liquid, R_ADMIN, "Spawn Liquid", "Spawns an amount of chosen liquid at your current location.", ADMIN_CATEGORY_FUN) var/choice var/valid_id while(!valid_id) - choice = tgui_input_text(usr, "Enter the ID of the reagent you want to add.", "Search reagents") + choice = tgui_input_text(user, "Enter the ID of the reagent you want to add.", "Search reagents") if(isnull(choice)) //Get me out of here! break if (!ispath(text2path(choice))) @@ -16,26 +12,22 @@ else valid_id = TRUE if(!valid_id) - to_chat(usr, span_warning("A reagent with that ID doesn't exist!")) + to_chat(user, span_warning("A reagent with that ID doesn't exist!")) if(!choice) return - var/volume = tgui_input_number(usr, "Volume:", "Choose volume") + var/volume = tgui_input_number(user, "Volume:", "Choose volume") if(!volume) return - var/turf/epicenter = get_turf(mob) + var/turf/epicenter = get_turf(user.mob) epicenter.add_liquid(choice, volume) - message_admins("[ADMIN_LOOKUPFLW(usr)] spawned liquid at [epicenter.loc] ([choice] - [volume]).") - log_admin("[key_name(usr)] spawned liquid at [epicenter.loc] ([choice] - [volume]).") - -/client/proc/remove_liquid(turf/epicenter in world) - set name = "Remove Liquids" - set category = "Admin.Game" - set desc = "Fixes air in specified radius." + message_admins("[ADMIN_LOOKUPFLW(user)] spawned liquid at [epicenter.loc] ([choice] - [volume]).") + log_admin("[key_name(user)] spawned liquid at [epicenter.loc] ([choice] - [volume]).") - var/range = tgui_input_number(usr, "Enter range:", "Range selection", 2) +ADMIN_VERB_AND_CONTEXT_MENU(remove_liquid, R_ADMIN, "Remove liquids", "Removes all liquids in specified radius.", ADMIN_CATEGORY_GAME, turf/epicenter in world) + var/range = tgui_input_number(user, "Enter range:", "Range selection", 2) for(var/obj/effect/abstract/liquid_turf/liquid in range(range, epicenter)) qdel(liquid, TRUE) - message_admins("[key_name_admin(usr)] removed liquids with range [range] in [epicenter.loc.name]") - log_game("[key_name_admin(usr)] removed liquids with range [range] in [epicenter.loc.name]") + message_admins("[key_name_admin(user)] removed liquids with range [range] in [epicenter.loc.name]") + log_game("[key_name_admin(user)] removed liquids with range [range] in [epicenter.loc.name]") diff --git a/modular_nova/modules/lorecaster/code/story_manager.dm b/modular_nova/modules/lorecaster/code/story_manager.dm index 0ddcd23c83d..7c28a336365 100644 --- a/modular_nova/modules/lorecaster/code/story_manager.dm +++ b/modular_nova/modules/lorecaster/code/story_manager.dm @@ -1,10 +1,5 @@ +ADMIN_VERB(lorecaster_story_manager, R_ADMIN, "Lorecaster Stories", "Open the Lorecaster Story Manager.", ADMIN_CATEGORY_EVENTS) /client/proc/lorecaster_story_manager() - set category = "Admin.Events" - set name = "Lorecaster Stories" - - if(!check_rights(R_ADMIN)) - return - var/datum/story_manager_interface/ui = new(usr) ui.ui_interact(usr) diff --git a/modular_nova/modules/oneclickantag/code/oneclickantag.dm b/modular_nova/modules/oneclickantag/code/oneclickantag.dm index dac87f762cf..4bcac3ff422 100644 --- a/modular_nova/modules/oneclickantag/code/oneclickantag.dm +++ b/modular_nova/modules/oneclickantag/code/oneclickantag.dm @@ -38,14 +38,8 @@ return FALSE return TRUE -/client/proc/one_click_antag() - set name = "Create Antagonist" - set desc = "Auto-create an antagonist of your choice" - set category = "Admin.Events" - - if(holder) - holder.one_click_antag() - return +ADMIN_VERB(one_click_antag, R_ADMIN, "Create Antagonist", "Auto-create an antagonist of your choice", ADMIN_CATEGORY_EVENTS) + user.holder?.one_click_antag() /** If anyone can figure out how to get Obsessed to work I would be very appreciative. diff --git a/modular_nova/modules/opposing_force/code/admin_procs.dm b/modular_nova/modules/opposing_force/code/admin_procs.dm index 379a1de08cb..f91b4821874 100644 --- a/modular_nova/modules/opposing_force/code/admin_procs.dm +++ b/modular_nova/modules/opposing_force/code/admin_procs.dm @@ -1,19 +1,15 @@ -/client/proc/request_more_opfor() - set category = "Admin.Fun" - set name = "Request OPFOR" - set desc = "Request players sign up for opfor if they have antag on." - +ADMIN_VERB(request_more_opfor, R_FUN, "Request OPFOR", "Request players sign up for opfor if they have antag on.", ADMIN_CATEGORY_FUN) var/asked = 0 for(var/mob/living/carbon/human/human in GLOB.alive_player_list) if(human.client?.prefs?.read_preference(/datum/preference/toggle/be_antag)) to_chat(human, examine_block(span_greentext("The admins are looking for OPFOR players, if you're interested, sign up in the OOC tab!"))) asked++ - message_admins("[ADMIN_LOOKUP(usr)] has requested more OPFOR players! (Asked: [asked] players)") + message_admins("[ADMIN_LOOKUP(user)] has requested more OPFOR players! (Asked: [asked] players)") +ADMIN_VERB(view_opfors, R_ADMIN, "View OPFORs", "View OPFORs.", ADMIN_CATEGORY_GAME) + user.mob.client?.view_opfors() /client/proc/view_opfors() - set name = "View OPFORs" - set category = "Admin.Game" if(holder) var/list/dat = list("") dat += SSopposing_force.get_check_antag_listing() diff --git a/modular_nova/modules/panicbunker/code/panicbunker.dm b/modular_nova/modules/panicbunker/code/panicbunker.dm index 410853d3f21..eb9275f8855 100644 --- a/modular_nova/modules/panicbunker/code/panicbunker.dm +++ b/modular_nova/modules/panicbunker/code/panicbunker.dm @@ -1,9 +1,6 @@ GLOBAL_LIST_EMPTY(bunker_passthrough) -/client/proc/addbunkerbypass(ckeytobypass as text|null) - set category = "Admin" - set name = "Add PB Bypass" - set desc = "Allows a given ckey to connect despite the panic bunker for a given round." +ADMIN_VERB(addbunkerbypass, R_ADMIN, "Add PB Bypass", "Allows a given ckey to connect despite the panic bunker for a given round.", ADMIN_CATEGORY_MAIN, ckeytobypass as text|null) if(!CONFIG_GET(flag/sql_enabled)) to_chat(usr, span_adminnotice("The Database is not enabled!")) return @@ -14,11 +11,7 @@ GLOBAL_LIST_EMPTY(bunker_passthrough) log_admin("[key_name(usr)] has added [ckeytobypass] to the current round's bunker bypass list.") message_admins("[key_name_admin(usr)] has added [ckeytobypass] to the current round's bunker bypass list.") -/client/proc/revokebunkerbypass(ckeytobypass as text|null) - set category = "Admin" - set name = "Revoke PB Bypass" - set desc = "Revoke's a ckey's permission to bypass the panic bunker for a given round." - +ADMIN_VERB(revokebunkerbypass, R_ADMIN, "Revoke PB Bypass", "Revoke's a ckey's permission to bypass the panic bunker for a given round.", ADMIN_CATEGORY_MAIN, ckeytobypass as text|null) if(!CONFIG_GET(flag/sql_enabled)) to_chat(usr, span_adminnotice("The Database is not enabled!")) return diff --git a/modular_nova/modules/pollution/code/admin_spawn_pollution.dm b/modular_nova/modules/pollution/code/admin_spawn_pollution.dm index 12102f43f39..125a9fb740b 100644 --- a/modular_nova/modules/pollution/code/admin_spawn_pollution.dm +++ b/modular_nova/modules/pollution/code/admin_spawn_pollution.dm @@ -1,16 +1,12 @@ -/client/proc/spawn_pollution() - set category = "Admin.Fun" - set name = "Spawn Pollution" - set desc = "Spawns an amount of chosen pollutant at your current location." - +ADMIN_VERB(spawn_pollution, R_ADMIN, "Spawn Pollution", "Spawns an amount of chosen pollutant at your current location.", ADMIN_CATEGORY_FUN) var/list/singleton_list = SSpollution.singletons - var/choice = tgui_input_list(usr, "What type of pollutant would you like to spawn?", "Spawn Pollution", singleton_list) + var/choice = tgui_input_list(user, "What type of pollutant would you like to spawn?", "Spawn Pollution", singleton_list) if(!choice) return var/amount_choice = input("Amount of pollution:") as null|num if(!amount_choice) return - var/turf/epicenter = get_turf(mob) + var/turf/epicenter = get_turf(user.mob) epicenter.pollute_turf(choice, amount_choice) - message_admins("[ADMIN_LOOKUPFLW(usr)] spawned pollution at [epicenter.loc] ([choice] - [amount_choice]).") - log_admin("[key_name(usr)] spawned pollution at [epicenter.loc] ([choice] - [amount_choice]).") + message_admins("[ADMIN_LOOKUPFLW(user)] spawned pollution at [epicenter.loc] ([choice] - [amount_choice]).") + log_admin("[key_name(user)] spawned pollution at [epicenter.loc] ([choice] - [amount_choice]).") diff --git a/modular_nova/modules/server_overflow/code/chat_link.dm b/modular_nova/modules/server_overflow/code/chat_link.dm index b77f0a926e7..6fc26c14f20 100644 --- a/modular_nova/modules/server_overflow/code/chat_link.dm +++ b/modular_nova/modules/server_overflow/code/chat_link.dm @@ -60,19 +60,15 @@ html = msg, confidential = TRUE) -/client/proc/request_help() - set category = "Admin" - set name = "Cross-server Help Request" - set desc = "Sends a loud message to all other servers that we are crosslinked to!" - - var/help_request_message = tgui_input_text(src, "Input help message!", "Help message", "Send help!", 150, FALSE) +ADMIN_VERB(request_help, R_ADMIN, "Cross-server Help Request", "Sends a loud message to all other servers that we are crosslinked to!", ADMIN_CATEGORY_MAIN) + var/help_request_message = tgui_input_text(user, "Input help message!", "Help message", "Send help!", 150, FALSE) if(!help_request_message) return - send2adminchat(ckey, "CROSSLINK HELP REQUEST([CONFIG_GET(string/cross_server_name) ? CONFIG_GET(string/cross_server_name) : station_name()]): [help_request_message]") - send_help_request_to_other_server(ckey, help_request_message) + send2adminchat(user.ckey, "CROSSLINK HELP REQUEST([CONFIG_GET(string/cross_server_name) ? CONFIG_GET(string/cross_server_name) : station_name()]): [help_request_message]") + send_help_request_to_other_server(user.ckey, help_request_message) - message_admins("[ADMIN_LOOKUPFLW(usr)] sent out a cross-server help request with the message: [help_request_message].") - log_admin("[key_name(usr)] sent cross-server help request [help_request_message].") + message_admins("[ADMIN_LOOKUPFLW(user)] sent out a cross-server help request with the message: [help_request_message].") + log_admin("[key_name(user)] sent cross-server help request [help_request_message].") // Oh no, they need help! /proc/send_help_request_to_other_server(exp_name, message) diff --git a/modular_nova/modules/title_screen/code/title_screen_controls.dm b/modular_nova/modules/title_screen/code/title_screen_controls.dm index 9e81494a2c3..e4beb663a17 100644 --- a/modular_nova/modules/title_screen/code/title_screen_controls.dm +++ b/modular_nova/modules/title_screen/code/title_screen_controls.dm @@ -2,19 +2,13 @@ /** * Enables an admin to upload a new titlescreen image. */ -/client/proc/admin_change_title_screen() - set category = "Admin.Fun" - set name = "Title Screen: Change" - - if(!check_rights(R_FUN)) - return - - log_admin("[key_name(usr)] is changing the title screen.") - message_admins("[key_name_admin(usr)] is changing the title screen.") +ADMIN_VERB(admin_change_title_screen, R_FUN, "Title Screen: Change", "Upload a new titlescreen image.", ADMIN_CATEGORY_FUN) + log_admin("[key_name(user)] is changing the title screen.") + message_admins("[key_name_admin(user)] is changing the title screen.") switch(alert(usr, "Please select a new title screen.", "Title Screen", "Change", "Reset", "Cancel")) if("Change") - var/file = input(usr) as icon|null + var/file = input(user) as icon|null if(!file) return SStitle.change_title_screen(file) @@ -26,13 +20,7 @@ /** * Sets a titlescreen notice, a big red text on the main screen. */ -/client/proc/change_title_screen_notice() - set category = "Admin.Fun" - set name = "Title Screen: Set Notice" - - if(!check_rights(R_FUN)) - return - +ADMIN_VERB(change_title_screen_notice, R_FUN, "Title Screen: Set Notice", "Sets a titlescreen notice, a big red text on the main screen.", ADMIN_CATEGORY_FUN) log_admin("[key_name(usr)] is setting the title screen notice.") message_admins("[key_name_admin(usr)] is setting the title screen notice.") @@ -47,13 +35,9 @@ /** * Reloads the titlescreen if it is bugged for someone. */ -/client/verb/fix_title_screen() - set name = "Fix Lobby Screen" - set desc = "Lobbyscreen broke? Press this." - set category = "OOC" - - if(istype(mob, /mob/dead/new_player)) - var/mob/dead/new_player/new_player = mob +ADMIN_VERB(fix_title_screen, R_ADMIN, "Fix Lobby Screen", "Lobbyscreen broke? Press this.", ADMIN_CATEGORY_MAIN) + if(istype(user.mob, /mob/dead/new_player)) + var/mob/dead/new_player/new_player = user.mob new_player.show_title_screen() else winset(src, "title_browser", "is-disabled=true;is-visible=false") @@ -62,17 +46,11 @@ /** * An admin debug command that enables you to change the HTML on the go. */ -/client/proc/change_title_screen_html() - set category = "Admin.Fun" - set name = "Title Screen: Set HTML" - - if(!check_rights(R_DEBUG)) - return - - log_admin("[key_name(usr)] is setting the title screen HTML.") - message_admins("[key_name_admin(usr)] is setting the title screen HTML.") +ADMIN_VERB(change_title_screen_html, R_DEBUG, "Title Screen: Set HTML", "Change lobby screen HTML on the go.", ADMIN_CATEGORY_FUN) + log_admin("[key_name(user)] is setting the title screen HTML.") + message_admins("[key_name_admin(user)] is setting the title screen HTML.") - var/new_html = input(usr, "Please enter your desired HTML(WARNING: YOU WILL BREAK SHIT)", "DANGER: TITLE HTML EDIT") as message|null + var/new_html = input(user, "Please enter your desired HTML(WARNING: YOU WILL BREAK SHIT)", "DANGER: TITLE HTML EDIT") as message|null if(!new_html) return @@ -80,4 +58,4 @@ SStitle.title_html = new_html SStitle.show_title_screen() - message_admins("[key_name_admin(usr)] has changed the title screen HTML.") + message_admins("[key_name_admin(user)] has changed the title screen HTML.") diff --git a/tff_modular/modules/blooper/bark.dm b/tff_modular/modules/blooper/bark.dm index 72fa8da623b..12a2ceed7e9 100644 --- a/tff_modular/modules/blooper/bark.dm +++ b/tff_modular/modules/blooper/bark.dm @@ -37,9 +37,7 @@ GLOBAL_VAR_INIT(blooper_allowed, TRUE) // For administrators message_admins("[key_name_admin(usr)] toggled Blooper.") SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Blooper", "[GLOB.blooper_allowed ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! -/world/AVerbsAdmin() - . = ..() - return . + /datum/admins/proc/toggleblooper +ADMIN_VERB(verb_path, R_SERVER, "Toggle Blooper", "Toggle ANNOYING NOIZES", ADMIN_CATEGORY_SERVER) /proc/toggle_blooper(toggle = null) if(toggle != null) diff --git a/tgstation.dme b/tgstation.dme index 1f9b84357f1..0b7f7157c9c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -32,6 +32,7 @@ #include "code\__DEFINES\actions.dm" #include "code\__DEFINES\actionspeed_modification.dm" #include "code\__DEFINES\admin.dm" +#include "code\__DEFINES\admin_verb.dm" #include "code\__DEFINES\adventure.dm" #include "code\__DEFINES\airlock.dm" #include "code\__DEFINES\alarm.dm" @@ -718,6 +719,7 @@ #include "code\controllers\configuration\entries\resources.dm" #include "code\controllers\subsystem\achievements.dm" #include "code\controllers\subsystem\addiction.dm" +#include "code\controllers\subsystem\admin_verbs.dm" #include "code\controllers\subsystem\ai_controllers.dm" #include "code\controllers\subsystem\air.dm" #include "code\controllers\subsystem\ambience.dm" @@ -2939,6 +2941,8 @@ #include "code\modules\admin\smites\smite.dm" #include "code\modules\admin\smites\supply_pod.dm" #include "code\modules\admin\smites\supply_pod_quick.dm" +#include "code\modules\admin\verb_datums\_admin_verb_datum.dm" +#include "code\modules\admin\verb_datums\_admin_verb_holder.dm" #include "code\modules\admin\verbs\admin.dm" #include "code\modules\admin\verbs\admin_newscaster.dm" #include "code\modules\admin\verbs\adminevents.dm" @@ -2993,6 +2997,7 @@ #include "code\modules\admin\verbs\server.dm" #include "code\modules\admin\verbs\shuttlepanel.dm" #include "code\modules\admin\verbs\spawnobjasmob.dm" +#include "code\modules\admin\verbs\special_verbs.dm" #include "code\modules\admin\verbs\lua\_hooks.dm" #include "code\modules\admin\verbs\lua\_wrappers.dm" #include "code\modules\admin\verbs\lua\helpers.dm"