diff --git a/code/ATMOSPHERICS/_atmospherics_helpers.dm b/code/ATMOSPHERICS/_atmospherics_helpers.dm index a1b6aad7e5..fbc50aee1e 100644 --- a/code/ATMOSPHERICS/_atmospherics_helpers.dm +++ b/code/ATMOSPHERICS/_atmospherics_helpers.dm @@ -15,11 +15,9 @@ /obj/machinery/atmospherics/var/debug = 0 -/client/proc/atmos_toggle_debug(var/obj/machinery/atmospherics/M in view()) - set name = "Toggle Debug Messages" - set category = "Debug.Misc" - M.debug = !M.debug - to_chat(usr, "[M]: Debug messages toggled [M.debug? "on" : "off"].") +ADMIN_VERB(atmos_toggle_debug, R_DEBUG, "Toggle Debug Messages", "Allows to toggle receiving debug messages.", ADMIN_CATEGORY_DEBUG_MISC, obj/machinery/atmospherics/machine in view()) + machine.debug = !machine.debug + to_chat(user, span_debug_info("[machine]: Debug messages toggled [machine.debug? "on" : "off"].")) //Generalized gas pumping proc. //Moves gas from one gas_mixture to another and returns the amount of power needed (assuming 1 second), or -1 if no gas was pumped. diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index cb39381e4b..ec2debcc1e 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -200,7 +200,7 @@ update_icon() return -/obj/machinery/atmospherics/binary/passive_gate/attack_hand(user as mob) +/obj/machinery/atmospherics/binary/passive_gate/attack_hand(mob/user) if(..()) return add_fingerprint(user) diff --git a/code/ZAS/Diagnostic.dm b/code/ZAS/Diagnostic.dm index 9b32bb1313..06388d31b5 100644 --- a/code/ZAS/Diagnostic.dm +++ b/code/ZAS/Diagnostic.dm @@ -1,42 +1,24 @@ -/client/proc/ZoneTick() - set category = "Debug.Misc" - set name = "Process Atmos" - set desc = "Manually run a single tick of the air subsystem" - - // TODO - This might be a useful diagnostic tool. However its complicated to do with StonedMC - // Therefore it is left unimplemented for now until its use actually becomes required. ~Leshana - /* - if(!check_rights(R_DEBUG)) return - - var/result = SSair.Tick() - if(result) - to_chat(src, "Successfully Processed.") - - else - to_chat(src, "Failed to process! ([SSair.tick_progress])") - */ - -/client/proc/Zone_Info(turf/T as null|turf) - set category = "Debug.Misc" +ADMIN_VERB_VISIBILITY(Zone_Info, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(Zone_Info, R_DEBUG, "ZAS Zone Info", "Prints the ZAS information of the zone (Only use on a test server).", ADMIN_CATEGORY_MAPPING_ZAS, turf/T) if(T) if(istype(T,/turf/simulated) && T:zone) - T:zone:dbg_data(src) + T:zone:dbg_data(user) else - to_chat(mob, "No zone here.") + to_chat(user, span_debug_warning("No zone here.")) var/datum/gas_mixture/mix = T.return_air() - to_chat(mob, "[mix.return_pressure()] kPa [mix.temperature]C") + to_chat(user, span_debug_info("[mix.return_pressure()] kPa [mix.temperature]C")) for(var/g in mix.gas) - to_chat(mob, "[g]: [mix.gas[g]]\n") + to_chat(user, span_debug_info("[g]: [mix.gas[g]]\n")) else - if(zone_debug_images) - for(var/zone in zone_debug_images) - images -= zone_debug_images[zone] - zone_debug_images = null + if(user.zone_debug_images) + for(var/zone in user.zone_debug_images) + user.images -= user.zone_debug_images[zone] + user.zone_debug_images = null /client/var/list/zone_debug_images -/client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf) - set category = "Debug.Misc" +ADMIN_VERB_VISIBILITY(Test_ZAS_Connection, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(Test_ZAS_Connection, R_DEBUG, "Test ZAS Connection", "Tests the ZAS zone connection (Only use on a test server).", ADMIN_CATEGORY_MAPPING_ZAS, turf/simulated/T) if(!istype(T)) return @@ -50,15 +32,15 @@ "Down" = DOWN,\ #endif "N/A" = null) - var/direction = tgui_input_list(usr, "What direction do you wish to test?","Set direction", direction_list) + var/direction = tgui_input_list(user, "What direction do you wish to test?","Set direction", direction_list) if(!direction) return if(direction == "N/A") if(!(T.self_airblock() & AIR_BLOCKED)) - to_chat(mob, "The turf can pass air! :D") + to_chat(user, span_debug_info("The turf can pass air! :D")) else - to_chat(mob, "No air passage :x") + to_chat(user, span_debug_warning("No air passage :x")) return var/turf/simulated/other_turf = get_step(T, direction_list[direction]) @@ -70,31 +52,30 @@ if(o_block & AIR_BLOCKED) if(t_block & AIR_BLOCKED) - to_chat(mob, "Neither turf can connect. :(") + to_chat(user, span_debug_warning("Neither turf can connect. :(")) else - to_chat(mob, "The initial turf only can connect. :\\") + to_chat(user, span_debug_warning("The initial turf only can connect. :\\")) else if(t_block & AIR_BLOCKED) - to_chat(mob, "The other turf can connect, but not the initial turf. :/") + to_chat(user, span_debug_warning("The other turf can connect, but not the initial turf. :/")) else - to_chat(mob, "Both turfs can connect! :)") + to_chat(user, span_debug_info("Both turfs can connect! :)")) - to_chat(mob, "Additionally, \...") + to_chat(user, span_debug_info("Additionally, \...")) if(o_block & ZONE_BLOCKED) if(t_block & ZONE_BLOCKED) - to_chat(mob, "neither turf can merge.") + to_chat(user, span_debug_warning("neither turf can merge.")) else - to_chat(mob, "the other turf cannot merge.") + to_chat(user, span_debug_warning("the other turf cannot merge.")) else if(t_block & ZONE_BLOCKED) - to_chat(mob, "the initial turf cannot merge.") + to_chat(user, span_debug_warning("the initial turf cannot merge.")) else - to_chat(mob, "both turfs can merge.") + to_chat(user, span_debug_warning("both turfs can merge.")) -/client/proc/ZASSettings() - set category = "Debug.Dangerous" - - GLOB.vsc.SetDefault(mob) +ADMIN_VERB_VISIBILITY(Test_ZAS_Connection, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG) +ADMIN_VERB(ZASSettings, R_ADMIN, "ZAS Settings", "Access the ZAS settings.", ADMIN_CATEGORY_DEBUG_DANGEROUS, turf/simulated/T) + GLOB.vsc.SetDefault(user.mob) diff --git a/code/__defines/admin_verb.dm b/code/__defines/admin_verb.dm index 3cb2af3313..ac34a29252 100644 --- a/code/__defines/admin_verb.dm +++ b/code/__defines/admin_verb.dm @@ -77,6 +77,7 @@ _ADMIN_VERB(verb_path_name, verb_permissions, verb_name, verb_desc, verb_categor // Admin verb categories #define ADMIN_CATEGORY_MAIN "Admin" +#define ADMIN_CATEGORY_CHAT "Admin.Chat" #define ADMIN_CATEGORY_EVENTS "Admin.Events" #define ADMIN_CATEGORY_FUN "Admin.Fun" #define ADMIN_CATEGORY_GAME "Admin.Game" @@ -84,26 +85,36 @@ _ADMIN_VERB(verb_path_name, verb_permissions, verb_name, verb_desc, verb_categor #define ADMIN_CATEGORY_LOGS "Admin.Logs" #define ADMIN_CATEGORY_MISC "Admin.Misc" #define ADMIN_CATEGORY_SECRETS "Admin.Secrets" +#define ADMIN_CATEGORY_SILICON "Admin.Silicon" #define ADMIN_CATEGORY_INVESTIGATE "Admin.Investigate" +#define ADMIN_CATEGORY_IPINTEL "Admin.IPIntel" // Special categories that are separated #define ADMIN_CATEGORY_DEBUG "Debug" +#define ADMIN_CATEGORY_DEBUG_ASSETS "Debug.Assets" #define ADMIN_CATEGORY_DEBUG_INVESTIGATE "Debug.Investigate" #define ADMIN_CATEGORY_DEBUG_DANGEROUS "Debug.Dangerous" +#define ADMIN_CATEGORY_DEBUG_EVENTS "Debug.Evemts" #define ADMIN_CATEGORY_DEBUG_GAME "Debug.Game" #define ADMIN_CATEGORY_DEBUG_SERVER "Debug.Server" +#define ADMIN_CATEGORY_DEBUG_SPRITES "Debug.Sprites" +#define ADMIN_CATEGORY_DEBUG_MISC "Debug.Misc" + #define ADMIN_CATEGORY_OBJECT "Object" #define ADMIN_CATEGORY_MAPPING "Mapping" +#define ADMIN_CATEGORY_MAPPING_TESTS "Mapping.Testserver Only" +#define ADMIN_CATEGORY_MAPPING_ZAS "Mapping.ZAS" #define ADMIN_CATEGORY_PROFILE "Profile" -#define ADMIN_CATEGORY_IPINTEL "Admin.IPIntel" // Server Categories #define ADMIN_CATEGORY_SERVER "Server" +#define ADMIN_CATEGORY_SERVER_CHAT "Server.Chat" #define ADMIN_CATEGORY_SERVER_GAME "Server.Game" #define ADMIN_CATEGORY_SERVER_ADMIN "Server.Admin" #define ADMIN_CATEGORY_SERVER_CONFIG "Server.Config" // Fun categories +#define ADMIN_CATEGORY_FUN_ADD_NIF "Fun.Add Nif" #define ADMIN_CATEGORY_FUN_EVENT_KIT "Fun.Event Kit" #define ADMIN_CATEGORY_FUN_DROP_POD "Fun.Drop Pod" #define ADMIN_CATEGORY_FUN_DO_NOT "Fun.Do Not" @@ -113,3 +124,4 @@ _ADMIN_VERB(verb_path_name, verb_permissions, verb_name, verb_desc, verb_categor // Visibility flags #define ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG "Map-Debug" +#define ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST "Localhost" diff --git a/code/_global_vars/mobs.dm b/code/_global_vars/mobs.dm index 7e60dc71ea..10d829904a 100644 --- a/code/_global_vars/mobs.dm +++ b/code/_global_vars/mobs.dm @@ -5,4 +5,3 @@ GLOBAL_LIST_EMPTY(stealthminID) GLOBAL_LIST_EMPTY(directory) //all ckeys with associated client GLOBAL_LIST_EMPTY(clients) GLOBAL_LIST_EMPTY(players_by_zlevel) -GLOBAL_LIST_EMPTY(round_text_log) diff --git a/code/controllers/subsystems/admin_verbs.dm b/code/controllers/subsystems/admin_verbs.dm index fabb7eff7b..0885381453 100644 --- a/code/controllers/subsystems/admin_verbs.dm +++ b/code/controllers/subsystems/admin_verbs.dm @@ -131,6 +131,8 @@ SUBSYSTEM_DEF(admin_verbs) // refresh their verbs admin_visibility_flags[admin.ckey] ||= list() + if(admin.is_localhost()) + admin_visibility_flags[admin.ckey] |= list(ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) 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() diff --git a/code/controllers/subsystems/game_master.dm b/code/controllers/subsystems/game_master.dm index 0ea110c074..738629dac1 100644 --- a/code/controllers/subsystems/game_master.dm +++ b/code/controllers/subsystems/game_master.dm @@ -150,15 +150,8 @@ SUBSYSTEM_DEF(game_master) var/ignore_time_restrictions = FALSE // Useful for debugging without needing to wait 20 minutes each time. var/ignore_round_chaos = FALSE // If true, the system will happily choose back to back intense events like meteors and blobs, Dwarf Fortress style. -/client/proc/show_gm_status() - set category = "Debug" - set name = "Show GM Status" - set desc = "Shows you what the GM is thinking. If only that existed in real life..." - - if(check_rights(R_ADMIN|R_EVENT|R_DEBUG)) - SSgame_master.interact(usr) - else - to_chat(usr, span_warning("You do not have sufficient rights to view the GM panel, sorry.")) +ADMIN_VERB(show_gm_status, R_ADMIN|R_EVENT|R_DEBUG, "Show GM Status", "Shows you what the GM is thinking. If only that existed in real life...", ADMIN_CATEGORY_DEBUG_GAME) + SSgame_master.interact(user) /datum/controller/subsystem/game_master/proc/interact(var/client/user) if(!user) diff --git a/code/datums/diseases/_MobProcs.dm b/code/datums/diseases/_MobProcs.dm index 8d82327652..59aaf22166 100644 --- a/code/datums/diseases/_MobProcs.dm +++ b/code/datums/diseases/_MobProcs.dm @@ -220,20 +220,13 @@ danger = disease.danger return danger -/client/proc/ReleaseVirus() - set category = "Fun.Event Kit" - set name = "Release Virus" - set desc = "Release a pre-set virus." - - if(!check_rights(R_FUN|R_EVENT)) - return FALSE - - var/disease = tgui_input_list(usr, "Choose virus", "Viruses", subtypesof(/datum/disease), subtypesof(/datum/disease)) +ADMIN_VERB(ReleaseVirus, R_SPAWN|R_EVENT, "Release Virus", "Release a pre-set virus.", ADMIN_CATEGORY_FUN_EVENT_KIT) + var/disease = tgui_input_list(user, "Choose virus", "Viruses", subtypesof(/datum/disease), subtypesof(/datum/disease)) if(isnull(disease)) return FALSE - var/mob/living/carbon/human/H = tgui_input_list(usr, "Choose infectee", "Characters", GLOB.human_mob_list) + var/mob/living/carbon/human/H = tgui_input_list(user, "Choose infectee", "Characters", GLOB.human_mob_list) if(isnull(H)) return FALSE @@ -243,10 +236,8 @@ if(!H.HasDisease(D)) H.ForceContractDisease(D) - message_admins("[key_name_admin(usr)] has triggered a virus outbreak of [D.name]! Affected mob: [key_name_admin(H)]") - log_admin("[key_name_admin(usr)] infected [key_name_admin(H)] with [D.name]") + message_admins("[key_name_admin(user)] has triggered a virus outbreak of [D.name]! Affected mob: [key_name_admin(H)]") + log_admin("[key_name_admin(user)] infected [key_name_admin(H)] with [D.name]") if(!GLOB.archive_diseases[D.GetDiseaseID()]) GLOB.archive_diseases[D.GetDiseaseID()] = D - - return TRUE diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index c42baca7e0..07e6338b32 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -479,14 +479,7 @@ GLOBAL_LIST_INIT(advance_cures, list( if(length(preserve)) R.data["viruses"] = preserve -/client/proc/AdminCreateVirus() - set category = "Fun.Event Kit" - set name = "Create Advanced Virus" - set desc = "Create an advanced virus and release it." - - if(!is_admin(usr)) - return FALSE - +ADMIN_VERB(AdminCreateVirus, R_SPAWN|R_EVENT, "Create Advanced Virus", "Create an advanced virus and release it.", ADMIN_CATEGORY_FUN_EVENT_KIT) var/i = VIRUS_SYMPTOM_LIMIT var/mob/living/carbon/human/H = null @@ -497,22 +490,23 @@ GLOBAL_LIST_INIT(advance_cures, list( symptoms += "Done" symptoms += GLOB.list_symptoms.Copy() do - if(src) - var/symptom = tgui_input_list(src, "Choose a symptom to add ([i] remaining)", "Choose a Symptom", symptoms) - if(isnull(symptom)) - return - else if(istext(symptom)) - i = 0 - else if(ispath(symptom)) - var/datum/symptom/S = new symptom - if(!D.HasSymptom(S)) - D.symptoms += S - i -= 1 + if(!user) + return + var/symptom = tgui_input_list(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom", symptoms) + if(isnull(symptom)) + return + else if(istext(symptom)) + i = 0 + else if(ispath(symptom)) + var/datum/symptom/S = new symptom + if(!D.HasSymptom(S)) + D.symptoms += S + i -= 1 while(i > 0) if(length(D.symptoms) > 0) - var/new_name = tgui_input_text(src, "Name your new disease.", "New Name") + var/new_name = tgui_input_text(user, "Name your new disease.", "New Name") if(!new_name) return FALSE D.AssignName(new_name) @@ -521,7 +515,7 @@ GLOBAL_LIST_INIT(advance_cures, list( for(var/datum/disease/advance/AD in GLOB.active_diseases) AD.Refresh() - H = tgui_input_list(src, "Choose infectee", "Infectees", GLOB.human_mob_list) + H = tgui_input_list(user, "Choose infectee", "Infectees", GLOB.human_mob_list) if(isnull(H)) return FALSE @@ -532,10 +526,8 @@ GLOBAL_LIST_INIT(advance_cures, list( var/list/name_symptoms = list() for(var/datum/symptom/S in D.symptoms) name_symptoms += S.name - message_admins("[key_name_admin(src)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]") - log_admin("[key_name_admin(src)] infected [key_name_admin(H)] with [D.name]. It has these symptoms: [english_list(name_symptoms)]") - - return TRUE + message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]") + log_admin("[key_name_admin(user)] infected [key_name_admin(H)] with [D.name]. It has these symptoms: [english_list(name_symptoms)]") /datum/disease/advance/infect(mob/living/infectee, make_copy = TRUE) var/datum/disease/advance/A = make_copy ? Copy() : src diff --git a/code/datums/managed_browsers/feedback_viewer.dm b/code/datums/managed_browsers/feedback_viewer.dm index 6b9bc8c13d..e3f11ff828 100644 --- a/code/datums/managed_browsers/feedback_viewer.dm +++ b/code/datums/managed_browsers/feedback_viewer.dm @@ -1,18 +1,15 @@ /client var/datum/managed_browser/feedback_viewer/feedback_viewer = null -/datum/admins/proc/view_feedback() - set category = "Admin.Misc" - set name = "View Feedback" - set desc = "Open the Feedback Viewer" - - if(!check_rights(R_ADMIN|R_DEBUG|R_EVENT)) +ADMIN_VERB(view_feedback, R_ADMIN|R_DEBUG|R_EVENT, "View Feedback", "Open the Feedback Viewer.", ADMIN_CATEGORY_MISC) + if(!check_rights()) return - if(usr.client.feedback_viewer) - usr.client.feedback_viewer.display() - else - usr.client.feedback_viewer = new(usr.client) + if(user.feedback_viewer) + user.feedback_viewer.display() + return + + user.feedback_viewer = new(user) // This object holds the code to run the admin feedback viewer. /datum/managed_browser/feedback_viewer diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 743f0a3af2..e051261edd 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -127,9 +127,9 @@ popup.set_content(output) popup.open() -/datum/mind/proc/edit_memory() +/datum/mind/proc/edit_memory(mob/user) if(!SSticker || !SSticker.mode) - tgui_alert_async(usr, "Not before round-start!", "Alert") + tgui_alert_async(user, "Not before round-start!", "Alert") return var/out = span_bold("[name]") + "[(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" @@ -161,12 +161,13 @@ out += "
\[add\]

" out += span_bold("Ambitions:") + " [ambitions ? ambitions : "None"] \[edit\]
" - var/datum/browser/popup = new(usr, "edit_memory[src]", "Edit Memory") + var/datum/browser/popup = new(user, "edit_memory[src]", "Edit Memory") popup.set_content(out) popup.open() /datum/mind/Topic(href, href_list) - if(!check_rights(R_ADMIN|R_FUN|R_EVENT)) return + if(!check_rights(R_ADMIN|R_FUN|R_EVENT)) + return if(href_list["add_antagonist"]) var/datum/antagonist/antag = GLOB.all_antag_types[href_list["add_antagonist"]] @@ -428,7 +429,7 @@ for(var/datum/objective/objective in objectives) to_chat(current, span_bold("Objective #[obj_count]") + ": [objective.explanation_text]") obj_count++ - edit_memory() + edit_memory(usr) /datum/mind/proc/find_syndicate_uplink() var/list/L = current.get_contents() diff --git a/code/game/gamemodes/events/holidays/Holidays.dm b/code/game/gamemodes/events/holidays/Holidays.dm index 4e42d23459..de1c43f538 100644 --- a/code/game/gamemodes/events/holidays/Holidays.dm +++ b/code/game/gamemodes/events/holidays/Holidays.dm @@ -229,18 +229,13 @@ GLOBAL_LIST_EMPTY(Holiday) //Holidays are lists now, so we can have more than on GLOB.Holiday["Friday the 13th"] = "Friday the 13th is a superstitious day, associated with bad luck and misfortune." //Allows GA and GM to set the Holiday variable -/client/proc/Set_Holiday() - set name = "Set Holiday" - set category = "Fun.Event Kit" - set desc = "Force-set the Holiday variable to make the game think it's a certain day." - if(!check_rights(R_SERVER)) return - +ADMIN_VERB(Set_Holiday, R_SERVER, "Set Holiday", "Force-set the Holiday variable to make the game think it's a certain day.", ADMIN_CATEGORY_FUN_EVENT_KIT) GLOB.Holiday = list() - var/H = tgui_input_text(src,"What holiday is it today?","Set Holiday") + var/H = tgui_input_text(user,"What holiday is it today?","Set Holiday") if(!H) return - var/B = tgui_input_text(src,"Now explain what the holiday is about","Set Holiday", multiline = TRUE, prevent_enter = TRUE) + var/B = tgui_input_text(user,"Now explain what the holiday is about","Set Holiday", multiline = TRUE, prevent_enter = TRUE) if(!B) return @@ -251,8 +246,8 @@ GLOBAL_LIST_EMPTY(Holiday) //Holidays are lists now, so we can have more than on world.update_status() Holiday_Game_Start() - message_admins(span_notice("ADMIN: Event: [key_name(src)] force-set Holiday to \"[GLOB.Holiday]\"")) - log_admin("[key_name(src)] force-set Holiday to \"[GLOB.Holiday]\"") + message_admins(span_notice("ADMIN: Event: [key_name(user)] force-set Holiday to \"[GLOB.Holiday]\"")) + log_admin("[key_name(user)] force-set Holiday to \"[GLOB.Holiday]\"") //Run at the start of a round diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 0921374fdf..7b5ae43b6f 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -109,12 +109,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) SSticker.mode.antag_templates |= antag message_admins("Admin [key_name_admin(usr)] added [antag.role_text] template to game mode.") - // I am very sure there's a better way to do this, but I'm not sure what it might be. ~Z - spawn(1) - for(var/datum/admins/admin in world) - if(usr.client == admin.owner) - admin.show_game_mode(usr) - return + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/show_game_mode) /datum/game_mode/proc/announce() //to be called when round starts to_chat(world, span_world("The current game mode is [capitalize(name)]!")) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 939a13b8fb..269ca89b59 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -223,7 +223,8 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva qdel(src) /obj/structure/AIcore/deactivated/proc/check_malf(var/mob/living/silicon/ai/ai) - if(!ai) return + if(!ai) + return for (var/datum/mind/malfai in GLOB.malf.current_antagonists) if (ai.mind == malfai) return 1 @@ -238,7 +239,8 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva else to_chat(user, span_danger("ERROR:") + " Unable to locate artificial intelligence.") return - else if(W.has_tool_quality(TOOL_WRENCH)) + + if(W.has_tool_quality(TOOL_WRENCH)) if(anchored) user.visible_message(span_bold("\The [user]") + " starts to unbolt \the [src] from the plating...") playsound(src, W.usesound, 50, 1) @@ -248,35 +250,34 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva user.visible_message(span_bold("\The [user]") + " finishes unfastening \the [src]!") anchored = FALSE return - else - user.visible_message(span_bold("\The [user]") + " starts to bolt \the [src] to the plating...") - playsound(src, W.usesound, 50, 1) - if(!do_after(user, 4 SECONDS * W.toolspeed, target = src)) - user.visible_message(span_bold("\The [user]") + " decides not to bolt \the [src].") - return - user.visible_message(span_bold("\The [user]") + " finishes fastening down \the [src]!") - anchored = TRUE + + user.visible_message(span_bold("\The [user]") + " starts to bolt \the [src] to the plating...") + playsound(src, W.usesound, 50, 1) + if(!do_after(user, 4 SECONDS * W.toolspeed, target = src)) + user.visible_message(span_bold("\The [user]") + " decides not to bolt \the [src].") return - else - return ..() + user.visible_message(span_bold("\The [user]") + " finishes fastening down \the [src]!") + anchored = TRUE + return -/client/proc/empty_ai_core_toggle_latejoin() - set name = "Toggle AI Core Latejoin" - set category = "Admin.Silicon" + return ..() +ADMIN_VERB(empty_ai_core_toggle_latejoin, R_ADMIN|R_SERVER|R_EVENT, "Toggle AI Core Latejoin", "Toggles the option to latejoin as AI core.", ADMIN_CATEGORY_SILICON) var/list/cores = list() - for(var/obj/structure/AIcore/deactivated/D in GLOB.all_deactivated_AI_cores) - cores["[D] ([D.loc.loc])"] = D + for(var/obj/structure/AIcore/deactivated/current_ai_struct in GLOB.all_deactivated_AI_cores) + cores["[current_ai_struct] ([current_ai_struct.loc.loc])"] = current_ai_struct - var/id = tgui_input_list(usr, "Which core?", "Toggle AI Core Latejoin", cores) - if(!id) return + var/id = tgui_input_list(user, "Which core?", "Toggle AI Core Latejoin", cores) + if(!id) + return - var/obj/structure/AIcore/deactivated/D = cores[id] - if(!D) return + var/obj/structure/AIcore/deactivated/ai_struct = cores[id] + if(!ai_struct) + return - if(D in GLOB.empty_playable_ai_cores) - GLOB.empty_playable_ai_cores -= D - to_chat(src, "\The [id] is now [span_red("not available")] for latejoining AIs.") + if(ai_struct in GLOB.empty_playable_ai_cores) + GLOB.empty_playable_ai_cores -= ai_struct + to_chat(user, span_infoplain("\The [id] is now [span_red("not available")] for latejoining AIs.")) else - GLOB.empty_playable_ai_cores += D - to_chat(src, "\The [id] is now [span_green("available")] for latejoining AIs.") + GLOB.empty_playable_ai_cores += ai_struct + to_chat(user, span_infoplain("\The [id] is now [span_green("available")] for latejoining AIs.")) diff --git a/code/game/objects/effects/spawners/bombspawner.dm b/code/game/objects/effects/spawners/bombspawner.dm index 9f40bbca89..9a5b7226fc 100644 --- a/code/game/objects/effects/spawners/bombspawner.dm +++ b/code/game/objects/effects/spawners/bombspawner.dm @@ -1,22 +1,19 @@ -/client/proc/spawn_tanktransferbomb() - set category = "Debug.Game" - set desc = "Spawn a tank transfer valve bomb" - set name = "Instant TTV" - - if(!check_rights(R_SPAWN)) return - +ADMIN_VERB(spawn_tanktransferbomb, R_SPAWN, "Instant TTV", "Spawn a tank transfer valve bomb.", ADMIN_CATEGORY_DEBUG_GAME) var/obj/effect/spawner/newbomb/proto = /obj/effect/spawner/newbomb/radio/custom - var/p = tgui_input_number(usr, "Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt)) - if(p == null) return + var/p = tgui_input_number(user, "Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt)) + if(isnull(p)) + return - var/o = tgui_input_number(usr, "Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt)) - if(o == null) return + var/o = tgui_input_number(user, "Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt)) + if(isnull(o)) + return - var/c = tgui_input_number(usr, "Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt)) - if(c == null) return + var/c = tgui_input_number(user, "Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt)) + if(isnull(c)) + return - new /obj/effect/spawner/newbomb/radio/custom(get_turf(mob), p, o, c) + new /obj/effect/spawner/newbomb/radio/custom(get_turf(user.mob), p, o, c) /obj/effect/spawner/newbomb name = "TTV bomb" diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm index 7011515cb5..31165d009f 100644 --- a/code/game/objects/explosion_recursive.dm +++ b/code/game/objects/explosion_recursive.dm @@ -1,8 +1,3 @@ -/client/proc/kaboom() - var/power = tgui_input_number(src, "power?", "power?") - var/turf/T = get_turf(src.mob) - explosion(T, power) - /turf var/explosion_resistance diff --git a/code/game/objects/mail.dm b/code/game/objects/mail.dm index 53afd5a5fb..ea4efe1c46 100644 --- a/code/game/objects/mail.dm +++ b/code/game/objects/mail.dm @@ -276,13 +276,7 @@ disposal_holder.destinationTag = sortTag // Mail spawn for events -/datum/admins/proc/spawn_mail(var/object as text) - set name = "Spawn Mail" - set category = "Fun.Event Kit" - set desc = "Spawn mail for a specific player, with a specific item." - - if(!check_rights(R_SPAWN)) return - +ADMIN_VERB(spawn_mail, R_SPAWN, "Spawn Mail", "Spawn mail for a specific player, with a specific item.", ADMIN_CATEGORY_FUN_EVENT_KIT, object as text) var/list/types = typesof(/atom) var/list/matches = new() var/list/recipients = list() @@ -298,23 +292,25 @@ if(matches.len==1) chosen = matches[1] else - chosen = tgui_input_list(usr, "Select an atom type", "Spawn Atom in Mail", matches) + chosen = tgui_input_list(user, "Select an atom type", "Spawn Atom in Mail", matches) if(!chosen) return for(var/mob/living/player in GLOB.player_list) recipients += player - var/mob/living/chosen_player = tgui_input_list(usr, "Choose recipient", "Recipients", recipients, recipients) + var/mob/living/chosen_player = tgui_input_list(user, "Choose recipient", "Recipients", recipients, recipients) recipient_mind = chosen_player.mind if(!recipient_mind) return - var/shuttle_spawn = tgui_alert(usr, "Spawn mail at location or in the shuttle?", "Spawn mail", list("Location", "Shuttle")) + var/shuttle_spawn = tgui_alert(user, "Spawn mail at location or in the shuttle?", "Spawn mail", list("Location", "Shuttle")) if(!shuttle_spawn) return + + var/mob/user_mob = user.mob if(shuttle_spawn == "Shuttle") var/obj/item/mail/new_mail = new new_mail.initialize_for_recipient(recipient_mind, TRUE) @@ -322,10 +318,10 @@ SSmail.admin_mail += new_mail log_and_message_admins("spawned [chosen] inside an envelope at the shuttle") else - var/obj/item/mail/ground_mail = new /obj/item/mail(usr.loc) + var/obj/item/mail/ground_mail = new /obj/item/mail(user_mob.loc) ground_mail.initialize_for_recipient(recipient_mind, TRUE) new chosen(ground_mail) - log_and_message_admins("spawned [chosen] inside an envelope at ([usr.x],[usr.y],[usr.z])") + log_and_message_admins("spawned [chosen] inside an envelope at ([user_mob.x],[user_mob.y],[user_mob.z])") feedback_add_details("admin_verb","SM") diff --git a/code/game/world.dm b/code/game/world.dm index daeb4e8139..0a7db1bf11 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -175,10 +175,6 @@ GLOBAL_VAR(restart_counter) load_alienwhitelist() load_jobwhitelist() - //Emergency Fix - load_mods() - //end-emergency fix - src.update_status() setup_season() //VOREStation Addition @@ -562,31 +558,6 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday) fdel(F) F << the_mode -/hook/startup/proc/loadMods() - world.load_mods() - return 1 - -/world/proc/load_mods() - if(CONFIG_GET(flag/admin_legacy_system)) - var/text = file2text("config/moderators.txt") - if (!text) - log_world("Failed to load config/mods.txt") - else - var/list/lines = splittext(text, "\n") - for(var/line in lines) - if (!line) - continue - - if (copytext(line, 1, 2) == ";") - continue - - var/title = "Moderator" - var/rights = GLOB.admin_ranks[title] - - var/ckey = copytext(line, 1, length(line)+1) - var/datum/admins/D = new /datum/admins(title, rights, ckey) - D.associate(GLOB.directory[ckey]) - /world/proc/update_status() var/s = "" diff --git a/code/modules/admin/ToRban.dm b/code/modules/admin/ToRban.dm index 11cb9c5440..3ebb0c83a2 100644 --- a/code/modules/admin/ToRban.dm +++ b/code/modules/admin/ToRban.dm @@ -43,10 +43,8 @@ log_world("ToR data update aborted: no data.") return -/client/proc/ToRban(task in list("update","toggle","show","remove","remove all","find")) - set name = "ToRban" - set category = "Server.Config" - if(!check_rights_for(src, R_HOLDER)) return +ADMIN_VERB(ToRban, R_ADMIN|R_SERVER, "ToRban", "Modifies the TorBan settings.", ADMIN_CATEGORY_SERVER_CONFIG) + var/task = tgui_input_list(user, "What do you want to do?", "Select Option", list("update","toggle","show","remove","remove all","find")) switch(task) if("update") ToRban_update() @@ -61,32 +59,32 @@ if("show") var/savefile/F = new(TORFILE) var/dat - if( length(F.dir) ) - for( var/i=1, i<=length(F.dir), i++ ) + if(length(F.dir)) + for(var/i=1, i<=length(F.dir), i++) dat += "#[i] [F.dir[i]]" dat = "[dat]
" else dat = "No addresses in list." - var/datum/browser/popup = new(src, "ToRban_show", "Torban") + var/datum/browser/popup = new(user, "ToRban_show", "Torban") popup.set_content(dat) popup.open() if("remove") var/savefile/F = new(TORFILE) - var/choice = tgui_input_list(src,"Please select an IP address to remove from the ToR banlist:","Remove ToR ban", F.dir) + var/choice = tgui_input_list(user,"Please select an IP address to remove from the ToR banlist:","Remove ToR ban", F.dir) if(choice) F.dir.Remove(choice) - to_chat(src, span_filter_adminlog(span_bold("Address removed"))) + to_chat(user, span_filter_adminlog(span_bold("Address removed"))) if("remove all") - to_chat(src, span_filter_adminlog(span_bold("[TORFILE] was [fdel(TORFILE)?"":"not "]removed."))) + to_chat(user, span_filter_adminlog(span_bold("[TORFILE] was [fdel(TORFILE)?"":"not "]removed."))) if("find") - var/input = tgui_input_text(src,"Please input an IP address to search for:","Find ToR ban",null) + var/input = tgui_input_text(user,"Please input an IP address to search for:","Find ToR ban",null) if(input) if(ToRban_isbanned(input)) - to_chat(src, span_filter_adminlog("[span_orange(span_bold("Address is a known ToR address"))]")) + to_chat(user, span_filter_adminlog("[span_orange(span_bold("Address is a known ToR address"))]")) else - to_chat(src, span_filter_adminlog(span_danger("Address is not a known ToR address"))) + to_chat(user, span_filter_adminlog(span_danger("Address is not a known ToR address"))) return #undef TORFILE diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 9418b5eec2..2eeba77af7 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -246,26 +246,10 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m /datum/player_info/var/content // text content of the information /datum/player_info/var/timestamp // Because this is bloody annoying -/datum/admins/proc/PlayerNotes() - set category = "Admin.Logs" - set name = "Player Notes" - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins)) - to_chat(usr, "Error: you are not an admin!") - return - PlayerNotesPage(1) +ADMIN_VERB(PlayerNotes, R_ADMIN|R_MOD|R_EVENT|R_DEBUG, "Player Notes", "Access the player notes.", ADMIN_CATEGORY_INVESTIGATE) + user.holder.PlayerNotesPage(user.mob, 1) -/datum/admins/proc/PlayerNotesFilter() - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins)) - to_chat(usr, "Error: you are not an admin!") - return - var/filter = tgui_input_text(usr, "Filter string (case-insensitive regex)", "Player notes filter") - PlayerNotesPage(1, filter) - -/datum/admins/proc/PlayerNotesPage(page, filter) +/datum/admins/proc/PlayerNotesPage(mob/user, page) var/savefile/S=new("data/player_notes.sav") var/list/note_keys S >> note_keys @@ -275,7 +259,7 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m var/datum/tgui_module/player_notes/A = new(src) A.ckeys = note_keys - A.tgui_interact(usr) + A.tgui_interact(user) /datum/admins/proc/player_has_info(var/key as text) @@ -285,47 +269,27 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m if(!infos || !infos.len) return 0 else return 1 - -/datum/admins/proc/show_player_info(var/key as text) - set category = "Admin.Investigate" - set name = "Show Player Info" - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins)) - to_chat(usr, "Error: you are not an admin!") - return - +ADMIN_VERB(show_player_info, R_ADMIN|R_MOD|R_EVENT|R_DEBUG, "Show Player Info", "Access the player info.", ADMIN_CATEGORY_INVESTIGATE) var/datum/tgui_module/player_notes_info/A = new(src) - A.key = key - A.tgui_interact(usr) + A.tgui_interact(user) +ADMIN_VERB(access_news_network, R_ADMIN|R_EVENT, "Access Newscaster Network", "Allows you to view, add and edit news feeds.", ADMIN_CATEGORY_FUN_EVENT_KIT) + var/dat = text("

