mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-09 00:43:55 +00:00
Configuration Controller (#7857)
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
/datum/configuration/load()
|
||||
. = ..()
|
||||
SSassets.OnConfigLoad()
|
||||
|
||||
SUBSYSTEM_DEF(assets)
|
||||
name = "Assets"
|
||||
init_order = INIT_ORDER_ASSETS
|
||||
@@ -10,9 +6,9 @@ SUBSYSTEM_DEF(assets)
|
||||
var/list/preload = list()
|
||||
var/datum/asset_transport/transport = new()
|
||||
|
||||
/datum/controller/subsystem/assets/proc/OnConfigLoad()
|
||||
/datum/controller/subsystem/assets/OnConfigLoad() // CHOMPEdit
|
||||
var/newtransporttype = /datum/asset_transport
|
||||
switch (config.asset_transport)
|
||||
switch (CONFIG_GET(string/asset_transport)) // CHOMPEdit
|
||||
if ("webroot")
|
||||
newtransporttype = /datum/asset_transport/webroot
|
||||
|
||||
@@ -27,7 +23,7 @@ SUBSYSTEM_DEF(assets)
|
||||
|
||||
|
||||
/datum/controller/subsystem/assets/Initialize()
|
||||
|
||||
OnConfigLoad()
|
||||
|
||||
for(var/type in typesof(/datum/asset))
|
||||
var/datum/asset/A = type
|
||||
|
||||
@@ -203,18 +203,19 @@ SUBSYSTEM_DEF(dbcore)
|
||||
failed_connection_timeout = world.time + 50
|
||||
return FALSE
|
||||
|
||||
if(!config.sql_enabled)
|
||||
if(!CONFIG_GET(flag/sql_enabled))
|
||||
return FALSE
|
||||
|
||||
//start_db_daemon()
|
||||
|
||||
var/user = sqlfdbklogin
|
||||
var/pass = sqlfdbkpass
|
||||
var/db = sqlfdbkdb
|
||||
var/address = sqladdress
|
||||
var/port = text2num(sqlport)
|
||||
var/timeout = 10
|
||||
var/thread_limit = 50
|
||||
var/user = CONFIG_GET(string/feedback_login)
|
||||
var/pass = CONFIG_GET(string/feedback_password)
|
||||
var/db = CONFIG_GET(string/feedback_database)
|
||||
var/address = CONFIG_GET(string/address)
|
||||
var/port = CONFIG_GET(number/port)
|
||||
var/timeout = max(CONFIG_GET(number/async_query_timeout), CONFIG_GET(number/blocking_query_timeout))
|
||||
var/min_sql_connections = CONFIG_GET(number/pooling_min_sql_connections)
|
||||
var/max_sql_connections = CONFIG_GET(number/pooling_max_sql_connections)
|
||||
|
||||
var/result = json_decode(rustg_sql_connect_pool(json_encode(list(
|
||||
"host" = address,
|
||||
@@ -224,7 +225,8 @@ SUBSYSTEM_DEF(dbcore)
|
||||
"db_name" = db,
|
||||
"read_timeout" = timeout,
|
||||
"write_timeout" = timeout,
|
||||
"max_threads" = thread_limit,
|
||||
"min_threads" = min_sql_connections,
|
||||
"max_threads" = max_sql_connections,
|
||||
))))
|
||||
. = (result["status"] == "ok")
|
||||
if (.)
|
||||
@@ -236,7 +238,7 @@ SUBSYSTEM_DEF(dbcore)
|
||||
++failed_connections
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/CheckSchemaVersion()
|
||||
if(config.sql_enabled)
|
||||
if(CONFIG_GET(flag/sql_enabled))
|
||||
if(Connect())
|
||||
log_world("Database connection established.")
|
||||
else
|
||||
@@ -283,14 +285,14 @@ SUBSYSTEM_DEF(dbcore)
|
||||
connection = null
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/IsConnected()
|
||||
if (!config.sql_enabled)
|
||||
if (!CONFIG_GET(flag/sql_enabled))
|
||||
return FALSE
|
||||
if (!connection)
|
||||
return FALSE
|
||||
return json_decode(rustg_sql_connected(connection))["status"] == "online"
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/ErrorMsg()
|
||||
if(!config.sql_enabled)
|
||||
if(!CONFIG_GET(flag/sql_enabled))
|
||||
return "Database disabled by configuration"
|
||||
return last_error
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ SUBSYSTEM_DEF(game_master)
|
||||
|
||||
GM = new game_master_type()
|
||||
|
||||
if(config && !config.enable_game_master)
|
||||
if(config && !CONFIG_GET(flag/enable_game_master)) // CHOMPEdit
|
||||
can_fire = FALSE
|
||||
|
||||
return SS_INIT_SUCCESS // CHOMPEdit
|
||||
|
||||
@@ -6,7 +6,7 @@ SUBSYSTEM_DEF(inactivity)
|
||||
var/number_kicked = 0
|
||||
|
||||
/datum/controller/subsystem/inactivity/fire(resumed = FALSE)
|
||||
if (!config.kick_inactive)
|
||||
if (!CONFIG_GET(number/kick_inactive)) // CHOMPEdit
|
||||
can_fire = FALSE
|
||||
return
|
||||
if (!resumed)
|
||||
@@ -15,8 +15,8 @@ SUBSYSTEM_DEF(inactivity)
|
||||
while(client_list.len)
|
||||
var/client/C = client_list[client_list.len]
|
||||
client_list.len--
|
||||
if(C.is_afk(config.kick_inactive MINUTES) && can_kick(C))
|
||||
to_chat_immediate(C, world.time, "<span class='warning'>You have been inactive for more than [config.kick_inactive] minute\s and have been disconnected.</span>")
|
||||
if(C.is_afk(CONFIG_GET(number/kick_inactive) MINUTES) && can_kick(C)) // CHOMPEdit
|
||||
to_chat_immediate(C, world.time, "<span class='warning'>You have been inactive for more than [CONFIG_GET(number/kick_inactive)] minute\s and have been disconnected.</span>") // CHOMPEdit
|
||||
|
||||
var/information
|
||||
if(C.mob)
|
||||
|
||||
@@ -14,7 +14,7 @@ SUBSYSTEM_DEF(lighting)
|
||||
|
||||
/datum/controller/subsystem/lighting/Initialize() // CHOMPEdit
|
||||
if(!subsystem_initialized)
|
||||
if (config.starlight)
|
||||
if (CONFIG_GET(flag/starlight)) // CHOMPEdit
|
||||
for(var/area/A in world)
|
||||
if (A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT)
|
||||
A.luminosity = 0
|
||||
|
||||
@@ -20,7 +20,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
maploader = new()
|
||||
load_map_templates()
|
||||
|
||||
if(config.generate_map)
|
||||
if(CONFIG_GET(flag/generate_map)) // CHOMPEdit
|
||||
// Map-gen is still very specific to the map, however putting it here should ensure it loads in the correct order.
|
||||
using_map.perform_map_generation()
|
||||
|
||||
@@ -52,8 +52,8 @@ SUBSYSTEM_DEF(mapping)
|
||||
|
||||
// Choose an engine type
|
||||
var/datum/map_template/engine/chosen_type = null
|
||||
if (LAZYLEN(config.engine_map))
|
||||
var/chosen_name = pick(config.engine_map)
|
||||
if (LAZYLEN(CONFIG_GET(str_list/engine_map))) // CHOMPEdit
|
||||
var/chosen_name = pick(CONFIG_GET(str_list/engine_map)) // CHOMPEdit
|
||||
chosen_type = map_templates[chosen_name]
|
||||
if(!istype(chosen_type))
|
||||
error("Configured engine map [chosen_name] is not a valid engine map name!")
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// Choose an engine type
|
||||
var/datum/map_template/engine/chosen_type = null
|
||||
if (LAZYLEN(config.engine_map))
|
||||
if (LAZYLEN(CONFIG_GET(str_list/engine_map))) // CHOMPEdit
|
||||
var/chosen_name = pickedEngine //Instead of using the config, we'll take an argument.
|
||||
chosen_type = map_templates[chosen_name]
|
||||
if(!istype(chosen_type))
|
||||
|
||||
@@ -19,7 +19,7 @@ SUBSYSTEM_DEF(media_tracks)
|
||||
return SS_INIT_SUCCESS // CHOMPEdit
|
||||
|
||||
/datum/controller/subsystem/media_tracks/proc/load_tracks()
|
||||
for(var/filename in config.jukebox_track_files)
|
||||
for(var/filename in CONFIG_GET(str_list/jukebox_track_files)) // CHOMPEdit
|
||||
report_progress("Loading jukebox track: [filename]")
|
||||
|
||||
if(!fexists(filename))
|
||||
|
||||
@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(nightshift)
|
||||
var/high_security_mode = FALSE
|
||||
|
||||
/datum/controller/subsystem/nightshift/Initialize()
|
||||
if(!config.enable_night_shifts)
|
||||
if(!CONFIG_GET(flag/enable_night_shifts)) // CHOMPEdit
|
||||
can_fire = FALSE
|
||||
/*
|
||||
if(config.randomize_shift_time)
|
||||
|
||||
@@ -16,7 +16,7 @@ SUBSYSTEM_DEF(persist)
|
||||
|
||||
// Do PTO Accruals
|
||||
/datum/controller/subsystem/persist/proc/update_department_hours(var/resumed = FALSE)
|
||||
if(!config.time_off)
|
||||
if(!CONFIG_GET(flag/time_off)) // CHOMPEdit
|
||||
return
|
||||
|
||||
establish_db_connection()
|
||||
@@ -78,7 +78,7 @@ SUBSYSTEM_DEF(persist)
|
||||
play_hours[department_earning] = wait_in_hours
|
||||
|
||||
// Cap it
|
||||
dept_hours[department_earning] = min(config.pto_cap, dept_hours[department_earning])
|
||||
dept_hours[department_earning] = min(CONFIG_GET(number/pto_cap), dept_hours[department_earning]) // CHOMPEdit
|
||||
|
||||
// Okay we figured it out, lets update database!
|
||||
var/sql_ckey = sql_sanitize_text(C.ckey)
|
||||
|
||||
@@ -27,7 +27,7 @@ SUBSYSTEM_DEF(persistence)
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/track_value(var/atom/value, var/track_type)
|
||||
|
||||
if(config.persistence_disabled) //if the config is set to persistence disabled, nothing will save or load.
|
||||
if(CONFIG_GET(flag/persistence_disabled)) //if the config is set to persistence disabled, nothing will save or load. // CHOMPEdit
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(value)
|
||||
|
||||
@@ -24,7 +24,7 @@ SUBSYSTEM_DEF(radiation)
|
||||
if(QDELETED(S))
|
||||
sources -= S
|
||||
else if(S.decay)
|
||||
S.update_rad_power(S.rad_power - config.radiation_decay_rate)
|
||||
S.update_rad_power(S.rad_power - CONFIG_GET(number/radiation_decay_rate)) // COMPEdit
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
@@ -93,12 +93,12 @@ SUBSYSTEM_DEF(radiation)
|
||||
origin.calc_rad_resistance()
|
||||
|
||||
if(origin.cached_rad_resistance)
|
||||
if(config.radiation_resistance_calc_mode == RAD_RESIST_CALC_DIV)
|
||||
working = round((working / (origin.cached_rad_resistance * config.radiation_resistance_multiplier)), 0.01)
|
||||
else if(config.radiation_resistance_calc_mode == RAD_RESIST_CALC_SUB)
|
||||
working = round((working - (origin.cached_rad_resistance * config.radiation_resistance_multiplier)), 0.01)
|
||||
if(CONFIG_GET(flag/radiation_resistance_calc_mode) == RAD_RESIST_CALC_DIV) // CHOMPEdit
|
||||
working = round((working / (origin.cached_rad_resistance * CONFIG_GET(number/radiation_resistance_multiplier))), 0.01) // CHOMPEdit
|
||||
else if(CONFIG_GET(flag/radiation_resistance_calc_mode) == RAD_RESIST_CALC_SUB) // CHOMPEdit
|
||||
working = round((working - (origin.cached_rad_resistance * CONFIG_GET(number/radiation_resistance_multiplier))), 0.01) // CHOMPEdit
|
||||
|
||||
if(working <= config.radiation_lower_limit) // Too far from this source
|
||||
if(working <= CONFIG_GET(number/radiation_lower_limit)) // Too far from this source // CHOMPEdit
|
||||
working = 0 // May as well be 0
|
||||
break
|
||||
|
||||
@@ -106,7 +106,7 @@ SUBSYSTEM_DEF(radiation)
|
||||
// Shouldn't really ever have practical uses, but standing in a room literally made from uranium is more dangerous than standing next to a single uranium vase
|
||||
. += working / (dist ** 2)
|
||||
|
||||
if(. <= config.radiation_lower_limit)
|
||||
if(. <= CONFIG_GET(number/radiation_lower_limit)) // CHOMPEdit
|
||||
. = 0
|
||||
|
||||
// Add a radiation source instance to the repository. It will override any existing source on the same turf.
|
||||
|
||||
@@ -14,7 +14,7 @@ SUBSYSTEM_DEF(sqlite)
|
||||
return SS_INIT_SUCCESS // CHOMPEdit
|
||||
|
||||
/datum/controller/subsystem/sqlite/proc/connect()
|
||||
if(!config.sqlite_enabled)
|
||||
if(!CONFIG_GET(flag/sqlite_enabled)) // CHOMPEdit
|
||||
return
|
||||
|
||||
if(!sqlite_db)
|
||||
@@ -104,17 +104,17 @@ SUBSYSTEM_DEF(sqlite)
|
||||
return !sqlite_check_for_errors(query, "Insert Feedback")
|
||||
|
||||
/datum/controller/subsystem/sqlite/proc/can_submit_feedback(client/C)
|
||||
if(!config.sqlite_enabled)
|
||||
if(!CONFIG_GET(flag/sqlite_enabled)) // CHOMPEdit
|
||||
return FALSE
|
||||
if(config.sqlite_feedback_min_age && !is_old_enough(C))
|
||||
if(CONFIG_GET(number/sqlite_feedback_min_age) && !is_old_enough(C)) // CHOMPEdit
|
||||
return FALSE
|
||||
if(config.sqlite_feedback_cooldown > 0 && get_feedback_cooldown(C.key, config.sqlite_feedback_cooldown, sqlite_db) > 0)
|
||||
if(CONFIG_GET(number/sqlite_feedback_cooldown) > 0 && get_feedback_cooldown(C.key, CONFIG_GET(number/sqlite_feedback_cooldown), sqlite_db) > 0) // CHOMPEdit
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
// Returns TRUE if the player is 'old' enough, according to the config.
|
||||
/datum/controller/subsystem/sqlite/proc/is_old_enough(client/C)
|
||||
if(get_player_age(C.key) < config.sqlite_feedback_min_age)
|
||||
if(get_player_age(C.key) < CONFIG_GET(number/sqlite_feedback_min_age)) // CHOMPEdit
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ SUBSYSTEM_DEF(statpanels)
|
||||
list("Instances:", "[num2text(world.contents.len, 10)]"),
|
||||
list("World Time:", "[world.time]"),
|
||||
list("Globals:", GLOB.stat_entry(), "\ref[GLOB]"),
|
||||
//list("[config]:", config.stat_entry(), "\ref[config]"),
|
||||
list("[config]:", config.stat_entry(), "\ref[config]"),
|
||||
list("Byond:", "(FPS:[world.fps]) (TickCount:[world.time/world.tick_lag]) (TickDrift:[round(Master.tickdrift,1)]([round((Master.tickdrift/(world.time/world.tick_lag))*100,0.1)]%)) (Internal Tick Usage: [round(MAPTICK_LAST_INTERNAL_TICK_USAGE,0.1)]%)"),
|
||||
list("Master Controller:", Master.stat_entry(), "\ref[Master]"),
|
||||
list("Failsafe Controller:", Failsafe.stat_entry(), "\ref[Failsafe]"),
|
||||
|
||||
@@ -49,8 +49,8 @@ var/global/datum/controller/subsystem/ticker/ticker
|
||||
global.ticker = src // TODO - Remove this! Change everything to point at SSticker intead
|
||||
|
||||
/datum/controller/subsystem/ticker/Initialize()
|
||||
pregame_timeleft = config.pregame_time
|
||||
send2mainirc("Server lobby is loaded and open at byond://[config.serverurl ? config.serverurl : (config.server ? config.server : "[world.address]:[world.port]")]")
|
||||
pregame_timeleft = CONFIG_GET(number/pregame_time) // CHOMPEdit
|
||||
send2mainirc("Server lobby is loaded and open at byond://[CONFIG_GET(string/serverurl) ? CONFIG_GET(string/serverurl) : (CONFIG_GET(string/server) ? CONFIG_GET(string/server) : "[world.address]:[world.port]")]") // CHOMPEdit
|
||||
SSwebhooks.send(
|
||||
WEBHOOK_ROUNDPREP,
|
||||
list(
|
||||
@@ -98,7 +98,7 @@ var/global/datum/controller/subsystem/ticker/ticker
|
||||
fire() // Don't wait for next tick, do it now!
|
||||
return
|
||||
|
||||
if(pregame_timeleft <= config.vote_autogamemode_timeleft && !SSvote.gamemode_vote_called)
|
||||
if(pregame_timeleft <= CONFIG_GET(number/vote_autogamemode_timeleft) && !SSvote.gamemode_vote_called)
|
||||
SSvote.autogamemode() // Start the game mode vote (if we haven't had one already)
|
||||
|
||||
// Called during GAME_STATE_SETTING_UP (RUNLEVEL_SETUP)
|
||||
@@ -106,7 +106,7 @@ var/global/datum/controller/subsystem/ticker/ticker
|
||||
round_start_time = world.time //otherwise round_start_time would be 0 for the signals
|
||||
if(!setup_choose_gamemode())
|
||||
// It failed, go back to lobby state and re-send the welcome message
|
||||
pregame_timeleft = config.pregame_time
|
||||
pregame_timeleft = CONFIG_GET(number/pregame_time) // CHOMPEdit
|
||||
SSvote.gamemode_vote_called = FALSE // Allow another autogamemode vote
|
||||
current_state = GAME_STATE_PREGAME
|
||||
Master.SetRunLevel(RUNLEVEL_LOBBY)
|
||||
@@ -133,8 +133,8 @@ var/global/datum/controller/subsystem/ticker/ticker
|
||||
if(!src.mode)
|
||||
var/list/weighted_modes = list()
|
||||
for(var/datum/game_mode/GM in runnable_modes)
|
||||
weighted_modes[GM.config_tag] = config.probabilities[GM.config_tag]
|
||||
src.mode = gamemode_cache[pickweight(weighted_modes)]
|
||||
weighted_modes[GM.config_tag] = CONFIG_GET(keyed_list/probabilities)[GM.config_tag] // CHOMPEdit
|
||||
src.mode = config.gamemode_cache[pickweight(weighted_modes)] // CHOMPEdit
|
||||
else
|
||||
src.mode = config.pick_mode(master_mode)
|
||||
|
||||
@@ -148,7 +148,7 @@ var/global/datum/controller/subsystem/ticker/ticker
|
||||
job_master.DivideOccupations() // Apparently important for new antagonist system to register specific job antags properly.
|
||||
|
||||
if(!src.mode.can_start())
|
||||
to_world("<span class='danger'><B>Unable to start [mode.name].</B> Not enough players readied, [config.player_requirements[mode.config_tag]] players needed. Reverting to pregame lobby.</span>")
|
||||
to_world("<span class='danger'><B>Unable to start [mode.name].</B> Not enough players readied, [CONFIG_GET(keyed_list/player_requirements)[mode.config_tag]] players needed. Reverting to pregame lobby.</span>") // CHOMPEdit
|
||||
mode.fail_setup()
|
||||
mode = null
|
||||
job_master.ResetOccupations()
|
||||
@@ -196,7 +196,7 @@ var/global/datum/controller/subsystem/ticker/ticker
|
||||
current_state = GAME_STATE_PLAYING
|
||||
Master.SetRunLevel(RUNLEVEL_GAME)
|
||||
|
||||
if(config.sql_enabled)
|
||||
if(CONFIG_GET(flag/sql_enabled)) // CHOMPEdit
|
||||
statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
|
||||
|
||||
return 1
|
||||
@@ -212,7 +212,7 @@ var/global/datum/controller/subsystem/ticker/ticker
|
||||
// Calculate if game and/or mode are finished (Complicated by the continuous_rounds config option)
|
||||
var/game_finished = FALSE
|
||||
var/mode_finished = FALSE
|
||||
if (config.continous_rounds) // Game keeps going after mode ends.
|
||||
if (CONFIG_GET(flag/continuous_rounds)) // Game keeps going after mode ends. // CHOMPEdit
|
||||
game_finished = (emergency_shuttle.returned() || mode.station_was_nuked)
|
||||
mode_finished = ((end_game_state >= END_GAME_MODE_FINISHED) || mode.check_finished()) // Short circuit if already finished.
|
||||
else // Game ends when mode does
|
||||
|
||||
@@ -89,7 +89,7 @@ SUBSYSTEM_DEF(vote)
|
||||
if(votes > greatest_votes)
|
||||
greatest_votes = votes
|
||||
//CHOMPEdit End
|
||||
if(!config.vote_no_default && choices.len) // Default-vote for everyone who didn't vote
|
||||
if(!CONFIG_GET(flag/vote_no_default) && choices.len) // Default-vote for everyone who didn't vote // CHOMPEdit
|
||||
var/non_voters = (GLOB.clients.len - total_votes)
|
||||
if(non_voters > 0)
|
||||
if(mode == VOTE_RESTART)
|
||||
@@ -192,7 +192,7 @@ SUBSYSTEM_DEF(vote)
|
||||
|
||||
/datum/controller/subsystem/vote/proc/submit_vote(ckey, newVote)
|
||||
if(mode)
|
||||
if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder)
|
||||
if(CONFIG_GET(flag/vote_no_dead) && usr.stat == DEAD && !usr.client.holder) // CHOMPEdit
|
||||
return
|
||||
if(current_votes[ckey])
|
||||
choices[choices[current_votes[ckey]]]--
|
||||
@@ -202,10 +202,10 @@ SUBSYSTEM_DEF(vote)
|
||||
else
|
||||
current_votes[ckey] = null
|
||||
|
||||
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, automatic = FALSE, time = config.vote_period)
|
||||
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, automatic = FALSE, time = CONFIG_GET(number/vote_period)) // CHOMPEdit
|
||||
if(!mode)
|
||||
if(started_time != null && !(check_rights(R_ADMIN|R_EVENT) || automatic))
|
||||
var/next_allowed_time = (started_time + config.vote_delay)
|
||||
var/next_allowed_time = (started_time + CONFIG_GET(number/vote_delay)) // CHOMPEdit
|
||||
if(next_allowed_time > world.time)
|
||||
return 0
|
||||
|
||||
@@ -219,7 +219,7 @@ SUBSYSTEM_DEF(vote)
|
||||
return 0
|
||||
choices.Add(config.votable_modes)
|
||||
for(var/F in choices)
|
||||
var/datum/game_mode/M = gamemode_cache[F]
|
||||
var/datum/game_mode/M = config.gamemode_cache[F] // CHOMPEdit
|
||||
if(!M)
|
||||
continue
|
||||
gamemode_names[M.config_tag] = capitalize(M.name) //It's ugly to put this here but it works
|
||||
@@ -236,7 +236,7 @@ SUBSYSTEM_DEF(vote)
|
||||
question = "Your PDA beeps with a message from Central. Would you like an additional hour to finish ongoing projects? (OOC Notice: Transfer votes must have a majority (70%) of all votes to initiate transfer.)" //Yawn Wider Edit //CHOMP EDIT: Changed to 'one' hour. Add notice stating transfer must contain 70% of total vote.
|
||||
choices.Add("Initiate Crew Transfer", "Extend the Shift") //VOREStation Edit
|
||||
if(VOTE_ADD_ANTAGONIST)
|
||||
if(!config.allow_extra_antags || ticker.current_state >= GAME_STATE_SETTING_UP)
|
||||
if(!CONFIG_GET(flag/allow_extra_antags) || ticker.current_state >= GAME_STATE_SETTING_UP) // CHOMPEdit
|
||||
return 0
|
||||
for(var/antag_type in all_antag_types)
|
||||
var/datum/antagonist/antag = all_antag_types[antag_type]
|
||||
@@ -265,7 +265,7 @@ SUBSYSTEM_DEF(vote)
|
||||
|
||||
log_vote(text)
|
||||
|
||||
to_world(span_purple("<b>[text]</b>\nType <b>vote</b> or click <a href='?src=\ref[src]'>here</a> to place your votes.\nYou have [config.vote_period / 10] seconds to vote."))
|
||||
to_world(span_purple("<b>[text]</b>\nType <b>vote</b> or click <a href='?src=\ref[src]'>here</a> to place your votes.\nYou have [CONFIG_GET(number/vote_period) / 10] seconds to vote.")) // CHOMPEdit
|
||||
if(vote_type == VOTE_CREW_TRANSFER || vote_type == VOTE_GAMEMODE || vote_type == VOTE_CUSTOM)
|
||||
world << sound('sound/ambience/alarm4.ogg', repeat = 0, wait = 0, volume = 50, channel = 3) //CHOMPStation Edit TFF 10/5/20 - revert to old soundtrack contrary to YW
|
||||
|
||||
@@ -274,7 +274,7 @@ SUBSYSTEM_DEF(vote)
|
||||
round_progressing = 0
|
||||
to_world(span_red("<b>Round start has been delayed.</b>"))
|
||||
|
||||
time_remaining = round(config.vote_period / 10)
|
||||
time_remaining = round(CONFIG_GET(number/vote_period) / 10) // CHOMPEdit
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -318,31 +318,31 @@ SUBSYSTEM_DEF(vote)
|
||||
. += "(<a href='?src=\ref[src];[HrefToken()];vote=cancel'>Cancel Vote</a>) "
|
||||
else
|
||||
. += "<h2>Start a vote:</h2><hr><ul><li>"
|
||||
if(admin || config.allow_vote_restart)
|
||||
if(admin || CONFIG_GET(flag/allow_vote_restart)) // CHOMPEdit
|
||||
. += "<a href='?src=\ref[src];vote=restart'>Restart</a>"
|
||||
else
|
||||
. += span_gray("Restart (Disallowed)")
|
||||
. += "</li><li>"
|
||||
|
||||
if(admin || config.allow_vote_restart)
|
||||
if(admin || CONFIG_GET(flag/allow_vote_restart)) // CHOMPEdit
|
||||
. += "<a href='?src=\ref[src];vote=crew_transfer'>Crew Transfer</a>"
|
||||
else
|
||||
. += span_gray("Crew Transfer (Disallowed)")
|
||||
|
||||
if(admin)
|
||||
. += "\t(<a href='?src=\ref[src];[HrefToken()];vote=toggle_restart'>[config.allow_vote_restart ? "Allowed" : "Disallowed"]</a>)"
|
||||
. += "\t(<a href='?src=\ref[src];[HrefToken()];vote=toggle_restart'>[CONFIG_GET(flag/allow_vote_restart) ? "Allowed" : "Disallowed"]</a>)" // CHOMPEdit
|
||||
. += "</li><li>"
|
||||
|
||||
if(admin || config.allow_vote_mode)
|
||||
if(admin || CONFIG_GET(flag/allow_vote_mode)) // CHOMPEdit
|
||||
. += "<a href='?src=\ref[src];vote=gamemode'>GameMode</a>"
|
||||
else
|
||||
. += span_gray("GameMode (Disallowed)")
|
||||
|
||||
if(admin)
|
||||
. += "\t(<a href='?src=\ref[src];[HrefToken()];vote=toggle_gamemode'>[config.allow_vote_mode ? "Allowed" : "Disallowed"]</a>)"
|
||||
. += "\t(<a href='?src=\ref[src];[HrefToken()];vote=toggle_gamemode'>[CONFIG_GET(flag/allow_vote_mode) ? "Allowed" : "Disallowed"]</a>)" // CHOMPEdit
|
||||
. += "</li><li>"
|
||||
|
||||
if(!antag_add_failed && config.allow_extra_antags)
|
||||
if(!antag_add_failed && CONFIG_GET(flag/allow_extra_antags)) // CHOMPEdit
|
||||
. += "<a href='?src=\ref[src];vote=add_antagonist'>Add Antagonist Type</a>"
|
||||
else
|
||||
. += span_gray("Add Antagonist (Disallowed)")
|
||||
@@ -368,22 +368,22 @@ SUBSYSTEM_DEF(vote)
|
||||
reset()
|
||||
if("toggle_restart")
|
||||
if(usr.client.holder)
|
||||
config.allow_vote_restart = !config.allow_vote_restart
|
||||
CONFIG_SET(flag/allow_vote_restart, !CONFIG_GET(flag/allow_vote_restart)) // CHOMPEdit
|
||||
if("toggle_gamemode")
|
||||
if(usr.client.holder)
|
||||
config.allow_vote_mode = !config.allow_vote_mode
|
||||
CONFIG_SET(flag/allow_vote_mode, !CONFIG_GET(flag/allow_vote_mode)) // CHOMPEdit
|
||||
|
||||
if(VOTE_RESTART)
|
||||
if(config.allow_vote_restart || usr.client.holder)
|
||||
if(CONFIG_GET(flag/allow_vote_restart) || usr.client.holder) // CHOMPEdit
|
||||
initiate_vote(VOTE_RESTART, usr.key)
|
||||
if(VOTE_GAMEMODE)
|
||||
if(config.allow_vote_mode || usr.client.holder)
|
||||
if(CONFIG_GET(flag/allow_vote_mode) || usr.client.holder) // CHOMPEdit
|
||||
initiate_vote(VOTE_GAMEMODE, usr.key)
|
||||
if(VOTE_CREW_TRANSFER)
|
||||
if(config.allow_vote_restart || usr.client.holder)
|
||||
if(CONFIG_GET(flag/allow_vote_restart) || usr.client.holder) // CHOMPEdit
|
||||
initiate_vote(VOTE_CREW_TRANSFER, usr.key)
|
||||
if(VOTE_ADD_ANTAGONIST)
|
||||
if(config.allow_extra_antags || usr.client.holder)
|
||||
if(CONFIG_GET(flag/allow_extra_antags) || usr.client.holder) // CHOMPEdit
|
||||
initiate_vote(VOTE_ADD_ANTAGONIST, usr.key)
|
||||
if(VOTE_CUSTOM)
|
||||
if(usr.client.holder)
|
||||
|
||||
Reference in New Issue
Block a user