port ADMIN_VERB and friends (#30646)

* port ADMIN_VERB and friends

* some renaming

* dumb

* one more rename

* never search and replace this codebase

* fix TM issues, more renaming

* add a static analysis to shore up user verbs

* fix double message on roundstart

* remove macro we're not using yet

* convert remaining playsounds verbs

* convert more verbs i missed somehow

* why is this a completely different signature than everything else

* fix ui_interact arg

* fix logging view and others

* buncha issues caught in TM

* fix mentor tickets ui

* fix bug report viewing

* moron
This commit is contained in:
warriorstar-orion
2025-12-12 19:18:22 +00:00
committed by GitHub
parent f89b05ee88
commit 2a842644d5
92 changed files with 1751 additions and 3113 deletions
+10 -18
View File
@@ -7,16 +7,9 @@
else
to_chat(usr, "There is no active vote")
/client/proc/start_vote()
set category = "Admin"
set name = "Start Vote"
set desc = "Start a vote on the server"
if(!check_rights(R_ADMIN))
return
USER_VERB(start_vote, R_ADMIN, "Start Vote", "Start a vote on the server", VERB_CATEGORY_ADMIN)
if(SSvote.active_vote)
to_chat(usr, "A vote is already in progress")
to_chat(client, "A vote is already in progress")
return
// Ask admins which type of vote they want to start
@@ -28,7 +21,7 @@
for(var/vtype in vote_types)
votemap["[vtype]"] = vtype
var/choice = tgui_input_list(usr, "Select a vote type", "Vote", vote_types)
var/choice = tgui_input_list(client, "Select a vote type", "Vote", vote_types)
if(choice == null)
return
@@ -36,26 +29,25 @@
if(choice != "\[CUSTOM]")
// Not custom, figure it out
var/datum/vote/votetype = votemap["[choice]"]
SSvote.start_vote(new votetype(usr.ckey))
SSvote.start_vote(new votetype(client.ckey))
return
// Its custom, lets ask
var/question = tgui_input_text(usr, "What is the vote for?", "Create Vote", encode = FALSE)
var/question = tgui_input_text(client, "What is the vote for?", "Create Vote", encode = FALSE)
if(isnull(question))
return
var/list/choices = list()
for(var/i in 1 to 10)
var/option = tgui_input_text(usr, "Please enter an option or hit cancel to finish", "Create Vote", encode = FALSE)
if(isnull(option) || !usr.client)
var/option = tgui_input_text(client, "Please enter an option or hit cancel to finish", "Create Vote", encode = FALSE)
if(isnull(option) || !client)
break
choices |= option
var/c2 = tgui_alert(usr, "Show counts while vote is happening?", "Counts", list("Yes", "No"))
var/c3 = input(usr, "Select a result calculation type", "Vote", VOTE_RESULT_TYPE_MAJORITY) as anything in list(VOTE_RESULT_TYPE_MAJORITY)
var/c2 = tgui_alert(client, "Show counts while vote is happening?", "Counts", list("Yes", "No"))
var/c3 = input(client, "Select a result calculation type", "Vote", VOTE_RESULT_TYPE_MAJORITY) as anything in list(VOTE_RESULT_TYPE_MAJORITY)
var/datum/vote/V = new /datum/vote(usr.ckey, question, choices, TRUE)
var/datum/vote/V = new /datum/vote(client.ckey, question, choices, TRUE)
V.show_counts = (c2 == "Yes")
V.vote_result_type = c3
SSvote.start_vote(V)