From 7f0a3698700e76db72c502f1d70e7020fa47dc16 Mon Sep 17 00:00:00 2001 From: Putnam Date: Fri, 7 Feb 2020 04:29:53 -0800 Subject: [PATCH] Also added options for custom votes --- code/__DEFINES/vote.dm | 9 +++++++++ code/controllers/subsystem/vote.dm | 2 ++ 2 files changed, 11 insertions(+) diff --git a/code/__DEFINES/vote.dm b/code/__DEFINES/vote.dm index b83ea7b8f6..12e802383e 100644 --- a/code/__DEFINES/vote.dm +++ b/code/__DEFINES/vote.dm @@ -6,3 +6,12 @@ #define INSTANT_RUNOFF_VOTING 5 GLOBAL_LIST_INIT(vote_score_options,list("Bad","Poor","Acceptable","Good","Great")) + +GLOBAL_LIST_INIT(vote_type_names,list(\ +"Plurality (default)" = PLURALITY_VOTING,\ +"Approval" = APPROVAL_VOTING,\ +"IRV (single winner ranked choice)" = INSTANT_RUNOFF_VOTING,\ +"Schulze (ranked choice, higher result=better)" = SCHULZE_VOTING,\ +"Raw Score (returns results from 0 to 1, winner is 1)" = SCORE_VOTING,\ +"Majority Judgement (single-winner score voting)" = MAJORITY_JUDGEMENT_VOTING,\ +)) diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 0b80f6253a..730f688723 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -487,6 +487,8 @@ SUBSYSTEM_DEF(vote) question = stripped_input(usr,"What is the vote for?") if(!question) return 0 + var/system_string = input(usr,"Which voting type?",GLOB.vote_type_names[1]) in GLOB.vote_type_names + vote_system = GLOB.vote_type_names[system_string] for(var/i=1,i<=10,i++) var/option = capitalize(stripped_input(usr,"Please enter an option or hit cancel to finish")) if(!option || mode || !usr.client)