Stringified the vote #defines for easier config stuff

This commit is contained in:
Putnam
2020-10-18 14:49:43 -07:00
parent 44dc292101
commit 558d11bc73
4 changed files with 11 additions and 22 deletions
+7 -7
View File
@@ -1,9 +1,9 @@
#define PLURALITY_VOTING 0
#define APPROVAL_VOTING 1
#define SCHULZE_VOTING 2
#define SCORE_VOTING 3
#define MAJORITY_JUDGEMENT_VOTING 4
#define INSTANT_RUNOFF_VOTING 5
#define PLURALITY_VOTING "PLURALITY"
#define APPROVAL_VOTING "APPROVAL"
#define SCHULZE_VOTING "SCHULZE"
#define SCORE_VOTING "SCORE"
#define MAJORITY_JUDGEMENT_VOTING "MAJORITY_JUDGEMENT"
#define INSTANT_RUNOFF_VOTING "IRV"
#define SHOW_RESULTS (1<<0)
#define SHOW_VOTES (1<<1)
@@ -26,4 +26,4 @@ GLOBAL_LIST_INIT(display_vote_settings, list(\
"Ongoing Votes" = SHOW_VOTES,
"Winner" = SHOW_WINNER,
"Abstainers" = SHOW_ABSTENTION
))
))
@@ -290,7 +290,7 @@
/datum/config_entry/flag/tgstyle_maprotation
/datum/config_entry/string/map_vote_type
config_entry_value = "SCORE"
config_entry_value = APPROVAL_VOTING
/datum/config_entry/number/maprotatechancedelta
config_entry_value = 0.75
+1 -12
View File
@@ -482,18 +482,7 @@ SUBSYSTEM_DEF(ticker)
INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/.proc/maprotate)
else
var/vote_type = CONFIG_GET(string/map_vote_type)
switch(vote_type)
if("PLURALITY")
SSvote.initiate_vote("map","server", display = SHOW_RESULTS)
if("APPROVAL")
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = APPROVAL_VOTING)
if("IRV")
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = INSTANT_RUNOFF_VOTING)
if("SCORE")
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = MAJORITY_JUDGEMENT_VOTING)
else
SSvote.initiate_vote("map","server", display = SHOW_RESULTS)
// fallback
SSvote.initiate_vote("map","server", display = SHOW_RESULTS, votesystem = vote_type)
/datum/controller/subsystem/ticker/proc/HasRoundStarted()
return current_state >= GAME_STATE_PLAYING