mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] fix admin vote verb (#10437)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e11b9aba4f
commit
1fc7ba386b
@@ -5,18 +5,18 @@
|
|||||||
if(SSvote.active_vote)
|
if(SSvote.active_vote)
|
||||||
SSvote.active_vote.tgui_interact(usr)
|
SSvote.active_vote.tgui_interact(usr)
|
||||||
else
|
else
|
||||||
to_chat(usr, span_warning("There is no active vote"))
|
to_chat(src, span_warning("There is no active vote"))
|
||||||
|
|
||||||
/client/proc/start_vote()
|
/client/proc/start_vote()
|
||||||
set category = "Admin.Game" // CHOMPEdit
|
set category = "Admin.Game" // CHOMPEdit
|
||||||
set name = "Start Vote"
|
set name = "Start Vote"
|
||||||
set desc = "Start a vote on the server"
|
set desc = "Start a vote on the server"
|
||||||
|
|
||||||
if(!is_admin())
|
if(!is_admin(usr))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(SSvote.active_vote)
|
if(SSvote.active_vote)
|
||||||
to_chat(usr, span_warning("A vote is already in progress"))
|
to_chat(src, span_warning("A vote is already in progress"))
|
||||||
return
|
return
|
||||||
|
|
||||||
var/vote_types = subtypesof(/datum/vote)
|
var/vote_types = subtypesof(/datum/vote)
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
for(var/vtype in vote_types)
|
for(var/vtype in vote_types)
|
||||||
votemap["[vtype]"] = vtype
|
votemap["[vtype]"] = vtype
|
||||||
|
|
||||||
var/choice = tgui_input_list(usr, "Select a vote type", "Vote", vote_types)
|
var/choice = tgui_input_list(src, "Select a vote type", "Vote", vote_types)
|
||||||
|
|
||||||
if(choice == null)
|
if(choice == null)
|
||||||
return
|
return
|
||||||
@@ -36,19 +36,19 @@
|
|||||||
SSvote.start_vote(new votetype(usr.ckey))
|
SSvote.start_vote(new votetype(usr.ckey))
|
||||||
return
|
return
|
||||||
|
|
||||||
var/question = tgui_input_text(usr, "What is the vote for?", "Create Vote", encode = FALSE)
|
var/question = tgui_input_text(src, "What is the vote for?", "Create Vote", encode = FALSE)
|
||||||
if(isnull(question))
|
if(isnull(question))
|
||||||
return
|
return
|
||||||
|
|
||||||
var/list/choices = list()
|
var/list/choices = list()
|
||||||
for(var/i in 1 to 10)
|
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)
|
var/option = tgui_input_text(src, "Please enter an option or hit cancel to finish", "Create Vote", encode = FALSE)
|
||||||
if(isnull(option) || !usr.client)
|
if(isnull(option) || !usr.client)
|
||||||
break
|
break
|
||||||
choices |= option
|
choices |= option
|
||||||
|
|
||||||
var/c2 = tgui_alert(usr, "Show counts while vote is happening?", "Counts", list("Yes", "No"))
|
var/c2 = tgui_alert(src, "Show counts while vote is happening?", "Counts", list("Yes", "No"))
|
||||||
var/c3 = tgui_input_list(usr, "Select a result calculation type", "Vote", list(VOTE_RESULT_TYPE_MAJORITY))
|
var/c3 = tgui_input_list(src, "Select a result calculation type", "Vote", list(VOTE_RESULT_TYPE_MAJORITY))
|
||||||
|
|
||||||
var/datum/vote/V = new /datum/vote(usr.ckey, question, choices, TRUE)
|
var/datum/vote/V = new /datum/vote(usr.ckey, question, choices, TRUE)
|
||||||
V.show_counts = (c2 == "Yes")
|
V.show_counts = (c2 == "Yes")
|
||||||
|
|||||||
Reference in New Issue
Block a user