Redoes the admin verb define to require passing in an Admin Visible Name, and restores the usage of '-' for the verb bar when you want to call verbs from the command bar. Also cleans up and organizes the backend for drawing verbs to make it easier in the future for me to make it look better (#73214)

## About The Pull Request

Damn that's a long title.

Admin Verbs can be used in the verb bar with hyphens instead of spaces
again.
## Why It's Good For The Game

Admin muscle memory
## Changelog
This commit is contained in:
Zephyr
2023-02-04 01:20:18 -08:00
committed by GitHub
parent b1e2b18e7f
commit fca90f5c78
56 changed files with 317 additions and 288 deletions
+36 -36
View File
@@ -7,7 +7,7 @@
/client/proc/remove_admin_verbs()
SSadmin_verbs.deassosciate_admin(src)
ADMIN_VERB(admin, hide_all_verbs, "Hide all of your Admin Verbs", NONE)
ADMIN_VERB(admin, hide_all_verbs, "Hide All Verbs", "Hide all of your Admin Verbs", NONE)
usr.client.remove_admin_verbs()
add_verb(usr.client, /client/proc/show_verbs)
to_chat(usr, span_admin("Almost all of your adminverbs have been hidden."))
@@ -22,7 +22,7 @@ ADMIN_VERB(admin, hide_all_verbs, "Hide all of your Admin Verbs", NONE)
to_chat(src, span_interface("All of your adminverbs are now visible."), confidential = TRUE)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Adminverbs") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
ADMIN_VERB(game, aghost, "Observe without leaving the game", R_ADMIN)
ADMIN_VERB(game, aghost, "AGhost", "Observe without leaving the game", R_ADMIN)
if(isnewplayer(usr))
to_chat(usr, span_red("Error: AGhost: Cannot admin-ghost wile in the lobby. Join or Observe first."))
return
@@ -45,7 +45,7 @@ ADMIN_VERB(game, aghost, "Observe without leaving the game", R_ADMIN)
if(usr && !usr.key)
usr.key = "@[key]" // If the key starts with '@' it designates an admin ghost
ADMIN_VERB(game, invisimin, "Toggles ghost-like invisibility", R_ADMIN)
ADMIN_VERB(game, invisimin, "Invisimin", "Toggles ghost-like invisibility", R_ADMIN)
if(initial(usr.invisibility) == INVISIBILITY_OBSERVER)
to_chat(usr, span_boldannounce("Invisimin toggle failed. You are already an invisible mob like a ghost."), confidential = TRUE)
return
@@ -56,40 +56,40 @@ ADMIN_VERB(game, invisimin, "Toggles ghost-like invisibility", R_ADMIN)
usr.invisibility = INVISIBILITY_OBSERVER
to_chat(usr, span_adminnotice("<b>Invisimin on. You are now as invisible as a ghost.</b>"), confidential = TRUE)
ADMIN_VERB(game, check_antagonists, "", R_ADMIN)
ADMIN_VERB(game, check_antagonists, "Check Antagonists", "", R_ADMIN)
usr.client.holder.check_antagonists()
log_admin("[key_name(usr)] checked antagonists.") //for tsar~ get a room you two
if(!isobserver(usr) && SSticker.HasRoundStarted())
message_admins("[key_name_admin(usr)] checked antagonists.")
ADMIN_VERB(game, list_bombers, "", R_ADMIN)
ADMIN_VERB(game, list_bombers, "List Bombers", "", R_ADMIN)
usr.client.holder.list_bombers()
ADMIN_VERB(game, list_signalers, "", R_ADMIN)
ADMIN_VERB(game, list_signalers, "List Signalers", "", R_ADMIN)
usr.client.holder.list_signalers()
ADMIN_VERB(game, list_law_changes, "", R_ADMIN)
ADMIN_VERB(game, list_law_changes, "List Law Changes", "", R_ADMIN)
usr.client.holder.list_law_changes()
ADMIN_VERB(game, show_manifest, "", R_ADMIN)
ADMIN_VERB(game, show_manifest, "Show Manifest", "", R_ADMIN)
usr.client.holder.show_manifest()
ADMIN_VERB(game, list_dna, "", R_ADMIN)
ADMIN_VERB(game, list_dna, "List DNA", "", R_ADMIN)
usr.client.holder.list_dna()
ADMIN_VERB(game, list_fingerprints, "", R_ADMIN)
ADMIN_VERB(game, list_fingerprints, "List Fingerprints", "", R_ADMIN)
usr.client.holder.list_fingerprints()
ADMIN_VERB(admin, banning_panel, "", R_BAN)
ADMIN_VERB(admin, banning_panel, "Banning Panel", "", R_BAN)
usr.client.holder.ban_panel()
ADMIN_VERB(admin, unbanning_panel, "", R_BAN)
ADMIN_VERB(admin, unbanning_panel, "Unbanning Panel", "", R_BAN)
usr.client.holder.unban_panel()
ADMIN_VERB(game, game_panel, "", NONE)
ADMIN_VERB(game, game_panel, "Game Panel", "", NONE)
usr.client.holder.Game()
ADMIN_VERB(admin, server_poll_management, "", R_POLL)
ADMIN_VERB(admin, server_poll_management, "Server Poll Management", "", R_POLL)
usr.client.holder.poll_list_panel()
/// Returns this client's stealthed ckey
@@ -125,7 +125,7 @@ ADMIN_VERB(admin, server_poll_management, "", R_POLL)
/client/proc/createStealthKey()
GLOB.stealthminID["[ckey]"] = generateStealthCkey()
ADMIN_VERB(admin, stealth_mode, "Makes you unable to be seen through most means", R_STEALTH)
ADMIN_VERB(admin, stealth_mode, "Stealth Mode", "Makes you unable to be seen through most means", R_STEALTH)
if(usr.client.holder.fakekey)
usr.client.disable_stealth_mode()
else
@@ -172,7 +172,7 @@ ADMIN_VERB(admin, stealth_mode, "Makes you unable to be seen through most means"
#undef STEALTH_MODE_TRAIT
ADMIN_VERB(fun, drop_bomb, "Cause an explosion of varying strength at your location", R_FUN)
ADMIN_VERB(fun, drop_bomb, "Drop Bomb", "Cause an explosion of varying strength at your location", R_FUN)
var/list/choices = list("Small Bomb (1, 2, 3, 3)", "Medium Bomb (2, 3, 4, 4)", "Big Bomb (3, 5, 7, 5)", "Maxcap", "Custom Bomb")
var/choice = tgui_input_list(usr, "What size explosion would you like to produce? NOTE: You can do all this rapidly and in an IC manner (using cruise missiles!) with the Config/Launch Supplypod verb. WARNING: These ignore the maxcap", "Drop Bomb", choices)
if(isnull(choice))
@@ -209,7 +209,7 @@ ADMIN_VERB(fun, drop_bomb, "Cause an explosion of varying strength at your locat
message_admins("[ADMIN_LOOKUPFLW(usr)] creating an admin explosion at [epicenter.loc].")
log_admin("[key_name(usr)] created an admin explosion at [epicenter.loc].")
ADMIN_VERB(fun, drop_dynex_bomb, "Cause an explosion of varting strength at your location", R_FUN)
ADMIN_VERB(fun, drop_dynex_bomb, "Drop Dynex Bomb", "Cause an explosion of varting strength at your location", R_FUN)
var/ex_power = input(usr, "Explosive Power:") as null|num
var/turf/epicenter = get_turf(usr)
if(ex_power && epicenter)
@@ -217,21 +217,21 @@ ADMIN_VERB(fun, drop_dynex_bomb, "Cause an explosion of varting strength at your
message_admins("[ADMIN_LOOKUPFLW(usr)] creating an admin explosion at [epicenter.loc].")
log_admin("[key_name(usr)] created an admin explosion at [epicenter.loc].")
ADMIN_VERB(debug, get_dynex_range, "Get the estimated range of a bomb, using explosive power", R_FUN)
ADMIN_VERB(debug, get_dynex_range, "Get Dynex Range", "Get the estimated range of a bomb, using explosive power", R_FUN)
var/ex_power = input(usr, "Explosive Power:") as null|num
if (isnull(ex_power))
return
var/range = round((2 * ex_power)**GLOB.DYN_EX_SCALE)
to_chat(usr, "Estimated Explosive Range: (Devastation: [round(range*0.25)], Heavy: [round(range*0.5)], Light: [round(range)])")
ADMIN_VERB(debug, get_dynex_power, "Get the estimated power of a bomb, to reach the specific range", R_FUN)
ADMIN_VERB(debug, get_dynex_power, "Get Dynex Power", "Get the estimated power of a bomb, to reach the specific range", R_FUN)
var/ex_range = input(usr, "Light Explosion Range:") as null|num
if (isnull(ex_range))
return
var/power = (0.5 * ex_range)**(1/GLOB.DYN_EX_SCALE)
to_chat(usr, "Estimated Explosive Power: [power]")
ADMIN_VERB(debug, set_dynex_scale, "Set the scale multiplier on dynex explosions. Default of 0.5", R_FUN)
ADMIN_VERB(debug, set_dynex_scale, "Set Dynex Scale", "Set the scale multiplier on dynex explosions. Default of 0.5", R_FUN)
var/ex_scale = input("New DynEx Scale:") as null|num
if(isnull(ex_scale))
return
@@ -239,17 +239,17 @@ ADMIN_VERB(debug, set_dynex_scale, "Set the scale multiplier on dynex explosions
log_admin("[key_name(usr)] has modified Dynamic Explosion Scale: [ex_scale]")
message_admins("[key_name_admin(usr)] has modified Dynamic Explosion Scale: [ex_scale]")
ADMIN_VERB(debug, atmos_control_panel, "", R_DEBUG)
ADMIN_VERB(debug, atmos_control_panel, "Atmos Control Panel", "", R_DEBUG)
SSair.ui_interact(usr)
ADMIN_VERB(trading_card_game, reload_cards, "", R_DEBUG)
ADMIN_VERB(trading_card_game, reload_cards, "Reload Cards", "", R_DEBUG)
if(!SStrading_card_game.loaded)
to_chat(usr, span_admin("The card subsystem is not currently loaded!"))
return
message_admins("[key_name_admin(usr)] manually reloaded SStrading_card_game.")
SStrading_card_game.reloadAllCardFiles()
ADMIN_VERB(trading_card_game, validate_cards, "", R_DEBUG)
ADMIN_VERB(trading_card_game, validate_cards, "Validate Cards", "", R_DEBUG)
if(!SStrading_card_game.loaded)
to_chat(usr, span_admin("The card subsystem is not currently loaded!"))
return
@@ -261,7 +261,7 @@ ADMIN_VERB(trading_card_game, validate_cards, "", R_DEBUG)
else
to_chat(usr, span_admin("No errors found in card rarities or overrides."))
ADMIN_VERB(trading_card_game, test_cardpack_distribution, "", R_DEBUG)
ADMIN_VERB(trading_card_game, test_cardpack_distribution, "Test Cardpack Distribution", "", R_DEBUG)
if(!SStrading_card_game.loaded)
to_chat(usr, span_admin("The card subsystem is not currently loaded!"))
return
@@ -275,14 +275,14 @@ ADMIN_VERB(trading_card_game, test_cardpack_distribution, "", R_DEBUG)
var/guar = tgui_input_number(usr, "Should we use the pack's guaranteed rarity? If so, how many?", "We've all been there. Man you should have seen the old system")
SStrading_card_game.check_card_distribution(pack, batch_size, batch_count, guar)
ADMIN_VERB(trading_card_game, print_cards, "", R_DEBUG)
ADMIN_VERB(trading_card_game, print_cards, "Print Cards", "", R_DEBUG)
if(!SStrading_card_game.loaded)
to_chat(usr, span_admin("The card subsystem is not currently loaded!"))
return
SStrading_card_game.printAllCards()
ADMIN_VERB(fun, give_mob_spell, "", R_FUN, mob/spell_recipient in GLOB.mob_list)
ADMIN_VERB(fun, give_mob_spell, "Give Mob Spell", "", R_FUN, mob/spell_recipient in GLOB.mob_list)
var/which = tgui_alert(usr, "Chose by name or by type path?", "Chose option", list("Name", "Typepath"))
if(!which)
return
@@ -325,7 +325,7 @@ ADMIN_VERB(fun, give_mob_spell, "", R_FUN, mob/spell_recipient in GLOB.mob_list)
to_chat(usr, span_userdanger("Spells given to mindless mobs will belong to the mob and not their mind, \
and as such will not be transferred if their mind changes body (Such as from Mindswap)."))
ADMIN_VERB(fun, remove_spell, "", R_FUN, mob/removal_target in GLOB.mob_list)
ADMIN_VERB(fun, remove_spell, "Remove Spell", "", R_FUN, mob/removal_target in GLOB.mob_list)
var/list/target_spell_list = list()
for(var/datum/action/cooldown/spell/spell in removal_target.actions)
target_spell_list[spell.name] = spell
@@ -344,7 +344,7 @@ ADMIN_VERB(fun, remove_spell, "", R_FUN, mob/removal_target in GLOB.mob_list)
log_admin("[key_name(usr)] removed the spell [chosen_spell] from [key_name(removal_target)].")
message_admins("[key_name_admin(usr)] removed the spell [chosen_spell] from [key_name_admin(removal_target)].")
ADMIN_VERB(fun, give_disease, "Give Disease", R_FUN, mob/living/victim in GLOB.mob_living_list)
ADMIN_VERB(fun, give_disease, "Give Disease", "", R_FUN, mob/living/victim in GLOB.mob_living_list)
var/datum/disease/disease_type = input(usr, "Choose the disease to give to that guy", "ACHOO") as null|anything in sort_list(SSdisease.diseases, GLOBAL_PROC_REF(cmp_typepaths_asc))
if(!disease_type)
return
@@ -361,10 +361,10 @@ ADMIN_CONTEXT_ENTRY(context_object_say, "Object Say", R_FUN, obj/target in world
log_admin("[key_name(usr)] made [target] at [AREACOORD(target)] say \"[message]\"")
message_admins(span_adminnotice("[key_name_admin(usr)] made [target] at [AREACOORD(target)]. say \"[message]\""))
ADMIN_VERB(build_mode, toggle_build_mode_self, "", R_BUILD)
ADMIN_VERB(build_mode, toggle_build_mode_self, "Toggle Build Mode Self", "", R_BUILD)
togglebuildmode(usr)
ADMIN_VERB(game, check_ai_laws, "", R_ADMIN)
ADMIN_VERB(game, check_ai_laws, "Check AI Laws", "", R_ADMIN)
var/law_bound_entities = 0
for(var/mob/living/silicon/subject as anything in GLOB.silicon_mobs)
law_bound_entities++
@@ -418,14 +418,14 @@ ADMIN_VERB(game, check_ai_laws, "", R_ADMIN)
log_admin("[src] re-adminned themselves.")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Readmin")
ADMIN_VERB(debug, populate_world, "Populate the world with the given number of test mobs", R_DEBUG, amount = 50 as num)
ADMIN_VERB(debug, populate_world, "Populate World", "Populate the world with the given number of test mobs", R_DEBUG, amount = 50 as num)
for (var/i in 1 to amount)
var/turf/tile = get_safe_random_station_turf()
var/mob/living/carbon/human/hooman = new(tile)
hooman.equipOutfit(pick(subtypesof(/datum/outfit)))
testing("Spawned test mob at [get_area_name(tile, TRUE)] ([tile.x],[tile.y],[tile.z])")
ADMIN_VERB(game, toggle_admin_ai_interaction, "Allows you to interact with most machines as an AI would as a ghost", R_ADMIN)
ADMIN_VERB(game, toggle_admin_ai_interaction, "Toggle Admin AI Interaction", "Allows you to interact with most machines as an AI would as a ghost", R_ADMIN)
usr.client.AI_Interact = !usr.client.AI_Interact
if(usr && isAdminGhostAI(usr))
usr.has_unlimited_silicon_privilege = usr.client.AI_Interact
@@ -440,7 +440,7 @@ ADMIN_VERB(game, toggle_admin_ai_interaction, "Allows you to interact with most
var/datum/admins/admin = GLOB.admin_datums[ckey]
admin?.associate(src)
ADMIN_VERB(debug, send_maps_profile, "", R_DEBUG)
ADMIN_VERB(debug, send_maps_profile, "Send Maps Profile", "", R_DEBUG)
usr.client << link("?debug=profile&type=sendmaps&window=test")
/**
@@ -452,7 +452,7 @@ ADMIN_VERB(debug, send_maps_profile, "", R_DEBUG)
* They're all clientles mobs with minds / jobs.
*/
ADMIN_VERB(debug, spawn_debug_full_crew, "Creates a full crew for the station, filling the datacore and assigning them all minds/jobs. Don't do this on live", R_DEBUG)
ADMIN_VERB(debug, spawn_debug_full_crew, "Spawn Full Debug Crew", "Creates a full crew for the station, filling the datacore and assigning them all minds/jobs. Don't do this on live", R_DEBUG)
if(SSticker.current_state != GAME_STATE_PLAYING)
to_chat(usr, "You should only be using this after a round has setup and started.")
return
@@ -515,7 +515,7 @@ ADMIN_VERB(debug, spawn_debug_full_crew, "Creates a full crew for the station, f
/// Debug verb for seeing at a glance what all spells have as set requirements
ADMIN_VERB(debug, show_spell_requirements, "seeing at a glance what all spells have as set requirements", R_DEBUG)
ADMIN_VERB(debug, show_spell_requirements, "Show Spell Requirements", "seeing at a glance what all spells have as set requirements", R_DEBUG)
var/header = "<tr><th>Name</th> <th>Requirements</th>"
var/all_requirements = list()
for(var/datum/action/cooldown/spell/spell as anything in typesof(/datum/action/cooldown/spell))
@@ -549,7 +549,7 @@ ADMIN_VERB(debug, show_spell_requirements, "seeing at a glance what all spells h
popup.set_content(page_contents)
popup.open()
ADMIN_VERB(events, load_jump_lazy_template, "", R_ADMIN)
ADMIN_VERB(events, load_jump_lazy_template, "Load or Jump Lazy Template", "", R_ADMIN)
var/list/choices = LAZY_TEMPLATE_KEY_LIST_ALL()
var/choice = tgui_input_list(usr, "Key?", "Lazy Loader", choices)
if(!choice)