mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Configuration datum refactor (#30763)
* Configuration datum refactor * More WIP * New easier on the eyes format * More WIP * Finished config.txt * Fucktons more WIP * The end of conversion draws near... * Add all this shit * Done converting entries finally * Hunting down compile errors * More WIP * MORE CONVERSIONS * More WIP * More WIP * Oh shit only 90 errors this time! * IT COMPILES!!! * Fixes world start runtimes
This commit is contained in:
@@ -47,19 +47,17 @@
|
||||
else
|
||||
log_world(originmastercommit)
|
||||
/datum/getrev/proc/DownloadPRDetails()
|
||||
if(!config.githubrepoid)
|
||||
var/repo_id = CONFIG_GET(number/githubrepoid)
|
||||
if(!repo_id)
|
||||
if(testmerge.len)
|
||||
log_world("PR details download failed: No github repo config set")
|
||||
return
|
||||
if(!isnum(text2num(config.githubrepoid)))
|
||||
log_world("PR details download failed: Invalid github repo id: [config.githubrepoid]")
|
||||
return
|
||||
for(var/line in testmerge)
|
||||
if(!isnum(text2num(line)))
|
||||
log_world("PR details download failed: Invalid PR number: [line]")
|
||||
return
|
||||
|
||||
var/url = "https://api.github.com/repositories/[config.githubrepoid]/pulls/[line].json"
|
||||
var/url = "https://api.github.com/repositories/[repo_id]/pulls/[line].json"
|
||||
GLOB.valid_HTTPSGet = TRUE
|
||||
var/json = HTTPSGet(url)
|
||||
if(!json)
|
||||
@@ -87,7 +85,7 @@
|
||||
details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["user"]["login"])
|
||||
if(details && findtext(details, "\[s\]") && (!usr || !usr.client.holder))
|
||||
continue
|
||||
. += "<a href=\"[config.githuburl]/pull/[line]\">#[line][details]</a><br>"
|
||||
. += "<a href=\"[CONFIG_GET(string/githuburl)]/pull/[line]\">#[line][details]</a><br>"
|
||||
|
||||
/client/verb/showrevinfo()
|
||||
set category = "OOC"
|
||||
@@ -101,44 +99,47 @@
|
||||
to_chat(src, GLOB.revdata.GetTestMergeInfo())
|
||||
prefix = "Based off origin/master commit: "
|
||||
var/pc = GLOB.revdata.originmastercommit
|
||||
to_chat(src, "[prefix]<a href=\"[config.githuburl]/commit/[pc]\">[copytext(pc, 1, min(length(pc), 7))]</a>")
|
||||
to_chat(src, "[prefix]<a href=\"[CONFIG_GET(string/githuburl)]/commit/[pc]\">[copytext(pc, 1, min(length(pc), 7))]</a>")
|
||||
else
|
||||
to_chat(src, "Revision unknown")
|
||||
to_chat(src, "<b>Current Informational Settings:</b>")
|
||||
to_chat(src, "Protect Authority Roles From Traitor: [config.protect_roles_from_antagonist]")
|
||||
to_chat(src, "Protect Assistant Role From Traitor: [config.protect_assistant_from_antagonist]")
|
||||
to_chat(src, "Enforce Human Authority: [config.enforce_human_authority]")
|
||||
to_chat(src, "Allow Latejoin Antagonists: [config.allow_latejoin_antagonists]")
|
||||
to_chat(src, "Enforce Continuous Rounds: [config.continuous.len] of [config.modes.len] roundtypes")
|
||||
to_chat(src, "Allow Midround Antagonists: [config.midround_antag.len] of [config.modes.len] roundtypes")
|
||||
if(config.show_game_type_odds)
|
||||
to_chat(src, "Protect Authority Roles From Traitor: [CONFIG_GET(flag/protect_roles_from_antagonist)]")
|
||||
to_chat(src, "Protect Assistant Role From Traitor: [CONFIG_GET(flag/protect_assistant_from_antagonist)]")
|
||||
to_chat(src, "Enforce Human Authority: [CONFIG_GET(flag/enforce_human_authority)]")
|
||||
to_chat(src, "Allow Latejoin Antagonists: [CONFIG_GET(flag/allow_latejoin_antagonists)]")
|
||||
to_chat(src, "Enforce Continuous Rounds: [length(CONFIG_GET(keyed_flag_list/continuous))] of [config.modes.len] roundtypes")
|
||||
to_chat(src, "Allow Midround Antagonists: [length(CONFIG_GET(keyed_flag_list/midround_antag))] of [config.modes.len] roundtypes")
|
||||
if(CONFIG_GET(flag/show_game_type_odds))
|
||||
var/list/probabilities = CONFIG_GET(keyed_number_list/probability)
|
||||
if(SSticker.IsRoundInProgress())
|
||||
var/prob_sum = 0
|
||||
var/current_odds_differ = FALSE
|
||||
var/list/probs = list()
|
||||
var/list/modes = config.gamemode_cache
|
||||
var/list/min_pop = CONFIG_GET(keyed_number_list/min_pop)
|
||||
var/list/max_pop = CONFIG_GET(keyed_number_list/max_pop)
|
||||
for(var/mode in modes)
|
||||
var/datum/game_mode/M = mode
|
||||
var/ctag = initial(M.config_tag)
|
||||
if(!(ctag in config.probabilities))
|
||||
if(!(ctag in probabilities))
|
||||
continue
|
||||
if((config.min_pop[ctag] && (config.min_pop[ctag] > SSticker.totalPlayersReady)) || (config.max_pop[ctag] && (config.max_pop[ctag] < SSticker.totalPlayersReady)) || (initial(M.required_players) > SSticker.totalPlayersReady))
|
||||
if((min_pop[ctag] && (min_pop[ctag] > SSticker.totalPlayersReady)) || (max_pop[ctag] && (max_pop[ctag] < SSticker.totalPlayersReady)) || (initial(M.required_players) > SSticker.totalPlayersReady))
|
||||
current_odds_differ = TRUE
|
||||
continue
|
||||
probs[ctag] = 1
|
||||
prob_sum += config.probabilities[ctag]
|
||||
prob_sum += probabilities[ctag]
|
||||
if(current_odds_differ)
|
||||
to_chat(src, "<b>Game Mode Odds for current round:</b>")
|
||||
for(var/ctag in probs)
|
||||
if(config.probabilities[ctag] > 0)
|
||||
var/percentage = round(config.probabilities[ctag] / prob_sum * 100, 0.1)
|
||||
if(probabilities[ctag] > 0)
|
||||
var/percentage = round(probabilities[ctag] / prob_sum * 100, 0.1)
|
||||
to_chat(src, "[ctag] [percentage]%")
|
||||
|
||||
to_chat(src, "<b>All Game Mode Odds:</b>")
|
||||
var/sum = 0
|
||||
for(var/ctag in config.probabilities)
|
||||
sum += config.probabilities[ctag]
|
||||
for(var/ctag in config.probabilities)
|
||||
if(config.probabilities[ctag] > 0)
|
||||
var/percentage = round(config.probabilities[ctag] / sum * 100, 0.1)
|
||||
for(var/ctag in probabilities)
|
||||
sum += probabilities[ctag]
|
||||
for(var/ctag in probabilities)
|
||||
if(probabilities[ctag] > 0)
|
||||
var/percentage = round(probabilities[ctag] / sum * 100, 0.1)
|
||||
to_chat(src, "[ctag] [percentage]%")
|
||||
|
||||
Reference in New Issue
Block a user