Admin Newscaster Unit

") -/datum/admins/proc/access_news_network() //MARKER - set category = "Fun.Event Kit" - 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!") - return - var/dat - dat = text("

Admin Newscaster Unit

") - - switch(admincaster_screen) + var/datum/admins/admin_holder = user.holder + switch(admin_holder.admincaster_screen) if(0) dat += {"Welcome to the admin newscaster.
Here you can add, edit and censor every newspiece on the network.
Feed channels and stories entered through here will be uneditable and handled as official news by the rest of the units.
Note that this panel allows full freedom over the news network, there are no constrictions except the few basic ones. Don't break things! "} if(GLOB.news_network.wanted_issue) - dat+= "
Read Wanted Issue" + dat+= "
Read Wanted Issue" - dat+= {"

Create Feed Channel -
View Feed Channels -
Submit new Feed story -

Exit + dat+= {"

Create Feed Channel +
View Feed Channels +
Submit new Feed story +

Exit "} var/wanted_already = 0 @@ -333,95 +297,95 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m wanted_already = 1 dat+={"
"} + span_bold("Feed Security functions:") + {"
-
[(wanted_already) ? ("Manage") : ("Publish")] \"Wanted\" Issue -
Censor Feed Stories -
Mark Feed Channel with [using_map.company_name] D-Notice (disables and locks the channel. -

The newscaster recognises you as:
"} + span_green("[src.admincaster_signature]") + {"
+
[(wanted_already) ? ("Manage") : ("Publish")] \"Wanted\" Issue +
Censor Feed Stories +
Mark Feed Channel with [using_map.company_name] D-Notice (disables and locks the channel. +

The newscaster recognises you as:
"} + span_green("[admin_holder.admincaster_signature]") + {"
"} if(1) dat+= "Station Feed Channels
" - if( isemptylist(GLOB.news_network.network_channels) ) + if(isemptylist(GLOB.news_network.network_channels) ) dat+=span_italics("No active channels found...") else for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels) if(CHANNEL.is_admin_channel) - dat+=span_bold("[CHANNEL.channel_name]") + "
" + dat+=span_bold("[CHANNEL.channel_name]") + "
" else - dat+=span_bold("[CHANNEL.channel_name] [(CHANNEL.censored) ? (span_red("***")) : null]
") - dat+={"

Refresh -
Back + dat+=span_bold("[CHANNEL.channel_name] [(CHANNEL.censored) ? (span_red("***")) : null]
") + dat+={"

Refresh +
Back "} if(2) dat+={" Creating new Feed Channel... -
"} + span_bold("Channel Name:") + {" [src.admincaster_feed_channel.channel_name]
- "} + span_bold("Channel Author:") + {" "} + span_green("[src.admincaster_signature]") + {"
- "} + span_bold("Will Accept Public Feeds:") + {" [(src.admincaster_feed_channel.locked) ? ("NO") : ("YES")]

-
Submit

Cancel
+
"} + span_bold("Channel Name:") + {" [admin_holder.admincaster_feed_channel.channel_name]
+ "} + span_bold("Channel Author:") + {" "} + span_green("[admin_holder.admincaster_signature]") + {"
+ "} + span_bold("Will Accept Public Feeds:") + {" [(admin_holder.admincaster_feed_channel.locked) ? ("NO") : ("YES")]

+
Submit

Cancel
"} if(3) dat+={" Creating new Feed Message... -
"} + span_bold("Receiving Channel:") + {" [src.admincaster_feed_channel.channel_name]
- "} + span_bold("Message Author:") + {" "} + span_green("[src.admincaster_signature]") + {"
- "} + span_bold("Message Body:") + {" [src.admincaster_feed_message.body]
-
Submit

Cancel
+
"} + span_bold("Receiving Channel:") + {" [admin_holder.admincaster_feed_channel.channel_name]
+ "} + span_bold("Message Author:") + {" "} + span_green("[admin_holder.admincaster_signature]") + {"
+ "} + span_bold("Message Body:") + {" [admin_holder.admincaster_feed_message.body]
+
Submit

Cancel
"} if(4) dat+={" - Feed story successfully submitted to [src.admincaster_feed_channel.channel_name].

-
Return
+ Feed story successfully submitted to [admin_holder.admincaster_feed_channel.channel_name].

+
Return
"} if(5) dat+={" - Feed Channel [src.admincaster_feed_channel.channel_name] created successfully.

-
Return
+ Feed Channel [admin_holder.admincaster_feed_channel.channel_name] created successfully.

+
Return
"} if(6) dat+=span_bold(span_maroon("ERROR: Could not submit Feed story to Network.")) + "

" - if(src.admincaster_feed_channel.channel_name=="") + if(admin_holder.admincaster_feed_channel.channel_name=="") dat+=span_maroon("•Invalid receiving channel name.") + "
" - if(src.admincaster_feed_message.body == "" || src.admincaster_feed_message.body == "\[REDACTED\]" || admincaster_feed_message.title == "") + if(admin_holder.admincaster_feed_message.body == "" || admin_holder.admincaster_feed_message.body == "\[REDACTED\]" || admin_holder.admincaster_feed_message.title == "") dat+=span_maroon("•Invalid message body.") + "
" - dat+="
Return
" + dat+="
Return
" if(7) dat+=span_bold(span_maroon("ERROR: Could not submit Feed Channel to Network.")) + "

" - if(src.admincaster_feed_channel.channel_name =="" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]") + if(admin_holder.admincaster_feed_channel.channel_name =="" || admin_holder.admincaster_feed_channel.channel_name == "\[REDACTED\]") dat+=span_maroon("•Invalid channel name.") + "
" var/check = 0 for(var/datum/feed_channel/FC in GLOB.news_network.network_channels) - if(FC.channel_name == src.admincaster_feed_channel.channel_name) + if(FC.channel_name == admin_holder.admincaster_feed_channel.channel_name) check = 1 break if(check) dat+=span_maroon("•Channel name already in use.") + "
" - dat+="
Return
" + dat+="
Return
" if(9) - dat+=span_bold("[src.admincaster_feed_channel.channel_name]: ") + span_small("\[created by: [span_maroon("[src.admincaster_feed_channel.author]")]\]") + "
" - if(src.admincaster_feed_channel.censored) + dat+=span_bold("[admin_holder.admincaster_feed_channel.channel_name]: ") + span_small("\[created by: [span_maroon("[admin_holder.admincaster_feed_channel.author]")]\]") + "
" + if(admin_holder.admincaster_feed_channel.censored) dat+={" "} + span_red(span_bold("ATTENTION: ")) + {"This channel has been deemed as threatening to the welfare of the station, and marked with a [using_map.company_name] D-Notice.
No further feed story additions are allowed while the D-Notice is in effect.

"} else - if( isemptylist(src.admincaster_feed_channel.messages) ) + if( isemptylist(admin_holder.admincaster_feed_channel.messages) ) dat+=span_italics("No feed messages found in channel...") + "
" else var/i = 0 - for(var/datum/feed_message/MESSAGE in src.admincaster_feed_channel.messages) + for(var/datum/feed_message/MESSAGE in admin_holder.admincaster_feed_channel.messages) i++ //dat+="-[MESSAGE.body]
" var/pic_data if(MESSAGE.img) - usr << browse_rsc(MESSAGE.img, "tmp_photo[i].png") + user << browse_rsc(MESSAGE.img, "tmp_photo[i].png") pic_data+="
" dat+= get_newspaper_content(MESSAGE.title, MESSAGE.body, MESSAGE.author,"#d4cec1", pic_data) dat+="
" dat+=span_small("\[Story by [span_maroon("[MESSAGE.author] - [MESSAGE.time_stamp]")]\]") + "
" dat+={" -

Refresh -
Back +

Refresh +
Back "} if(10) dat+={" @@ -434,8 +398,8 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m dat+=span_italics("No feed channels found active...") + "
" else for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels) - dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? (span_red("***")) : null]
" - dat+="
Cancel" + dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? (span_red("***")) : null]
" + dat+="
Cancel" if(11) dat+={" "} + span_bold("[using_map.company_name] D-Notice Handler") + {"
@@ -447,41 +411,41 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m dat+=span_italics("No feed channels found active...") + "
" else for(var/datum/feed_channel/CHANNEL in GLOB.news_network.network_channels) - dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? (span_red("***")) : null]
" + dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? (span_red("***")) : null]
" - dat+="
Back" + dat+="
Back" if(12) dat+={" - "} + span_bold("[src.admincaster_feed_channel.channel_name]: ") + span_small("\[ created by: [span_maroon("[src.admincaster_feed_channel.author]")] \]") + {"
- "} + span_normal("[(src.admincaster_feed_channel.author=="\[REDACTED\]") ? ("Undo Author censorship") : ("Censor channel Author")]") + {"
+ "} + span_bold("[admin_holder.admincaster_feed_channel.channel_name]: ") + span_small("\[ created by: [span_maroon("[admin_holder.admincaster_feed_channel.author]")] \]") + {"
+ "} + span_normal("[(admin_holder.admincaster_feed_channel.author=="\[REDACTED\]") ? ("Undo Author censorship") : ("Censor channel Author")]") + {"
"} - if( isemptylist(src.admincaster_feed_channel.messages) ) + if( isemptylist(admin_holder.admincaster_feed_channel.messages) ) dat+=span_italics("No feed messages found in channel...") + "
" else - for(var/datum/feed_message/MESSAGE in src.admincaster_feed_channel.messages) + for(var/datum/feed_message/MESSAGE in admin_holder.admincaster_feed_channel.messages) dat+={" -[MESSAGE.body]
"} + span_small("\[Story by [span_maroon("[MESSAGE.author]")]\]") + {"
- "} + span_normal("[(MESSAGE.body == "\[REDACTED\]") ? ("Undo story censorship") : ("Censor story")] - [(MESSAGE.author == "\[REDACTED\]") ? ("Undo Author Censorship") : ("Censor message Author")]") + {"
+ "} + span_normal("[(MESSAGE.body == "\[REDACTED\]") ? ("Undo story censorship") : ("Censor story")] - [(MESSAGE.author == "\[REDACTED\]") ? ("Undo Author Censorship") : ("Censor message Author")]") + {"
"} - dat+="
Back" + dat+="
Back" if(13) dat+={" - "} + span_bold("[src.admincaster_feed_channel.channel_name]: ") + span_small("\[ created by: [span_maroon("[src.admincaster_feed_channel.author]")] \]") + {"
- Channel messages listed below. If you deem them dangerous to the station, you can Bestow a D-Notice upon the channel.
+ "} + span_bold("[admin_holder.admincaster_feed_channel.channel_name]: ") + span_small("\[ created by: [span_maroon("[admin_holder.admincaster_feed_channel.author]")] \]") + {"
+ Channel messages listed below. If you deem them dangerous to the station, you can Bestow a D-Notice upon the channel.
"} - if(src.admincaster_feed_channel.censored) + if(admin_holder.admincaster_feed_channel.censored) dat+={" "} + span_red(span_bold("ATTENTION: ")) + {"This channel has been deemed as threatening to the welfare of the station, and marked with a [using_map.company_name] D-Notice.
No further feed story additions are allowed while the D-Notice is in effect.

"} else - if( isemptylist(src.admincaster_feed_channel.messages) ) + if( isemptylist(admin_holder.admincaster_feed_channel.messages) ) dat+=span_italics("No feed messages found in channel...") + "
" else - for(var/datum/feed_message/MESSAGE in src.admincaster_feed_channel.messages) + for(var/datum/feed_message/MESSAGE in admin_holder.admincaster_feed_channel.messages) dat+="-[MESSAGE.body]
" + span_small("\[Story by [span_maroon("[MESSAGE.author]")]\]") + "
" - dat+="
Back" + dat+="
Back" if(14) dat+=span_bold("Wanted Issue Handler:") var/wanted_already = 0 @@ -493,33 +457,33 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m dat+=span_normal(span_italics("
A wanted issue is already in Feed Circulation. You can edit or cancel it below.")) dat+={"
- Criminal Name: [src.admincaster_feed_message.author]
- Description: [src.admincaster_feed_message.body]
+ Criminal Name: [admin_holder.admincaster_feed_message.author]
+ Description: [admin_holder.admincaster_feed_message.body]
"} if(wanted_already) dat+=span_bold("Wanted Issue created by:") + span_green(" [GLOB.news_network.wanted_issue.backup_author]") + "
" else - dat+=span_bold("Wanted Issue will be created under prosecutor:") + span_green(" [src.admincaster_signature]") + "
" - dat+="
[(wanted_already) ? ("Edit Issue") : ("Submit")]" + dat+=span_bold("Wanted Issue will be created under prosecutor:") + span_green(" [admin_holder.admincaster_signature]") + "
" + dat+="
[(wanted_already) ? ("Edit Issue") : ("Submit")]" if(wanted_already) - dat+="
Take down Issue" - dat+="
Cancel" + dat+="
Take down Issue" + dat+="
Cancel" if(15) dat+={" - "} + span_green("Wanted issue for [src.admincaster_feed_message.author] is now in Network Circulation.") + {"

-
Return
+ "} + span_green("Wanted issue for [admin_holder.admincaster_feed_message.author] is now in Network Circulation.") + {"

+
Return
"} if(16) dat+=span_bold(span_maroon("ERROR: Wanted Issue rejected by Network.")) + "

" - if(src.admincaster_feed_message.author =="" || src.admincaster_feed_message.author == "\[REDACTED\]") + if(admin_holder.admincaster_feed_message.author =="" || admin_holder.admincaster_feed_message.author == "\[REDACTED\]") dat+=span_maroon("•Invalid name for person wanted.") + "
" - if(src.admincaster_feed_message.body == "" || src.admincaster_feed_message.body == "\[REDACTED\]") + if(admin_holder.admincaster_feed_message.body == "" || admin_holder.admincaster_feed_message.body == "\[REDACTED\]") dat+=span_maroon("•Invalid description.") + "
" - dat+="
Return
" + dat+="
Return
" if(17) dat+={" "} + span_bold("Wanted Issue successfully deleted from Circulation") + {"
-
Return
+
Return
"} if(18) dat+={" @@ -529,29 +493,30 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m "} + span_bold("Photo:") + {": "} if(GLOB.news_network.wanted_issue.img) - usr << browse_rsc(GLOB.news_network.wanted_issue.img, "tmp_photow.png") + user << browse_rsc(GLOB.news_network.wanted_issue.img, "tmp_photow.png") dat+="
" else dat+="None" - dat+="
Back
" + dat+="
Back
" if(19) dat+={" - "} + span_green("Wanted issue for [src.admincaster_feed_message.author] successfully edited.") + {"

-
Return
+ "} + span_green("Wanted issue for [admin_holder.admincaster_feed_message.author] successfully edited.") + {"

+
Return
"} else dat+="I'm sorry to break your immersion. This shit's bugged. Report this bug to Agouri, polyxenitopalidou@gmail.com" - //to_chat(world, "Channelname: [src.admincaster_feed_channel.channel_name] [src.admincaster_feed_channel.author]") - //to_chat(world, "Msg: [src.admincaster_feed_message.author] [src.admincaster_feed_message.body]") + //to_chat(world, "Channelname: [admin_holder.admincaster_feed_channel.channel_name] [admin_holder.admincaster_feed_channel.author]") + //to_chat(world, "Msg: [admin_holder.admincaster_feed_message.author] [admin_holder.admincaster_feed_message.body]") - var/datum/browser/popup = new(owner, "admincaster_main", "Admin Newscaster", 400, 600) + var/datum/browser/popup = new(user, "admincaster_main", "Admin Newscaster", 400, 600) popup.add_head_content("Admin Newscaster") popup.set_content(dat) popup.open() /datum/admins/proc/Jobbans() - if(!check_rights(R_BAN)) return + if(!check_rights(R_BAN)) + return var/dat = span_bold("Job Bans!") + "
" for(var/t in GLOB.jobban_keylist) @@ -628,7 +593,7 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_HOLDER, "Show Player Panel", m #define HARD_RESTART "Hard Restart (No Delay/Feedback Reason)" #define HARDEST_RESTART "Hardest Restart (No actions, just reboot)" #define TGS_RESTART "Server Restart (Kill and restart DD)" -ADMIN_VERB(restart, R_SERVER, "Reboot World", "Restarts the world immediately.", "Server.Game") +ADMIN_VERB(restart, R_SERVER, "Reboot World", "Restarts the world immediately.", ADMIN_CATEGORY_SERVER_GAME) var/list/options = list(REGULAR_RESTART, REGULAR_RESTART_DELAYED, HARD_RESTART) // this option runs a codepath that can leak db connections because it skips subsystem (specifically SSdbcore) shutdown @@ -681,25 +646,22 @@ ADMIN_VERB(restart, R_SERVER, "Reboot World", "Restarts the world immediately.", #undef HARDEST_RESTART #undef TGS_RESTART -ADMIN_VERB(cancel_reboot, R_SERVER, "Cancel Reboot", "Cancels a pending world reboot.", "Server.Game") +ADMIN_VERB(cancel_reboot, R_SERVER, "Cancel Reboot", "Cancels a pending world reboot.", ADMIN_CATEGORY_SERVER_GAME) if(!SSticker.cancel_reboot(user)) return log_admin("[key_name(user)] cancelled the pending world reboot.") message_admins("[key_name_admin(user)] cancelled the pending world reboot.") -/datum/admins/proc/announce() - set category = "Admin.Chat" - set name = "Announce" - set desc="Announce your desires to the world" - if(!check_rights(0)) return +ADMIN_VERB(announce, R_SERVER|R_ADMIN|R_EVENT, "Announce", "Announce your desires to the world.", ADMIN_CATEGORY_CHAT) + var/message = tgui_input_text(user, "Global message to send:", "Admin Announce", multiline = TRUE, prevent_enter = TRUE) + if(!message) + return - var/message = tgui_input_text(usr, "Global message to send:", "Admin Announce", multiline = TRUE, prevent_enter = TRUE) - if(message) - if(!check_rights(R_SERVER,0)) - message = sanitize(message, 500, extra = 0) - message = replacetext(message, "\n", "
") // required since we're putting it in a

tag - send_ooc_announcement(message, "From [usr.client.holder.fakekey ? "Administrator" : usr.key]") - log_admin("Announce: [key_name(usr)] : [message]") + if(!check_rights_for(user, R_SERVER)) + message = sanitize(message, 500, extra = 0) + message = replacetext(message, "\n", "
") // required since we're putting it in a

tag + send_ooc_announcement(message, "From [user.holder.fakekey ? "Administrator" : usr.key]") + log_admin("Announce: [key_name(user)] : [message]") feedback_add_details("admin_verb","A") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/admins/proc/intercom() @@ -815,14 +777,7 @@ ADMIN_VERB(cancel_reboot, R_SERVER, "Cancel Reboot", "Cancels a pending world re GLOB.global_announcer.autosay("[this_message]", "[this_sender]", "[channel == "Common" ? null : channel]", states = speech_verb) //Common is a weird case, as it's not a "channel", it's just talking into a radio without a channel set. sleep(this_wait SECONDS) -/datum/admins/proc/toggleooc() - set category = "Server.Chat" - set desc="Globally Toggles OOC" - set name="Toggle Player OOC" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(toggleooc, R_ADMIN, "Toggle Player OOC", "Globally Toggles OOC.", ADMIN_CATEGORY_SERVER_CHAT) CONFIG_SET(flag/ooc_allowed, !CONFIG_GET(flag/ooc_allowed)) if (CONFIG_GET(flag/ooc_allowed)) to_chat(world, span_world("The OOC channel has been globally enabled!")) @@ -831,14 +786,7 @@ ADMIN_VERB(cancel_reboot, R_SERVER, "Cancel Reboot", "Cancels a pending world re log_and_message_admins("toggled OOC.") feedback_add_details("admin_verb","TOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/togglelooc() - set category = "Server.Chat" - set desc="Globally Toggles LOOC" - set name="Toggle Player LOOC" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(togglelooc, R_ADMIN, "Toggle Player LOOC", "Globally Toggles LOOC.", ADMIN_CATEGORY_SERVER_CHAT) CONFIG_SET(flag/looc_allowed, !CONFIG_GET(flag/looc_allowed)) if (CONFIG_GET(flag/looc_allowed)) to_chat(world, span_world("The LOOC channel has been globally enabled!")) @@ -847,130 +795,88 @@ ADMIN_VERB(cancel_reboot, R_SERVER, "Cancel Reboot", "Cancels a pending world re log_and_message_admins("toggled LOOC.") feedback_add_details("admin_verb","TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/datum/admins/proc/toggledsay() - set category = "Server.Chat" - set desc="Globally Toggles DSAY" - set name="Toggle DSAY" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(toggledsay, R_ADMIN, "Toggle DSAY", "Globally Toggles DSAY.", ADMIN_CATEGORY_SERVER_CHAT) CONFIG_SET(flag/dsay_allowed, !CONFIG_GET(flag/dsay_allowed)) if (CONFIG_GET(flag/dsay_allowed)) to_chat(world, span_world("Deadchat has been globally enabled!")) else to_chat(world, span_world("Deadchat has been globally disabled!")) - log_admin("[key_name(usr)] toggled deadchat.") - message_admins("[key_name_admin(usr)] toggled deadchat.") + log_admin("[key_name(user)] toggled deadchat.") + message_admins("[key_name_admin(user)] toggled deadchat.") feedback_add_details("admin_verb","TDSAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc -/datum/admins/proc/toggleoocdead() - set category = "Server.Chat" - set desc="Toggle Dead OOC." - set name="Toggle Dead OOC" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(toggleoocdead, R_ADMIN, "Toggle Dead OOC", "Toggle Dead OOC.", ADMIN_CATEGORY_SERVER_CHAT) CONFIG_SET(flag/dooc_allowed, !CONFIG_GET(flag/dooc_allowed)) - log_admin("[key_name(usr)] toggled Dead OOC.") - message_admins("[key_name_admin(usr)] toggled Dead OOC.") + log_admin("[key_name(user)] toggled Dead OOC.") + message_admins("[key_name_admin(user)] toggled Dead OOC.") feedback_add_details("admin_verb","TDOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/togglehubvisibility() - set category = "Server.Config" - set desc="Globally Toggles Hub Visibility" - set name="Toggle Hub Visibility" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(togglehubvisibility, R_HOST, "Toggle Hub Visibility", "Globally Toggles Hub Visibility.", ADMIN_CATEGORY_SERVER_CONFIG) world.visibility = !(world.visibility) - log_admin("[key_name(usr)] toggled hub visibility.") - message_admins("[key_name_admin(usr)] toggled hub visibility. The server is now [world.visibility ? "visible" : "invisible"] ([world.visibility]).") + log_admin("[key_name(user)] toggled hub visibility.") + message_admins("[key_name_admin(user)] toggled hub visibility. The server is now [world.visibility ? "visible" : "invisible"] ([world.visibility]).") feedback_add_details("admin_verb","THUB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc -/datum/admins/proc/toggletraitorscaling() - set category = "Server.Game" - set desc="Toggle traitor scaling" - set name="Toggle Traitor Scaling" +ADMIN_VERB(toggletraitorscaling, R_ADMIN, "Toggle traitor scaling", "Toggle traitor scaling.", ADMIN_CATEGORY_SERVER_GAME) CONFIG_SET(flag/traitor_scaling, !CONFIG_GET(flag/traitor_scaling)) - log_admin("[key_name(usr)] toggled Traitor Scaling to [CONFIG_GET(flag/traitor_scaling)].") - message_admins("[key_name_admin(usr)] toggled Traitor Scaling [CONFIG_GET(flag/traitor_scaling) ? "on" : "off"].") + log_admin("[key_name(user)] toggled Traitor Scaling to [CONFIG_GET(flag/traitor_scaling)].") + message_admins("[key_name_admin(user)] toggled Traitor Scaling [CONFIG_GET(flag/traitor_scaling) ? "on" : "off"].") feedback_add_details("admin_verb","TTS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/startnow() - set category = "Server.Game" - set desc="Start the round ASAP" - set name="Start Now" - - if(!check_rights(R_SERVER|R_EVENT)) - return +ADMIN_VERB(startnow, R_SERVER|R_EVENT, "Start Now", "Start the round ASAP.", ADMIN_CATEGORY_SERVER_GAME) if(SSticker.current_state > GAME_STATE_PREGAME) - to_chat(usr, span_warning("Error: Start Now: Game has already started.")) + to_chat(user, span_warning("Error: Start Now: Game has already started.")) return if(!SSticker.start_immediately) SSticker.start_immediately = TRUE 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.)" - log_admin("[key_name(usr)] has started the game.[msg]") - message_admins(span_notice("[key_name_admin(usr)] has started the game.[msg]")) - feedback_add_details("admin_verb","SN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - else - SSticker.start_immediately = FALSE - to_chat(world, span_filter_system(span_blue("Immediate game start canceled. Normal startup resumed."))) - log_and_message_admins("cancelled immediate game start.") -/datum/admins/proc/toggleenter() - set category = "Server.Game" - set desc="People can't enter" - set name="Toggle Entering" + log_admin("[key_name(user)] has started the game.[msg]") + message_admins(span_notice("[key_name_admin(user)] has started the game.[msg]")) + feedback_add_details("admin_verb","SN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + return + SSticker.start_immediately = FALSE + to_chat(world, span_filter_system(span_blue("Immediate game start canceled. Normal startup resumed."))) + log_and_message_admins("cancelled immediate game start.") + +ADMIN_VERB(toggleenter, R_SERVER|R_ADMIN, "Toggle Entering", "Toggle if people can join the round.", ADMIN_CATEGORY_SERVER_GAME) CONFIG_SET(flag/enter_allowed, !CONFIG_GET(flag/enter_allowed)) if (!CONFIG_GET(flag/enter_allowed)) to_chat(world, span_world("New players may no longer enter the game.")) else to_chat(world, span_world("New players may now enter the game.")) - log_admin("[key_name(usr)] toggled new player game entering.") - message_admins(span_blue("[key_name_admin(usr)] toggled new player game entering.")) + log_admin("[key_name(user)] toggled new player game entering.") + message_admins(span_blue("[key_name_admin(user)] toggled new player game entering.")) world.update_status() feedback_add_details("admin_verb","TE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/toggleAI() - set category = "Server.Game" - set desc="People can't be AI" - set name="Toggle AI" +ADMIN_VERB(toggleAI, R_SERVER|R_EVENT, "Toggle AI", "Toggle if people can play as AI.", ADMIN_CATEGORY_SERVER_GAME) CONFIG_SET(flag/allow_ai, !CONFIG_GET(flag/allow_ai)) if (!CONFIG_GET(flag/allow_ai)) to_chat(world, span_world("The AI job is no longer chooseable.")) else to_chat(world, span_world("The AI job is chooseable now.")) - log_admin("[key_name(usr)] toggled AI allowed.") + log_admin("[key_name(user)] toggled AI allowed.") world.update_status() feedback_add_details("admin_verb","TAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/toggleaban() - set category = "Server.Game" - set desc="Respawn basically" - set name="Toggle Respawn" +ADMIN_VERB(toggleaban, R_SERVER|R_EVENT, "Toggle Respawn", "Respawn basically.", ADMIN_CATEGORY_SERVER_GAME) CONFIG_SET(flag/abandon_allowed, !CONFIG_GET(flag/abandon_allowed)) if(CONFIG_GET(flag/abandon_allowed)) to_chat(world, span_world("You may now respawn.")) else to_chat(world, span_world("You may no longer respawn :(")) - message_admins(span_blue("[key_name_admin(usr)] toggled respawn to [CONFIG_GET(flag/abandon_allowed) ? "On" : "Off"].")) - log_admin("[key_name(usr)] toggled respawn to [CONFIG_GET(flag/abandon_allowed) ? "On" : "Off"].") + message_admins(span_blue("[key_name_admin(user)] toggled respawn to [CONFIG_GET(flag/abandon_allowed) ? "On" : "Off"].")) + log_admin("[key_name(user)] toggled respawn to [CONFIG_GET(flag/abandon_allowed) ? "On" : "Off"].") world.update_status() feedback_add_details("admin_verb","TR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/togglepersistence() - set category = "Server.Config" - set desc="Whether persistent data will be saved from now on." - set name="Toggle Persistent Data" +ADMIN_VERB(togglepersistence, R_SERVER, "Toggle Persistent Data", "Whether persistent data will be saved from now on.", ADMIN_CATEGORY_SERVER_CONFIG) CONFIG_SET(flag/persistence_disabled, !CONFIG_GET(flag/persistence_disabled)) - message_admins(span_blue("[key_name_admin(usr)] toggled persistence to [CONFIG_GET(flag/persistence_disabled) ? "Off" : "On"].")) - log_admin("[key_name(usr)] toggled persistence to [CONFIG_GET(flag/persistence_disabled) ? "Off" : "On"].") + message_admins(span_blue("[key_name_admin(user)] toggled persistence to [CONFIG_GET(flag/persistence_disabled) ? "Off" : "On"].")) + log_admin("[key_name(user)] toggled persistence to [CONFIG_GET(flag/persistence_disabled) ? "Off" : "On"].") world.update_status() feedback_add_details("admin_verb","TPD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -1000,48 +906,34 @@ ADMIN_VERB(toggle_space_ninja, R_FUN|R_SERVER, "Toggle Space Ninjas", "Toggle sp message_admins("[key_name_admin(user)] toggled Space Ninjas [CONFIG_GET(flag/ninjas_allowed) ? "on" : "off"].") feedback_add_details("admin_verb","TSN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/delay() - set category = "Server.Game" - set desc="Delay the game start/end" - set name="Delay" - - if(!check_rights(R_SERVER|R_EVENT|R_ADMIN|R_MOD)) return +ADMIN_VERB(delay, R_SERVER|R_EVENT|R_ADMIN|R_MOD, "Delay", "Delay the game start/end.", ADMIN_CATEGORY_SERVER_GAME) if (SSticker.current_state >= GAME_STATE_PLAYING) // Tell the ticker to delay/resume SSticker.toggle_delay() - log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].") - message_admins(span_blue("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")) + log_admin("[key_name(user)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].") + message_admins(span_blue("[key_name(user)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")) return GLOB.round_progressing = !GLOB.round_progressing if (!GLOB.round_progressing) to_chat(world, span_world("The game start has been delayed.")) - log_admin("[key_name(usr)] delayed the game.") + log_admin("[key_name(user)] delayed the game.") else to_chat(world, span_world("The game will start soon.")) - log_admin("[key_name(usr)] removed the delay.") + log_admin("[key_name(user)] removed the delay.") feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/adjump() - set category = "Server.Game" - set desc="Toggle admin jumping" - set name="Toggle Jump" +ADMIN_VERB(adjump, R_SERVER, "Toggle Jump", "Toggle admin jumping.", ADMIN_CATEGORY_SERVER_GAME) CONFIG_SET(flag/allow_admin_jump, !CONFIG_GET(flag/allow_admin_jump)) message_admins(span_blue("Toggled admin jumping to [CONFIG_GET(flag/allow_admin_jump)].")) feedback_add_details("admin_verb","TJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/adspawn() - set category = "Server.Game" - set desc="Toggle admin spawning" - set name="Toggle Spawn" +ADMIN_VERB(adspawn, R_SERVER, "Toggle Spawn", "Toggle admin spawning.", ADMIN_CATEGORY_SERVER_GAME) CONFIG_SET(flag/allow_admin_spawning, !CONFIG_GET(flag/allow_admin_spawning)) message_admins(span_blue("Toggled admin item spawning to [CONFIG_GET(flag/allow_admin_spawning)].")) feedback_add_details("admin_verb","TAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/adrev() - set category = "Server.Game" - set desc="Toggle admin revives" - set name="Toggle Revive" +ADMIN_VERB(adrev, R_SERVER, "Toggle Revive", "Toggle admin revives.", ADMIN_CATEGORY_SERVER_GAME) CONFIG_SET(flag/allow_admin_rev, !CONFIG_GET(flag/allow_admin_rev)) message_admins(span_blue("Toggled reviving to [CONFIG_GET(flag/allow_admin_rev)].")) feedback_add_details("admin_verb","TAR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -1087,79 +979,55 @@ ADMIN_VERB(toggle_space_ninja, R_FUN|R_SERVER, "Toggle Space Ninjas", "Toggle sp return 0 -/datum/admins/proc/spawn_fruit(seedtype in SSplants.seeds) - set category = "Debug.Game" - set desc = "Spawn the product of a seed." - set name = "Spawn Fruit" - - if(!check_rights(R_SPAWN)) return - +ADMIN_VERB(spawn_fruit, R_SPAWN, "Spawn Fruit", "Spawn the product of a seed.", ADMIN_CATEGORY_DEBUG_GAME) + var/seedtype = tgui_input_list(user, "Select Seed.", "Seed Type", SSplants.seeds) if(!seedtype || !SSplants.seeds[seedtype]) return - var/amount = tgui_input_number(usr, "Amount of fruit to spawn", "Fruit Amount", 1) + var/amount = tgui_input_number(user, "Amount of fruit to spawn", "Fruit Amount", 1) + var/mob/user_mob = user.mob if(!isnull(amount)) var/datum/seed/S = SSplants.seeds[seedtype] - S.harvest(usr,0,0,amount) - log_admin("[key_name(usr)] spawned [seedtype] fruit at ([usr.x],[usr.y],[usr.z])") + S.harvest(user_mob,0,0,amount) + log_admin("[key_name(user)] spawned [seedtype] fruit at ([user_mob.x],[user_mob.y],[user_mob.z])") -/datum/admins/proc/spawn_custom_item() - set category = "Debug.Game" - set desc = "Spawn a custom item." - set name = "Spawn Custom Item" - - if(!check_rights(R_SPAWN)) return - - var/owner = tgui_input_list(usr, "Select a ckey.", "Spawn Custom Item", GLOB.custom_items) - if(!owner|| !GLOB.custom_items[owner]) +ADMIN_VERB(spawn_custom_item, R_SPAWN, "Spawn Custom Item", "Spawn a custom item.", ADMIN_CATEGORY_DEBUG_GAME) + var/owner = tgui_input_list(user, "Select a ckey.", "Spawn Custom Item", GLOB.custom_items) + if(!owner) return var/list/possible_items = GLOB.custom_items[owner] - var/datum/custom_item/item_to_spawn = tgui_input_list(usr, "Select an item to spawn.", "Spawn Custom Item", possible_items) + if(!possible_items) + return + var/datum/custom_item/item_to_spawn = tgui_input_list(user, "Select an item to spawn.", "Spawn Custom Item", possible_items) if(!item_to_spawn) return - item_to_spawn.spawn_item(get_turf(usr)) - -/datum/admins/proc/check_custom_items() - set category = "Debug.Investigate" - set desc = "Check the custom item list." - set name = "Check Custom Items" - - if(!check_rights(R_SPAWN)) return + item_to_spawn.spawn_item(get_turf(user.mob)) +ADMIN_VERB(check_custom_items, R_SPAWN, "Check Custom Items", "Check the custom item list.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) if(!GLOB.custom_items) - to_chat(usr, "Custom item list is null.") + to_chat(user, "Custom item list is null.") return - if(!length(GLOB.custom_items)) - to_chat(usr, "Custom item list not populated.") + if(!GLOB.custom_items.len) + to_chat(user, "Custom item list not populated.") return for(var/assoc_key in GLOB.custom_items) - to_chat(usr, "[assoc_key] has:") + to_chat(user, "[assoc_key] has:") var/list/current_items = GLOB.custom_items[assoc_key] for(var/datum/custom_item/item in current_items) - to_chat(usr, "- name: [item.name] icon: [item.item_icon] path: [item.item_path] desc: [item.item_desc]") - -/datum/admins/proc/spawn_plant(seedtype in SSplants.seeds) - set category = "Debug.Game" - set desc = "Spawn a spreading plant effect." - set name = "Spawn Plant" - - if(!check_rights(R_SPAWN)) return + to_chat(user, "- name: [item.name] icon: [item.item_icon] path: [item.item_path] desc: [item.item_desc]") +ADMIN_VERB(spawn_plant, R_SPAWN, "Spawn Plant", "Spawn a spreading plant effect.", ADMIN_CATEGORY_DEBUG_GAME) + var/seedtype = tgui_input_list(user, "Select Seed.", "Seed Type", SSplants.seeds) if(!seedtype || !SSplants.seeds[seedtype]) return - new /obj/effect/plant(get_turf(usr), SSplants.seeds[seedtype]) - log_admin("[key_name(usr)] spawned [seedtype] vines at ([usr.x],[usr.y],[usr.z])") - -/datum/admins/proc/spawn_atom(var/object as text) - set name = "Spawn" - set category = "Debug.Game" - set desc = "(atom path) Spawn an atom" - - if(!check_rights(R_SPAWN)) return + var/mob/user_mob = user.mob + new /obj/effect/plant(get_turf(user_mob), SSplants.seeds[seedtype]) + log_admin("[key_name(user)] spawned [seedtype] vines at ([user_mob.x],[user_mob.y],[user_mob.z])") +ADMIN_VERB(spawn_atom, R_SPAWN, "Spawn", "(atom path) Spawn an atom", ADMIN_CATEGORY_DEBUG_GAME, object as text) var/list/types = typesof(/atom) var/list/matches = new() @@ -1174,42 +1042,34 @@ ADMIN_VERB(toggle_space_ninja, R_FUN|R_SERVER, "Toggle Space Ninjas", "Toggle sp if(matches.len==1) chosen = matches[1] else - chosen = tgui_input_list(usr, "Select an atom type", "Spawn Atom", matches) + chosen = tgui_input_list(user, "Select an atom type", "Spawn Atom", matches) if(!chosen) return + var/mob/user_mob = user.mob if(ispath(chosen,/turf)) - var/turf/T = get_turf(usr.loc) + var/turf/T = get_turf(user_mob.loc) T.ChangeTurf(chosen) else - new chosen(usr.loc) + new chosen(user_mob.loc) - log_and_message_admins("spawned [chosen] at ([usr.x],[usr.y],[usr.z])") + log_and_message_admins("spawned [chosen] at ([user_mob.x],[user_mob.y],[user_mob.z])") feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/datum/admins/proc/show_traitor_panel(var/mob/M in GLOB.mob_list) - set category = "Admin.Events" - set desc = "Edit mobs's memory and role" - set name = "Show Traitor Panel" - +ADMIN_VERB(show_traitor_panel, R_ADMIN|R_FUN|R_EVENT, "Show Traitor Panel", "Edit mobs's memory and role", ADMIN_CATEGORY_EVENTS, mob/M in GLOB.mob_list) if(!istype(M)) - to_chat(usr, "This can only be used on instances of type /mob") + to_chat(user, "This can only be used on instances of type /mob") return if(!M.mind) - to_chat(usr, "This mob has no mind!") + to_chat(user, "This mob has no mind!") return - M.mind.edit_memory() + M.mind.edit_memory(user.mob) feedback_add_details("admin_verb","STP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/show_game_mode() - set category = "Admin.Game" - set desc = "Show the current round configuration." - set name = "Show Game Mode" - +ADMIN_VERB(show_game_mode, R_ADMIN|R_EVENT, "Show Game Mode", "Show the current round configuration.", ADMIN_CATEGORY_GAME) if(!SSticker|| !SSticker.mode) - tgui_alert_async(usr, "Not before roundstart!", "Alert") + tgui_alert_async(user, "Not before roundstart!", "Alert") return var/out = span_large(span_bold("Current mode: [SSticker.mode.name] ([SSticker.mode.config_tag])")) + "
" @@ -1273,36 +1133,29 @@ ADMIN_VERB(toggle_space_ninja, R_FUN|R_SERVER, "Toggle Space Ninjas", "Toggle sp out += " None." out += " \[+\]
" - var/datum/browser/popup = new(owner, "edit_mode[src]", "Edit Game Mode") + var/datum/browser/popup = new(user, "edit_mode[user.holder]", "Edit Game Mode") popup.set_content(out) popup.open() feedback_add_details("admin_verb","SGM") - -/datum/admins/proc/toggletintedweldhelmets() - set category = "Server.Config" - set desc="Reduces view range when wearing welding helmets" - set name="Toggle tinted welding helmets." +ADMIN_VERB(toggletintedweldhelmets, R_ADMIN, "Toggle tinted welding helmets", "Reduces view range when wearing welding helmets.", ADMIN_CATEGORY_SERVER_CONFIG) CONFIG_SET(flag/welder_vision, !CONFIG_GET(flag/welder_vision)) if (CONFIG_GET(flag/welder_vision)) to_chat(world, span_world("Reduced welder vision has been enabled!")) else to_chat(world, span_world("Reduced welder vision has been disabled!")) - log_admin("[key_name(usr)] toggled welder vision.") - message_admins("[key_name_admin(usr)] toggled welder vision.", 1) + log_admin("[key_name(user)] toggled welder vision.") + message_admins("[key_name_admin(user)] toggled welder vision.", 1) feedback_add_details("admin_verb","TTWH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/toggleguests() - set category = "Server.Config" - set desc="Guests can't enter" - set name="Toggle guests" +ADMIN_VERB(toggleguests, R_HOST, "Toggle guests", "Guests can't enter.", ADMIN_CATEGORY_SERVER_CONFIG) CONFIG_SET(flag/guests_allowed, !CONFIG_GET(flag/guests_allowed)) if (!CONFIG_GET(flag/guests_allowed)) to_chat(world, span_world("Guests may no longer enter the game.")) else to_chat(world, span_world("Guests may now enter the game.")) - log_admin("[key_name(usr)] toggled guests game entering [CONFIG_GET(flag/guests_allowed)?"":"dis"]allowed.") - message_admins(span_blue("[key_name_admin(usr)] toggled guests game entering [CONFIG_GET(flag/guests_allowed)?"":"dis"]allowed.")) + log_admin("[key_name(user)] toggled guests game entering [CONFIG_GET(flag/guests_allowed)?"":"dis"]allowed.") + message_admins(span_blue("[key_name_admin(user)] toggled guests game entering [CONFIG_GET(flag/guests_allowed)?"":"dis"]allowed.")) feedback_add_details("admin_verb","TGU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/update_mob_sprite(mob/living/carbon/human/H as mob) @@ -1404,119 +1257,65 @@ ADMIN_VERB(toggle_space_ninja, R_FUN|R_SERVER, "Toggle Space Ninjas", "Toggle sp qdel(frommob) return 1 -/datum/admins/proc/force_antag_latespawn() - set category = "Admin.Events" - set name = "Force Template Spawn" - set desc = "Force an antagonist template to spawn." - - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins)) - to_chat(usr, "Error: you are not an admin!") - return - +ADMIN_VERB(force_antag_latespawn, R_ADMIN|R_EVENT|R_FUN, "Force Template Spawn", "Force an antagonist template to spawn.", ADMIN_CATEGORY_EVENTS) if(!SSticker|| !SSticker.mode) - to_chat(usr, "Mode has not started.") + to_chat(user, span_warning("Mode has not started.")) return - var/antag_type = tgui_input_list(usr, "Choose a template.","Force Latespawn", GLOB.all_antag_types) + var/antag_type = tgui_input_list(user, "Choose a template.","Force Latespawn", GLOB.all_antag_types) if(!antag_type || !GLOB.all_antag_types[antag_type]) - to_chat(usr, "Aborting.") + to_chat(user, span_warning("Aborting.")) return var/datum/antagonist/antag = GLOB.all_antag_types[antag_type] - message_admins("[key_name(usr)] attempting to force latespawn with template [antag.id].") + message_admins("[key_name(user)] attempting to force latespawn with template [antag.id].") antag.attempt_late_spawn() -/datum/admins/proc/force_mode_latespawn() - set category = "Admin.Events" - set name = "Force Mode Spawn" - set desc = "Force autotraitor to proc." - - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins) || !check_rights(R_ADMIN|R_EVENT|R_FUN)) - to_chat(usr, "Error: you are not an admin!") - return - +ADMIN_VERB(force_mode_latespawn, R_ADMIN|R_EVENT|R_FUN, "Force Mode Spawn", "Force autotraitor to proc.", ADMIN_CATEGORY_EVENTS) if(!SSticker|| !SSticker.mode) - to_chat(usr, "Mode has not started.") + to_chat(user, span_warning("Mode has not started.")) return log_and_message_admins("attempting to force mode autospawn.") SSticker.mode.try_latespawn() -/datum/admins/proc/paralyze_mob(mob/living/H as mob) - set category = "Admin.Events" - set name = "Toggle Paralyze" - set desc = "Paralyzes a player. Or unparalyses them." - +ADMIN_VERB_AND_CONTEXT_MENU(paralyze_mob, R_ADMIN|R_MOD|R_EVENT, "Toggle Paralyze", "Paralyzes a player. Or unparalyses them.", ADMIN_CATEGORY_EVENTS, mob/living/living_target in GLOB.mob_list) var/msg + if (living_target.paralysis == 0) + living_target.SetParalysis(8000) + msg = "has paralyzed [key_name(living_target)]." + log_and_message_admins(msg) + return + if(tgui_alert(user, "[key_name(living_target)] is paralyzed, would you like to unparalyze them?","Paralyze Mob",list("Yes","No")) == "Yes") + living_target.SetParalysis(0) + msg = "has unparalyzed [key_name(living_target)]." + log_and_message_admins(msg) - if(check_rights(R_ADMIN|R_MOD|R_EVENT)) - if (H.paralysis == 0) - H.SetParalysis(8000) - msg = "has paralyzed [key_name(H)]." - log_and_message_admins(msg) - else - if(tgui_alert(src, "[key_name(H)] is paralyzed, would you like to unparalyze them?","Paralyze Mob",list("Yes","No")) == "Yes") - H.SetParalysis(0) - msg = "has unparalyzed [key_name(H)]." - log_and_message_admins(msg) +ADMIN_VERB(set_tcrystals, R_ADMIN|R_EVENT, "Set Telecrystals", "Allows admins to change telecrystals of a user.", ADMIN_CATEGORY_DEBUG_GAME, mob/living/carbon/human/human_mob in GLOB.player_list) + var/crystals = tgui_input_number(user, "Amount of telecrystals for [human_mob.ckey], currently [human_mob.mind.tcrystals].") + if (!isnull(crystals)) + human_mob.mind.tcrystals = crystals + var/msg = "[key_name(user)] has modified [human_mob.ckey]'s telecrystals to [crystals]." + message_admins(msg) -/datum/admins/proc/set_tcrystals(mob/living/carbon/human/H as mob) - set category = "Debug.Game" - set name = "Set Telecrystals" - set desc = "Allows admins to change telecrystals of a user." - set popup_menu = FALSE - var/crystals - - if(check_rights(R_ADMIN|R_EVENT)) - crystals = tgui_input_number(usr, "Amount of telecrystals for [H.ckey], currently [H.mind.tcrystals].", crystals) - if (!isnull(crystals)) - H.mind.tcrystals = crystals - var/msg = "[key_name(usr)] has modified [H.ckey]'s telecrystals to [crystals]." - message_admins(msg) - else - to_chat(usr, "You do not have access to this command.") - -/datum/admins/proc/add_tcrystals(mob/living/carbon/human/H as mob) - set category = "Debug.Game" - set name = "Add Telecrystals" - set desc = "Allows admins to change telecrystals of a user by addition." - set popup_menu = FALSE - var/crystals - - if(check_rights(R_ADMIN|R_EVENT)) - crystals = tgui_input_number(usr, "Amount of telecrystals to give to [H.ckey], currently [H.mind.tcrystals].", crystals) - if (!isnull(crystals)) - H.mind.tcrystals += crystals - var/msg = "[key_name(usr)] has added [crystals] to [H.ckey]'s telecrystals." - message_admins(msg) - else - to_chat(usr, "You do not have access to this command.") +ADMIN_VERB(add_tcrystals, R_ADMIN|R_EVENT, "Add Telecrystals", "Allows admins to change telecrystals of a user by addition.", ADMIN_CATEGORY_DEBUG_GAME, mob/living/carbon/human/human_mob in GLOB.player_list) + var/crystals = tgui_input_number(user, "Amount of telecrystals to give to [human_mob.ckey], currently [human_mob.mind.tcrystals].") + if (!isnull(crystals)) + human_mob.mind.tcrystals += crystals + var/msg = "[key_name(user)] has added [crystals] to [human_mob.ckey]'s telecrystals." + message_admins(msg) -/datum/admins/proc/sendFax() - set category = "Fun.Event Kit" - set name = "Send Fax" - set desc = "Sends a fax to this machine" - var/department = tgui_input_list(usr, "Choose a fax", "Fax", GLOB.alldepartments) +ADMIN_VERB(sendFax, R_ADMIN|R_MOD|R_EVENT, "Send Fax", "Sends a fax to this machine.", ADMIN_CATEGORY_FUN_EVENT_KIT) + var/department = tgui_input_list(user, "Choose a fax", "Fax", GLOB.alldepartments) for(var/obj/machinery/photocopier/faxmachine/sendto in GLOB.allfaxes) if(sendto.department == department) + var/replyorigin = tgui_input_text(user, "Please specify who the fax is coming from", "Origin") - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins)) - to_chat(usr, "Error: you are not an admin!") - return + var/obj/item/paper/admin/P = new /obj/item/paper/admin(null) //hopefully the null loc won't cause trouble for us + user.holder.faxreply = P - var/replyorigin = tgui_input_text(src.owner, "Please specify who the fax is coming from", "Origin") - - var/obj/item/paper/admin/P = new /obj/item/paper/admin( null ) //hopefully the null loc won't cause trouble for us - faxreply = P - - P.admindatum = src + P.admindatum = user.holder P.origin = replyorigin P.destination = sendto @@ -1590,17 +1389,17 @@ ADMIN_VERB(toggle_space_ninja, R_FUN|R_SERVER, "Toggle Space Ninjas", "Toggle sp faxreply = null return -/datum/admins/proc/set_uplink(mob/living/carbon/human/H as mob) +/datum/admins/proc/set_uplink(mob/living/carbon/human/human_mob) set category = "Debug.Events" set name = "Set Uplink" set desc = "Allows admins to set up an uplink on a character. This will be required for a character to use telecrystals." set popup_menu = FALSE if(check_rights(R_ADMIN|R_DEBUG)) - GLOB.traitors.spawn_uplink(H) - H.mind.tcrystals = DEFAULT_TELECRYSTAL_AMOUNT - H.mind.accept_tcrystals = 1 - var/msg = "[key_name(usr)] has given [H.ckey] an uplink." + GLOB.traitors.spawn_uplink(human_mob) + human_mob.mind.tcrystals = DEFAULT_TELECRYSTAL_AMOUNT + human_mob.mind.accept_tcrystals = 1 + var/msg = "[key_name(usr)] has given [human_mob.ckey] an uplink." message_admins(msg) else to_chat(usr, "You do not have access to this command.") diff --git a/code/modules/admin/admin_verb_lists_vr.dm b/code/modules/admin/admin_verb_lists_vr.dm index 42a0de8c97..1d08615507 100644 --- a/code/modules/admin/admin_verb_lists_vr.dm +++ b/code/modules/admin/admin_verb_lists_vr.dm @@ -1,291 +1,88 @@ //admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless GLOBAL_LIST_INIT(admin_verbs_admin, list( - /client/proc/toggle_vantag_hud, - /datum/admins/proc/set_tcrystals, - /datum/admins/proc/add_tcrystals, - /datum/admins/proc/show_traitor_panel, //interface which shows a mob's mind., - /datum/admins/proc/show_game_mode, //Configuration window for the current game mode., - /datum/admins/proc/force_mode_latespawn, //Force the mode to try a latespawn proc, - /datum/admins/proc/force_antag_latespawn, //Force a specific template to try a latespawn proc, - /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/announce, //priority announce something to all clients., /datum/admins/proc/intercom, //send a fake intercom message, like an arrivals announcement, /datum/admins/proc/intercom_convo, //send a fake intercom conversation, like an ATC exchange, - /client/proc/player_panel_new, //shows an interface for all players, with links to various panels, - /client/proc/player_panel, /client/proc/hide_verbs, //hides all our adminverbs, /client/proc/hide_most_verbs, //hides all our hideable adminverbs, - /client/proc/cmd_check_new_players, //allows us to see every new player, - /client/proc/cmd_admin_pm_context, //right-click adminPM interface, - /client/proc/cmd_admin_pm_panel, //admin-pm list, - /client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head', - /datum/admins/proc/access_news_network, //allows access of newscasters, /client/proc/jumptocoord, //we ghost and jump to a coordinate, /client/proc/Getmob, //teleports a mob to our location, /client/proc/Getkey, //teleports a mob with a certain ckey to our location, /client/proc/Jump, /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/cmd_admin_direct_narrate, //send text directly to a player with no padding. Useful for narratives and fluff-text, - /client/proc/cmd_admin_world_narrate, //sends text to all players with no padding, /client/proc/check_ai_laws, //shows AI and borg laws, /client/proc/rename_silicon, //properly renames silicons, - /client/proc/manage_silicon_laws, // Allows viewing and editing silicon laws. , /client/proc/modify_robot, - /client/proc/check_antagonists, - /client/proc/dsay, //talk in deadchat using our ckey/fakekey, - /datum/admins/proc/toggleooc, //toggles ooc on/off for everyone, - /datum/admins/proc/togglelooc, //toggles looc on/off for everyone, - /datum/admins/proc/toggleoocdead, //toggles ooc on/off for everyone who is dead, - /datum/admins/proc/togglehubvisibility, //toggles visibility on the BYOND Hub., - /datum/admins/proc/toggledsay, //toggles dsay on/off for everyone, - /datum/admins/proc/PlayerNotes, - /datum/admins/proc/show_player_info, /client/proc/free_slot, //frees slot for chosen job, /client/proc/cmd_admin_change_custom_event, /client/proc/toggleghostwriters, /client/proc/toggledrones, - /client/proc/check_customitem_activity, /client/proc/man_up, /client/proc/global_man_up, /client/proc/response_team, // Response Teams admin verb, /client/proc/trader_ship, // Trader ship admin verb, - /client/proc/event_manager_panel, - /client/proc/empty_ai_core_toggle_latejoin, - /client/proc/empty_ai_core_toggle_latejoin, /client/proc/aooc, - /client/proc/change_human_appearance_admin, // Allows an admin to change the basic appearance of human-based mobs , - /client/proc/change_human_appearance_self, // Allows the human-based mob itself change its basic appearance , /client/proc/change_security_level, - /client/proc/view_chemical_reaction_logs, - /client/proc/makepAI, - /datum/admins/proc/paralyze_mob, - /datum/admins/proc/quick_authentic_nif, //CHOMPStation add + /datum/admins/proc/quick_authentic_nif, //CHOMPStation addn verbs (#19260)) /datum/admins/proc/set_uplink, - /datum/admins/proc/sendFax, - /datum/admins/proc/view_feedback, /client/proc/delbook, - /client/proc/toggle_spawning_with_recolour, /client/proc/start_vote, - /client/proc/hide_motion_tracker_feedback, - )) - -GLOBAL_LIST_INIT(admin_verbs_spawn, list( - /datum/admins/proc/spawn_fruit, - /datum/admins/proc/spawn_custom_item, - /datum/admins/proc/check_custom_items, - /datum/admins/proc/spawn_plant, - /datum/admins/proc/spawn_atom, //allows us to spawn instances, - /datum/admins/proc/spawn_mail, - /client/proc/spawn_character_mob, - /client/proc/spawn_chemdisp_cartridge, - /client/proc/map_template_load, - /client/proc/map_template_upload, - /client/proc/map_template_load_on_new_z, - /client/proc/eventkit_open_mob_spawner, - /client/proc/generic_structure, - /client/proc/generic_item, - /client/proc/create_gm_message, - /client/proc/remove_gm_message, - /client/proc/AdminCreateVirus, - /client/proc/ReleaseVirus, - /client/proc/spawn_reagent - )) - -GLOBAL_LIST_INIT(admin_verbs_server, list( - /datum/admins/proc/capture_map, - /client/proc/Set_Holiday, - /client/proc/ToRban, - /datum/admins/proc/startnow, - /datum/admins/proc/delay, - /datum/admins/proc/toggleaban, - /datum/admins/proc/togglepersistence, - /client/proc/toggle_log_hrefs, - /datum/admins/proc/toggleAI, - /client/proc/cmd_debug_del_all, - /datum/admins/proc/adrev, - /datum/admins/proc/adspawn, - /datum/admins/proc/adjump, - /client/proc/check_customitem_activity, - /client/proc/modify_server_news, - /client/proc/recipe_dump, - /client/proc/panicbunker, - /client/proc/paranoia_logging, - /client/proc/ip_reputation )) GLOBAL_LIST_INIT(admin_verbs_debug, list( - /client/proc/Debug2, /client/proc/kill_air, - /client/proc/ZASSettings, - /client/proc/cmd_debug_make_powernets, - /client/proc/kill_airgroup, - /client/proc/cmd_debug_mob_lists, - /client/proc/cmd_debug_using_map, - /client/proc/cmd_debug_del_all, - /client/proc/cmd_debug_tog_aliens, - /client/proc/cmd_display_del_log, - /client/proc/cmd_display_init_log, - // /client/proc/cmd_display_overlay_log, /client/proc/air_report, /client/proc/reload_admins, - /client/proc/reload_eventMs, /client/proc/print_random_map, /client/proc/create_random_map, /client/proc/apply_random_map, /client/proc/overlay_random_map, /client/proc/delete_random_map, /client/proc/show_plant_genes, - /client/proc/enable_debug_verbs, /client/proc/Jump, /client/proc/jumptomob, /client/proc/jumptocoord, - /client/proc/dsay, - /client/proc/player_panel_new, //shows an interface for all players, with links to various panels, - /client/proc/player_panel, /client/proc/hide_verbs, //hides all our adminverbs, /client/proc/hide_most_verbs, //hides all our hideable adminverbs, - /client/proc/cmd_check_new_players, //allows us to see every new player, - // /client/proc/show_gm_status, //We don't use SSgame_master yet. /datum/admins/proc/set_uplink, - /datum/admins/proc/change_weather, - /datum/admins/proc/change_time, - /client/proc/cmd_regenerate_asset_cache, - /client/proc/cmd_clear_smart_asset_cache, - /client/proc/cmd_reload_robot_sprite_test, - /client/proc/simple_DPS, - /datum/admins/proc/view_feedback, /client/proc/stop_sounds, - /client/proc/spawn_reagent, /datum/admins/proc/quick_authentic_nif, //CHOMPStation add - /client/proc/reload_configuration //CHOMPAdd )) //verbs which can be hidden - needs work GLOBAL_LIST_INIT(admin_verbs_hideable, list( -// /client/proc/deadchat, - /datum/admins/proc/show_traitor_panel, - /datum/admins/proc/toggleenter, - /datum/admins/proc/toggleguests, - /datum/admins/proc/announce, - /client/proc/cmd_admin_subtle_message, - /datum/admins/proc/access_news_network, - /client/proc/cmd_admin_direct_narrate, - /client/proc/cmd_admin_world_narrate, - /client/proc/Set_Holiday, - /client/proc/ToRban, - /datum/admins/proc/startnow, - /datum/admins/proc/delay, - /datum/admins/proc/toggleaban, - /client/proc/toggle_log_hrefs, - /datum/admins/proc/toggleAI, - /datum/admins/proc/adrev, - /datum/admins/proc/adspawn, - /datum/admins/proc/adjump, - /client/proc/Debug2, /client/proc/reload_admins, /client/proc/kill_air, - /client/proc/cmd_debug_make_powernets, - /client/proc/kill_airgroup, - /client/proc/startSinglo, - /client/proc/simple_DPS, - /client/proc/cmd_debug_mob_lists, - /client/proc/cmd_debug_using_map, - /client/proc/cmd_debug_del_all, - /client/proc/cmd_debug_tog_aliens, - /client/proc/cmd_display_del_log, /client/proc/air_report, - /client/proc/enable_debug_verbs, /datum/admins/proc/set_uplink, - /datum/admins/proc/set_tcrystals, /client/proc/stop_sounds )) GLOBAL_LIST_INIT(admin_verbs_mod, list( - /client/proc/cmd_admin_pm_context, //right-click adminPM interface, - /client/proc/cmd_admin_pm_panel, //admin-pm list, - /datum/admins/proc/PlayerNotes, - /client/proc/player_panel_new, //shows an interface for all players, with links to various panels, - /client/proc/player_panel, /client/proc/hide_verbs, //hides all our adminverbs, /client/proc/hide_most_verbs, //hides all our hideable adminverbs, - /client/proc/cmd_check_new_players, //allows us to see every new player, - /datum/admins/proc/show_player_info, - /datum/admins/proc/show_traitor_panel, - /client/proc/player_panel_new, - /client/proc/dsay, - /client/proc/check_antagonists, /client/proc/aooc, - /client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head', - /datum/admins/proc/paralyze_mob, - /client/proc/cmd_admin_direct_narrate, - /datum/admins/proc/sendFax, - /datum/admins/proc/view_persistent_data, - /client/proc/start_vote, + /client/proc/start_vote )) GLOBAL_LIST_INIT(admin_verbs_event_manager, list( - /client/proc/toggle_vantag_hud, - /client/proc/cmd_admin_pm_context, - /client/proc/cmd_admin_pm_panel, - /client/proc/player_panel_new, //shows an interface for all players, with links to various panels, - /client/proc/player_panel, /client/proc/hide_verbs, //hides all our adminverbs, /client/proc/hide_most_verbs, //hides all our hideable adminverbs, - /client/proc/cmd_check_new_players, //allows us to see every new player, - /datum/admins/proc/show_player_info, - /client/proc/dsay, - /client/proc/cmd_admin_subtle_message, - /client/proc/check_antagonists, /client/proc/aooc, - /datum/admins/proc/paralyze_mob, - /client/proc/cmd_admin_direct_narrate, - /datum/admins/proc/sendFax, - /datum/admins/proc/change_weather, - /datum/admins/proc/change_time, - /client/proc/cmd_regenerate_asset_cache, - /client/proc/cmd_clear_smart_asset_cache, - /client/proc/cmd_reload_robot_sprite_test, /client/proc/Jump, /client/proc/jumptomob, /client/proc/jumptocoord, - /datum/admins/proc/delay, - /client/proc/Set_Holiday, - /datum/admins/proc/PlayerNotes, - /datum/admins/proc/change_weather, - /datum/admins/proc/change_time, - /client/proc/cmd_regenerate_asset_cache, - /client/proc/cmd_clear_smart_asset_cache, - /client/proc/cmd_reload_robot_sprite_test, - /datum/admins/proc/set_tcrystals, - /datum/admins/proc/add_tcrystals, - /datum/admins/proc/show_traitor_panel, //interface which shows a mob's mind., - /datum/admins/proc/show_game_mode, //Configuration window for the current game mode., - /datum/admins/proc/force_mode_latespawn, //Force the mode to try a latespawn proc, - /datum/admins/proc/force_antag_latespawn, //Force a specific template to try a latespawn proc, - /datum/admins/proc/announce, //priority announce something to all clients., /datum/admins/proc/intercom, //send a fake intercom message, like an arrivals announcement, /datum/admins/proc/intercom_convo, //send a fake intercom conversation, like an ATC exchange, - /client/proc/cmd_admin_pm_context, //right-click adminPM interface, - /client/proc/cmd_admin_pm_panel, //admin-pm list, - /client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head', - /datum/admins/proc/access_news_network, //allows access of newscasters, /client/proc/jumptocoord, //we ghost and jump to a coordinate, /client/proc/Getmob, //teleports a mob to our location, /client/proc/Getkey, //teleports a mob with a certain ckey to our location, /client/proc/Jump, /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/cmd_admin_direct_narrate, //send text directly to a player with no padding. Useful for narratives and fluff-text, - /client/proc/cmd_admin_world_narrate, //sends text to all players with no padding, /client/proc/check_ai_laws, //shows AI and borg laws, /client/proc/rename_silicon, //properly renames silicons, - /client/proc/manage_silicon_laws, // Allows viewing and editing silicon laws. , /client/proc/modify_robot, - /client/proc/check_antagonists, - /client/proc/dsay, //talk in deadchat using our ckey/fakekey, - /datum/admins/proc/show_player_info, /client/proc/free_slot, //frees slot for chosen job, /client/proc/cmd_admin_change_custom_event, /client/proc/toggleghostwriters, @@ -293,29 +90,10 @@ GLOBAL_LIST_INIT(admin_verbs_event_manager, list( /client/proc/global_man_up, /client/proc/response_team, // Response Teams admin verb, /client/proc/trader_ship, // Trader ship admin verb, - /client/proc/event_manager_panel, /client/proc/aooc, - /client/proc/change_human_appearance_admin, // Allows an admin to change the basic appearance of human-based mobs , - /client/proc/change_human_appearance_self, // Allows the human-based mob itself change its basic appearance , /client/proc/change_security_level, - /client/proc/makepAI, - /datum/admins/proc/paralyze_mob, - /datum/admins/proc/sendFax, - /datum/admins/proc/view_feedback, - /datum/admins/proc/capture_map, - /client/proc/Set_Holiday, - /datum/admins/proc/startnow, - /datum/admins/proc/delay, - /client/proc/cmd_debug_del_all, - /client/proc/modify_server_news, - /client/proc/toggle_spawning_with_recolour, /client/proc/start_vote, - /client/proc/AdminCreateVirus, - /client/proc/ReleaseVirus, /client/proc/add_hidden_area, /client/proc/remove_hidden_area, - /client/proc/hide_motion_tracker_feedback, - /client/proc/modify_event_collector, - /client/proc/induce_malfunction, /datum/admins/proc/quick_authentic_nif, //CHOMPStation add )) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 384156edd0..f8ede55065 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -4,9 +4,7 @@ if(rights & R_HOLDER) if(rights & R_BUILDMODE) add_verb(src, /client/proc/togglebuildmodeself) if(rights & R_ADMIN) add_verb(src, GLOB.admin_verbs_admin) - 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_SPAWN) add_verb(src, GLOB.admin_verbs_spawn) if(rights & R_MOD) add_verb(src, GLOB.admin_verbs_mod) if(rights & R_EVENT) add_verb(src, GLOB.admin_verbs_event_manager) @@ -18,10 +16,7 @@ remove_verb(src, list( /client/proc/togglebuildmodeself, GLOB.admin_verbs_admin, - GLOB.admin_verbs_server, GLOB.admin_verbs_debug, - GLOB.admin_verbs_spawn, - GLOB.debug_verbs )) // NEW ADMIN VERBS SYSTEM @@ -139,32 +134,20 @@ ADMIN_VERB(show_manifest, R_ADMIN, "Show Manifest", "View the shift's Manifest." user.holder.show_manifest() //BLACKBOX_LOG_ADMIN_VERB("Show Manifest") -/client/proc/player_panel() - set name = "Player Panel" - set category = "Admin.Game" - if(check_rights(R_HOLDER)) - holder.player_panel_old() +ADMIN_VERB(player_panel, R_HOLDER, "Player Panel", "Open the player panel.", ADMIN_CATEGORY_GAME) + user.holder.player_panel_old(user) feedback_add_details("admin_verb","PP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return -/client/proc/player_panel_new() - set name = "Player Panel New" - set category = "Admin.Game" - if(check_rights(R_HOLDER)) - holder.player_panel_new() +ADMIN_VERB(player_panel_new, R_HOLDER, "Player Panel New", "Open the player panel.", ADMIN_CATEGORY_GAME) + user.holder.player_panel_new(user) feedback_add_details("admin_verb","PPN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return -/client/proc/check_antagonists() - set name = "Check Antagonists" - set category = "Admin.Investigate" - if(check_rights(R_HOLDER)) - holder.check_antagonists() - log_admin("[key_name(usr)] checked antagonists.") //for tsar~ +ADMIN_VERB(check_antagonists, R_HOLDER, "Check Antagonists", "Open the antagonist panel.", ADMIN_CATEGORY_INVESTIGATE) + user.holder.check_antagonists(user) + log_admin("[key_name(user)] checked antagonists.") //for tsar~ feedback_add_details("admin_verb","CHA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return -ADMIN_VERB(jobbans, R_BAN, "Display Job bans", "View job bans here.", "Admin.Investigate") +ADMIN_VERB(jobbans, R_BAN, "Display Job bans", "View job bans here.", ADMIN_CATEGORY_INVESTIGATE) if(CONFIG_GET(flag/ban_legacy_system)) user.holder.Jobbans() else @@ -205,7 +188,7 @@ ADMIN_VERB(game_panel, R_ADMIN|R_SERVER|R_FUN, "Game Panel", "Look at the state i = 0 GLOB.stealthminID["[ckey]"] = "@[num2text(num)]" -ADMIN_VERB(stealth, R_STEALTH, "Stealth Mode", "Toggle stealth.", "Admin.Game") +ADMIN_VERB(stealth, R_STEALTH, "Stealth Mode", "Toggle stealth.", ADMIN_CATEGORY_GAME) if(user.holder.fakekey) user.holder.fakekey = null if(isnewplayer(user.mob)) @@ -365,13 +348,11 @@ ADMIN_VERB(deadmin, R_NONE, "DeAdmin", "Shed your admin powers.", ADMIN_CATEGORY var/mob/observer/dead/our_mob = user.mob our_mob.visualnet?.removeVisibility(our_mob, user) -/client/proc/toggle_log_hrefs() - set name = "Toggle href logging" - set category = "Server.Config" - if(!holder) return - if(config) - CONFIG_SET(flag/log_hrefs, !CONFIG_GET(flag/log_hrefs)) - message_admins(span_bold("[key_name_admin(usr)] [CONFIG_GET(flag/log_hrefs) ? "started" : "stopped"] logging hrefs")) +ADMIN_VERB(toggle_log_hrefs, R_SERVER, "Toggle href logging", "Allows to toggle the logging of used hrefs.", ADMIN_CATEGORY_SERVER_CONFIG) + if(!config) + return + CONFIG_SET(flag/log_hrefs, !CONFIG_GET(flag/log_hrefs)) + message_admins(span_bold("[key_name_admin(user)] [CONFIG_GET(flag/log_hrefs) ? "started" : "stopped"] logging hrefs")) /client/proc/check_ai_laws() set name = "Check AI Laws" @@ -394,18 +375,14 @@ ADMIN_VERB(deadmin, R_NONE, "DeAdmin", "Shed your admin powers.", ADMIN_CATEGORY S.SetName(new_name) feedback_add_details("admin_verb","RAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/manage_silicon_laws() - set name = "Manage Silicon Laws" - set category = "Admin.Silicon" +ADMIN_VERB(manage_silicon_laws, R_ADMIN|R_EVENT, "Manage Silicon Laws", "Allows to modify silicon laws.", ADMIN_CATEGORY_SILICON) + var/mob/living/silicon/selected_silicon = tgui_input_list(user, "Select silicon.", "Manage Silicon Laws", GLOB.silicon_mob_list) + if(!selected_silicon) + return - if(!check_rights(R_ADMIN|R_EVENT)) return - - var/mob/living/silicon/S = tgui_input_list(usr, "Select silicon.", "Manage Silicon Laws", GLOB.silicon_mob_list) - if(!S) return - - var/datum/tgui_module/law_manager/admin/L = new(S) - L.tgui_interact(usr) - log_and_message_admins("has opened [S]'s law manager.") + var/datum/tgui_module/law_manager/admin/law_interface = new(selected_silicon) + law_interface.tgui_interact(user.mob) + log_and_message_admins("has opened [selected_silicon]'s law manager.") feedback_add_details("admin_verb","MSL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/change_security_level() @@ -443,13 +420,6 @@ ADMIN_VERB(deadmin, R_NONE, "DeAdmin", "Shed your admin powers.", ADMIN_CATEGORY // feedback_add_details("admin_verb","MP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return -/client/proc/playernotes() - set name = "Show Player Info" - set category = "Admin.Moderation" - if(check_rights(R_HOLDER)) - holder.PlayerNotes() - return - /client/proc/free_slot() set name = "Free Job Slot" set category = "Admin.Game" @@ -541,23 +511,20 @@ ADMIN_VERB(remove_spell, R_FUN, "Remove Spell", ADMIN_VERB_NO_DESCRIPTION, ADMIN feedback_add_details("admin_verb","RS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //BLACKBOX_LOG_ADMIN_VERB("Remove Spell") -ADMIN_VERB(debug_statpanel, R_DEBUG, "Debug Stat Panel", "Toggles local debug of the stat panel", "Debug.Misc") +ADMIN_VERB(debug_statpanel, R_DEBUG, "Debug Stat Panel", "Toggles local debug of the stat panel.", ADMIN_CATEGORY_DEBUG_MISC) user.stat_panel.send_message("create_debug") -/client/proc/spawn_reagent() - set name = "Spawn Reagent" - set category = "Debug.Game" - - if(!check_rights(R_ADMIN|R_EVENT)) return - var/datum/reagent/R = tgui_input_list(usr, "Select a reagent to spawn", "Reagent Spawner", subtypesof(/datum/reagent)) - if(!R) +ADMIN_VERB(spawn_reagent, R_DEBUG|R_EVENT, "Spawn Reagent", "Spawn any reagent.", ADMIN_CATEGORY_DEBUG_GAME) + var/datum/reagent/new_reagent = tgui_input_list(user, "Select a reagent to spawn", "Reagent Spawner", subtypesof(/datum/reagent)) + if(!new_reagent) return - var/obj/item/reagent_containers/glass/bottle/B = new(usr.loc) + var/mob/user_mob = user.mob + var/obj/item/reagent_containers/glass/bottle/new_bottle = new(user_mob.loc) - B.icon_state = "bottle-1" - B.reagents.add_reagent(R.id, 60) - B.name = "[B.name] of [R.name]" + new_bottle.icon_state = "bottle-1" + new_bottle.reagents.add_reagent(new_reagent.id, 60) + new_bottle.name = "[new_bottle.name] of [new_reagent.name]" /client/proc/add_hidden_area() set name = "Add Ghostsight Block Area" @@ -591,15 +558,9 @@ ADMIN_VERB(debug_statpanel, R_DEBUG, "Debug Stat Panel", "Toggles local debug of A.flags &= ~(AREA_BLOCK_GHOST_SIGHT) GLOB.ghostnet.removeArea(A) -/client/proc/hide_motion_tracker_feedback() - set name = "Toggle Motion Echos" - set desc = "Hides or reveals motion tracker echos globally." - set category = "Admin.Events" - - if(!check_rights(R_ADMIN|R_EVENT)) - return +ADMIN_VERB(hide_motion_tracker_feedback, R_ADMIN|R_EVENT, "Toggle Motion Echos", "Hides or reveals motion tracker echos globally.", ADMIN_CATEGORY_EVENTS) SSmotiontracker.hide_all = !SSmotiontracker.hide_all - log_admin("[key_name(usr)] changed the motion echo visibility to [SSmotiontracker.hide_all ? "hidden" : "visible"].") + log_admin("[key_name(user)] changed the motion echo visibility to [SSmotiontracker.hide_all ? "hidden" : "visible"].") ADMIN_VERB(adminorbit, R_FUN, "Orbit Things", "Makes something orbit around something else.", ADMIN_CATEGORY_FUN_EVENT_KIT) var/center @@ -651,7 +612,7 @@ ADMIN_VERB(adminorbit, R_FUN, "Orbit Things", "Makes something orbit around some if(tgui_alert(user, "\The [orbiter] will orbit around [center]. Is this okay?", "Confirm Orbit", list("Yes", "No")) == "Yes") orbiter.orbit(center, distance, clock, speed, segments) -ADMIN_VERB(removetickets, R_ADMIN, "Security Tickets", "Allows one to remove tickets from the global list.", "Admin.Investigate") +ADMIN_VERB(removetickets, R_ADMIN, "Security Tickets", "Allows one to remove tickets from the global list.", ADMIN_CATEGORY_INVESTIGATE) if(GLOB.security_printer_tickets.len >= 1) var/input = tgui_input_list(user, "Which message?", "Security Tickets", GLOB.security_printer_tickets) if(!input) @@ -712,22 +673,15 @@ ADMIN_VERB(removetickets, R_ADMIN, "Security Tickets", "Allows one to remove tic popup.set_content(dat) popup.open() -/client/proc/toggle_spawning_with_recolour() - set name = "Toggle Simple/Robot recolour verb" - set desc = "Makes it so new robots/simple_mobs spawn with a verb to recolour themselves for this round. You must set them separately." - set category = "Server.Game" - - if(!check_rights(R_ADMIN|R_EVENT|R_FUN)) - return - - var/which = tgui_alert(usr, "Which do you want to toggle?", "Choose Recolour Toggle", list("Robot", "Simple Mob")) +ADMIN_VERB(toggle_spawning_with_recolour, R_ADMIN|R_EVENT|R_FUN, "Toggle Simple/Robot recolour verb", "Makes it so new robots/simple_mobs spawn with a verb to recolour themselves for this round. You must set them separately.", ADMIN_CATEGORY_SERVER_GAME) + var/which = tgui_alert(user, "Which do you want to toggle?", "Choose Recolour Toggle", list("Robot", "Simple Mob")) switch(which) if("Robot") CONFIG_SET(flag/allow_robot_recolor, !CONFIG_GET(flag/allow_robot_recolor)) - to_chat(usr, "You have [CONFIG_GET(flag/allow_robot_recolor) ? "enabled" : "disabled"] newly spawned cyborgs to spawn with the recolour verb") + to_chat(user, "You have [CONFIG_GET(flag/allow_robot_recolor) ? "enabled" : "disabled"] newly spawned cyborgs to spawn with the recolour verb") if("Simple Mob") CONFIG_SET(flag/allow_simple_mob_recolor, !CONFIG_GET(flag/allow_simple_mob_recolor)) - to_chat(usr, "You have [CONFIG_GET(flag/allow_simple_mob_recolor) ? "enabled" : "disabled"] newly spawned simple mobs to spawn with the recolour verb") + to_chat(user, "You have [CONFIG_GET(flag/allow_simple_mob_recolor) ? "enabled" : "disabled"] newly spawned simple mobs to spawn with the recolour verb") -ADMIN_VERB(modify_shift_end, (R_ADMIN|R_EVENT|R_SERVER), "Modify Shift End", "Modifies the hard shift end time.", "Server.Game") +ADMIN_VERB(modify_shift_end, (R_ADMIN|R_EVENT|R_SERVER), "Modify Shift End", "Modifies the hard shift end time.", ADMIN_CATEGORY_SERVER_GAME) GLOB.transfer_controller.modify_hard_end(user) diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index d6b7b8c460..2f37312d32 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -65,6 +65,8 @@ GLOBAL_PROTECT(href_token) if(IsAdminAdvancedProcCall()) alert_to_permissions_elevation_attempt(usr) return QDEL_HINT_LETMELIVE + if(faxreply) + qdel(faxreply) . = ..() /datum/admins/proc/activate() diff --git a/code/modules/admin/map_capture.dm b/code/modules/admin/map_capture.dm index 95c3731563..6faf85349b 100644 --- a/code/modules/admin/map_capture.dm +++ b/code/modules/admin/map_capture.dm @@ -1,24 +1,37 @@ -/datum/admins/proc/capture_map(tx as null|num, ty as null|num, tz as null|num, range as null|num) - set category = "Server.Game" - set name = "Capture Map Part" - set desc = "Usage: Capture-Map-Part target_x_cord target_y_cord target_z_cord range (captures part of a map originating from bottom left corner)" - if(!check_rights(R_ADMIN|R_DEBUG|R_SERVER)) +ADMIN_VERB(capture_map, R_ADMIN, "Capture Map Part", "Usage: Capture-Map-Part target_x_cord target_y_cord target_z_cord range (captures part of a map originating from bottom left corner).", ADMIN_CATEGORY_SERVER_GAME) + + var/pos_type = tgui_alert(user, "Do you want to use your current loc or a manual number input?", "Where?", list("Manual", "Location", "Cancel")) + if(!pos_type || pos_type == "Cancel") return + var/tx + var/ty + var/tz + if(pos_type == "Location") + tx = user.mob.x + ty = user.mob.y + tz = user.mob.z + else + tx = tgui_input_number(user, "Select X location", "X Loc", 1, world.maxx, 1) + ty = tgui_input_number(user, "Select Y location", "Y Loc", 1, world.maxy, 1) + tz = tgui_input_number(user, "Select Z location", "Z Loc", 1, world.maxz, 1) + + var/range = tgui_input_number(user, "Select Range", "Range", 1, 32, 1) + if(isnull(tx) || isnull(ty) || isnull(tz) || isnull(range)) - to_chat(usr, span_filter_notice("Capture Map Part, captures part of a map using camara like rendering.")) - to_chat(usr, span_filter_notice("Usage: Capture-Map-Part target_x_cord target_y_cord target_z_cord range.")) - to_chat(usr, span_filter_notice("Target coordinates specify bottom left corner of the capture, range defines render distance to opposite corner.")) + to_chat(user, span_filter_notice("Capture Map Part, captures part of a map using camara like rendering.")) + to_chat(user, span_filter_notice("Usage: Capture-Map-Part target_x_cord target_y_cord target_z_cord range.")) + to_chat(user, span_filter_notice("Target coordinates specify bottom left corner of the capture, range defines render distance to opposite corner.")) return if(range > 32 || range <= 0) - to_chat(usr, span_filter_notice("Capturing range is incorrect, it must be within 1-32.")) + to_chat(user, span_filter_notice("Capturing range is incorrect, it must be within 1-32.")) return if(locate(tx,ty,tz)) var/list/turfstocapture = list() - var/hasasked = 0 + var/hasasked = FALSE for(var/xoff = 0 to range) for(var/yoff = 0 to range) var/turf/T = locate(tx + xoff,ty + yoff,tz) @@ -26,8 +39,8 @@ turfstocapture.Add(T) else if(!hasasked) - var/answer = tgui_alert(usr, "Capture includes non existant turf, Continue capture?","Continue capture?", list("No", "Yes")) - hasasked = 1 + var/answer = tgui_alert(user, "Capture includes non existant turf, Continue capture?","Continue capture?", list("No", "Yes")) + hasasked = TRUE if(answer != "Yes") return @@ -53,7 +66,7 @@ cap.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff) var/file_name = "map_capture_x[tx]_y[ty]_z[tz]_r[range].png" - to_chat(usr, span_filter_notice("Saved capture in cache as [file_name].")) - usr << browse_rsc(cap, file_name) + to_chat(user, span_filter_notice("Saved capture in cache as [file_name].")) + DIRECT_OUTPUT(user, browse_rsc(cap, file_name)) else - to_chat(usr, span_filter_notice("Target coordinates are incorrect.")) + to_chat(user, span_filter_notice("Target coordinates are incorrect.")) diff --git a/code/modules/admin/news.dm b/code/modules/admin/news.dm index a3757306bf..51072998ee 100644 --- a/code/modules/admin/news.dm +++ b/code/modules/admin/news.dm @@ -9,28 +9,15 @@ return TRUE return FALSE -/client/proc/modify_server_news() - set name = "Modify Public News" - set category = "Server.Game" - - if(!check_rights(0)) - return - +ADMIN_VERB(modify_server_news, R_SERVER|R_EVENT, "Modify Public News", "Modify the public news message.", ADMIN_CATEGORY_SERVER_GAME) var/savefile/F = new(NEWSFILE) if(F) - //ChompEDIT start - handle reads correctly - var/title - F["title"] >> title //This is done twice on purpose. For some reason BYOND misses the first read, if performed before the world starts - F["title"] >> title - var/body - F["body"] >> body - body = html2paper_markup(body) - //ChompEDIT end - - var/new_title = tgui_input_text(src,"Write a good title for the news update. Note: HTML is NOT supported.","Write News", title, MAX_MESSAGE_LEN) + var/title = F["title"] + var/body = html2paper_markup(F["body"]) + var/new_title = tgui_input_text(user, "Write a good title for the news update. Note: HTML is NOT supported.", "Write News", title, MAX_MESSAGE_LEN) if(!new_title) return - var/new_body = tgui_input_text(src,"Write the body of the news update here. Note: HTML is NOT supported, however paper markup is supported. \n\ + var/new_body = tgui_input_text(user, "Write the body of the news update here. Note: HTML is NOT supported, however paper markup is supported. \n\ Hitting enter will automatically add a line break. \n\ Valid markup includes: \[b\], \[i\], \[u\], \[large\], \[h1\], \[h2\], \[h3\]\ \[*\], \[hr\], \[small\], \[list\], \[table\], \[grid\], \ \[row\], \[cell\], \[logo\], \[talogo\], \[sglogo\].","Write News", body, MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE) @@ -42,9 +29,9 @@ GLOB.servernews_hash = md5("[new_title]" + "[new_body]") //ChompADD - update the servernews hash global F["title"] << new_title F["body"] << new_body - F["author"] << key + F["author"] << user.key F["timestamp"] << time2text(world.realtime, "DDD, MMM DD YYYY") - message_admins("[key] modified the news to read:
[new_title]
[new_body]") + message_admins("[user.key] modified the news to read:
[new_title]
[new_body]") /client/proc/get_server_news() //ChompEDIT - child of /client/ var/savefile/F = new(NEWSFILE) diff --git a/code/modules/admin/persistence.dm b/code/modules/admin/persistence.dm index 79a93b8c0f..5802d6133e 100644 --- a/code/modules/admin/persistence.dm +++ b/code/modules/admin/persistence.dm @@ -1,6 +1,2 @@ -/datum/admins/proc/view_persistent_data() - set category = "Admin.Game" - set name = "View Persistent Data" - set desc = "Shows a list of persistent data for this round. Allows modification by admins." - - SSpersistence.show_info(usr) +ADMIN_VERB(view_persistent_data, R_MOD|R_ADMIN, "View Persistent Data", "Shows a list of persistent data for this round. Allows modification by admins.", ADMIN_CATEGORY_GAME) + SSpersistence.show_info(user) diff --git a/code/modules/admin/player_effects.dm b/code/modules/admin/player_effects.dm index 029cdb7b08..0ed4ae9357 100644 --- a/code/modules/admin/player_effects.dm +++ b/code/modules/admin/player_effects.dm @@ -1,5 +1,5 @@ -ADMIN_VERB_AND_CONTEXT_MENU(player_effects, R_FUN, "Player Effects", "Modify a player character with various 'special treatments' from a list.", ADMIN_CATEGORY_FUN_EVENT_KIT, mob/target in GLOB.mob_list) +ADMIN_VERB_AND_CONTEXT_MENU(player_effects, R_FUN, "Player Effects", "Modify a player character with various 'special treatments' from a list.", ADMIN_CATEGORY_FUN_EVENT_KIT, mob/target in get_mob_with_client_list()) var/datum/eventkit/player_effects/spawner = new() spawner.target = target spawner.tgui_interact(user.mob) @@ -776,19 +776,18 @@ ADMIN_VERB_AND_CONTEXT_MENU(player_effects, R_FUN, "Player Effects", "Modify a p target.dust() if("paralyse") - var/mob/living/Tar = target - if(!istype(Tar)) + if(!isliving(target)) return - ui.user.client.holder.paralyze_mob(Tar) + SSadmin_verbs.dynamic_invoke_verb(ui.user.client, /datum/admin_verb/paralyze_mob, target) if("subtle_message") - ui.user.client.cmd_admin_subtle_message(target) + SSadmin_verbs.dynamic_invoke_verb(ui.user.client, /datum/admin_verb/cmd_admin_subtle_message, target) if("direct_narrate") - ui.user.client.cmd_admin_direct_narrate(target) + SSadmin_verbs.dynamic_invoke_verb(ui.user.client, /datum/admin_verb/cmd_admin_direct_narrate, target) if("player_panel") - SSadmin_verbs.dynamic_invoke_verb(ui.user, /datum/admin_verb/show_player_panel, target) + SSadmin_verbs.dynamic_invoke_verb(ui.user.client, /datum/admin_verb/show_player_panel, target) if("view_variables") ui.user.client.debug_variables(target) diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 9207dfc9a9..02f0c76d18 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -1,6 +1,6 @@ -/datum/admins/proc/player_panel_new()//The new one - if (!check_rights_for(usr.client, R_HOLDER)) +/datum/admins/proc/player_panel_new(client/user)//The new one + if (!check_rights_for(user, R_HOLDER)) return var/ui_scale = owner.prefs.read_preference(/datum/preference/toggle/ui_scale) var/dat = "Admin Player Panel" @@ -320,11 +320,11 @@ var/window_size = "size=600x480" if(owner.window_scaling && ui_scale) window_size = "size=[600 * owner.window_scaling]x[400 * owner.window_scaling]" - usr << browse(dat, "window=players;[window_size]") + user << browse(dat, "window=players;[window_size]") //The old one -/datum/admins/proc/player_panel_old() - if (!check_rights_for(usr.client, R_HOLDER)) +/datum/admins/proc/player_panel_old(client/user) + if (!check_rights_for(user, R_HOLDER)) return var/dat = "Player Menu" @@ -367,10 +367,10 @@ dat += {"

- + "} - if(usr.client) + if(user) switch(is_special_character(M)) if(0) dat += {""} @@ -385,11 +385,11 @@ dat += "
[M.key ? (M.client ? M.key : "[M.key] (DC)") : "No key"] XPMPMTraitor?
" - usr << browse(dat, "window=players;size=640x480") + user << browse(dat, "window=players;size=640x480") -/datum/admins/proc/check_antagonists() +/datum/admins/proc/check_antagonists(client/user) if (SSticker && SSticker.current_state >= GAME_STATE_PLAYING) var/dat = "Round Status

" + span_bold("Round Status") + "

" dat += "Current Game Mode: " + span_bold("[SSticker.mode.name]") + "
" @@ -416,6 +416,6 @@ var/datum/antagonist/A = GLOB.all_antag_types[antag_type] dat += A.get_check_antag_output(src) dat += "" - usr << browse(dat, "window=roundstatus;size=400x500") + user << browse(dat, "window=roundstatus;size=400x500") else - tgui_alert_async(usr, "The game hasn't started yet!") + tgui_alert_async(user, "The game hasn't started yet!") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 9898d94437..f6487653d7 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -28,7 +28,7 @@ return if(SSticker.mode && SSticker.mode.check_antagonists_topic(href, href_list)) - check_antagonists() + check_antagonists(usr.client) return if(href_list["ticket"]) @@ -841,7 +841,7 @@ if(istext(mute_type)) mute_type = text2num(mute_type) if(!isnum(mute_type)) return - cmd_admin_mute(M, mute_type) + cmd_admin_mute(M, mute_type, usr) else if(href_list["c_mode"]) if(!check_rights(R_ADMIN|R_EVENT)) return @@ -877,7 +877,7 @@ return tgui_alert_async(usr, "The game has already started.") GLOB.master_mode = href_list["c_mode2"] log_admin("[key_name(usr)] set the mode as [config.mode_names[GLOB.master_mode]].") - message_admins(span_blue("[key_name_admin(usr)] set the mode as [config.mode_names[GLOB.master_mode]]."), 1) + message_admins(span_blue("[key_name_admin(usr)] set the mode as [config.mode_names[GLOB.master_mode]].")) to_chat(world, span_world(span_blue("The mode is now: [config.mode_names[GLOB.master_mode]]"))) Game() // updates the main game menu world.save_mode(GLOB.master_mode) @@ -892,7 +892,7 @@ return tgui_alert_async(usr, "The game mode has to be secret!") GLOB.secret_force_mode = href_list["f_secret2"] log_admin("[key_name(usr)] set the forced secret mode as [GLOB.secret_force_mode].") - message_admins(span_blue("[key_name_admin(usr)] set the forced secret mode as [GLOB.secret_force_mode]."), 1) + message_admins(span_blue("[key_name_admin(usr)] set the forced secret mode as [GLOB.secret_force_mode].")) Game() // updates the main game menu .(href, list("f_secret"=1)) @@ -905,7 +905,7 @@ return log_admin("[key_name(usr)] attempting to monkeyize [key_name(H)]") - message_admins(span_blue("[key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]"), 1) + message_admins(span_blue("[key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]")) H.monkeyize() else if(href_list["corgione"]) @@ -917,7 +917,7 @@ return log_admin("[key_name(usr)] attempting to corgize [key_name(H)]") - message_admins(span_blue("[key_name_admin(usr)] attempting to corgize [key_name_admin(H)]"), 1) + message_admins(span_blue("[key_name_admin(usr)] attempting to corgize [key_name_admin(H)]")) H.corgize() else if(href_list["forcespeech"]) @@ -973,7 +973,7 @@ to_chat(M, span_filter_system(span_warning("You have been sent to the prison station!"))) log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.") - message_admins(span_blue("[key_name_admin(usr)] sent [key_name_admin(M)] to the prison station."), 1) + message_admins(span_blue("[key_name_admin(usr)] sent [key_name_admin(M)] to the prison station.")) else if(href_list["sendbacktolobby"]) if(!check_rights(R_ADMIN)) @@ -1022,7 +1022,7 @@ spawn(50) to_chat(M, span_filter_system(span_notice("You have been sent to the Thunderdome."))) log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)") - message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 1)", 1) + message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 1)") else if(href_list["tdome2"]) if(!check_rights(R_FUN)) return @@ -1048,7 +1048,7 @@ spawn(50) to_chat(M, span_filter_system(span_notice("You have been sent to the Thunderdome."))) log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)") - message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 2)", 1) + message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 2)") else if(href_list["tdomeadmin"]) if(!check_rights(R_FUN)) return @@ -1071,7 +1071,7 @@ spawn(50) to_chat(M, span_filter_system(span_notice("You have been sent to the Thunderdome."))) log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)") - message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Admin.)", 1) + message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Admin.)") else if(href_list["tdomeobserve"]) if(!check_rights(R_FUN)) return @@ -1101,7 +1101,7 @@ spawn(50) to_chat(M, span_filter_system(span_notice("You have been sent to the Thunderdome."))) log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)") - message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Observer.)", 1) + message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Observer.)") else if(href_list["revive"]) if(!check_rights(R_REJUVINATE)) return @@ -1113,7 +1113,7 @@ if(CONFIG_GET(flag/allow_admin_rev)) L.revive() - message_admins(span_red("Admin [key_name_admin(usr)] healed / revived [key_name_admin(L)]!"), 1) + message_admins(span_red("Admin [key_name_admin(usr)] healed / revived [key_name_admin(L)]!")) log_admin("[key_name(usr)] healed / Rrvived [key_name(L)]") else to_chat(usr, span_filter_adminlog(span_filter_warning("Admin Rejuvinates have been disabled"))) @@ -1126,7 +1126,7 @@ to_chat(usr, span_filter_adminlog("This can only be used on instances of type /mob/living/carbon/human")) return - message_admins(span_red("Admin [key_name_admin(usr)] AIized [key_name_admin(H)]!"), 1) + message_admins(span_red("Admin [key_name_admin(usr)] AIized [key_name_admin(H)]!")) log_admin("[key_name(usr)] AIized [key_name(H)]") H.AIize() @@ -1138,7 +1138,7 @@ to_chat(usr, span_filter_adminlog("This can only be used on instances of type /mob/living/carbon/human")) return - usr.client.cmd_admin_alienize(H) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/cmd_admin_alienize, H) else if(href_list[VK_HK_TURN_ROBOT]) if(!check_rights(R_SPAWN)) return @@ -1148,7 +1148,7 @@ to_chat(usr, span_filter_adminlog("This can only be used on instances of type /mob/living/carbon/human")) return - usr.client.cmd_admin_robotize(H) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/cmd_admin_robotize, H) else if(href_list["makeanimal"]) if(!check_rights(R_SPAWN)) return @@ -1158,7 +1158,7 @@ to_chat(usr, span_filter_adminlog("This cannot be used on instances of type /mob/new_player")) return - usr.client.cmd_admin_animalize(M) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/cmd_admin_animalize, M) else if(href_list["respawn"]) if(!check_rights(R_SPAWN)) @@ -1207,7 +1207,7 @@ G.ManualFollow(M) else if(href_list["check_antagonist"]) - check_antagonists() + check_antagonists(usr.client) else if(href_list["take_question"]) @@ -1514,13 +1514,13 @@ if(!check_rights(R_ADMIN|R_EVENT|R_FUN)) return var/mob/M = locate(href_list["narrateto"]) - usr.client.cmd_admin_direct_narrate(M) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/cmd_admin_direct_narrate, M) else if(href_list["subtlemessage"]) if(!check_rights(R_MOD|R_ADMIN|R_EVENT|R_FUN,0)) return var/mob/M = locate(href_list["subtlemessage"]) - usr.client.cmd_admin_subtle_message(M) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/cmd_admin_subtle_message, M) else if(href_list["traitor"]) if(!check_rights(R_ADMIN|R_MOD|R_EVENT)) return @@ -1533,7 +1533,7 @@ if(!ismob(M)) to_chat(usr, span_filter_adminlog("This can only be used on instances of type /mob.")) return - show_traitor_panel(M) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/show_traitor_panel, M) else if(href_list["create_object"]) if(!check_rights(R_SPAWN)) return @@ -1678,15 +1678,15 @@ else if(href_list["ac_view_wanted"]) //Admin newscaster Topic() stuff be here src.admincaster_screen = 18 //The ac_ prefix before the hrefs stands for AdminCaster. - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_set_channel_name"]) src.admincaster_feed_channel.channel_name = sanitizeSafe(tgui_input_text(usr, "Provide a Feed Channel Name", "Network Channel Handler", "", encode = FALSE)) - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_set_channel_lock"]) src.admincaster_feed_channel.locked = !src.admincaster_feed_channel.locked - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_submit_new_channel"]) var/check = 0 @@ -1703,22 +1703,22 @@ feedback_inc("newscaster_channels",1) //Adding channel to the global network log_admin("[key_name_admin(usr)] created command feed channel: [src.admincaster_feed_channel.channel_name]!") src.admincaster_screen=5 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_set_channel_receiving"]) var/list/available_channels = list() for(var/datum/feed_channel/F in GLOB.news_network.network_channels) available_channels += F.channel_name src.admincaster_feed_channel.channel_name = tgui_input_list(usr, "Choose receiving Feed Channel", "Network Channel Handler", available_channels) - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_set_new_title"]) src.admincaster_feed_message.title = tgui_input_text(usr, "Enter the Feed title", "Network Channel Handler", "", MAX_MESSAGE_LEN) - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_set_new_message"]) src.admincaster_feed_message.body = tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", "", MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE) - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_submit_new_message"]) if(src.admincaster_feed_message.body =="" || admincaster_feed_message.title == "" || admincaster_feed_message.body =="\[REDACTED\]" || admincaster_feed_channel.channel_name == "" ) @@ -1729,23 +1729,23 @@ src.admincaster_screen=4 log_admin("[key_name_admin(usr)] submitted a feed story to channel: [src.admincaster_feed_channel.channel_name]!") - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_create_channel"]) src.admincaster_screen=2 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_create_feed_story"]) src.admincaster_screen=3 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_menu_censor_story"]) src.admincaster_screen=10 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_menu_censor_channel"]) src.admincaster_screen=11 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_menu_wanted"]) var/already_wanted = 0 @@ -1756,15 +1756,15 @@ src.admincaster_feed_message.author = GLOB.news_network.wanted_issue.author src.admincaster_feed_message.body = GLOB.news_network.wanted_issue.body src.admincaster_screen = 14 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_set_wanted_name"]) src.admincaster_feed_message.author = tgui_input_text(usr, "Provide the name of the Wanted person", "Network Security Handler", "", MAX_MESSAGE_LEN) - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_set_wanted_desc"]) src.admincaster_feed_message.body = tgui_input_text(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", "", MAX_MESSAGE_LEN) - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_submit_wanted"]) var/input_param = text2num(href_list["ac_submit_wanted"]) @@ -1790,7 +1790,7 @@ GLOB.news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author src.admincaster_screen = 19 log_admin("[key_name_admin(usr)] issued a Station-wide Wanted Notification for [src.admincaster_feed_message.author]!") - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_cancel_wanted"]) var/choice = tgui_alert(usr, "Please confirm Wanted Issue removal","Network Security Handler",list("Confirm","Cancel")) @@ -1799,7 +1799,7 @@ for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.update_icon() src.admincaster_screen=17 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_censor_channel_author"]) var/datum/feed_channel/FC = locate(href_list["ac_censor_channel_author"]) @@ -1808,7 +1808,7 @@ FC.author = span_bold("\[REDACTED\]") else FC.author = FC.backup_author - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_censor_channel_story_author"]) var/datum/feed_message/MSG = locate(href_list["ac_censor_channel_story_author"]) @@ -1817,7 +1817,7 @@ MSG.author = span_bold("\[REDACTED\]") else MSG.author = MSG.backup_author - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_censor_channel_story_body"]) var/datum/feed_message/MSG = locate(href_list["ac_censor_channel_story_body"]) @@ -1826,22 +1826,22 @@ MSG.body = span_bold("\[REDACTED\]") else MSG.body = MSG.backup_body - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_pick_d_notice"]) var/datum/feed_channel/FC = locate(href_list["ac_pick_d_notice"]) src.admincaster_feed_channel = FC src.admincaster_screen=13 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_toggle_d_notice"]) var/datum/feed_channel/FC = locate(href_list["ac_toggle_d_notice"]) FC.censored = !FC.censored - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_view"]) src.admincaster_screen=1 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_setScreen"]) //Brings us to the main menu and resets all fields~ src.admincaster_screen = text2num(href_list["ac_setScreen"]) @@ -1850,26 +1850,26 @@ src.admincaster_feed_channel = new /datum/feed_channel if(src.admincaster_feed_message) src.admincaster_feed_message = new /datum/feed_message - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_show_channel"]) var/datum/feed_channel/FC = locate(href_list["ac_show_channel"]) src.admincaster_feed_channel = FC src.admincaster_screen = 9 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_pick_censor_channel"]) var/datum/feed_channel/FC = locate(href_list["ac_pick_censor_channel"]) src.admincaster_feed_channel = FC src.admincaster_screen = 12 - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_refresh"]) - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["ac_set_signature"]) src.admincaster_signature = tgui_input_text(usr, "Provide your desired signature", "Network Identity Handler", "", MAX_MESSAGE_LEN) - src.access_news_network() + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/access_news_network) else if(href_list["populate_inactive_customitems"]) if(check_rights(R_ADMIN|R_SERVER)) @@ -1911,28 +1911,6 @@ return SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/despawn_player, carbon_target) - - // player info stuff - - if(href_list["notes"]) - var/ckey = href_list["ckey"] - if(!ckey) - var/mob/M = locate(href_list["mob"]) - if(ismob(M)) - ckey = M.ckey - - switch(href_list["notes"]) - if("show") - var/datum/tgui_module/player_notes_info/A = new(src) - A.key = ckey - A.tgui_interact(usr) - if("list") - var/filter - if(href_list["filter"] && href_list["filter"] != "0") - filter = url_decode(href_list["filter"]) - PlayerNotesPage(text2num(href_list["index"]), filter) - if("filter") - PlayerNotesFilter() return /mob/living/proc/can_centcom_reply() diff --git a/code/modules/admin/verbs/adminfun.dm b/code/modules/admin/verbs/adminfun.dm index 5bcbcfdec9..5d1042ff84 100644 --- a/code/modules/admin/verbs/adminfun.dm +++ b/code/modules/admin/verbs/adminfun.dm @@ -60,7 +60,7 @@ ADMIN_VERB(gib_them, (R_ADMIN|R_FUN), "Gib", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CA victim.gib() feedback_add_details("admin_verb","GIB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -ADMIN_VERB(gib_self, R_HOLDER, "Gibself", "Give yourself the same treatment you give others.", "Fun.Do Not") +ADMIN_VERB(gib_self, R_HOLDER, "Gibself", "Give yourself the same treatment you give others.", ADMIN_CATEGORY_FUN_DO_NOT) var/confirm = tgui_alert(user, "You sure?", "Confirm", list("Yes", "No")) if(!confirm) return diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index d6106fe212..913ffc9c90 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -1,22 +1,13 @@ //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) //CHOMP Edit: Reverting this to let all staff respond to ahelps - to_chat(src, span_admin_pm_warning("Error: Admin-PM-Context: Only administrators may use this command.")) +ADMIN_VERB_ONLY_CONTEXT_MENU(cmd_admin_pm_context, R_ADMIN|R_MOD|R_SERVER|R_EVENT, "Admin PM Mob", mob/M in GLOB.mob_list) + if(!ismob(M) || !M.client) return - if( !ismob(M) || !M.client ) - return - cmd_admin_pm(M.client,null) + user.cmd_admin_pm(M.client, null) feedback_add_details("admin_verb","Admin PM Mob") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //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) //CHOMP Edit: Reverting this to let all staff respond to ahelps - to_chat(src, span_admin_pm_warning("Error: Admin-PM-Panel: Only administrators may use this command.")) - var/list/client/targets[0] +ADMIN_VERB(cmd_admin_pm_panel, R_ADMIN|R_MOD|R_SERVER|R_EVENT, "Admin PM", "Directly message a player.", ADMIN_CATEGORY_MAIN) + var/list/client/targets = list() for(var/client/T) if(T.mob) if(isnewplayer(T.mob)) @@ -27,10 +18,10 @@ targets["[T.mob.real_name](as [T.mob.name]) - [T]"] = T else targets["(No Mob) - [T]"] = T - var/target = tgui_input_list(src,"To whom shall we send a message?","Admin PM", sortList(targets)) + var/target = tgui_input_list(user, "To whom shall we send a message?", "Admin PM", sortList(targets)) if(!target) //Admin canceled return - cmd_admin_pm(targets[target],null) + user.cmd_admin_pm(targets[target], null) feedback_add_details("admin_verb","Admin PM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_ahelp_reply(whom) diff --git a/code/modules/admin/verbs/antag-ooc.dm b/code/modules/admin/verbs/antag-ooc.dm index a2b50be813..f442b2ec88 100644 --- a/code/modules/admin/verbs/antag-ooc.dm +++ b/code/modules/admin/verbs/antag-ooc.dm @@ -4,16 +4,16 @@ set desc = "Antagonist OOC" var/is_admin = check_rights(R_ADMIN|R_MOD|R_EVENT, show_msg = 0) - var/is_antag = usr.mind && usr.mind.special_role + var/is_antag = src.mob.mind && src.mob.mind.special_role if(!is_antag && !is_admin) // Non-antagonists and non-admins have no business using this. - to_chat(usr, span_warning("Sorry, but only certain antagonists or administrators can use this verb.")) + to_chat(src, span_warning("Sorry, but only certain antagonists or administrators can use this verb.")) return else if(is_antag && !is_admin) // Is an antag, and not an admin, meaning we need to check if their antag type allows AOOC. - var/datum/antagonist/A = get_antag_data(usr.mind.special_role) + var/datum/antagonist/A = get_antag_data(src.mob.mind.special_role) if(!A || !A.can_speak_aooc || !A.can_hear_aooc) - to_chat(usr, span_warning("Sorry, but your antagonist type is not allowed to speak in AOOC.")) + to_chat(src, span_warning("Sorry, but your antagonist type is not allowed to speak in AOOC.")) return msg = sanitize(msg) @@ -24,14 +24,14 @@ var/display_name = src.key if(holder) if(holder.fakekey) - display_name = usr.client.holder.fakekey + display_name = holder.fakekey // Name shown to other players. Admins whom are not also antags have their rank displayed. - var/player_display = (is_admin && !is_antag) ? "[display_name]([usr.client.holder.rank_names()])" : display_name + var/player_display = (is_admin && !is_antag) ? "[display_name]([holder.rank_names()])" : display_name for(var/mob/M in GLOB.mob_list) if(check_rights_for(M.client, R_ADMIN|R_MOD|R_EVENT)) // Staff can see AOOC unconditionally, and with more details. - to_chat(M, span_ooc(span_aooc("[create_text_tag("aooc", "Antag-OOC:", M.client)] [get_options_bar(src, 0, 1, 1)]([admin_jump_link(usr, check_rights_for(M.client, R_HOLDER))]): " + span_message("[msg]")))) + to_chat(M, span_ooc(span_aooc("[create_text_tag("aooc", "Antag-OOC:", M.client)] [get_options_bar(src, 0, 1, 1)]([admin_jump_link(src.mob, check_rights_for(M.client, R_HOLDER))]): " + span_message("[msg]")))) else if(M.client) // Players can only see AOOC if observing, or if they are an antag type allowed to use AOOC. var/datum/antagonist/A = null if(M.mind) // Observers don't have minds, but they should still see AOOC. diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 88d81e4243..b76b7a3922 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -1,32 +1,29 @@ -/client/proc/atmosscan() - set category = "Mapping" - set name = "Check Piping" +ADMIN_VERB_VISIBILITY(atmosscan, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(atmosscan, R_DEBUG, "Check Piping", "Check all pipes in game (Only use on a test server).", ADMIN_CATEGORY_MAPPING) set background = 1 - if(!check_rights_for(src, R_HOLDER)) - return feedback_add_details("admin_verb","CP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - if(tgui_alert(src, "WARNING: This command should not be run on a live server. Do you want to continue?", "Check Piping", list("No", "Yes")) != "Yes") + if(tgui_alert(user, "WARNING: This command should not be run on a live server. Do you want to continue?", "Check Piping", list("No", "Yes")) != "Yes") return - to_chat(src, "Checking for disconnected pipes...") + to_chat(user, span_debug_info("Checking for disconnected pipes...")) //all plumbing - yes, some things might get stated twice, doesn't matter. for (var/obj/machinery/atmospherics/plumbing in GLOB.machines) if (plumbing.nodealert) - to_chat(src, span_filter_adminlog(span_warning("Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])"))) + to_chat(user, span_filter_adminlog(span_warning("Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])"))) //Manifolds for (var/obj/machinery/atmospherics/pipe/manifold/pipe in GLOB.machines) if (!pipe.node1 || !pipe.node2 || !pipe.node3) - to_chat(src, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])"))) + to_chat(user, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])"))) //Pipes for (var/obj/machinery/atmospherics/pipe/simple/pipe in GLOB.machines) if (!pipe.node1 || !pipe.node2) - to_chat(src, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])"))) + to_chat(user, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])"))) - to_chat(src, "Checking for overlapping pipes...") + to_chat(user, span_debug_info("Checking for overlapping pipes...")) next_turf: for(var/turf/T in world) for(var/dir in GLOB.cardinal) @@ -36,25 +33,21 @@ for(var/connect_type in pipe.connect_types) connect_types[connect_type] += 1 if(connect_types[1] > 1 || connect_types[2] > 1 || connect_types[3] > 1) - to_chat(src, span_filter_adminlog(span_warning("Overlapping pipe ([pipe.name]) located at [T.x],[T.y],[T.z] ([get_area(T)])"))) + to_chat(user, span_filter_adminlog(span_warning("Overlapping pipe ([pipe.name]) located at [T.x],[T.y],[T.z] ([get_area(T)])"))) continue next_turf - to_chat(src, "Done") - -/client/proc/powerdebug() - set category = "Mapping" - set name = "Check Power" - if(!check_rights_for(src, R_HOLDER)) - return + to_chat(user, span_debug_info("Done")) +ADMIN_VERB_VISIBILITY(powerdebug, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(powerdebug, R_DEBUG, "Check Power", "Checks all powernets (Only use on a test server).", ADMIN_CATEGORY_MAPPING) feedback_add_details("admin_verb","CPOW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! for (var/datum/powernet/PN in SSmachines.powernets) if (!PN.nodes || !PN.nodes.len) if(PN.cables && (PN.cables.len > 1)) var/obj/structure/cable/C = PN.cables[1] - to_chat(usr, span_filter_adminlog("Powernet with no nodes! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")) + to_chat(user, span_filter_adminlog("Powernet with no nodes! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")) if (!PN.cables || (PN.cables.len < 10)) if(PN.cables && (PN.cables.len > 1)) var/obj/structure/cable/C = PN.cables[1] - to_chat(usr, span_filter_adminlog("Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")) + to_chat(user, span_filter_adminlog("Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")) diff --git a/code/modules/admin/verbs/change_appearance.dm b/code/modules/admin/verbs/change_appearance.dm index 643d126ef9..53ce50d52e 100644 --- a/code/modules/admin/verbs/change_appearance.dm +++ b/code/modules/admin/verbs/change_appearance.dm @@ -1,37 +1,27 @@ -/client/proc/change_human_appearance_admin() - set name = "Change Mob Appearance - Admin" - set desc = "Allows you to change the mob appearance" - set category = "Admin.Events" +ADMIN_VERB(change_human_appearance_admin, R_FUN, "Change Mob Appearance - Admin", "Allows you to change the mob appearance.", ADMIN_CATEGORY_EVENTS) + var/mob/living/carbon/human/target_human = tgui_input_list(user, "Select mob.", "Change Mob Appearance - Admin", GLOB.human_mob_list) + if(!target_human) + return - if(!check_rights(R_FUN)) return - - var/mob/living/carbon/human/H = tgui_input_list(usr, "Select mob.", "Change Mob Appearance - Admin", GLOB.human_mob_list) - if(!H) return - - log_and_message_admins("is altering the appearance of [H].") - H.change_appearance(APPEARANCE_ALL, usr, check_species_whitelist = 0, state = ADMIN_STATE(R_FUN)) + log_and_message_admins("is altering the appearance of [target_human].") + target_human.change_appearance(APPEARANCE_ALL, usr, check_species_whitelist = 0, state = ADMIN_STATE(R_FUN)) feedback_add_details("admin_verb","CHAA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/change_human_appearance_self() - set name = "Change Mob Appearance - Self" - set desc = "Allows the mob to change its appearance" - set category = "Admin.Events" - - if(!check_rights(R_FUN)) return - - var/mob/living/carbon/human/H = tgui_input_list(usr, "Select mob.", "Change Mob Appearance - Self", GLOB.human_mob_list) - if(!H) return - - if(!H.client) - to_chat(usr, span_filter_warning(" Only mobs with clients can alter their own appearance.")) +ADMIN_VERB(change_human_appearance_self, R_FUN, "Change Mob Appearance - Self", "Allows the mob to change its appearance.", ADMIN_CATEGORY_EVENTS) + var/mob/living/carbon/human/human_target = tgui_input_list(user, "Select mob.", "Change Mob Appearance - Self", GLOB.human_mob_list) + if(!human_target) return - switch(tgui_alert(usr, "Do you wish for [H] to be allowed to select non-whitelisted races?","Alter Mob Appearance","Yes","No","Cancel")) + + if(!human_target.client) + to_chat(human_target, span_filter_warning("Only mobs with clients can alter their own appearance.")) + return + switch(tgui_alert(user, "Do you wish for [human_target] to be allowed to select non-whitelisted races?","Alter Mob Appearance","Yes","No","Cancel")) if("Yes") - log_and_message_admins("has allowed [H] to change [H.p_their()] appearance, without whitelisting of races.") - H.change_appearance(APPEARANCE_ALL, H, check_species_whitelist = 0) + log_and_message_admins("has allowed [human_target] to change [human_target.p_their()] appearance, without whitelisting of races.") + human_target.change_appearance(APPEARANCE_ALL, human_target, check_species_whitelist = 0) if("No") - log_and_message_admins("has allowed [H] to change [H.p_their()] appearance, with whitelisting of races.") - H.change_appearance(APPEARANCE_ALL, H, check_species_whitelist = 1) + log_and_message_admins("has allowed [human_target] to change [human_target.p_their()] appearance, with whitelisting of races.") + human_target.change_appearance(APPEARANCE_ALL, human_target, check_species_whitelist = 1) feedback_add_details("admin_verb","CMAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! ADMIN_VERB(editappear, R_FUN, "Edit Appearance", "Edit a human's apperance.", ADMIN_CATEGORY_FUN_EVENT_KIT) diff --git a/code/modules/admin/verbs/check_customitem_activity.dm b/code/modules/admin/verbs/check_customitem_activity.dm index cadd8d5ae3..55e17d090c 100644 --- a/code/modules/admin/verbs/check_customitem_activity.dm +++ b/code/modules/admin/verbs/check_customitem_activity.dm @@ -1,10 +1,7 @@ GLOBAL_VAR_INIT(checked_for_inactives, FALSE) GLOBAL_VAR_INIT(inactive_keys, "None
") -/client/proc/check_customitem_activity() - set category = "Admin.Investigate" - set name = "Check activity of players with custom items" - +ADMIN_VERB(check_customitem_activity, R_ADMIN|R_MOD|R_SERVER, "Check activity of players with custom items", "Allows you to investigate custom item activity.", ADMIN_CATEGORY_INVESTIGATE) var/dat = span_bold("Inactive players with custom items") + "
" dat += "
" dat += "The list below contains players with custom items that have not logged\ @@ -19,9 +16,9 @@ GLOBAL_VAR_INIT(inactive_keys, "None
") dat += "
" dat += "This system was implemented on March 1 2013, and the database a few days before that. Root server access is required to add or disable access to specific custom items.
" else - dat += "Populate list (requires an active database connection)
" + dat += "Populate list (requires an active database connection)
" - var/datum/browser/popup = new(src, "inactive_customitems", "Inactive Custom Items", 600, 480) + var/datum/browser/popup = new(user, "inactive_customitems", "Inactive Custom Items", 600, 480) popup.set_content(dat) popup.open() @@ -84,4 +81,4 @@ GLOBAL_VAR_INIT(inactive_keys, "None
") GLOB.checked_for_inactives = TRUE if(C) - C.check_customitem_activity() + SSadmin_verbs.dynamic_invoke_verb(C, /datum/admin_verb/check_customitem_activity) //Recursively calling ourselves until cancelled or a unique name is given. diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm index 557d74c825..49f98eaa44 100644 --- a/code/modules/admin/verbs/cinematic.dm +++ b/code/modules/admin/verbs/cinematic.dm @@ -1,4 +1,4 @@ -ADMIN_VERB(cinematic, R_FUN, "Cinematic", "Show a cinematic to all players.", "Fun.Do Not") +ADMIN_VERB(cinematic, R_FUN, "Cinematic", "Show a cinematic to all players.", ADMIN_CATEGORY_FUN_DO_NOT) var/datum/cinematic/choice = tgui_input_list( user, "Chose a cinematic to play to everyone in the server.", diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index b8b296ab3c..d6be5edc68 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -1,31 +1,20 @@ -/client/proc/dsay(msg as text) - set category = "Admin.Chat" - set name = "Dsay" //Gave this shit a shorter name so you only have to time out "dsay" rather than "dead say" to use it --NeoFite - set hidden = 1 - if(!check_rights_for(src, R_HOLDER)) - to_chat(src, "Only administrators may use this command.") - return - if(!src.mob) - return - if(prefs.muted & MUTE_DEADCHAT) - to_chat(src, span_warning("You cannot send DSAY messages (muted).")) +ADMIN_VERB(dsay, R_HOLDER, "Dsay", "Speak to the dead.", ADMIN_CATEGORY_CHAT, msg as text) + if(user.prefs.muted & MUTE_DEADCHAT) + to_chat(user, span_warning("You cannot send DSAY messages (muted).")) return - if(!prefs?.read_preference(/datum/preference/toggle/show_dsay)) - to_chat(src, span_warning("You have deadchat muted.")) + if(!user.prefs?.read_preference(/datum/preference/toggle/show_dsay)) + to_chat(user, span_warning("You have deadchat muted.")) return - if (src.handle_spam_prevention(msg,MUTE_DEADCHAT)) - return - - var/stafftype = uppertext(holder.rank_names()) + var/stafftype = uppertext(user.holder.rank_names()) msg = sanitize(msg) - log_admin("DSAY: [key_name(src)] : [msg]") + log_admin("DSAY: [key_name(user)] : [msg]") if (!msg) return - say_dead_direct(span_name("[stafftype]([src.holder.fakekey ? src.holder.fakekey : src.key])") + " says, " + span_message("\"[msg]\"")) + say_dead_direct(span_name("[stafftype]([user.holder.fakekey ? user.holder.fakekey : user.key])") + " says, " + span_message("\"[msg]\"")) feedback_add_details("admin_verb","D") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 9eaa0d2fe8..8e78a3e087 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1,85 +1,73 @@ -/client/proc/Debug2() - set category = "Debug.Investigate" - set name = "Debug-Game" - if(!check_rights(R_DEBUG)) return +ADMIN_VERB(Debug2, R_DEBUG, "Debug-Game", "Toggles debug level 2, might be quite spammy.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) if(GLOB.Debug2) GLOB.Debug2 = FALSE - message_admins("[key_name(src)] toggled debugging off.") - log_admin("[key_name(src)] toggled debugging off.") + message_admins("[key_name(user)] toggled debugging off.") + log_admin("[key_name(user)] toggled debugging off.") else GLOB.Debug2 = TRUE - message_admins("[key_name(src)] toggled debugging on.") - log_admin("[key_name(src)] toggled debugging on.") + message_admins("[key_name(user)] toggled debugging on.") + log_admin("[key_name(user)] toggled debugging on.") feedback_add_details("admin_verb","DG2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! // callproc moved to code/modules/admin/callproc -/client/proc/simple_DPS() - set name = "Simple DPS" - set category = "Debug.Investigate" - set desc = "Gives a really basic idea of how much hurt something in-hand does." - +ADMIN_VERB(simple_DPS, R_DEBUG, "Simple DPS", "Gives a really basic idea of how much hurt something in-hand does.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) var/obj/item/I = null - var/mob/living/user = null - if(isliving(usr)) - user = usr - I = user.get_active_hand() - if(!I || !istype(I)) - to_chat(user, span_warning("You need to have something in your active hand, to use this verb.")) - return - var/weapon_attack_speed = user.get_attack_speed(I) / 10 - var/weapon_damage = I.force - var/modified_damage_percent = 1 - - for(var/datum/modifier/M in user.modifiers) - if(!isnull(M.outgoing_melee_damage_percent)) - weapon_damage *= M.outgoing_melee_damage_percent - modified_damage_percent *= M.outgoing_melee_damage_percent - - if(istype(I, /obj/item/gun)) - var/obj/item/gun/G = I - var/obj/item/projectile/P - - if(istype(I, /obj/item/gun/energy)) - var/obj/item/gun/energy/energy_gun = G - P = new energy_gun.projectile_type() - - else if(istype(I, /obj/item/gun/projectile)) - var/obj/item/gun/projectile/projectile_gun = G - var/obj/item/ammo_casing/ammo = projectile_gun.chambered - P = ammo.BB - - else - to_chat(user, span_warning("DPS calculation by this verb is not supported for \the [G]'s type. Energy or Ballistic only, sorry.")) - - weapon_damage = P.damage - weapon_attack_speed = G.fire_delay / 10 - qdel(P) - - var/DPS = weapon_damage / weapon_attack_speed - to_chat(user, span_notice("Damage: [weapon_damage][modified_damage_percent != 1 ? " (Modified by [modified_damage_percent*100]%)":""]")) - to_chat(user, span_notice("Attack Speed: [weapon_attack_speed]/s")) - to_chat(user, span_notice("\The [I] does [DPS] damage per second.")) - if(DPS > 0) - to_chat(user, span_notice("At your maximum health ([user.getMaxHealth()]), it would take approximately;")) - to_chat(user, span_notice("[(user.getMaxHealth() - CONFIG_GET(number/health_threshold_softcrit)) / DPS] seconds to softcrit you. ([CONFIG_GET(number/health_threshold_softcrit)] health)")) - to_chat(user, span_notice("[(user.getMaxHealth() - user.get_crit_point()) / DPS] seconds to hardcrit you. ([user.get_crit_point()] health)")) - to_chat(user, span_notice("[(user.getMaxHealth() - (-user.getMaxHealth())) / DPS] seconds to kill you. ([(-user.getMaxHealth())] health)")) - - else + var/mob/living/user_mob = user.mob + if(!istype(user_mob)) to_chat(user, span_warning("You need to be a living mob, with hands, and for an object to be in your active hand, to use this verb.")) return -/client/proc/Cell() - set category = "Debug.Investigate" - set name = "Cell" - if(!mob) + I = user_mob.get_active_hand() + if(!I || !istype(I)) + to_chat(user, span_warning("You need to have something in your active hand, to use this verb.")) return - var/turf/T = mob.loc + var/weapon_attack_speed = user_mob.get_attack_speed(I) / 10 + var/weapon_damage = I.force + var/modified_damage_percent = 1 - if (!( istype(T, /turf) )) + for(var/datum/modifier/M in user_mob.modifiers) + if(!isnull(M.outgoing_melee_damage_percent)) + weapon_damage *= M.outgoing_melee_damage_percent + modified_damage_percent *= M.outgoing_melee_damage_percent + + if(istype(I, /obj/item/gun)) + var/obj/item/gun/G = I + var/obj/item/projectile/P + + if(istype(I, /obj/item/gun/energy)) + var/obj/item/gun/energy/energy_gun = G + P = new energy_gun.projectile_type() + + else if(istype(I, /obj/item/gun/projectile)) + var/obj/item/gun/projectile/projectile_gun = G + var/obj/item/ammo_casing/ammo = projectile_gun.chambered + P = ammo.BB + + else + to_chat(user, span_warning("DPS calculation by this verb is not supported for \the [G]'s type. Energy or Ballistic only, sorry.")) + + weapon_damage = P.damage + weapon_attack_speed = G.fire_delay / 10 + qdel(P) + + var/DPS = weapon_damage / weapon_attack_speed + to_chat(user, span_notice("Damage: [weapon_damage][modified_damage_percent != 1 ? " (Modified by [modified_damage_percent*100]%)":""]")) + to_chat(user, span_notice("Attack Speed: [weapon_attack_speed]/s")) + to_chat(user, span_notice("\The [I] does [DPS] damage per second.")) + if(DPS > 0) + to_chat(user, span_notice("At your maximum health ([user_mob.getMaxHealth()]), it would take approximately;")) + to_chat(user, span_notice("[(user_mob.getMaxHealth() - CONFIG_GET(number/health_threshold_softcrit)) / DPS] seconds to softcrit you. ([CONFIG_GET(number/health_threshold_softcrit)] health)")) + to_chat(user, span_notice("[(user_mob.getMaxHealth() - user_mob.get_crit_point()) / DPS] seconds to hardcrit you. ([user_mob.get_crit_point()] health)")) + to_chat(user, span_notice("[(user_mob.getMaxHealth() - (-user_mob.getMaxHealth())) / DPS] seconds to kill you. ([(-user_mob.getMaxHealth())] health)")) + + +ADMIN_VERB(Cell, R_DEBUG, "Cell", "Display the atmos information of the current cell.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) + var/turf/T = get_turf(user.mob) + + if (!(isturf(T))) return var/datum/gas_mixture/env = T.return_air() @@ -90,61 +78,48 @@ for(var/g in env.gas) t += span_blue("[g]: [env.gas[g]] / [env.gas[g] * R_IDEAL_GAS_EQUATION * env.temperature / env.volume]kPa\n") - usr.show_message(t, 1) + user.mob.show_message(t, 1) feedback_add_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_robotize(var/mob/M in GLOB.mob_list) - set category = "Fun.Event Kit" - set name = "Make Robot" - +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_robotize, R_ADMIN|R_EVENT|R_DEBUG, "Make Robot", "Turns the target into a robot.", ADMIN_CATEGORY_FUN_EVENT_KIT, mob/living/carbon/human/target_human in GLOB.human_mob_list) if(!SSticker) - tgui_alert_async(usr, "Wait until the game starts") + tgui_alert_async(user, "Wait until the game starts") + return + if(!ishuman(target_human)) + tgui_alert_async(user, "Invalid mob") return - if(ishuman(M)) - log_admin("[key_name(src)] has robotized [M.key].") - spawn(10) - M:Robotize() - else - tgui_alert_async(usr, "Invalid mob") - -/client/proc/cmd_admin_animalize(var/mob/M in GLOB.mob_list) - set category = "Fun.Event Kit" - set name = "Make Simple Animal" + log_admin("[key_name(user)] has robotized [target_human.key].") + addtimer(CALLBACK(target_human, TYPE_PROC_REF(/mob/living/carbon/human, Robotize)), 1 SECOND, TIMER_DELETE_ME) +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_animalize, R_ADMIN|R_EVENT|R_DEBUG, "Make Simple Animal", "Spawns a new player directly as animal.", ADMIN_CATEGORY_FUN_EVENT_KIT, mob/target_mob in GLOB.mob_list) if(!SSticker) - tgui_alert_async(usr, "Wait until the game starts") + tgui_alert_async(user, "Wait until the game starts") return - if(!M) - tgui_alert_async(usr, "That mob doesn't seem to exist, close the panel and try again.") + if(!target_mob) + tgui_alert_async(user, "That mob doesn't seem to exist, close the panel and try again.") return - if(isnewplayer(M)) - tgui_alert_async(usr, "The mob must not be a new_player.") + if(isnewplayer(target_mob)) + tgui_alert_async(user, "The mob must not be a new_player.") return - log_admin("[key_name(src)] has animalized [M.key].") - spawn(10) - M.Animalize(usr) + log_admin("[key_name(user)] has animalized [target_mob.key].") + addtimer(CALLBACK(target_mob, TYPE_PROC_REF(/mob, Animalize)), 1 SECOND, TIMER_DELETE_ME) - -/client/proc/makepAI() - set category = "Fun.Event Kit" - set name = "Make pAI" - set desc = "Spawn someone in as a pAI!" - if(!check_rights(R_ADMIN|R_EVENT|R_DEBUG)) - return - var/turf/T = get_turf(mob) +ADMIN_VERB(makepAI, R_ADMIN|R_EVENT|R_DEBUG, "Make pAI", "Spawn someone in as a pAI!", ADMIN_CATEGORY_FUN_EVENT_KIT) + var/turf/target_turf = get_turf(user.mob) var/list/available = list() - for(var/mob/C in GLOB.mob_list) - if(C.key && isobserver(C)) - available.Add(C) - var/mob/choice = tgui_input_list(usr, "Choose a player to play the pAI", "Spawn pAI", available) + for(var/mob/current_client in GLOB.mob_list) + if(current_client.key && isobserver(current_client)) + available += current_client + var/mob/choice = tgui_input_list(user, "Choose a player to play the pAI", "Spawn pAI", available) if(!choice) - return 0 - var/obj/item/paicard/typeb/card = new(T) + return + + var/obj/item/paicard/typeb/card = new(target_turf) var/mob/living/silicon/pai/pai = new(card) pai.real_name = pai.name pai.key = choice.key @@ -152,67 +127,52 @@ if(tgui_alert(pai, "Do you want to load your pAI data?", "Load", list("Yes", "No")) == "Yes") pai.apply_preferences(pai.client) else - pai.name = sanitizeSafe(tgui_input_text(pai, "Enter your pAI name:", "pAI Name", "Personal AI", encode = FALSE)) - log_admin("made a pAI with key=[pai.key] at ([T.x],[T.y],[T.z])") + var/new_name = sanitizeName(tgui_input_text(pai, "Enter your pAI name:", "pAI Name", "Personal AI", encode = FALSE), allow_numbers = TRUE) + if(new_name) + pai.name = new_name + log_admin("made a pAI with key=[pai.key] at ([target_turf.x],[target_turf.y],[target_turf.z])") feedback_add_details("admin_verb","MPAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_alienize(var/mob/M in GLOB.mob_list) - set category = "Fun.Event Kit" - set name = "Make Alien" - +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_alienize, R_ADMIN|R_EVENT|R_DEBUG, "Make Alien", "Turns the target into an alien.", ADMIN_CATEGORY_FUN_EVENT_KIT, mob/living/carbon/human/target_human in GLOB.human_mob_list) if(!SSticker) - tgui_alert_async(usr, "Wait until the game starts") + tgui_alert_async(user, "Wait until the game starts") + return + if(!ishuman(target_human)) + tgui_alert_async(user, "Invalid mob") return - if(ishuman(M)) - log_admin("[key_name(src)] has alienized [M.key].") - spawn(10) - M:Alienize() - feedback_add_details("admin_verb","MKAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - log_admin("[key_name(usr)] made [key_name(M)] into an alien.") - message_admins(span_notice("[key_name_admin(usr)] made [key_name(M)] into an alien."), 1) - else - tgui_alert_async(usr, "Invalid mob") + log_admin("[key_name(user)] has alienized [target_human.key].") + addtimer(CALLBACK(target_human, TYPE_PROC_REF(/mob/living/carbon/human, Alienize)), 1 SECOND, TIMER_DELETE_ME) + feedback_add_details("admin_verb","MKAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + log_admin("[key_name(user)] made [key_name(target_human)] into an alien.") + message_admins(span_notice("[key_name_admin(user)] made [key_name(target_human)] into an alien.")) //TODO: merge the vievars version into this or something maybe mayhaps -/client/proc/cmd_debug_del_all() - set category = "Debug.Dangerous" - set name = "Del-All" - +ADMIN_VERB(cmd_debug_del_all, R_SERVER, "Del-All", "DANGER: Deletes all instances of a type.", ADMIN_CATEGORY_DEBUG_DANGEROUS) // to prevent REALLY stupid deletions var/blocked = list(/obj, /mob, /mob/living, /mob/living/carbon, /mob/living/carbon/human, /mob/observer/dead, /mob/living/silicon, /mob/living/silicon/robot, /mob/living/silicon/ai) - var/hsbitem = tgui_input_list(usr, "Choose an object to delete.", "Delete:", typesof(/obj) + typesof(/mob) - blocked) + var/hsbitem = tgui_input_list(user, "Choose an object to delete.", "Delete:", typesof(/obj) + typesof(/mob) - blocked) if(hsbitem) for(var/atom/O in world) if(istype(O, hsbitem)) qdel(O) - log_admin("[key_name(src)] has deleted all instances of [hsbitem].") - message_admins("[key_name_admin(src)] has deleted all instances of [hsbitem].", 0) + log_admin("[key_name(user)] has deleted all instances of [hsbitem].") + message_admins("[key_name_admin(user)] has deleted all instances of [hsbitem].", 0) feedback_add_details("admin_verb","DELA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_debug_make_powernets() - set category = "Debug.Dangerous" - set name = "Make Powernets" +ADMIN_VERB(cmd_debug_make_powernets, R_DEBUG, "Make Powernets", "Rebuild all powernets.", ADMIN_CATEGORY_DEBUG_DANGEROUS) SSmachines.makepowernets() - log_admin("[key_name(src)] has remade the powernet. SSmachines.makepowernets() called.") - message_admins("[key_name_admin(src)] has remade the powernets. SSmachines.makepowernets() called.", 0) + log_admin("[key_name(user)] has remade the powernet. SSmachines.makepowernets() called.") + message_admins("[key_name_admin(user)] has remade the powernets. SSmachines.makepowernets() called.") feedback_add_details("admin_verb","MPWN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_debug_tog_aliens() - set category = "Server.Game" - set name = "Toggle Aliens" - +ADMIN_VERB(cmd_debug_tog_aliens, R_DEBUG, "Toggle Aliens", "Toggle if aliens are allowed.", ADMIN_CATEGORY_SERVER_GAME) CONFIG_SET(flag/aliens_allowed, !CONFIG_GET(flag/aliens_allowed)) - log_admin("[key_name(src)] has turned aliens [CONFIG_GET(flag/aliens_allowed) ? "on" : "off"].") - message_admins("[key_name_admin(src)] has turned aliens [CONFIG_GET(flag/aliens_allowed) ? "on" : "off"].", 0) + log_admin("[key_name(user)] has turned aliens [CONFIG_GET(flag/aliens_allowed) ? "on" : "off"].") + message_admins("[key_name_admin(user)] has turned aliens [CONFIG_GET(flag/aliens_allowed) ? "on" : "off"].") feedback_add_details("admin_verb","TAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_display_del_log() - set category = "Debug.Investigate" - set name = "Display del() Log" - set desc = "Display del's log of everything that's passed through it." - - if(!check_rights(R_DEBUG)) return +ADMIN_VERB(cmd_display_del_log, R_DEBUG, "Display del() Log", "Display del's log of everything that's passed through it.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) var/list/dellog = list(span_bold("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) @@ -235,26 +195,14 @@ dellog += "
" - usr << browse("[dellog.Join()]", "window=dellog") + user << browse("[dellog.Join()]", "window=dellog") -/client/proc/cmd_display_init_log() - set category = "Debug.Investigate" - set name = "Display Initialize() Log" - set desc = "Displays a list of things that didn't handle Initialize() properly" +ADMIN_VERB(cmd_display_init_log, R_DEBUG, "Display Initialize() Log", "Displays a list of things that didn't handle Initialize() properly.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) + user << browse("[replacetext(SSatoms.InitLog(), "\n", "
")]", "window=initlog") - if(!check_rights(R_DEBUG)) - return - src << browse("[replacetext(SSatoms.InitLog(), "\n", "
")]", "window=initlog") +ADMIN_VERB(cmd_display_overlay_log, R_DEBUG, "Display overlay Log", "Display SSoverlays log of everything that's passed through it.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) + render_stats(SSoverlays.stats, user) -/* -/client/proc/cmd_display_overlay_log() - set category = "Debug.Investigate" - set name = "Display overlay Log" - set desc = "Display SSoverlays log of everything that's passed through it." - - if(!check_rights(R_DEBUG)) return - render_stats(SSoverlays.stats, src) -*/ // Render stats list for round-end statistics. /proc/render_stats(list/stats, user, sort = /proc/cmp_generic_stat_item_time) sortTim(stats, sort, TRUE) @@ -269,38 +217,31 @@ else . = lines.Join("\n") -/client/proc/cmd_admin_grantfullaccess(var/mob/M in GLOB.mob_list) - set category = "Admin.Events" - set name = "Grant Full Access" - +ADMIN_VERB(cmd_admin_grantfullaccess, (R_ADMIN|R_EVENT), "Grant Full Access", "Grants full access to a human.", ADMIN_CATEGORY_EVENTS, mob/living/carbon/human/H in GLOB.human_mob_list) if (!SSticker) - tgui_alert_async(usr, "Wait until the game starts") + tgui_alert_async(user, "Wait until the game starts") return - if (ishuman(M)) - var/mob/living/carbon/human/H = M - if (H.wear_id) - var/obj/item/card/id/id = H.wear_id - if(istype(H.wear_id, /obj/item/pda)) - var/obj/item/pda/pda = H.wear_id - id = pda.id - id.icon_state = "gold" - id.access = get_all_accesses().Copy() - else - var/obj/item/card/id/id = new/obj/item/card/id(M); - id.icon_state = "gold" - id.access = get_all_accesses().Copy() - id.registered_name = H.real_name - id.assignment = JOB_SITE_MANAGER - id.name = "[id.registered_name]'s ID Card ([id.assignment])" - H.equip_to_slot_or_del(id, slot_wear_id) - H.update_inv_wear_id() + if (H.wear_id) + var/obj/item/card/id/id = H.wear_id + if(istype(H.wear_id, /obj/item/pda)) + var/obj/item/pda/pda = H.wear_id + id = pda.id + id.icon_state = "gold" + id.access = get_all_accesses().Copy() else - tgui_alert_async(usr, "Invalid mob") + var/obj/item/card/id/id = new/obj/item/card/id(H); + id.icon_state = "gold" + id.access = get_all_accesses().Copy() + id.registered_name = H.real_name + id.assignment = JOB_SITE_MANAGER + id.name = "[id.registered_name]'s ID Card ([id.assignment])" + H.equip_to_slot_or_del(id, slot_wear_id) + H.update_inv_wear_id() feedback_add_details("admin_verb","GFA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - log_admin("[key_name(src)] has granted [M.key] full access.") - message_admins(span_blue("[key_name_admin(usr)] has granted [M.key] full access."), 1) + log_admin("[key_name(user)] has granted [H.key] full access.") + message_admins(span_blue("[key_name_admin(user)] has granted [H.key] full access.")) -ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct Control", "Assume direct control of a mob.", "Admin.Game", mob/M) +ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct Control", "Assume direct control of a mob.", ADMIN_CATEGORY_GAME, mob/M) if(M.ckey) if(tgui_alert(user, "This mob is being controlled by [M.ckey]. Are you sure you wish to assume control of it? [M.ckey] will be made a ghost.","Confirmation",list("Yes","No")) != "Yes") return @@ -311,7 +252,7 @@ ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct var/mob/observer/dead/ghost = new/mob/observer/dead(M,1) ghost.ckey = M.ckey - message_admins(span_blue("[key_name_admin(user)] assumed direct control of [M]."), 1) + message_admins(span_blue("[key_name_admin(user)] assumed direct control of [M].")) log_admin("[key_name(user)] assumed direct control of [M].") var/mob/adminmob = user.mob M.ckey = user.ckey @@ -319,20 +260,11 @@ ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct qdel(adminmob) feedback_add_details("admin_verb","ADC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/take_picture(var/atom/A in world) - set name = "Save PNG" - set category = "Debug.Misc" - set desc = "Opens a dialog to save a PNG of any object in the game." - - if(!check_rights(R_DEBUG)) - return - - downloadImage(A) - -/client/proc/cmd_admin_areatest() - set category = "Mapping" - set name = "Test areas" +ADMIN_VERB(take_picture, R_DEBUG, "Save PNG", "Opens a dialog to save a PNG of any object in the game.", ADMIN_CATEGORY_DEBUG_MISC, atom/selected_atom in world) + downloadImage(selected_atom) +ADMIN_VERB_VISIBILITY(cmd_admin_areatest, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(cmd_admin_areatest, R_DEBUG, "Test areas", "Manually tests all areas and prints to world (Only use on a test server).", ADMIN_CATEGORY_MAPPING_TESTS) var/list/areas_all = list() var/list/areas_with_APC = list() var/list/areas_with_air_alarm = list() @@ -445,13 +377,8 @@ ADMIN_VERB(cmd_admin_dress, R_FUN, "elect equipment", "Select equipment for a mo outfit.equip(H) log_and_message_admins("changed the equipment of [key_name(H)] to [outfit.name].") -/client/proc/startSinglo() - - set category = "Debug.Game" - set name = "Start Singularity" - set desc = "Sets up the singularity and all machines to get power flowing through the station" - - if(tgui_alert(usr, "Are you sure? This will start up the engine. Should only be used during debug!","Start Singularity",list("Yes","No")) != "Yes") +ADMIN_VERB(startSinglo, R_DEBUG|R_ADMIN, "Start Singularity", "Sets up the singularity and all machines to get power flowing through the station.", ADMIN_CATEGORY_DEBUG_GAME) + if(tgui_alert(user, "Are you sure? This will start up the engine. Should only be used during debug!","Start Singularity",list("Yes","No")) != "Yes") return for(var/obj/machinery/power/emitter/E in GLOB.machines) @@ -490,14 +417,11 @@ ADMIN_VERB(cmd_admin_dress, R_FUN, "elect equipment", "Select equipment for a mo if(!Rad.active) Rad.toggle_power() -/client/proc/setup_supermatter_engine() - set category = "Debug.Game" - set name = "Setup supermatter" - set desc = "Sets up the supermatter engine" + log_admin("[key_name(user)] setup the singulo engine") + message_admins(span_blue("[key_name_admin(user)] setup the singulo engine")) - if(!check_rights(R_DEBUG|R_ADMIN)) return - - var/response = tgui_alert(usr, "Are you sure? This will start up the engine. Should only be used during debug!","Setup Supermatter",list("Setup Completely","Setup except coolant","No")) +ADMIN_VERB(setup_supermatter_engine, R_DEBUG|R_ADMIN, "Setup supermatter", "Sets up the supermatter engine.", ADMIN_CATEGORY_DEBUG_GAME) + var/response = tgui_alert(user, "Are you sure? This will start up the engine. Should only be used during debug!","Setup Supermatter",list("Setup Completely","Setup except coolant","No")) if(!response || response == "No") return @@ -567,44 +491,32 @@ ADMIN_VERB(cmd_admin_dress, R_FUN, "elect equipment", "Select equipment for a mo T.zone.air.update_values() - log_admin("[key_name(usr)] setup the supermatter engine [response == "Setup except coolant" ? "without coolant" : ""]") - message_admins(span_blue("[key_name_admin(usr)] setup the supermatter engine [response == "Setup except coolant" ? "without coolant": ""]"), 1) - return + log_admin("[key_name(user)] setup the supermatter engine [response == "Setup except coolant" ? "without coolant" : ""]") + message_admins(span_blue("[key_name_admin(user)] setup the supermatter engine [response == "Setup except coolant" ? "without coolant": ""]")) - -/client/proc/cmd_debug_mob_lists() - set category = "Debug.Investigate" - set name = "Debug Mob Lists" - set desc = "For when you just gotta know" - - switch(tgui_input_list(usr, "Which list?", "List Choice", list("Players","Admins","Mobs","Living Mobs","Dead Mobs", "Clients"))) +ADMIN_VERB(cmd_debug_mob_lists, R_DEBUG, "Debug Mob Lists", "For when you just gotta know.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) + switch(tgui_input_list(user, "Which list?", "List Choice", list("Players","Admins","Mobs","Living Mobs","Dead Mobs", "Clients"))) if("Players") - to_chat(usr, span_filter_debuglogs(jointext(GLOB.player_list,","))) + to_chat(user, span_filter_debuglogs(jointext(GLOB.player_list,","))) if("Admins") - to_chat(usr, span_filter_debuglogs(jointext(GLOB.admins,","))) + to_chat(user, span_filter_debuglogs(jointext(GLOB.admins,","))) if("Mobs") - to_chat(usr, span_filter_debuglogs(jointext(GLOB.mob_list,","))) + to_chat(user, span_filter_debuglogs(jointext(GLOB.mob_list,","))) if("Living Mobs") - to_chat(usr, span_filter_debuglogs(jointext(GLOB.living_mob_list,","))) + to_chat(user, span_filter_debuglogs(jointext(GLOB.living_mob_list,","))) if("Dead Mobs") - to_chat(usr, span_filter_debuglogs(jointext(GLOB.dead_mob_list,","))) + to_chat(user, span_filter_debuglogs(jointext(GLOB.dead_mob_list,","))) if("Clients") - to_chat(usr, span_filter_debuglogs(jointext(GLOB.clients,","))) + to_chat(user, span_filter_debuglogs(jointext(GLOB.clients,","))) -/client/proc/cmd_debug_using_map() - set category = "Debug.Investigate" - set name = "Debug Map Datum" - set desc = "Debug the map metadata about the currently compiled in map." - - if(!check_rights(R_DEBUG)) - return - debug_variables(using_map) +ADMIN_VERB(cmd_debug_using_map, R_DEBUG, "Debug Map Datum", "Debug the map metadata about the currently compiled in map.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) + user.debug_variables(using_map) // DNA2 - Admin Hax /client/proc/cmd_admin_toggle_block(var/mob/M,var/block) if(!SSticker) - tgui_alert_async(usr, "Wait until the game starts") + tgui_alert_async(src, "Wait until the game starts") return if(istype(M, /mob/living/carbon)) M.dna.SetSEState(block,!M.dna.GetSEState(block)) @@ -615,7 +527,7 @@ ADMIN_VERB(cmd_admin_dress, R_FUN, "elect equipment", "Select equipment for a mo message_admins("[key_name_admin(src)] has toggled [M.key]'s [blockname] block [state]!") log_admin("[key_name(src)] has toggled [M.key]'s [blockname] block [state]!") else - tgui_alert_async(usr, "Invalid mob") + tgui_alert_async(src, "Invalid mob") ADMIN_VERB(view_runtimes, R_DEBUG, "View Runtimes", "Opens the runtime viewer.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) GLOB.error_cache.show_to(user) @@ -629,110 +541,84 @@ ADMIN_VERB(view_runtimes, R_DEBUG, "View Runtimes", "Opens the runtime viewer.", // Not using TGUI alert, because it's view runtimes, stuff is probably broken tgui_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") -/datum/admins/proc/change_weather() - set category = "Debug.Events" - set name = "Change Weather" - set desc = "Changes the current weather." - - if(!check_rights(R_DEBUG)) +ADMIN_VERB(change_weather, R_DEBUG|R_EVENT, "Change Weather", "Changes the current weather.", ADMIN_CATEGORY_DEBUG_EVENTS) + var/datum/planet/planet = tgui_input_list(user, "Which planet do you want to modify the weather on?", "Change Weather", SSplanets.planets) + if(!istype(planet)) return - - var/datum/planet/planet = tgui_input_list(usr, "Which planet do you want to modify the weather on?", "Change Weather", SSplanets.planets) - if(istype(planet)) - var/datum/weather/new_weather = tgui_input_list(usr, "What weather do you want to change to?", "Change Weather", planet.weather_holder.allowed_weather_types) - if(new_weather) - planet.weather_holder.change_weather(new_weather) - planet.weather_holder.rebuild_forecast() - var/log = "[key_name(src)] changed [planet.name]'s weather to [new_weather]." - message_admins(log) - log_admin(log) - -/datum/admins/proc/toggle_firework_override() - set category = "Fun.Event Kit" - set name = "Toggle Weather Firework Override" - set desc = "Toggles ability for weather fireworks to affect weather on planet of choice." - - if(!check_rights(R_DEBUG)) + var/datum/weather/new_weather = tgui_input_list(user, "What weather do you want to change to?", "Change Weather", planet.weather_holder.allowed_weather_types) + if(!new_weather) return + planet.weather_holder.change_weather(new_weather) + planet.weather_holder.rebuild_forecast() + var/log = "[key_name(user)] changed [planet.name]'s weather to [new_weather]." + message_admins(log) + log_admin(log) - var/datum/planet/planet = tgui_input_list(usr, "Which planet do you want to toggle firework effects on?", "Change Weather", SSplanets.planets) +ADMIN_VERB(toggle_firework_override, R_DEBUG|R_EVENT, "Toggle Weather Firework Override", "Toggles ability for weather fireworks to affect weather on planet of choice.", ADMIN_CATEGORY_DEBUG_EVENTS) + var/datum/planet/planet = tgui_input_list(user, "Which planet do you want to toggle firework effects on?", "Change Weather", SSplanets.planets) if(istype(planet) && planet.weather_holder) planet.weather_holder.firework_override = !(planet.weather_holder.firework_override) - var/log = "[key_name(src)] toggled [planet.name]'s firework override to [planet.weather_holder.firework_override ? "on" : "off"]." + var/log = "[key_name(user)] toggled [planet.name]'s firework override to [planet.weather_holder.firework_override ? "on" : "off"]." message_admins(log) log_admin(log) -/datum/admins/proc/change_time() - set category = "Debug.Events" - set name = "Change Planet Time" - set desc = "Changes the time of a planet." - - if(!check_rights(R_DEBUG)) +ADMIN_VERB(change_time, R_DEBUG|R_EVENT, "Change Planet Time", "Changes the time of a planet.", ADMIN_CATEGORY_DEBUG_EVENTS) + var/datum/planet/planet = tgui_input_list(user, "Which planet do you want to modify time on?", "Change Time", SSplanets.planets) + if(!istype(planet)) return + var/datum/time/current_time_datum = planet.current_time + var/planet_hours = max(round(current_time_datum.seconds_in_day / 36000) - 1, 0) + var/new_hour = tgui_input_number(user, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), planet_hours) + if(isnull(new_hour)) + return + var/planet_minutes = max(round(current_time_datum.seconds_in_hour / 600) - 1, 0) + var/new_minute = tgui_input_number(user, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), planet_minutes) + if(isnull(new_minute)) + return + var/type_needed = current_time_datum.type + var/datum/time/new_time = new type_needed() + new_time = new_time.add_hours(new_hour) + new_time = new_time.add_minutes(new_minute) + planet.current_time = new_time + spawn(1) + planet.update_sun() - var/datum/planet/planet = tgui_input_list(usr, "Which planet do you want to modify time on?", "Change Time", SSplanets.planets) - if(istype(planet)) - var/datum/time/current_time_datum = planet.current_time - var/planet_hours = max(round(current_time_datum.seconds_in_day / 36000) - 1, 0) - var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")), planet_hours) - if(!isnull(new_hour)) - var/planet_minutes = max(round(current_time_datum.seconds_in_hour / 600) - 1, 0) - var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")), planet_minutes) - if(!isnull(new_minute)) - var/type_needed = current_time_datum.type - var/datum/time/new_time = new type_needed() - new_time = new_time.add_hours(new_hour) - new_time = new_time.add_minutes(new_minute) - planet.current_time = new_time - spawn(1) - planet.update_sun() + var/log = "[key_name(user)] changed [planet.name]'s time to [planet.current_time.show_time("hh:mm")]." + message_admins(log) + log_admin(log) - var/log = "[key_name(src)] changed [planet.name]'s time to [planet.current_time.show_time("hh:mm")]." - message_admins(log) - log_admin(log) - -/client/proc/cmd_regenerate_asset_cache() - set category = "Debug.Assets" - set name = "Regenerate Asset Cache" - set desc = "Clears the asset cache and regenerates it immediately." +ADMIN_VERB(cmd_regenerate_asset_cache, R_DEBUG|R_SERVER, "Regenerate Asset Cache", "Clears the asset cache and regenerates it immediately.", ADMIN_CATEGORY_DEBUG_ASSETS) if(!CONFIG_GET(flag/cache_assets)) - to_chat(usr, span_warning("Asset caching is disabled in the config!")) + to_chat(user, span_warning("Asset caching is disabled in the config!")) return var/regenerated = 0 - for(var/datum/asset/A as() in subtypesof(/datum/asset)) - if(!initial(A.cross_round_cachable)) + for(var/datum/asset/current_asset as anything in subtypesof(/datum/asset)) + if(!initial(current_asset.cross_round_cachable)) continue - if(A == initial(A._abstract)) + if(current_asset == initial(current_asset._abstract)) continue - var/datum/asset/asset_datum = GLOB.asset_datums[A] + var/datum/asset/asset_datum = GLOB.asset_datums[current_asset] asset_datum.regenerate() regenerated++ - to_chat(usr, span_notice("Regenerated [regenerated] asset\s.")) + to_chat(user, span_notice("Regenerated [regenerated] asset\s.")) -/client/proc/cmd_clear_smart_asset_cache() - set category = "Debug.Assets" - set name = "Clear Smart Asset Cache" - set desc = "Clears the smart asset cache." +ADMIN_VERB(cmd_clear_smart_asset_cache, R_DEBUG|R_SERVER, "Clear Smart Asset Cache", "Clears the smart asset cache.", ADMIN_CATEGORY_DEBUG_ASSETS) if(!CONFIG_GET(flag/smart_cache_assets)) - to_chat(usr, span_warning("Smart asset caching is disabled in the config!")) + to_chat(user, span_warning("Smart asset caching is disabled in the config!")) return var/cleared = 0 - for(var/datum/asset/spritesheet_batched/A as() in subtypesof(/datum/asset/spritesheet_batched)) - if(A == initial(A._abstract)) + for(var/datum/asset/spritesheet_batched/current_asset as anything in subtypesof(/datum/asset/spritesheet_batched)) + if(current_asset == initial(current_asset._abstract)) continue - fdel("[ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY]/spritesheet_cache.[initial(A.name)].json") + fdel("[ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY]/spritesheet_cache.[initial(current_asset.name)].json") cleared++ - to_chat(usr, span_notice("Cleared [cleared] asset\s.")) + to_chat(user, span_notice("Cleared [cleared] asset\s.")) // For spriters with long world loads, allows to reload test robot sprites -/client/proc/cmd_reload_robot_sprite_test() - set category = "Debug.Sprites" - set name = "Reload Robot Test Sprites" - set desc = "Reloads the dmis from the test folder and creates the test datums." - +ADMIN_VERB(cmd_reload_robot_sprite_test, R_DEBUG|R_SERVER, "Reload Robot Test Sprites", "Reloads the dmis from the test folder and creates the test datums.", ADMIN_CATEGORY_DEBUG_SPRITES) SSrobot_sprites.reload_test_sprites() -ADMIN_VERB(quick_nif, R_ADMIN, "Quick NIF", "Spawns a NIF into someone in quick-implant mode.", "Fun.Add Nif") +ADMIN_VERB(quick_nif, R_ADMIN, "Quick NIF", "Spawns a NIF into someone in quick-implant mode.", ADMIN_CATEGORY_FUN_ADD_NIF) var/input_NIF var/mob/living/carbon/human/H = tgui_input_list(user, "Pick a mob with a player","Quick NIF", GLOB.player_list) diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index b1004afa70..00117e8078 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -112,80 +112,17 @@ load_admins() feedback_add_details("admin_verb","RLDA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/reload_eventMs() - set name = "Reload Event Managers" - set category = "Debug.Server" - - if(!check_rights(R_SERVER)) return - - message_admins("[usr] manually reloaded Event Managers") - world.load_mods() - - -//todo: -/client/proc/jump_to_dead_group() - set name = "Jump to dead group" - set category = "Debug.Game" - /* - if(!holder) - to_chat(src, "Only administrators may use this command.") - return - - if(!SSair) - to_chat(usr, "Cannot find air_system") - return - var/datum/air_group/dead_groups = list() - for(var/datum/air_group/group in SSair.air_groups) - if (!group.group_processing) - dead_groups += group - var/datum/air_group/dest_group = pick(dead_groups) - usr.loc = pick(dest_group.members) - feedback_add_details("admin_verb","JDAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return - */ - -/client/proc/kill_airgroup() - set name = "Kill Local Airgroup" - set desc = "Use this to allow manual manupliation of atmospherics." - set category = "Debug.Dangerous" - /* - if(!holder) - to_chat(src, "Only administrators may use this command.") - return - - if(!SSair) - to_chat(usr, "Cannot find air_system") - return - - var/turf/T = get_turf(usr) - if(istype(T, /turf/simulated)) - var/datum/air_group/AG = T:parent - AG.next_check = 30 - AG.group_processing = 0 - else - to_chat(usr, "Local airgroup is unsimulated!") - feedback_add_details("admin_verb","KLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - */ - -/client/proc/print_jobban_old() - set name = "Print Jobban Log" - set desc = "This spams all the active jobban entries for the current round to standard output." - set category = "Debug.Investigate" - - to_chat(usr, span_bold("Jobbans active in this round.")) +ADMIN_VERB(print_jobban_old, R_ADMIN|R_MOD, "Print Jobban Log", "This spams all the active jobban entries for the current round to standard output.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) + to_chat(user, span_debug_info(span_bold("Jobbans active in this round."))) for(var/t in GLOB.jobban_keylist) - to_chat(usr, "[t]") + to_chat(user, span_debug_info("[t]")) -/client/proc/print_jobban_old_filter() - set name = "Search Jobban Log" - set desc = "This searches all the active jobban entries for the current round and outputs the results to standard output." - set category = "Debug.Investigate" - - var/job_filter = tgui_input_text(usr, "Contains what?","Job Filter") +ADMIN_VERB(print_jobban_old_filter, R_ADMIN|R_MOD, "Search Jobban Log", "This searches all the active jobban entries for the current round and outputs the results to standard output.", ADMIN_CATEGORY_DEBUG_INVESTIGATE) + var/job_filter = tgui_input_text(user, "Contains what?","Job Filter") if(!job_filter) return - to_chat(usr, span_bold("Jobbans active in this round.")) + to_chat(user, span_debug_info(span_bold("Jobbans active in this round."))) for(var/t in GLOB.jobban_keylist) if(findtext(t, job_filter)) - to_chat(usr, "[t]") + to_chat(user, span_debug_info("[t]")) diff --git a/code/modules/admin/verbs/entity_narrate.dm b/code/modules/admin/verbs/entity_narrate.dm index a4c15e8dac..8b398fb3af 100644 --- a/code/modules/admin/verbs/entity_narrate.dm +++ b/code/modules/admin/verbs/entity_narrate.dm @@ -68,7 +68,7 @@ ADMIN_VERB_AND_CONTEXT_MENU(add_mob_for_narration, R_FUN, "Narrate Entity (Add r log_and_message_admins("added [A.name] for their personal list to narrate", user) //Logging here to avoid spam, while still safeguarding abuse //Proc for keeping our ref list relevant, deleting mobs that are no longer relevant for our event -ADMIN_VERB(remove_mob_for_narration, R_FUN, "Narrate Entity (Remove ref)", "Remove mobs you're no longer narrating from your list for easier work.", "Fun.Narrate") +ADMIN_VERB(remove_mob_for_narration, R_FUN, "Narrate Entity (Remove ref)", "Remove mobs you're no longer narrating from your list for easier work.", ADMIN_CATEGORY_FUN_NARRATE) if(!user.entity_narrate_holder) user.entity_narrate_holder = new /datum/entity_narrate() to_chat(user, "No references were added yet! First add references!") @@ -92,7 +92,7 @@ ADMIN_VERB(remove_mob_for_narration, R_FUN, "Narrate Entity (Remove ref)", "Remo //For now brings up a list of all entities on our reference list and gives us the option to choose what we wanna do //using TGUI/Byond list/alert inputs //Does not actually interact with the game world, it passes user input to narrate_mob_args(name, mode, message) after sanitizing -ADMIN_VERB(narrate_mob, R_FUN, "Narrate Entity (Interface)", "Send either a visible or audiable message through your chosen entities using an interface.", "Fun.Narrate") +ADMIN_VERB(narrate_mob, R_FUN, "Narrate Entity (Interface)", "Send either a visible or audiable message through your chosen entities using an interface.", ADMIN_CATEGORY_FUN_NARRATE) if(!user.entity_narrate_holder) user.entity_narrate_holder = new /datum/entity_narrate() to_chat(user, "No references were added yet! First add references!") diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm index c9dc93d3ef..425af6196f 100644 --- a/code/modules/admin/verbs/map_template_loadverb.dm +++ b/code/modules/admin/verbs/map_template_loadverb.dm @@ -1,16 +1,11 @@ -/client/proc/map_template_load() - set category = "Debug.Events" - set name = "Map template - Place At Loc" - var/datum/map_template/template - - - var/map = tgui_input_list(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template", SSmapping.map_templates) +ADMIN_VERB(map_template_load, R_SPAWN, "Map template - Place At Loc", "Spawns a new map template at the current position.", ADMIN_CATEGORY_DEBUG_EVENTS) + var/map = tgui_input_list(user, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template", SSmapping.map_templates) if(!map) return - template = SSmapping.map_templates[map] + var/datum/map_template/template = SSmapping.map_templates[map] - var/turf/T = get_turf(mob) + var/turf/T = get_turf(user.mob) if(!T) return @@ -18,57 +13,48 @@ template.preload_size(template.mappath) for(var/S in template.get_affected_turfs(T,centered = TRUE)) preview += image('icons/misc/debug_group.dmi',S ,"red") - usr.client.images += preview - if(tgui_alert(usr,"Confirm location.", "Template Confirm",list("No","Yes")) == "Yes") - if(template.annihilate && tgui_alert(usr,"This template is set to annihilate everything in the red square. EVERYTHING IN THE RED SQUARE WILL BE DELETED, ARE YOU ABSOLUTELY SURE?", "Template Confirm", list("No","Yes")) != "Yes") - usr.client.images -= preview + user.images += preview + if(tgui_alert(user, "Confirm location.", "Template Confirm", list("No","Yes")) == "Yes") + if(template.annihilate && tgui_alert(user, "This template is set to annihilate everything in the red square. EVERYTHING IN THE RED SQUARE WILL BE DELETED, ARE YOU ABSOLUTELY SURE?", "Template Confirm", list("No","Yes")) != "Yes") + user.images -= preview return if(template.load(T, centered = TRUE)) - message_admins(span_adminnotice("[key_name_admin(usr)] has placed a map template ([template.name]).")) + message_admins(span_adminnotice("[key_name_admin(user)] has placed a map template ([template.name]).")) else - to_chat(usr, "Failed to place map") - if(usr) - usr.client.images -= preview + to_chat(user, "Failed to place map") + if(user) + user.images -= preview -/client/proc/map_template_load_on_new_z() - set category = "Debug.Events" - set name = "Map template - New Z" - - var/datum/map_template/template - - var/map = tgui_input_list(usr, "Choose a Map Template to place on a new Z-level.","Place Map Template", SSmapping.map_templates) +ADMIN_VERB(map_template_load_on_new_z, R_SPAWN, "Map template - New Z", "Spawns a new map template at the selected z level.", ADMIN_CATEGORY_DEBUG_EVENTS) + var/map = tgui_input_list(user, "Choose a Map Template to place on a new Z-level.","Place Map Template", SSmapping.map_templates) if(!map) return - template = SSmapping.map_templates[map] + var/datum/map_template/template = SSmapping.map_templates[map] if(template.width > world.maxx || template.height > world.maxx) - if(tgui_alert(usr,"This template is larger than the existing z-levels. It will EXPAND ALL Z-LEVELS to match the size of the template. This may cause chaos. Are you sure you want to do this?","DANGER!!!",list("Cancel","Yes")) == "Cancel") - to_chat(usr,"Template placement aborted.") + if(tgui_alert(user, "This template is larger than the existing z-levels. It will EXPAND ALL Z-LEVELS to match the size of the template. This may cause chaos. Are you sure you want to do this?","DANGER!!!",list("Cancel","Yes")) == "Cancel") + to_chat(user,"Template placement aborted.") return - if(tgui_alert(usr,"Confirm map load.", "Template Confirm",list("No","Yes")) == "Yes") + if(tgui_alert(user, "Confirm map load.", "Template Confirm", list("No","Yes")) == "Yes") if(template.load_new_z()) - message_admins(span_adminnotice("[key_name_admin(usr)] has placed a map template ([template.name]) on Z level [world.maxz].")) + message_admins(span_adminnotice("[key_name_admin(user)] has placed a map template ([template.name]) on Z level [world.maxz].")) else - to_chat(usr, "Failed to place map") + to_chat(user, "Failed to place map") - -/client/proc/map_template_upload() - set category = "Debug.Events" - set name = "Map Template - Upload" - - var/map = input(usr, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file +ADMIN_VERB(map_template_upload, R_SPAWN, "Map Template - Upload", "Uploads the selected map template to the template storage.", ADMIN_CATEGORY_DEBUG_EVENTS) + 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") - to_chat(usr, "Bad map file: [map]") + to_chat(user, "Bad map file: [map]") return var/datum/map_template/M = new(map, "[map]") if(M.preload_size(map)) - to_chat(usr, "Map template '[map]' ready to place ([M.width]x[M.height])") + to_chat(user, "Map template '[map]' ready to place ([M.width]x[M.height])") SSmapping.map_templates[M.name] = M - message_admins(span_adminnotice("[key_name_admin(usr)] has uploaded a map template ([map])")) + message_admins(span_adminnotice("[key_name_admin(user)] has uploaded a map template ([map])")) else - to_chat(usr, "Map template '[map]' failed to load properly") + to_chat(user, "Map template '[map]' failed to load properly") diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 56aed838b8..a2d86b409c 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -40,21 +40,13 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) /obj/effect/debugging/marker/Move() return 0 -/client/proc/do_not_use_these() - set category = "Mapping" - set name = "-None of these are for ingame use!!" - -/client/proc/camera_view() - set category = "Mapping" - set name = "Camera Range Display" - +ADMIN_VERB_VISIBILITY(camera_view, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(camera_view, R_DEBUG, "Camera Range Display", "Globally changes the camera view (Only use on a test server).", ADMIN_CATEGORY_MAPPING_TESTS) if(GLOB.camera_range_display_status) GLOB.camera_range_display_status = FALSE else GLOB.camera_range_display_status = TRUE - - for(var/obj/effect/debugging/camera_range/C in GLOB.all_debugging_effects) qdel(C) @@ -63,14 +55,10 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) new/obj/effect/debugging/camera_range(C.loc) feedback_add_details("admin_verb","mCRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - -/client/proc/sec_camera_report() - set category = "Mapping" - set name = "Camera Report" - +ADMIN_VERB_VISIBILITY(sec_camera_report, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(sec_camera_report, R_DEBUG, "Camera Report", "Gives a report of the camera state (Only use on a test server).", ADMIN_CATEGORY_MAPPING_TESTS) if(!GLOB.master_controller) - tgui_alert_async(usr,"Master_controller not found.","Sec Camera Report") + tgui_alert_async(user,"Master_controller not found.","Sec Camera Report") return 0 var/list/obj/machinery/camera/CL = list() @@ -103,15 +91,13 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) output += "" - var/datum/browser/popup = new(src, "airreport", "Airreport", 1000, 500) + var/datum/browser/popup = new(user, "airreport", "Airreport", 1000, 500) popup.set_content(output) popup.open() feedback_add_details("admin_verb","mCRP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/intercom_view() - set category = "Mapping" - set name = "Intercom Range Display" - +ADMIN_VERB_VISIBILITY(intercom_view, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(intercom_view, R_DEBUG, "Intercom Range Display", "Displays the intercom view as effects (Only use on a test server).", ADMIN_CATEGORY_MAPPING_TESTS) if(GLOB.intercom_range_display_status) GLOB.intercom_range_display_status = FALSE else @@ -128,60 +114,6 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) qdel(F) feedback_add_details("admin_verb","mIRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -GLOBAL_LIST_INIT(debug_verbs, list( - /client/proc/do_not_use_these - ,/client/proc/camera_view - ,/client/proc/sec_camera_report - ,/client/proc/intercom_view - ,/client/proc/Cell - ,/client/proc/atmosscan - ,/client/proc/powerdebug - ,/client/proc/count_objects_on_z_level - ,/client/proc/count_objects_all - ,/client/proc/jump_to_dead_group - ,/client/proc/startSinglo - ,/client/proc/cmd_admin_grantfullaccess - ,/client/proc/kaboom - ,/client/proc/cmd_admin_areatest - ,/datum/admins/proc/show_traitor_panel - ,/client/proc/print_jobban_old - ,/client/proc/print_jobban_old_filter - ,/client/proc/forceEvent - ,/client/proc/Zone_Info - ,/client/proc/Test_ZAS_Connection - ,/client/proc/ZoneTick - ,/client/proc/rebootAirMaster - ,/client/proc/hide_debug_verbs - ,/client/proc/testZAScolors - ,/client/proc/testZAScolors_remove - ,/datum/admins/proc/setup_supermatter - ,/client/proc/atmos_toggle_debug - ,/client/proc/spawn_tanktransferbomb - ,/client/proc/take_picture - )) - - -/client/proc/enable_debug_verbs() - set category = "Debug.Misc" - set name = "Debug verbs" - - if(!check_rights(R_DEBUG)) return - - add_verb(src, GLOB.debug_verbs) - - feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/hide_debug_verbs() - set category = "Debug.Misc" - set name = "Hide Debug verbs" - - if(!check_rights(R_DEBUG)) return - - remove_verb(src, GLOB.debug_verbs) - - feedback_add_details("admin_verb","hDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - /client/var/list/testZAScolors_turfs = list() /client/var/list/testZAScolors_zones = list() /client/var/usedZAScolors = 0 @@ -202,88 +134,84 @@ GLOBAL_LIST_INIT(debug_verbs, list( continue recurse_zone(connected,recurse_level+1) +ADMIN_VERB_VISIBILITY(testZAScolors, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(testZAScolors, R_DEBUG, "Check ZAS connections", "Displays ZAS connections as effects (Only use on a test server).", ADMIN_CATEGORY_MAPPING_ZAS) + SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/testZAScolors_remove) -/client/proc/testZAScolors() - set category = "Mapping.ZAS" - set name = "Check ZAS connections" - - if(!check_rights(R_DEBUG)) return - testZAScolors_remove() - - var/turf/simulated/location = get_turf(usr) + var/turf/simulated/location = get_turf(user.mob) if(!istype(location, /turf/simulated)) // We're in space, let's not cause runtimes. - to_chat(usr, span_red("this debug tool cannot be used from space")) + to_chat(user, span_red("this debug tool cannot be used from space")) return var/icon/red = new('icons/misc/debug_group.dmi', "red") //created here so we don't have to make thousands of these. var/icon/green = new('icons/misc/debug_group.dmi', "green") var/icon/blue = new('icons/misc/debug_group.dmi', "blue") - if(!usedZAScolors) - to_chat(usr, "ZAS Test Colors") - to_chat(usr, "[span_green("Green")] = Zone you are standing in") - to_chat(usr, "[span_blue("Blue")] = Connected zone to the zone you are standing in") - to_chat(usr, "[span_yellow("Yellow")] = A zone that is connected but not one adjacent to your connected zone") - to_chat(usr, "[span_red("Red")] = Not connected") - usedZAScolors = 1 + if(!user.usedZAScolors) + to_chat(user, "ZAS Test Colors") + to_chat(user, "[span_green("Green")] = Zone you are standing in") + to_chat(user, "[span_blue("Blue")] = Connected zone to the zone you are standing in") + to_chat(user, "[span_yellow("Yellow")] = A zone that is connected but not one adjacent to your connected zone") + to_chat(user, "[span_red("Red")] = Not connected") + user.usedZAScolors = 1 - testZAScolors_zones += location.zone + user.testZAScolors_zones += location.zone for(var/turf/T in location.zone.contents) - images += image(green, T,"zasdebug", PLANE_ADMIN2) // CHOMPEDIT - testZAScolors_turfs += T + user.images += image(green, T,"zasdebug", PLANE_ADMIN2) // CHOMPEDIT + user.testZAScolors_turfs += T for(var/datum/connection_edge/zone/edge in location.zone.edges) var/datum/zone/Z = edge.get_connected_zone(location.zone) - testZAScolors_zones += Z + user.testZAScolors_zones += Z for(var/turf/T in Z.contents) - images += image(blue, T,"zasdebug",PLANE_ADMIN2) // CHOMPEDIT - testZAScolors_turfs += T + user.images += image(blue, T,"zasdebug",PLANE_ADMIN2) // CHOMPEDIT + user.testZAScolors_turfs += T for(var/datum/connection_edge/zone/z_edge in Z.edges) var/datum/zone/connected = z_edge.get_connected_zone(Z) - if(connected in testZAScolors_zones) + if(connected in user.testZAScolors_zones) continue - recurse_zone(connected,1) + user.recurse_zone(connected,1) for(var/turf/T in range(25,location)) if(!istype(T)) continue - if(T in testZAScolors_turfs) + if(T in user.testZAScolors_turfs) continue - images += image(red, T, "zasdebug", PLANE_ADMIN2) // CHOMPEDIT - testZAScolors_turfs += T + user.images += image(red, T, "zasdebug", PLANE_ADMIN2) // CHOMPEDIT + user.testZAScolors_turfs += T -/client/proc/testZAScolors_remove() - set category = "Mapping.ZAS" - set name = "Remove ZAS connection colors" +ADMIN_VERB_VISIBILITY(testZAScolors_remove, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(testZAScolors_remove, R_DEBUG, "Remove ZAS connection colors", "Clears displayed ZAS connections (Only use on a test server).", ADMIN_CATEGORY_MAPPING_ZAS) + user.testZAScolors_turfs.Cut() + user.testZAScolors_zones.Cut() - testZAScolors_turfs.Cut() - testZAScolors_zones.Cut() - - if(images.len) - for(var/image/i in images) + if(length(user.images)) + for(var/image/i in user.images) if(i.icon_state == "zasdebug") - images.Remove(i) + user.images.Remove(i) -/client/proc/rebootAirMaster() - set category = "Mapping.ZAS" - set name = "Reboot ZAS" - - if(tgui_alert(usr, "This will destroy and remake all zone geometry on the whole map.","Reboot ZAS",list("Reboot ZAS","Nevermind")) == "Reboot ZAS") +ADMIN_VERB_VISIBILITY(rebootAirMaster, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(rebootAirMaster, R_DEBUG, "Reboot ZAS", "Rstarts ZAS (Only use on a test server).", ADMIN_CATEGORY_MAPPING_ZAS) + if(tgui_alert(user, "This will destroy and remake all zone geometry on the whole map.","Reboot ZAS",list("Reboot ZAS","Nevermind")) == "Reboot ZAS") SSair.RebootZAS() -/client/proc/count_objects_on_z_level() - set category = "Mapping" - set name = "Count Objects On Level" - var/level = tgui_input_text(usr, "Which z-level?","Level?") - if(!level) return +ADMIN_VERB_VISIBILITY(count_objects_on_z_level, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(count_objects_on_z_level, R_DEBUG, "Count Objects On Level", "Counts all objects on a Z level (Only use on a test server).", ADMIN_CATEGORY_MAPPING) + var/level = tgui_input_text(user, "Which z-level?","Level?") + if(!level) + return var/num_level = text2num(level) - if(!num_level) return - if(!isnum(num_level)) return + if(!num_level) + return + if(!isnum(num_level)) + return - var/type_text = tgui_input_text(usr, "Which type path?","Path?") - if(!type_text) return + var/type_text = tgui_input_text(user, "Which type path?","Path?") + if(!type_text) + return var/type_path = text2path(type_text) - if(!type_path) return + if(!type_path) + return var/count = 1 @@ -314,14 +242,14 @@ GLOBAL_LIST_INIT(debug_verbs, list( to_chat(world, "There are [count] objects of type [type_path] on z-level [num_level]") feedback_add_details("admin_verb","mOBJZ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/count_objects_all() - set category = "Mapping" - set name = "Count Objects All" - - var/type_text = tgui_input_text(usr, "Which type path?","") - if(!type_text) return +ADMIN_VERB_VISIBILITY(count_objects_all, ADMIN_VERB_VISIBLITY_FLAG_LOCALHOST) +ADMIN_VERB(count_objects_all, R_DEBUG, "Count Objects All", "Count all objects by type (Only use on a test server).", ADMIN_CATEGORY_MAPPING) + var/type_text = tgui_input_text(user, "Which type path?","") + if(!type_text) + return var/type_path = text2path(type_text) - if(!type_path) return + if(!type_path) + return var/count = 0 @@ -340,3 +268,11 @@ GLOBAL_LIST_INIT(debug_verbs, list( to_chat(world, "There are [count] objects of type [type_path] in the game world") feedback_add_details("admin_verb","mOBJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + +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) + feedback_add_details("admin_verb","mapDB") + +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) diff --git a/code/modules/admin/verbs/panicbunker.dm b/code/modules/admin/verbs/panicbunker.dm index 4b2722995e..ac2cdf7e23 100644 --- a/code/modules/admin/verbs/panicbunker.dm +++ b/code/modules/admin/verbs/panicbunker.dm @@ -1,45 +1,27 @@ -/client/proc/panicbunker() - set category = "Server.Config" - set name = "Toggle Panic Bunker" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(panicbunker, R_ADMIN|R_SERVER, "Toggle Panic Bunker", "Locks the server down.", ADMIN_CATEGORY_SERVER_CONFIG) if (!CONFIG_GET(flag/sql_enabled)) - to_chat(usr, span_adminnotice("The Database is not enabled!")) + to_chat(user, span_adminnotice("The Database is not enabled!")) return CONFIG_SET(flag/panic_bunker, !CONFIG_GET(flag/panic_bunker)) - log_and_message_admins("has toggled the Panic Bunker, it is now [(CONFIG_GET(flag/panic_bunker) ? "on":"off")].", src) + log_and_message_admins("has toggled the Panic Bunker, it is now [(CONFIG_GET(flag/panic_bunker) ? "on":"off")].", user) if (CONFIG_GET(flag/panic_bunker) && (!SSdbcore || !SSdbcore.IsConnected())) message_admins("The database is not connected! Panic bunker will not work until the connection is reestablished.") feedback_add_details("admin_verb","PANIC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/paranoia_logging() - set category = "Server.Config" - set name = "New Player Warnings" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(paranoia_logging, R_ADMIN|R_SERVER, "New Player Warnings", "Toggle paranoia logging.", ADMIN_CATEGORY_SERVER_CONFIG) CONFIG_SET(flag/paranoia_logging, !CONFIG_GET(flag/paranoia_logging)) - log_and_message_admins("has toggled Paranoia Logging, it is now [(CONFIG_GET(flag/paranoia_logging) ? "on":"off")].", src) + log_and_message_admins("has toggled Paranoia Logging, it is now [(CONFIG_GET(flag/paranoia_logging) ? "on":"off")].", user) if (CONFIG_GET(flag/paranoia_logging) && (!SSdbcore || !SSdbcore.IsConnected())) message_admins("The database is not connected! Paranoia logging will not be able to give 'player age' (time since first connection) warnings, only Byond account warnings.") feedback_add_details("admin_verb","PARLOG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/ip_reputation() - set category = "Server.Config" - set name = "Toggle IP Rep Checks" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB(ip_reputation, R_ADMIN|R_SERVER, "Toggle IP Rep Checks", "Toggle ip reputation checks.", ADMIN_CATEGORY_SERVER_CONFIG) CONFIG_SET(flag/ip_reputation, !CONFIG_GET(flag/ip_reputation)) - log_and_message_admins("has toggled IP reputation checks, it is now [(CONFIG_GET(flag/ip_reputation) ? "on":"off")].", src) + log_and_message_admins("has toggled IP reputation checks, it is now [(CONFIG_GET(flag/ip_reputation) ? "on":"off")].", user) if (CONFIG_GET(flag/ip_reputation) && (!SSdbcore || !SSdbcore.IsConnected())) message_admins("The database is not connected! IP reputation logging will not be able to allow existing players to bypass the reputation checks (if that is enabled).") feedback_add_details("admin_verb","IPREP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index b6cef44ebf..be0d2b16fb 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -17,42 +17,34 @@ ADMIN_VERB(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTIO message_admins(msg) feedback_add_details("admin_verb","DEVR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_prison(mob/M as mob in GLOB.mob_list) - set category = "Admin.Game" - set name = "Prison" - if(!check_rights_for(src, R_HOLDER)) +ADMIN_VERB(cmd_admin_prison, R_ADMIN|R_MOD, "Prison", "Send target to prison.", ADMIN_CATEGORY_GAME, mob/target_mob in GLOB.mob_list) + if(!length(GLOB.prisonwarp)) return - - if (ismob(M)) - if(isAI(M)) - tgui_alert_async(usr, "The AI can't be sent to prison you jerk!") + if(ismob(target_mob)) + if(isAI(target_mob)) + tgui_alert_async(user, "The AI can't be sent to prison you jerk!") return //strip their stuff before they teleport into a cell :downs: - for(var/obj/item/W in M) - M.drop_from_inventory(W) + for(var/obj/item/content_item in target_mob) + target_mob.drop_from_inventory(content_item) //teleport person to cell - M.Paralyse(5) - M.Sleeping(5) + target_mob.Paralyse(5) + target_mob.Sleeping(5) sleep(5) //so they black out before warping - M.loc = pick(GLOB.prisonwarp) - if(ishuman(M)) - var/mob/living/carbon/human/prisoner = M + target_mob.forceMove(pick(GLOB.prisonwarp)) + if(ishuman(target_mob)) + var/mob/living/carbon/human/prisoner = target_mob prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/prison(prisoner), slot_w_uniform) prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes) spawn(50) - to_chat(M, span_red("You have been sent to the prison station!")) - log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.") - message_admins(span_blue("[key_name_admin(usr)] sent [key_name_admin(M)] to the prison station."), 1) + to_chat(target_mob, span_bolddanger("You have been sent to the prison station!")) + log_admin("[key_name(user)] sent [key_name(target_mob)] to the prison station.") + message_admins(span_blue("[key_name_admin(user)] sent [key_name_admin(target_mob)] to the prison station."), 1) feedback_add_details("admin_verb","PRISON") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //Allows staff to determine who the newer players are. -/client/proc/cmd_check_new_players() - set category = "Admin.Investigate" - set name = "Check new Players" - if(!check_rights_for(src, R_HOLDER)) - return - - var/age = tgui_alert(src, "Age check", "Show accounts yonger then _____ days", list("7","30","All")) +ADMIN_VERB(cmd_check_new_players, R_HOLDER, "Check new Players", "Check the account age.", ADMIN_CATEGORY_INVESTIGATE) + var/age = tgui_alert(user, "Age check", "Show accounts yonger then _____ days", list("7","30","All")) if(!age) return if(age == "All") @@ -65,32 +57,25 @@ ADMIN_VERB(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTIO var/highlight_special_characters = 1 - for(var/client/C in GLOB.clients) - if(C.player_age == "Requires database") + for(var/client/current_client in GLOB.clients) + if(current_client.player_age == "Requires database") missing_ages = 1 continue - if(C.player_age < age) - msg += "[key_name(C, 1, 1, highlight_special_characters)]: account is [C.player_age] days old
" + if(current_client.player_age < age) + msg += "[key_name(current_client, 1, 1, highlight_special_characters)]: account is [current_client.player_age] days old
" if(missing_ages) - to_chat(src, "Some accounts did not have proper ages set in their clients. This function requires database to be present.") + to_chat(user, "Some accounts did not have proper ages set in their clients. This function requires database to be present.") if(msg != "") - var/datum/browser/popup = new(src, "Player_age_check", "Player Age Check") + var/datum/browser/popup = new(user, "Player_age_check", "Player Age Check") popup.set_content(msg) popup.open() - else - to_chat(src, "No matches for that age range found.") - -/client/proc/cmd_admin_subtle_message(mob/M as mob in GLOB.mob_list) - set category = "Admin" - set name = "Subtle Message" - - if(!ismob(M)) return - if (!check_rights_for(src, R_HOLDER)) return + to_chat(user, "No matches for that age range found.") - var/msg = tgui_input_text(usr, "Message:", text("Subtle PM to [M.key]"), encode = FALSE) +ADMIN_VERB_ONLY_CONTEXT_MENU(cmd_admin_subtle_message, R_HOLDER, "Subtle Message", mob/targat_mob in get_mob_with_client_list()) + var/msg = tgui_input_text(user, "Message:", text("Subtle PM to [targat_mob.key]"), encode = FALSE) if (!msg) return @@ -98,25 +83,16 @@ ADMIN_VERB(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTIO if(!(msg[1] == "<" && msg[length(msg)] == ">")) //You can use HTML but only if the whole thing is HTML. Tries to prevent admin 'accidents'. msg = sanitize(msg) - if(usr) - if (usr.client) - if(check_rights_for(usr.client, R_HOLDER)) - to_chat(M, span_bold("You hear a voice in your head...") + " " + span_italics("[msg]")) + to_chat(targat_mob, span_bold("You hear a voice in your head...") + " " + span_italics("[msg]")) - log_admin("SubtlePM: [key_name(usr)] -> [key_name(M)] : [msg]") - msg = span_admin_pm_notice(span_bold(" SubtleMessage: [key_name_admin(usr)] -> [key_name_admin(M)] :") + " [msg]") + log_admin("SubtlePM: [key_name(user)] -> [key_name(targat_mob)] : [msg]") + msg = span_admin_pm_notice(span_bold(" SubtleMessage: [key_name_admin(user)] -> [key_name_admin(targat_mob)] :") + " [msg]") message_admins(msg) - admin_ticket_log(M, msg) + admin_ticket_log(targat_mob, msg) feedback_add_details("admin_verb","SMS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_world_narrate() // Allows administrators to fluff events a little easier -- TLE - set category = "Fun.Narrate" - set name = "Global Narrate" - - if (!check_rights_for(src, R_HOLDER)) - return - - var/msg = tgui_input_text(usr, "Message:", text("Enter the text you wish to appear to everyone:"), encode = FALSE) +ADMIN_VERB(cmd_admin_world_narrate, R_FUN|R_EVENT, "Global Narrate", "Globally narrate.", ADMIN_CATEGORY_FUN_NARRATE) // Allows administrators to fluff events a little easier -- TLE + var/msg = tgui_input_text(user, "Message:", text("Enter the text you wish to appear to everyone:"), encode = FALSE) if (!msg) return @@ -126,75 +102,80 @@ ADMIN_VERB(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTIO return to_chat(world, "[msg]") - log_admin("GlobalNarrate: [key_name(usr)] : [msg]") - message_admins(span_blue(span_bold(" GlobalNarrate: [key_name_admin(usr)] : [msg]
")), 1) + log_admin("GlobalNarrate: [key_name(user)] : [msg]") + message_admins(span_blue(span_bold("GlobalNarrate: [key_name_admin(user)] : [msg]
"))) feedback_add_details("admin_verb","GLN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_direct_narrate(var/mob/M) // Targetted narrate -- TLE - set category = "Fun.Narrate" - set name = "Direct Narrate" +ADMIN_VERB(cmd_admin_local_narrate, R_FUN|R_EVENT, "Local Narrate", "Locally narrate.", ADMIN_CATEGORY_FUN_NARRATE) + var/msg = tgui_input_text(user, "Message:", text("Enter the text you wish to appear to everyone within view range:"), encode = FALSE) - if(!check_rights_for(src, R_HOLDER)) + if (!msg) + return + if(!(msg[1] == "<" && msg[length(msg)] == ">")) //You can use HTML but only if the whole thing is HTML. Tries to prevent admin 'accidents'. + msg = sanitize(msg) + if (!msg) // We check both before and after, just in case sanitization ended us up with empty message. return - if(!M) - M = tgui_input_list(usr, "Direct narrate to who?", "Active Players", get_mob_with_client_list()) + for(var/mob/mobs in range(user.eye, user.view)) + to_chat(mobs, span_bold("[msg]")) + log_admin("LocalNarrate: [key_name(user)] : [msg]") + message_admins(span_blue(span_bold("LocalNarrate: [key_name_admin(user)] : [msg]
"))) + feedback_add_details("admin_verb","LNR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - if(!M) + +ADMIN_VERB(cmd_admin_direct_narrate, R_FUN|R_EVENT, "Direct Narrate", "Directly narrate the target.", ADMIN_CATEGORY_FUN_NARRATE, mob/target_mob) + if(!target_mob) + target_mob = tgui_input_list(user, "Direct narrate to who?", "Active Players", get_mob_with_client_list()) + + if(!target_mob) return - var/msg = tgui_input_text(usr, "Message:", text("Enter the text you wish to appear to your target:"), encode = FALSE) + var/msg = tgui_input_text(user, "Message:", text("Enter the text you wish to appear to your target:"), encode = FALSE) if(msg && !(msg[1] == "<" && msg[length(msg)] == ">")) //You can use HTML but only if the whole thing is HTML. Tries to prevent admin 'accidents'. msg = sanitize(msg) - if( !msg ) + if(!msg) return - to_chat(M, msg) - log_admin("DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]): [msg]") - msg = span_admin_pm_notice(span_bold(" DirectNarrate: [key_name(usr)] to ([M.name]/[M.key]):") + " [msg]
") + to_chat(target_mob, msg) + log_admin("DirectNarrate: [key_name(user)] to ([target_mob.name]/[target_mob.key]): [msg]") + msg = span_admin_pm_notice(span_bold(" DirectNarrate: [key_name(user)] to ([target_mob.name]/[target_mob.key]):") + " [msg]
") message_admins(msg) - admin_ticket_log(M, msg) + admin_ticket_log(target_mob, msg) feedback_add_details("admin_verb","DIRN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_godmode(mob/M as mob in GLOB.mob_list) - set category = "Admin.Game" - set name = "Toggle Godmode" +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_godmode, R_HOLDER, "Toggle Godmode", "Toggle godmode on the target.", ADMIN_CATEGORY_GAME, mob/target_mob in GLOB.mob_list) + if(target_mob.status_flags & GODMODE) + target_mob.RemoveElement(/datum/element/godmode) - if(!check_rights_for(src, R_HOLDER)) - return + else if(!(target_mob.status_flags & GODMODE)) + target_mob.AddElement(/datum/element/godmode) - if(M.status_flags & GODMODE) - M.RemoveElement(/datum/element/godmode) + to_chat(user, span_notice("Toggled [(target_mob.status_flags & GODMODE) ? "ON" : "OFF"]")) - else if(!(M.status_flags & GODMODE)) - M.AddElement(/datum/element/godmode) - - to_chat(usr, span_blue("Toggled [(M.status_flags & GODMODE) ? "ON" : "OFF"]")) - - log_admin("[key_name(usr)] has toggled [key_name(M)]'s godmode to [(M.status_flags & GODMODE) ? "On" : "Off"]") - var/msg = "[key_name_admin(usr)] has toggled [ADMIN_LOOKUPFLW(M)]'s godmode to [(M.status_flags & GODMODE) ? "On" : "Off"]" + log_admin("[key_name(user)] has toggled [key_name(target_mob)]'s godmode to [(target_mob.status_flags & GODMODE) ? "On" : "Off"]") + var/msg = "[key_name_admin(user)] has toggled [ADMIN_LOOKUPFLW(target_mob)]'s godmode to [(target_mob.status_flags & GODMODE) ? "On" : "Off"]" message_admins(msg) - admin_ticket_log(M, msg) + admin_ticket_log(target_mob, msg) feedback_add_details("admin_verb","GOD_ENABLE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0) +/proc/cmd_admin_mute(mob/target, mute_type, automute = 0, mob/user) if(automute) if(!CONFIG_GET(flag/automute_on)) return else - if(!usr || !usr.client) + if(!user || !user.client) return - if(!check_rights_for(usr.client, R_HOLDER)) - to_chat(usr, span_red("Error: cmd_admin_mute: You don't have permission to do this.")) + if(!check_rights_for(user.client, R_HOLDER)) + to_chat(user, span_red("Error: cmd_admin_mute: You don't have permission to do this.")) return - if(!M.client) - to_chat(usr, span_red("Error: cmd_admin_mute: This mob doesn't have a client tied to it.")) - if(check_rights_for(M.client, R_HOLDER)) - to_chat(usr, span_red("Error: cmd_admin_mute: You cannot mute an admin/mod.")) - if(!M.client) + if(!target.client) + to_chat(user, span_red("Error: cmd_admin_mute: This mob doesn't have a client tied to it.")) + if(check_rights_for(target.client, R_HOLDER)) + to_chat(user, span_red("Error: cmd_admin_mute: You cannot mute an admin/mod.")) + if(!target.client) return - if(check_rights_for(M.client, R_HOLDER)) + if(check_rights_for(target.client, R_HOLDER)) return var/muteunmute @@ -212,23 +193,23 @@ ADMIN_VERB(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTIO if(automute) muteunmute = "auto-muted" - M.client.prefs.muted |= mute_type - log_admin("SPAM AUTOMUTE: [muteunmute] [key_name(M)] from [mute_string]") - message_admins("SPAM AUTOMUTE: [muteunmute] [key_name_admin(M)] from [mute_string].", 1) - to_chat(M, span_alert("You have been [muteunmute] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin.")) + target.client.prefs.muted |= mute_type + log_admin("SPAM AUTOMUTE: [muteunmute] [key_name(target)] from [mute_string]") + message_admins("SPAM AUTOMUTE: [muteunmute] [key_name_admin(target)] from [mute_string].", 1) + to_chat(target, span_alert("You have been [muteunmute] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin.")) feedback_add_details("admin_verb","AUTOMUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return - if(M.client.prefs.muted & mute_type) + if(target.client.prefs.muted & mute_type) muteunmute = "unmuted" - M.client.prefs.muted &= ~mute_type + target.client.prefs.muted &= ~mute_type else muteunmute = "muted" - M.client.prefs.muted |= mute_type + target.client.prefs.muted |= mute_type - log_admin("[key_name(usr)] has [muteunmute] [key_name(M)] from [mute_string]") - message_admins("[key_name_admin(usr)] has [muteunmute] [key_name_admin(M)] from [mute_string].", 1) - to_chat(M, span_alert("You have been [muteunmute] from [mute_string].")) + log_admin("[key_name(user)] has [muteunmute] [key_name(target)] from [mute_string]") + message_admins("[key_name_admin(user)] has [muteunmute] [key_name_admin(target)] from [mute_string].", 1) + to_chat(target, span_alert("You have been [muteunmute] from [mute_string].")) feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! ADMIN_VERB(cmd_admin_add_random_ai_law, R_ADMIN|R_FUN, "Add Random AI Law", "Adds a random law to the station ai.", ADMIN_CATEGORY_FUN_SILICON) @@ -627,7 +608,7 @@ ADMIN_VERB(cmd_admin_add_freeform_ai_law, R_FUN, "Add Custom AI law", "Adds a cu GLOB.command_announcement.Announce("Ion storm detected near the [station_name()]. Please check all AI-controlled equipment for errors.", "Anomaly Alert", new_sound = 'sound/AI/ionstorm.ogg') feedback_add_details("admin_verb","IONC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_rejuvenate, R_ADMIN|R_FUN|R_MOD, "Rejuvenate", "Fully restores the target mob.", ADMIN_CATEGORY_GAME, mob/living/target_mob as mob in GLOB.mob_list) +ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_rejuvenate, R_ADMIN|R_FUN|R_MOD, "Rejuvenate", "Fully restores the target mob.", ADMIN_CATEGORY_GAME, mob/living/target_mob in GLOB.mob_list) if(!target_mob) return if(!istype(target_mob)) @@ -677,7 +658,7 @@ ADMIN_VERB(cmd_admin_list_open_jobs, R_HOLDER, "List free slots", "Show availabl to_chat(user, "[job.title]: [job.total_positions]") feedback_add_details("admin_verb","LFS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -ADMIN_VERB(cmd_admin_check_contents, R_HOLDER, "Check Contents", "Check the contents of the mob.", ADMIN_CATEGORY_INVESTIGATE, mob/living/living_target as mob in GLOB.mob_list) +ADMIN_VERB(cmd_admin_check_contents, R_HOLDER, "Check Contents", "Check the contents of the mob.", ADMIN_CATEGORY_INVESTIGATE, mob/living/living_target in GLOB.mob_list) var/list/content_list = living_target.get_contents() for(var/target in content_list) to_chat(user, "[target]") diff --git a/code/modules/admin/verbs/randomverbs_vr.dm b/code/modules/admin/verbs/randomverbs_vr.dm index 7442cfa78a..7524d48bdb 100644 --- a/code/modules/admin/verbs/randomverbs_vr.dm +++ b/code/modules/admin/verbs/randomverbs_vr.dm @@ -1,16 +1,10 @@ -/client/proc/spawn_character_mob() - set category = "Fun.Event Kit" - set name = "Spawn Character As Mob" - set desc = "Spawn a specified ckey as a chosen mob." - if(!holder) - return - - var/client/picked_client = tgui_input_list(src, "Who are we spawning as a mob?", "Client", GLOB.clients) +ADMIN_VERB(spawn_character_mob, R_SPAWN, "Spawn Character As Mob", "Spawn a specified ckey as a chosen mob.", ADMIN_CATEGORY_FUN_EVENT_KIT) + var/client/picked_client = tgui_input_list(user, "Who are we spawning as a mob?", "Client", GLOB.clients) if(!picked_client) return var/list/types = typesof(/mob/living) - var/mob_type = tgui_input_text(src, "Mob path to spawn as?", "Mob") + var/mob_type = tgui_input_text(user, "Mob path to spawn as?", "Mob") if(!mob_type) return var/list/matches = new() @@ -23,17 +17,17 @@ if(matches.len==1) chosen = matches[1] else - chosen = tgui_input_list(usr, "Select a mob type", "Select Mob", matches) + chosen = tgui_input_list(user, "Select a mob type", "Select Mob", matches) if(!chosen) return - var/char_name = tgui_alert(src, "Spawn mob with their character name?", "Mob name", list("Yes", "No", "Cancel")) + var/char_name = tgui_alert(user, "Spawn mob with their character name?", "Mob name", list("Yes", "No", "Cancel")) var/name = 0 if(!char_name || char_name == "Cancel") return if(char_name == "Yes") name = 1 - var/vorgans = tgui_alert(src, "Spawn mob with their character's vore organs and prefs?", "Vore organs", list("Yes", "No", "Cancel")) + var/vorgans = tgui_alert(user, "Spawn mob with their character's vore organs and prefs?", "Vore organs", list("Yes", "No", "Cancel")) var/organs if(!vorgans || vorgans == "Cancel") return @@ -42,18 +36,18 @@ if(vorgans == "No") organs = 0 - var/flavor = tgui_alert(src, "Spawn mob with their character's flavor text?", "Flavor text", list("General", "Robot", "Cancel")) + var/flavor = tgui_alert(user, "Spawn mob with their character's flavor text?", "Flavor text", list("General", "Robot", "Cancel")) var/spawnloc - if(!src.mob) - to_chat(src, "Can't spawn them in unless you're in a valid spawn location!") + if(!user.mob) + to_chat(user, "Can't spawn them in unless you're in a valid spawn location!") return - spawnloc = get_turf(src.mob) + spawnloc = get_turf(user.mob) var/mob/living/new_mob = new chosen(spawnloc) if(!new_mob) - to_chat(src, "Spawning failed, try again or bully coders") + to_chat(user, "Spawning failed, try again or bully coders") return new_mob.ai_holder_type = /datum/ai_holder/simple_mob/inert //Dont want the mob AI to activate if the client dc's or anything @@ -73,12 +67,12 @@ if(LAZYLEN(new_mob.vore_organs)) new_mob.vore_selected = new_mob.vore_organs[1] if(isanimal(new_mob)) - var/mob/living/simple_mob/Sm = new_mob - if(!Sm.voremob_loaded || !Sm.vore_active) - Sm.init_vore(TRUE) + var/mob/living/simple_mob/new_simple_mob = new_mob + if(!new_simple_mob.voremob_loaded || !new_simple_mob.vore_active) + new_simple_mob.init_vore(TRUE) - log_admin("[key_name_admin(src)] has spawned [new_mob.key] as mob [new_mob.type].") - message_admins("[key_name_admin(src)] has spawned [new_mob.key] as mob [new_mob.type].", 1) + log_admin("[key_name_admin(user)] has spawned [new_mob.key] as mob [new_mob.type].") + message_admins("[key_name_admin(user)] has spawned [new_mob.key] as mob [new_mob.type].", 1) to_chat(new_mob, "You've been spawned as a mob! Have fun.") @@ -86,8 +80,8 @@ return new_mob -ADMIN_VERB(cmd_admin_z_narrate, (R_ADMIN|R_MOD|R_EVENT), "Z Narrate", "Narrates to your Z level.", "Fun.Narrate") // Allows administrators to fluff events a little easier -- TLE - var/msg = tgui_input_text(usr, "Message:", text("Enter the text you wish to appear to everyone:")) +ADMIN_VERB(cmd_admin_z_narrate, (R_ADMIN|R_MOD|R_EVENT), "Z Narrate", "Narrates to your Z level.", ADMIN_CATEGORY_FUN_NARRATE) // Allows administrators to fluff events a little easier -- TLE + var/msg = tgui_input_text(user, "Message:", text("Enter the text you wish to appear to everyone:")) if (!msg) return @@ -108,19 +102,15 @@ ADMIN_VERB(cmd_admin_z_narrate, (R_ADMIN|R_MOD|R_EVENT), "Z Narrate", "Narrates message_admins(span_blue(span_bold(" ZNarrate: [key_name_admin(user)] : [msg]
")), 1) feedback_add_details("admin_verb","GLNA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/toggle_vantag_hud(var/mob/target as mob) - set category = "Fun.Event Kit" - set name = "Give/Remove Event HUD" - set desc = "Give a mob the event hud, which shows them other people's event preferences, or remove it from them" - +ADMIN_VERB_AND_CONTEXT_MENU(toggle_vantag_hud, R_EVENT|R_ADMIN|R_SERVER, "Give/Remove Event HUD", "Give a mob the event hud, which shows them other people's event preferences, or remove it from them.", ADMIN_CATEGORY_FUN_EVENT_KIT, mob/target in GLOB.player_list) if(target.vantag_hud) target.vantag_hud = FALSE target.recalculate_vis() - to_chat(src, "You removed the event HUD from [key_name(target)].") + to_chat(user, "You removed the event HUD from [key_name(target)].") to_chat(target, "You no longer have the event HUD.") else target.vantag_hud = TRUE target.recalculate_vis() - to_chat(src, "You gave the event HUD to [key_name(target)].") + to_chat(user, "You gave the event HUD to [key_name(target)].") to_chat(target, "You now have the event HUD. Icons will appear next to characters indicating if they prefer to be killed(red crosshairs), devoured(belly), or kidnapped(blue crosshairs) by event characters.") feedback_add_details("admin_verb","GREHud") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index 7df9a409be..b5f8102501 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -57,16 +57,7 @@ ADMIN_VERB(secrets, R_HOLDER, "Secrets", "Abuse harder than you ever have before browser.set_content(dat) browser.open() if("dialog_log") - var/dat = span_bold("Dialog Log
") - dat += "
" - for(var/l in GLOB.round_text_log) - dat += "
  • [l]
  • " - dat += "
    " - if(!GLOB.round_text_log) - dat += "No-one has said anything this round! (How odd?)" - var/datum/browser/browser = new(holder, "dialog_logs", "[src]", 550, 650, src) - browser.set_content(jointext(dat,null)) - browser.open() + SSadmin_verbs.dynamic_invoke_verb(ui.user, /datum/admin_verb/persistent_client_logs) if("show_admins") var/dat if(GLOB.admin_datums) @@ -77,7 +68,7 @@ ADMIN_VERB(secrets, R_HOLDER, "Secrets", "Abuse harder than you ever have before browser.set_content(dat) browser.open() if("show_traitors_and_objectives") // Not implemented in the UI - holder.holder.check_antagonists() + holder.holder.check_antagonists(ui.user.client) if("show_game_mode") if (SSticker.mode) tgui_alert_async(holder, "The game mode is [SSticker.mode.name]") else tgui_alert_async(holder, "For some reason there's a ticker, but not a game mode") diff --git a/code/modules/env_message/env_message.dm b/code/modules/env_message/env_message.dm index 9d6ea17abd..38c4022a97 100644 --- a/code/modules/env_message/env_message.dm +++ b/code/modules/env_message/env_message.dm @@ -121,60 +121,44 @@ GLOBAL_LIST_EMPTY(env_messages) icon = 'icons/effects/env_message.dmi' icon_state = "env_message_red" -/client/proc/create_gm_message() - set name = "Map Message - Create" - set desc = "Create an ooc message in the environment for other players to see." - set category = "Fun.Event Kit" - - if(!check_rights(R_FUN)) +ADMIN_VERB(create_gm_message, R_FUN, "Map Message - Create", "Create an ooc message in the environment for other players to see.", ADMIN_CATEGORY_FUN_EVENT_KIT) + var/mob/user_mob = user.mob + if(isnewplayer(user_mob)) + to_chat(user, span_warning("You must spawn or observe to place messages.")) return - if(isnewplayer(mob)) - to_chat(src, span_warning("You must spawn or observe to place messages.")) + if(!get_turf(user_mob)) return - if(!get_turf(mob) || !src.ckey) - return - - var/new_message = tgui_input_text(src, "Type in your message. It will be displayed to players who hover over the spot where you are right now.", "Env Message", "", MAX_MESSAGE_LEN) + var/new_message = tgui_input_text(user, "Type in your message. It will be displayed to players who hover over the spot where you are right now.", "Env Message", "", MAX_MESSAGE_LEN) if(!new_message) return - var/ourturf = get_turf(mob) + var/ourturf = get_turf(user_mob) - var/obj/effect/env_message/EM = locate(/obj/effect/env_message) in ourturf + var/obj/effect/env_message/new_env_message = locate(/obj/effect/env_message) in ourturf - if(!EM) - EM = new /obj/effect/env_message/admin(ourturf) - EM.add_message(src.ckey, new_message) + if(!new_env_message) + new_env_message = new /obj/effect/env_message/admin(ourturf) + new_env_message.add_message(user.ckey, new_message) - log_game("[key_name(src)] created an Env Message: [new_message] at ([EM.x], [EM.y], [EM.z])") - -/client/proc/remove_gm_message() - set name = "Map Message - Remove" - set desc = "Remove any env/map message." - set category = "Fun.Event Kit" - - if(!istype(src) || !src.ckey) - return - - if(!check_rights(R_FUN)) - return + log_game("[key_name(user)] created an Env Message: [new_message] at ([new_env_message.x], [new_env_message.y], [new_env_message.z])") +ADMIN_VERB(remove_gm_message, R_FUN, "Map Message - Remove", "Remove any env/map message.", ADMIN_CATEGORY_FUN_EVENT_KIT) var/list/all_map_messages = list() - for(var/obj/effect/env_message/A in world) - all_map_messages |= A.combined_message + for(var/obj/effect/env_message/available_message in world) + all_map_messages |= available_message.combined_message - if(!all_map_messages.len) - to_chat(src, span_warning("There are no map or env messages.")) + if(!length(all_map_messages)) + to_chat(user, span_warning("There are no map or env messages.")) return - var/mob/chosen_message = tgui_input_list(src, "Which message do you want to remove?", "Make contact", all_map_messages) + var/mob/chosen_message = tgui_input_list(user, "Which message do you want to remove?", "Make contact", all_map_messages) if(!chosen_message) return - for(var/obj/effect/env_message/EM in world) - if(EM.combined_message == chosen_message) - qdel(EM) - log_game("[key_name(src)] deleted an Env Message that contained other players' entries at ([EM.x], [EM.y], [EM.z])") + for(var/obj/effect/env_message/env_message in world) + if(env_message.combined_message == chosen_message) + log_game("[key_name(user)] deleted an Env Message that contained other players' entries at ([env_message.x], [env_message.y], [env_message.z])") + qdel(env_message) diff --git a/code/modules/eventkit/collector_event/admin_commands.dm b/code/modules/eventkit/collector_event/admin_commands.dm index 408a5e5a26..f2a6c3c623 100644 --- a/code/modules/eventkit/collector_event/admin_commands.dm +++ b/code/modules/eventkit/collector_event/admin_commands.dm @@ -2,14 +2,7 @@ Event Collector Admin Commands */ -/client/proc/modify_event_collector(var/obj/structure/event_collector/target in GLOB.event_collectors) - set category = "Fun.Event Kit" - set desc="Configure Event Collector" - set name="Configure Collector" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB_AND_CONTEXT_MENU(modify_event_collector, R_ADMIN, "Configure Collector", "Configure Event Collector.", ADMIN_CATEGORY_FUN_EVENT_KIT, obj/structure/event_collector/target in GLOB.event_collectors) var/msg = "---------------\n" if(target?.active_recipe?.len > 0) msg += " [target] has [target.active_recipe.len] left in its current recipe\n" @@ -27,7 +20,7 @@ Event Collector Admin Commands if(blockers > 0) msg += "[target] has [blockers] things blocking/slowing it down! Anything more than 10 means it's stopped!" - to_chat(usr,msg) + to_chat(user, msg) var/list/options = list( @@ -37,7 +30,7 @@ Event Collector Admin Commands "Force Clear Blockers" ) - var/option = tgui_input_list(usr, "What Would You Like To Do?", "Event Collector",options,"Cancel") + var/option = tgui_input_list(user, "What Would You Like To Do?", "Event Collector",options,"Cancel") switch(option) if("Cancel") return @@ -56,16 +49,9 @@ Event Collector Admin Commands if("Empty Stored Items") target.empty_items() -/client/proc/induce_malfunction(var/obj/structure/event_collector_blocker/target in GLOB.event_collector_blockers) - set category = "Fun.Event Kit" - set desc="Configure Collector Blocker" - set name="Toggle Malfunction State" - - if(!check_rights(R_ADMIN)) - return - +ADMIN_VERB_AND_CONTEXT_MENU(induce_malfunction, R_ADMIN, "Toggle Malfunction State", "Configure Collector Blocker.", ADMIN_CATEGORY_FUN_EVENT_KIT, obj/structure/event_collector_blocker/target in GLOB.event_collector_blockers) if(target.block_amount) target.fix() + return - else - target.induce_failure() + target.induce_failure() diff --git a/code/modules/eventkit/generic_objects/generic_item.dm b/code/modules/eventkit/generic_objects/generic_item.dm index b4a48f0a4f..e52ca70c50 100644 --- a/code/modules/eventkit/generic_objects/generic_item.dm +++ b/code/modules/eventkit/generic_objects/generic_item.dm @@ -91,11 +91,7 @@ user.visible_message(span_notice("[text_deactivated]")) update_icon() -/client/proc/generic_item() - set category = "Fun.Event Kit" - set name = "Spawn Generic Item" - set desc = "Spawn a customisable item with a range of different options." - +ADMIN_VERB(generic_item, R_SPAWN, "Spawn Generic Item", "Spawn a customisable item with a range of different options.", ADMIN_CATEGORY_FUN_EVENT_KIT) var/s_activatable = 0 var/s_togglable = 0 var/s_icon_state_on = 0 @@ -142,6 +138,7 @@ "fleshorb", "fleshorb_moving", "Upload Own Sprite") + var/list/sound_options = list('sound/effects/alert.ogg', 'sound/effects/bamf.ogg', 'sound/effects/bang.ogg', @@ -174,36 +171,32 @@ var/check_togglable - - if(!check_rights_for(src, R_HOLDER)) - return - - var/s_name = tgui_input_text(src, "Item Name:", "Name") - var/s_desc = tgui_input_text(src, "Item Description:", "Description") - var/s_icon_state_off = tgui_input_list(src, "Choose starting icon state:", "icon_state_off", icon_state_options) + var/s_name = tgui_input_text(user, "Item Name:", "Name") + var/s_desc = tgui_input_text(user, "Item Description:", "Description") + var/s_icon_state_off = tgui_input_list(user, "Choose starting icon state:", "icon_state_off", icon_state_options) if(s_icon_state_off == "Upload Own Sprite") - s_icon = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file - var/check_activatable = tgui_alert(src, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel")) + s_icon = input(user, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file + var/check_activatable = tgui_alert(user, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel")) if(!check_activatable || check_activatable == "Cancel") return if(check_activatable == "No") s_activatable = 0 if(check_activatable == "Yes") s_activatable = 1 - s_text_activated = tgui_input_text(src, "Activation text:", "Activation Text") - check_togglable = tgui_alert(src, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel")) + s_text_activated = tgui_input_text(user, "Activation text:", "Activation Text") + check_togglable = tgui_alert(user, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel")) if(!check_togglable || check_togglable == "Cancel") return if(check_togglable == "No") s_togglable = 0 if(check_togglable == "Yes") - s_text_deactivated = tgui_input_text(src, "Deactivation text:", "Deactivation Text") + s_text_deactivated = tgui_input_text(user, "Deactivation text:", "Deactivation Text") s_togglable = 1 - s_icon_state_on = tgui_input_list(src, "Choose activated icon state:", "icon_state_on", icon_state_options) + s_icon_state_on = tgui_input_list(user, "Choose activated icon state:", "icon_state_on", icon_state_options) if(s_icon_state_on == "Upload Own Sprite") - s_icon2 = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file - s_delay = tgui_input_number(src, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay") - var/check_effect = tgui_alert(src, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Cancel")) + s_icon2 = input(user, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file + s_delay = tgui_input_number(user, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay") + var/check_effect = tgui_alert(user, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Cancel")) if(!check_effect || check_effect == "Cancel") return if(check_effect == "No") @@ -216,14 +209,14 @@ s_effect = 3 if(check_effect == "Spawn Item") s_effect = 4 - s_object = get_path_from_partial_text() - var/check_sound = tgui_alert(src, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel")) + s_object = user.get_path_from_partial_text() + var/check_sound = tgui_alert(user, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel")) if(!check_sound || check_sound == "Cancel") return if(check_sound == "Yes") - s_sound = tgui_input_list(src, "Choose a sound to play on activation:", "Sound", sound_options) + s_sound = tgui_input_list(user, "Choose a sound to play on activation:", "Sound", sound_options) - var/spawnloc = get_turf(src.mob) + var/spawnloc = get_turf(user.mob) var/obj/item/generic_item/P = new(spawnloc) P.name = s_name P.desc = s_desc diff --git a/code/modules/eventkit/generic_objects/generic_structure.dm b/code/modules/eventkit/generic_objects/generic_structure.dm index 8ead25a99f..84cdf9a058 100644 --- a/code/modules/eventkit/generic_objects/generic_structure.dm +++ b/code/modules/eventkit/generic_objects/generic_structure.dm @@ -106,11 +106,7 @@ to_chat(user, span_notice("You [anchored? "un" : ""]secured \the [src]!")) anchored = !anchored -/client/proc/generic_structure() - set category = "Fun.Event Kit" - set name = "Spawn Generic Structure" - set desc = "Spawn a customisable structure with a range of different options." - +ADMIN_VERB(generic_structure, R_SPAWN, "Spawn Generic Structure", "Spawn a customisable structure with a range of different options.", ADMIN_CATEGORY_FUN_EVENT_KIT) var/s_wrenchable = 0 var/s_anchored = 0 var/s_density = 0 @@ -193,6 +189,7 @@ "ob_warhead_4", "angel", "Upload Own Sprite") + var/list/sound_options = list('sound/effects/alert.ogg', 'sound/effects/bamf.ogg', 'sound/effects/bang.ogg', @@ -225,57 +222,53 @@ var/check_togglable - - if(!check_rights_for(src, R_HOLDER)) - return - - var/s_name = tgui_input_text(src, "Structure Name:", "Name") - var/s_desc = tgui_input_text(src, "Structure Description:", "Description") - var/check_anchored = tgui_alert(src, "Start anchored?", "anchored", list("Yes", "No", "Cancel")) + var/s_name = tgui_input_text(user, "Structure Name:", "Name") + var/s_desc = tgui_input_text(user, "Structure Description:", "Description") + var/check_anchored = tgui_alert(user, "Start anchored?", "anchored", list("Yes", "No", "Cancel")) if(!check_anchored || check_anchored == "Cancel") return if(check_anchored == "No") s_anchored = 0 if(check_anchored == "Yes") s_anchored = 1 - var/check_density = tgui_alert(src, "Start dense?", "density", list("Yes", "No", "Cancel")) + var/check_density = tgui_alert(user, "Start dense?", "density", list("Yes", "No", "Cancel")) if(!check_density || check_density == "Cancel") return if(check_density == "No") s_density = 0 if(check_density == "Yes") s_density = 1 - var/check_wrenchable = tgui_alert(src, "Allow it to be fastened and unfastened with a wrench?", "wrenchable", list("Yes", "No", "Cancel")) + var/check_wrenchable = tgui_alert(user, "Allow it to be fastened and unfastened with a wrench?", "wrenchable", list("Yes", "No", "Cancel")) if(!check_wrenchable || check_wrenchable == "Cancel") return if(check_wrenchable == "No") s_wrenchable = 0 if(check_wrenchable == "Yes") s_wrenchable = 1 - var/s_icon_state_off = tgui_input_list(src, "Choose starting icon state:", "icon_state_off", icon_state_options) + var/s_icon_state_off = tgui_input_list(user, "Choose starting icon state:", "icon_state_off", icon_state_options) if(s_icon_state_off == "Upload Own Sprite") - s_icon = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file - var/check_activatable = tgui_alert(src, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel")) + s_icon = input(user, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file + var/check_activatable = tgui_alert(user, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel")) if(!check_activatable || check_activatable == "Cancel") return if(check_activatable == "No") s_activatable = 0 if(check_activatable == "Yes") s_activatable = 1 - s_text_activated = tgui_input_text(src, "Activation text:", "Activation Text") - check_togglable = tgui_alert(src, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel")) + s_text_activated = tgui_input_text(user, "Activation text:", "Activation Text") + check_togglable = tgui_alert(user, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel")) if(!check_togglable || check_togglable == "Cancel") return if(check_togglable == "No") s_togglable = 0 if(check_togglable == "Yes") - s_text_deactivated = tgui_input_text(src, "Deactivation text:", "Deactivation Text") + s_text_deactivated = tgui_input_text(user, "Deactivation text:", "Deactivation Text") s_togglable = 1 - s_icon_state_on = tgui_input_list(src, "Choose activated icon state:", "icon_state_on", icon_state_options) + s_icon_state_on = tgui_input_list(user, "Choose activated icon state:", "icon_state_on", icon_state_options) if(s_icon_state_on == "Upload Own Sprite") - s_icon2 = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file - s_delay = tgui_input_number(src, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay") - var/check_effect = tgui_alert(src, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Fear", "Cancel")) + s_icon2 = input(user, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file + s_delay = tgui_input_number(user, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay") + var/check_effect = tgui_alert(user, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Fear", "Cancel")) if(!check_effect || check_effect == "Cancel") return if(check_effect == "No") @@ -288,16 +281,16 @@ s_effect = 3 if(check_effect == "Spawn Item") s_effect = 4 - s_object = get_path_from_partial_text() + s_object = user.get_path_from_partial_text() if(check_effect == "Fear") s_effect = 5 - var/check_sound = tgui_alert(src, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel")) + var/check_sound = tgui_alert(user, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel")) if(!check_sound || check_sound == "Cancel") return if(check_sound == "Yes") - s_sound = tgui_input_list(src, "Choose a sound to play on activation:", "Sound", sound_options) + s_sound = tgui_input_list(user, "Choose a sound to play on activation:", "Sound", sound_options) - var/spawnloc = get_turf(src.mob) + var/spawnloc = get_turf(user.mob) var/obj/structure/generic_structure/P = new(spawnloc) P.name = s_name P.desc = s_desc @@ -322,7 +315,7 @@ P.update_icon() /client/proc/get_path_from_partial_text(default_path) - var/desired_path = tgui_input_text(usr, "Enter full or partial typepath.","Typepath","[default_path]") + var/desired_path = tgui_input_text(src, "Enter full or partial typepath.","Typepath","[default_path]") if(!desired_path) //VOREStation Add - If you don't give it anything it builds a list of every possible thing in the game and crashes your client. return //VOREStation Add - And the main way for it to do that is to push the cancel button, which should just do nothing. :U @@ -335,7 +328,7 @@ matches += path if(matches.len==0) - tgui_alert_async(usr, "No results found. Sorry.") + tgui_alert_async(src, "No results found. Sorry.") return var/result = null @@ -343,5 +336,5 @@ if(matches.len==1) result = matches[1] else - result = tgui_input_list(usr, "Select an atom type", "Spawn Atom", matches, strict_modern = TRUE) + result = tgui_input_list(src, "Select an atom type", "Spawn Atom", matches, strict_modern = TRUE) return result diff --git a/code/modules/eventkit/gm_interfaces/mob_spawner.dm b/code/modules/eventkit/gm_interfaces/mob_spawner.dm index 571952a2c9..60c559a1f5 100644 --- a/code/modules/eventkit/gm_interfaces/mob_spawner.dm +++ b/code/modules/eventkit/gm_interfaces/mob_spawner.dm @@ -190,15 +190,9 @@ /datum/eventkit/mob_spawner/tgui_close(mob/user) . = ..() - qdel(src) - -/client/proc/eventkit_open_mob_spawner() - set category = "Fun.Event Kit" - set name = "Open Mob Spawner" - set desc = "Opens an advanced version of the mob spawner." - - if(!check_rights(R_SPAWN)) - return + if(!QDELETED(src)) + qdel(src) +ADMIN_VERB(eventkit_open_mob_spawner, R_SPAWN, "Open Mob Spawner", "Opens an advanced version of the mob spawner.", ADMIN_CATEGORY_FUN_EVENT_KIT) var/datum/eventkit/mob_spawner/spawner = new() - spawner.tgui_interact(usr) + spawner.tgui_interact(user.mob) diff --git a/code/modules/events/event_manager.dm b/code/modules/events/event_manager.dm index 66835e0c62..bca76d03e2 100644 --- a/code/modules/events/event_manager.dm +++ b/code/modules/events/event_manager.dm @@ -222,19 +222,12 @@ Interact(usr) -/client/proc/forceEvent(var/type in SSevents.allEvents) - set name = "Trigger Event (Debug Only)" - set category = "Debug.Dangerous" - - if(!check_rights_for(src, R_HOLDER)) +ADMIN_VERB(forceEvent, R_DEBUG, "Trigger Event (Debug Only)", "Immediately triggers an event.", ADMIN_CATEGORY_DEBUG_DANGEROUS, type in SSevents.allEvents) + if(!ispath(type)) return + new type(new /datum/event_meta(EVENT_LEVEL_MAJOR)) + message_admins("[key_name_admin(user)] has triggered an event. ([type])") - if(ispath(type)) - new type(new /datum/event_meta(EVENT_LEVEL_MAJOR)) - message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1) - -/client/proc/event_manager_panel() - set name = "Event Manager Panel" - set category = "Admin.Events" - SSevents.Interact(usr) +ADMIN_VERB(event_manager_panel, R_ADMIN|R_EVENT, "Event Manager Panel", "Opens the event manager panel.", ADMIN_CATEGORY_EVENTS) + SSevents.Interact(user) feedback_add_details("admin_verb","EMP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/food/recipe_dump.dm b/code/modules/food/recipe_dump.dm index 467eff587d..327feae571 100644 --- a/code/modules/food/recipe_dump.dm +++ b/code/modules/food/recipe_dump.dm @@ -1,11 +1,4 @@ -/client/proc/recipe_dump() - set name = "Generate Recipe Dump" - set category = "Server.Admin" - set desc = "Dumps food and drink recipe info and images for wiki or other use." - - if(!check_rights_for(src, R_HOLDER)) - return - +ADMIN_VERB(recipe_dump, R_SERVER, "Generate Recipe Dump", "Dumps food and drink recipe info and images for wiki or other use.", ADMIN_CATEGORY_SERVER_ADMIN) //////////////////////// DRINK var/list/drink_recipes = list() for(var/datum/decl/chemical_reaction/instant/drinks/CR in SSchemistry.chemical_reactions) @@ -175,7 +168,7 @@ if(icon_to_give) var/image_path = "recipe-[ckey(food_recipes[Rp]["Result"])].png" html += "" - src << browse(icon_to_give, "window=picture;file=[image_path];display=0") + user << browse(icon_to_give, "window=picture;file=[image_path];display=0") else html += "No
    Image" @@ -244,7 +237,7 @@ html += "" html += "" - src << browse(html, "window=recipes;file=recipes_food.html;display=0") + user << browse(html, "window=recipes;file=recipes_food.html;display=0") //Drink Output html = "\ @@ -293,6 +286,6 @@ html += "" html += "" - src << browse(html, "window=recipes;file=recipes_drinks.html;display=0") + user << browse(html, "window=recipes;file=recipes_drinks.html;display=0") - to_chat(src, span_notice("In your byond cache, recipe-xxx.png files and recipes_drinks.html and recipes_food.html now exist. Place recipe-xxx.png files in a subfolder named 'imgrecipes' wherever you put them. The file will take a food.css or drinks.css file if in the same path.")) + to_chat(user, span_notice("In your byond cache, recipe-xxx.png files and recipes_drinks.html and recipes_food.html now exist. Place recipe-xxx.png files in a subfolder named 'imgrecipes' wherever you put them. The file will take a food.css or drinks.css file if in the same path.")) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 821c5a2efe..b249db9e19 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -2005,7 +2005,7 @@ to_chat(src, "Mob doesn't exist anymore") return - usr.client.cmd_admin_alienize(H) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/cmd_admin_alienize, H) if(href_list[VK_HK_TURN_SKELETON]) if(!check_rights(R_FUN)) @@ -2052,7 +2052,7 @@ to_chat(src, "Mob doesn't exist anymore") return - usr.client.cmd_admin_robotize(H) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/cmd_admin_robotize, H) /* if(href_list[VV_HK_PURRBATION]) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 2dd9e11bef..eb470b63ab 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1496,12 +1496,12 @@ GLOBAL_LIST_EMPTY_TYPED(living_players_by_zlevel, /list) regenerate_icons() if(href_list[VV_HK_PLAYER_PANEL]) - return SSadmin_verbs.dynamic_invoke_verb(usr, /datum/admin_verb/show_player_panel, src) + return SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/show_player_panel, src) if(href_list[VV_HK_GODMODE]) if(!check_rights(R_ADMIN)) return - usr.client.cmd_admin_godmode(src) + SSadmin_verbs.dynamic_invoke_verb(usr.client, /datum/admin_verb/cmd_admin_godmode, src) if(href_list[VV_HK_ADDLANGUAGE]) if(!check_rights(R_SPAWN)) diff --git a/code/modules/reagents/Chemistry-Logging.dm b/code/modules/reagents/Chemistry-Logging.dm index 121d518d27..74ccdebb66 100644 --- a/code/modules/reagents/Chemistry-Logging.dm +++ b/code/modules/reagents/Chemistry-Logging.dm @@ -14,17 +14,11 @@ GLOBAL_LIST_EMPTY(chemical_reaction_logs) message_admins(logstr) log_admin(logstr) -/client/proc/view_chemical_reaction_logs() - set name = "Show Chemical Reactions" - set category = "Admin.Investigate" - - if(!check_rights(R_ADMIN|R_MOD)) - return - +ADMIN_VERB(view_chemical_reaction_logs, R_ADMIN|R_MOD, "Show Chemical Reactions", "Access the chemical reactions log.", ADMIN_CATEGORY_INVESTIGATE) var/html = "" for(var/entry in GLOB.chemical_reaction_logs) html += "[entry]
    " - var/datum/browser/popup = new(usr, "chemlogs", "Chemlogs") + var/datum/browser/popup = new(user, "chemlogs", "Chemlogs") popup.set_content(html) popup.open() diff --git a/code/modules/reagents/machinery/dispenser/cartridge_spawn.dm b/code/modules/reagents/machinery/dispenser/cartridge_spawn.dm index a33c401f03..5941e212df 100644 --- a/code/modules/reagents/machinery/dispenser/cartridge_spawn.dm +++ b/code/modules/reagents/machinery/dispenser/cartridge_spawn.dm @@ -1,13 +1,17 @@ -/client/proc/spawn_chemdisp_cartridge(size in list("small", "medium", "large"), reagent in SSchemistry.chemical_reagents) - set name = "Spawn Chemical Dispenser Cartridge" - set category = "Admin.Events" - - var/obj/item/reagent_containers/chem_disp_cartridge/C +ADMIN_VERB(spawn_chemdisp_cartridge, R_SPAWN, "Spawn Chemical Dispenser Cartridge", "Spawns a chemical dispenser catridge.", ADMIN_CATEGORY_FUN_EVENT_KIT) + var/size = tgui_input_list(user, "Select the catridge size", "Select Size", list("small", "medium", "large"), "small") + if(!size) + return + var/reagent = tgui_input_list(user, "Select the reagent to put into the catridge", "Select Reagent", SSchemistry.chemical_reagents) + if(!reagent) + return + var/obj/item/reagent_containers/chem_disp_cartridge/new_catridge + var/mob/user_mob = user.mob switch(size) - if("small") C = new /obj/item/reagent_containers/chem_disp_cartridge/small(usr.loc) - if("medium") C = new /obj/item/reagent_containers/chem_disp_cartridge/medium(usr.loc) - if("large") C = new /obj/item/reagent_containers/chem_disp_cartridge(usr.loc) - C.reagents.add_reagent(reagent, C.volume) - var/datum/reagent/R = SSchemistry.chemical_reagents[reagent] - C.setLabel(R.name) - log_admin("[key_name(usr)] spawned a [size] reagent container containing [reagent] at ([usr.x],[usr.y],[usr.z])") + if("small") new_catridge = new /obj/item/reagent_containers/chem_disp_cartridge/small(user_mob.loc) + if("medium") new_catridge = new /obj/item/reagent_containers/chem_disp_cartridge/medium(user_mob.loc) + if("large") new_catridge = new /obj/item/reagent_containers/chem_disp_cartridge(user_mob.loc) + new_catridge.reagents.add_reagent(reagent, new_catridge.volume) + var/datum/reagent/used_reagent = SSchemistry.chemical_reagents[reagent] + new_catridge.setLabel(used_reagent.name) + log_admin("[key_name(user)] spawned a [size] reagent container containing [reagent] at ([user_mob.x],[user_mob.y],[user_mob.z])") diff --git a/code/modules/tension/tension.dm b/code/modules/tension/tension.dm index 5857de9b84..0fa6d0b1b5 100644 --- a/code/modules/tension/tension.dm +++ b/code/modules/tension/tension.dm @@ -154,14 +154,12 @@ var/datum/unarmed_attack/attack = H.get_unarmed_attack(threatened, BP_TORSO) if(!attack) damage_guess += 5 - - var/punch_damage = attack.get_unarmed_damage(H) + else + damage_guess += attack.get_unarmed_damage(H) if(H.gloves) if(istype(H.gloves, /obj/item/clothing/gloves)) var/obj/item/clothing/gloves/G = H.gloves - punch_damage += G.punch_force - - damage_guess += punch_damage + damage_guess += G.punch_force else damage_guess += 5 diff --git a/code/modules/tgs_commands/vorestation.dm b/code/modules/tgs_commands/vorestation.dm index 6c50a46e1f..48e1e27fac 100644 --- a/code/modules/tgs_commands/vorestation.dm +++ b/code/modules/tgs_commands/vorestation.dm @@ -416,7 +416,7 @@ GLOBAL_LIST_EMPTY(pending_discord_registrations) var/datum/language/current_lang = value if(current_lang.flags & WHITELISTED) whitelisted_language += language - message.text = "The following jobs and species have a whitelist:\nJobs: [english_list(whitelist_jobs)]\nSpecies: [english_list(GLOB.whitelisted_species)]\nLanguages: [english_list(whitelisted_language)]\nRobot Modules: [english_list(GLOB.whitelisted_module_types)]" + message.text = "The following jobs, species, languages and robot modules have a whitelist:\nJobs: [english_list(whitelist_jobs)]\nSpecies: [english_list(GLOB.whitelisted_species)]\nLanguages: [english_list(whitelisted_language)]\nRobot Modules: [english_list(GLOB.whitelisted_module_types)]" return message message_as_list.Cut(1, 2) diff --git a/code/modules/tgui/modules/admin/player_notes.dm b/code/modules/tgui/modules/admin/player_notes.dm index 8a15f16fb5..4260d29eb1 100644 --- a/code/modules/tgui/modules/admin/player_notes.dm +++ b/code/modules/tgui/modules/admin/player_notes.dm @@ -52,18 +52,18 @@ current_filter = filter -/datum/tgui_module/player_notes/proc/open_legacy() - var/datum/admins/A = GLOB.admin_datums[usr.ckey] +/datum/tgui_module/player_notes/proc/open_legacy(mob/user) + var/datum/admins/A = GLOB.admin_datums[user.ckey] A.PlayerNotesLegacy() /datum/tgui_module/player_notes/tgui_state(mob/user) - return ADMIN_STATE(R_ADMIN|R_EVENT|R_DEBUG) + return ADMIN_STATE(R_ADMIN|R_MOD|R_EVENT|R_DEBUG) -/datum/tgui_module/player_notes/tgui_fallback(payload) +/datum/tgui_module/player_notes/tgui_fallback(payload, mob/user) if(..()) return TRUE - open_legacy() + open_legacy(user) /datum/tgui_module/player_notes/tgui_act(action, params, datum/tgui/ui) if(..()) @@ -87,7 +87,7 @@ current_filter = "" if("open_legacy_ui") - open_legacy() + open_legacy(ui.user) /datum/tgui_module/player_notes/tgui_data(mob/user) var/list/data = list() @@ -117,14 +117,14 @@ qdel(src) /datum/tgui_module/player_notes_info/tgui_state(mob/user) - return ADMIN_STATE(R_ADMIN|R_EVENT|R_DEBUG) + return ADMIN_STATE(R_ADMIN|R_MOD|R_EVENT|R_DEBUG) -/datum/tgui_module/player_notes_info/tgui_fallback(payload) +/datum/tgui_module/player_notes_info/tgui_fallback(payload, mob/user) if(..()) return TRUE - var/datum/admins/A = GLOB.admin_datums[usr.ckey] - A.show_player_info_legacy(key) + var/datum/admins/A = GLOB.admin_datums[user.ckey] + A.show_player_info_legacy(user, key) /datum/tgui_module/player_notes_info/tgui_act(action, params, datum/tgui/ui) if(..()) @@ -195,20 +195,10 @@ // ==== LEGACY UI ==== /datum/admins/proc/PlayerNotesLegacy() - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins)) - to_chat(usr, "Error: you are not an admin!") - return PlayerNotesPageLegacy(1) /datum/admins/proc/PlayerNotesFilterLegacy() - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins)) - to_chat(usr, "Error: you are not an admin!") - return - var/filter = tgui_input_text(usr, "Filter string (case-insensitive regex)", "Player notes filter") + var/filter = tgui_input_text(owner, "Filter string (case-insensitive regex)", "Player notes filter") PlayerNotesPageLegacy(1, filter) /datum/admins/proc/PlayerNotesPageLegacy(page, filter) @@ -266,12 +256,7 @@ if(!infos || !infos.len) return 0 else return 1 -/datum/admins/proc/show_player_info_legacy(var/key as text) - if (!istype(src,/datum/admins)) - src = usr.client.holder - if (!istype(src,/datum/admins)) - to_chat(usr, "Error: you are not an admin!") - return +/datum/admins/proc/show_player_info_legacy(mob/user, key) var/dat = "" var/p_age = "unknown" @@ -298,7 +283,7 @@ I.rank = "N/A" update_file = 1 dat += span_green("[I.content]") + " " + span_italics("by [I.author] ([I.rank])") + " on " + span_italics(span_blue("[I.timestamp]")) + " " - if(I.author == usr.key || I.author == "Adminbot" || ishost(usr)) + if(I.author == user.key || I.author == "Adminbot" || ishost(user)) dat += "Remove" dat += "

    " if(update_file) info << infos @@ -320,14 +305,14 @@ if(!add) return notes_add(key,add,usr) - show_player_info_legacy(key) + show_player_info_legacy(usr, key) if(href_list["remove_player_info_legacy"]) var/key = href_list["remove_player_info_legacy"] var/index = text2num(href_list["remove_index"]) notes_del(key, index) - show_player_info_legacy(key) + show_player_info_legacy(usr, key) if(href_list["notes_legacy"]) var/ckey = href_list["ckey"] @@ -338,7 +323,7 @@ switch(href_list["notes_legacy"]) if("show") - show_player_info_legacy(ckey) + show_player_info_legacy(usr, ckey) if("list") var/filter if(href_list["filter"] && href_list["filter"] != "0") diff --git a/code/modules/tickets/procs.dm b/code/modules/tickets/procs.dm index c15b5f6230..94fc493f75 100644 --- a/code/modules/tickets/procs.dm +++ b/code/modules/tickets/procs.dm @@ -41,7 +41,7 @@ new /datum/ticket(msg, src, FALSE, 0) //admin proc -ADMIN_VERB(cmd_mentor_ticket_panel, (R_ADMIN|R_SERVER|R_MOD|R_MENTOR), "Mentor Ticket List", "Opens the list of mentor tickets", "Admin.Misc") +ADMIN_VERB(cmd_mentor_ticket_panel, (R_ADMIN|R_SERVER|R_MOD|R_MENTOR), "Mentor Ticket List", "Opens the list of mentor tickets", ADMIN_CATEGORY_MISC) var/browse_to switch(tgui_input_list(user, "Display which ticket list?", "List Choice", list("Active Tickets", "Resolved Tickets"))) diff --git a/config/example/moderators.txt b/config/example/moderators.txt deleted file mode 100644 index 781dffb4a2..0000000000 --- a/config/example/moderators.txt +++ /dev/null @@ -1,4 +0,0 @@ -; just add the ckey (lowercase) of every moderator on a separate line -; lines starting with ; are comments and will be ignored - -; not_a_user