verb macro system (pr 1/3) (#96720)

## About The Pull Request

just macro-izes all the usages of verbs in the codebase as a
pre-requisite to my follow up pr that serializes all the verbs arguments
so we can tgui-ify the command bar, so we can then put it on the
onscreen map.

this also basically does the same as #94487 so can easily be integrated
into the verb queueing stuff... but does not actually do any verb
queueing by itself. basically im just trying to be
https://github.com/tgstation/tgstation/labels/Atomic
## Why It's Good For The Game
it doesn't really do anything by itself but it does let us do more stuff

## Changelog
🆑
code: the backend to all verbs in the game has been played with, please
report any issues to github
/🆑

---------

Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
This commit is contained in:
harry
2026-07-04 02:45:07 -04:00
committed by GitHub
co-authored by harryob
parent e5afe71e87
commit ff006aa4a5
79 changed files with 369 additions and 565 deletions
+8 -13
View File
@@ -301,10 +301,10 @@ GLOBAL_LIST_INIT(unrecommended_builds, list(
prefs.last_id = computer_id //these are gonna be used for banning
if(fexists(roundend_report_file()))
add_verb(src, /client/proc/show_previous_roundend_report)
ASSIGN_GAME_VERB(src, /client, show_previous_roundend_report)
if(fexists("data/server_last_roundend_report.html"))
add_verb(src, /client/proc/show_servers_last_roundend_report)
ASSIGN_GAME_VERB(src, /client, show_servers_last_roundend_report)
var/full_version = "[byond_version].[byond_build ? byond_build : "xxx"]"
log_access("Login: [key_name(src)] from [address ? address : "localhost"]-[computer_id] || BYOND v[full_version]")
@@ -376,7 +376,7 @@ GLOBAL_LIST_INIT(unrecommended_builds, list(
admin_datum.associate(src)
connecting_admin = TRUE
else if(GLOB.deadmins[ckey])
add_verb(src, /client/proc/readmin)
ASSIGN_GAME_VERB(src, /client, readmin)
connecting_admin = TRUE
if(CONFIG_GET(flag/autoadmin))
if(!GLOB.admin_datums[ckey])
@@ -946,11 +946,11 @@ GLOBAL_LIST_INIT(unrecommended_builds, list(
if (interviewee)
return
if(CONFIG_GET(flag/see_own_notes))
add_verb(src, /client/proc/self_notes)
ASSIGN_GAME_VERB(src, /client, self_notes)
if(CONFIG_GET(flag/use_exp_tracking))
add_verb(src, /client/proc/self_playtime)
ASSIGN_GAME_VERB(src, /client, self_playtime)
if(!CONFIG_GET(flag/forbid_preferences_export))
add_verb(src, /client/proc/export_preferences)
ASSIGN_GAME_VERB(src, /client, export_preferences)
//checks if a client is afk
@@ -1198,17 +1198,12 @@ GLOBAL_LIST_INIT(unrecommended_builds, list(
var/mob/dead/observer/observer = mob
observer.ManualFollow(target)
/client/verb/stop_client_sounds()
set name = "Stop Sounds"
set category = "OOC"
set desc = "Stop Current Sounds"
GAME_VERB_DESC(/client, stop_client_sounds, "Stop Sounds", "Stop Current Sounds", "OOC")
SEND_SOUND(usr, sound(null))
tgui_panel?.stop_music()
SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Stop Self Sounds"))
/client/verb/toggle_fullscreen()
set name = "Toggle Fullscreen"
set category = "OOC"
GAME_VERB(/client, toggle_fullscreen, "Toggle Fullscreen", "OOC")
var/is_on = prefs.read_preference(/datum/preference/toggle/fullscreen_mode)
prefs.write_preference(GLOB.preference_entries[/datum/preference/toggle/fullscreen_mode], !is_on)
+2 -8
View File
@@ -1,7 +1,4 @@
/client/verb/open_character_preferences()
set category = "OOC"
set name = "Open Character Preferences"
set desc = "Open Character Preferences"
GAME_VERB_DESC(/client, open_character_preferences, "Open Character Preferences", "Open Character Preferences", "OOC")
if(!prefs)
return
@@ -9,10 +6,7 @@
prefs.update_static_data(usr)
prefs.ui_interact(usr)
/client/verb/open_game_preferences()
set category = "OOC"
set name = "Open Game Preferences"
set desc = "Open Game Preferences"
GAME_VERB_DESC(/client, open_game_preferences, "Open Game Preferences", "Open Game Preferences", "OOC")
if(!prefs)
return
+15 -80
View File
@@ -2,9 +2,7 @@ GLOBAL_VAR_INIT(OOC_COLOR, null)//If this is null, use the CSS for OOC. Otherwis
GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
///talking in OOC uses this
/client/verb/ooc(msg as text)
set name = VERB_OOC
GAME_VERB(/client, ooc, VERB_OOC, null, msg as text)
if(GLOB.say_disabled) //This is here to try to identify lag problems
to_chat(usr, span_danger("Speech is currently admin-disabled."))
return
@@ -148,13 +146,6 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8")
else
GLOB.dooc_allowed = !GLOB.dooc_allowed
/client/proc/set_ooc()
set name = "Set Player OOC Color"
set desc = "Modifies player OOC Color"
set category = "Server"
if(IsAdminAdvancedProcCall())
return
ADMIN_VERB(set_ooc_color, R_FUN, "Set Player OOC Color", "Modifies the global OOC color.", ADMIN_CATEGORY_SERVER)
var/newColor = tgui_color_picker(user, "Please select the new player OOC color.", "OOC color")
if(isnull(newColor))
@@ -164,13 +155,6 @@ ADMIN_VERB(set_ooc_color, R_FUN, "Set Player OOC Color", "Modifies the global OO
log_admin("[key_name_admin(user)] has set the player ooc color to [new_color].")
GLOB.OOC_COLOR = new_color
/client/proc/reset_ooc()
set name = "Reset Player OOC Color"
set desc = "Returns player OOC Color to default"
set category = "Server"
if(IsAdminAdvancedProcCall())
return
ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC color to default.", ADMIN_CATEGORY_SERVER)
if(tgui_alert(user, "Are you sure you want to reset the OOC color of all players?", "Reset Player OOC Color", list("Yes", "No")) != "Yes")
return
@@ -179,31 +163,20 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
GLOB.OOC_COLOR = null
//Checks admin notice
/client/verb/admin_notice()
set name = "Adminnotice"
set category = "Admin"
set desc = "Check the admin notice if it has been set"
GAME_VERB_DESC(/client, admin_notice, "Adminnotice", "Check the admin notice if it has been set", "Admin")
if(GLOB.admin_notice)
to_chat(src, "[span_boldnotice("Admin Notice:")]\n \t [GLOB.admin_notice]")
else
to_chat(src, span_notice("There are no admin notices at the moment."))
/client/verb/motd()
set name = "MOTD"
set category = "OOC"
set desc ="Check the Message of the Day"
GAME_VERB_DESC(/client, motd, "MOTD", "Check the Message of the Day", "OOC")
var/motd = global.config.motd
if(motd)
to_chat(src, "<span class='infoplain'><div class=\"motd\">[motd]</div></span>", handle_whitespace=FALSE)
else
to_chat(src, span_notice("The Message of the Day has not been set."))
/client/proc/self_notes()
set name = "View Admin Remarks"
set category = "OOC"
set desc = "View the notes that admins have written about you"
GAME_VERB_PROC_DESC(/client, self_notes, "View Admin Remarks", "View the notes that admins have written about you", "OOC")
if(!CONFIG_GET(flag/see_own_notes))
to_chat(usr, span_notice("Sorry, that function is not enabled on this server."))
@@ -211,10 +184,7 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
browse_messages(null, usr.ckey, null, TRUE)
/client/proc/self_playtime()
set name = "View tracked playtime"
set category = "OOC"
set desc = "View the amount of playtime for roles the server has tracked."
GAME_VERB_PROC_DESC(/client, self_playtime, "View tracked playtime", "View the amount of playtime for roles the server has tracked.", "OOC")
if(!CONFIG_GET(flag/use_exp_tracking))
to_chat(usr, span_notice("Sorry, tracking is currently disabled."))
@@ -223,11 +193,7 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
new /datum/job_report_menu(src, usr)
// Ignore verb
/client/verb/select_ignore()
set name = "Ignore"
set category = "OOC"
set desc ="Ignore a player's messages on the OOC channel"
GAME_VERB_DESC(/client, select_ignore, "Ignore", "Ignore a player's messages on the OOC channel", "OOC")
// Make a list to choose players from
var/list/players = list()
@@ -305,11 +271,7 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
to_chat(src, span_infoplain("You are now ignoring [selection] on the OOC channel."))
// Unignore verb
/client/verb/select_unignore()
set name = "Unignore"
set category = "OOC"
set desc = "Stop ignoring a player's messages on the OOC channel"
GAME_VERB_DESC(/client, select_unignore, "Unignore", "Stop ignoring a player's messages on the OOC channel", "OOC")
// Check if we've ignored any players
if(!length(prefs.ignoring))
// Express that we haven't ignored any players in chat
@@ -342,25 +304,15 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
// Express that we've unignored the selected player in chat
to_chat(src, span_infoplain("You are no longer ignoring [selection] on the OOC channel."))
/client/proc/show_previous_roundend_report()
set name = "Your Last Round"
set category = "OOC"
set desc = "View the last round end report you've seen"
GAME_VERB_PROC_DESC(/client, show_previous_roundend_report, "Your Last Round", "View the last round end report you've seen", "OOC")
SSticker.show_roundend_report(src, report_type = PERSONAL_LAST_ROUND)
/client/proc/show_servers_last_roundend_report()
set name = "Server's Last Round"
set category = "OOC"
set desc = "View the last round end report from this server"
GAME_VERB_PROC_DESC(/client, show_servers_last_roundend_report, "Server's Last Round", "View the last round end report from this server", "OOC")
SSticker.show_roundend_report(src, report_type = SERVER_LAST_ROUND)
/client/verb/fit_viewport()
set name = "Fit Viewport"
set category = "OOC"
set desc = "Fit the width of the map window to match the viewport"
GAME_VERB_DESC(/client, fit_viewport, "Fit Viewport", "Fit the width of the map window to match the viewport", "OOC")
// Fetch aspect ratio
var/view_size = getviewsize(view)
var/aspect_ratio = view_size[1] / view_size[2]
@@ -439,11 +391,7 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
if(fully_created)
INVOKE_ASYNC(src, VERB_REF(fit_viewport))
/client/verb/policy()
set name = "Show Policy"
set desc = "Show special server rules related to your current character."
set category = "OOC"
GAME_VERB_DESC(/client, policy, "Show Policy", "Show special server rules related to your current character.", "OOC")
//Collect keywords
var/list/keywords = mob.get_policy_keywords()
var/header = get_policy(POLICY_VERB_HEADER)
@@ -462,33 +410,20 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
browser.set_content(policytext.Join(""))
browser.open()
/client/verb/fix_stat_panel()
set name = "Fix Stat Panel"
set hidden = TRUE
GAME_VERB_HIDDEN(/client, fix_stat_panel, "Fix Stat Panel")
init_verbs()
/client/proc/export_preferences()
set name = "Export Preferences"
set desc = "Export your current preferences to a file."
set category = "OOC"
GAME_VERB_PROC_DESC(/client, export_preferences, "Export Preferences", "Export your current preferences to a file.", "OOC")
ASSERT(prefs, "User attempted to export preferences while preferences were null!") // what the fuck
prefs.savefile.export_json_to_client(usr, ckey)
/client/verb/map_vote_tally_count()
set name = "Show Map Vote Tallies"
set desc = "View the current map vote tally counts."
set category = "OOC"
GAME_VERB_DESC(/client, map_vote_tally_count, "Show Map Vote Tallies", "View the current map vote tally counts.", "OOC")
to_chat(mob, SSmap_vote.tally_printout)
/client/verb/linkforumaccount()
set category = "OOC"
set name = "Link Forum Account"
set desc = "Validates your byond account to your forum account. Required to post on the forums."
GAME_VERB_DESC(/client, linkforumaccount, "Link Forum Account", "Validates your byond account to your forum account. Required to post on the forums.", "OOC")
var/uri = CONFIG_GET(string/forum_link_uri)
if(!uri)
to_chat(src, span_warning("This feature is disabled."))
+1 -3
View File
@@ -1,6 +1,4 @@
/client/verb/toggle_stat_panel()
set name = "Toggle Stat Panel"
set hidden = TRUE
GAME_VERB_HIDDEN(/client, toggle_stat_panel, "Toggle Stat Panel")
//Flip it
prefs.write_preference(GLOB.preference_entries[/datum/preference/toggle/statpanel], !prefs.read_preference(/datum/preference/toggle/statpanel))
+1 -2
View File
@@ -1,8 +1,7 @@
/// Verb to simply kill yourself (in a very visual way to all players) in game! How family-friendly. Can be governed by a series of multiple checks (i.e. confirmation, is it allowed in this area, etc.) which are
/// handled and called by the proc this verb invokes. It's okay to block this, because we typically always give mobs in-game the ability to Ghost out of their current mob irregardless of context. This, in contrast,
/// can have as many different checks as you desire to prevent people from doing the deed to themselves.
/mob/living/verb/suicide()
set hidden = TRUE
GAME_VERB_HIDDEN(/mob/living, suicide, "suicide")
handle_suicide()
/// Actually handles the bare basics of the suicide process. Message type is the message we want to dispatch in the world regarding the suicide, using the defines in this file.
+2 -6
View File
@@ -1,9 +1,7 @@
#define DEFAULT_WHO_CELLS_PER_ROW 4
#define NO_ADMINS_ONLINE_MESSAGE "Adminhelps are also sent through TGS to services like IRC and Discord. If no admins are available in game, sending an adminhelp might still be noticed and responded to."
/client/verb/who()
set name = "Who"
set category = "OOC"
GAME_VERB(/client, who, "Who", "OOC")
var/msg = ""
@@ -69,9 +67,7 @@
msg += "<b>Total Players: [length(Lines)]</b>"
to_chat(src, fieldset_block(span_bold("Current Players"), span_infoplain(msg), "boxed_message"), type = MESSAGE_TYPE_INFO)
/client/verb/adminwho()
set category = "Admin"
set name = "Adminwho"
GAME_VERB(/client, adminwho, "Adminwho", "Admin")
var/list/lines = list()
var/payload_string = generate_adminwho_string()