Refactors vote code (#18403)

* Vote refactor

* Tweaks

* Review tweaks

* Tweak
This commit is contained in:
AffectedArc07
2022-07-20 22:13:41 +01:00
committed by GitHub
parent 444650ac7a
commit 20add76efb
18 changed files with 364 additions and 470 deletions
@@ -1,17 +1,11 @@
/// Config holder for stuff relating to the ingame vote system
/datum/configuration_section/vote_configuration
/// Allow players to start restart votes?
var/allow_restart_votes = FALSE
/// Allow players to start gamemode votes?
var/allow_mode_votes = FALSE
/// Minimum delay between each vote (deciseconds)
var/vote_delay = 18000 // 30 mins
/// How long will a vote last for (deciseconds)
var/vote_time = 600 // 60 seconds
var/vote_time = 60 SECONDS // 60 seconds
/// Time before the first shuttle vote (deciseconds)
var/autotransfer_initial_time = 72000 // 2 hours
var/autotransfer_initial_time = 2 HOURS // 2 hours
/// Time between subsequent shuttle votes if the first one is not successful (deciseconds)
var/autotransfer_interval_time = 18000 // 30 mins
var/autotransfer_interval_time = 30 MINUTES // 30 mins
/// Prevent dead players from voting
var/prevent_dead_voting = FALSE
/// Default to players not voting
@@ -21,13 +15,10 @@
/datum/configuration_section/vote_configuration/load_data(list/data)
// Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line
CONFIG_LOAD_BOOL(allow_restart_votes, data["allow_vote_restart"])
CONFIG_LOAD_BOOL(allow_mode_votes, data["allow_vote_mode"])
CONFIG_LOAD_BOOL(prevent_dead_voting, data["prevent_dead_voting"])
CONFIG_LOAD_BOOL(disable_default_vote, data["disable_default_vote"])
CONFIG_LOAD_BOOL(enable_map_voting, data["enable_map_voting"])
CONFIG_LOAD_NUM(vote_delay, data["vote_delay"])
CONFIG_LOAD_NUM(vote_time, data["vote_time"])
CONFIG_LOAD_NUM(autotransfer_initial_time, data["autotransfer_initial_time"])
CONFIG_LOAD_NUM(autotransfer_interval_time, data["autotransfer_interval_time"])