mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-05-17 12:20:09 +01:00
39a0bcd60e
* change encode * guhh * . * . * . * Update code/game/antagonist/antagonist_objectives.dm Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> * Update code/modules/clothing/spacesuits/rig/modules/specific/voice.dm Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> * Update code/modules/news/new_newspaper.dm Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> * Update code/modules/admin/DB ban/functions.dm Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> * Update code/modules/tgui/modules/communications.dm Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> * Update code/modules/mob/living/carbon/human/human.dm Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> * Update code/modules/mob/living/carbon/human/human.dm Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> --------- Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com>
57 lines
1.5 KiB
Plaintext
57 lines
1.5 KiB
Plaintext
/client/verb/vote()
|
|
set category = "OOC.Game"
|
|
set name = "Vote"
|
|
|
|
if(SSvote.active_vote)
|
|
SSvote.active_vote.tgui_interact(usr)
|
|
else
|
|
to_chat(src, span_warning("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(!is_admin(usr))
|
|
return
|
|
|
|
if(SSvote.active_vote)
|
|
to_chat(src, span_warning("A vote is already in progress"))
|
|
return
|
|
|
|
var/vote_types = subtypesof(/datum/vote)
|
|
vote_types |= "\[CUSTOM]"
|
|
|
|
var/list/votemap = list()
|
|
for(var/vtype in vote_types)
|
|
votemap["[vtype]"] = vtype
|
|
|
|
var/choice = tgui_input_list(src, "Select a vote type", "Vote", vote_types)
|
|
|
|
if(choice == null)
|
|
return
|
|
|
|
if(choice != "\[CUSTOM]")
|
|
var/datum/votetype = votemap["[choice]"]
|
|
SSvote.start_vote(new votetype(usr.ckey))
|
|
return
|
|
|
|
var/question = tgui_input_text(src, "What is the vote for?", "Create Vote", "", MAX_MESSAGE_LEN)
|
|
if(isnull(question))
|
|
return
|
|
|
|
var/list/choices = list()
|
|
for(var/i in 1 to 10)
|
|
var/option = tgui_input_text(src, "Please enter an option or hit cancel to finish", "Create Vote", "", MAX_MESSAGE_LEN)
|
|
if(isnull(option) || !usr.client)
|
|
break
|
|
choices |= option
|
|
|
|
var/c2 = tgui_alert(src, "Show counts while vote is happening?", "Counts", list("Yes", "No"))
|
|
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)
|
|
V.show_counts = (c2 == "Yes")
|
|
V.vote_result_type = c3
|
|
SSvote.start_vote(V)
|